From 373bc1138e0da688b6a61a81f1cbb86333c6f28b Mon Sep 17 00:00:00 2001 From: Shreesh Arora Date: Wed, 9 Nov 2022 15:41:58 +0530 Subject: [PATCH 01/55] apply dicount coupon on due amount in advance payment --- classes/Cart.php | 18 +++++++++++++++++- classes/CartRule.php | 25 ++++++++++++++++++++----- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/classes/Cart.php b/classes/Cart.php index 9d08d6834..2d7da1a43 100644 --- a/classes/Cart.php +++ b/classes/Cart.php @@ -1717,6 +1717,7 @@ class CartCore extends ObjectModel $order_total_discount = 0; $order_shipping_discount = 0; + $order_total_discount_advance_product = 0; if (!in_array($type, array(Cart::ONLY_SHIPPING, Cart::ONLY_PRODUCTS, Cart::ADVANCE_PAYMENT_ONLY_PRODUCTS)) && CartRule::isFeatureActive()) { // First, retrieve the cart rules associated to this "getOrderTotal" if ($with_shipping || $type == Cart::ONLY_DISCOUNTS) { @@ -1773,10 +1774,25 @@ class CartCore extends ObjectModel // If the cart rule offers a reduction, the amount is prorated (with the products in the package) if ($cart_rule['obj']->reduction_percent > 0 || $cart_rule['obj']->reduction_amount > 0) { $order_total_discount += Tools::ps_round($cart_rule['obj']->getContextualValue($with_taxes, $virtual_context, CartRule::FILTER_ACTION_REDUCTION, $package, $use_cache), $compute_precision); + + if ($type == Cart::ADVANCE_PAYMENT) { + $order_total_discount_advance_product += Tools::ps_round($cart_rule['obj']->getContextualValue($with_taxes, $virtual_context, CartRule::FILTER_ACTION_REDUCTION, $package, $use_cache, true), $compute_precision); + } } } $order_total_discount = min(Tools::ps_round($order_total_discount, 2), (float)$order_total_products) + (float)$order_shipping_discount; - $order_total -= $order_total_discount; + if ($type == Cart::ADVANCE_PAYMENT) { + // if discount is greater than due amount then only decrease the price of advance payment amount + // otherwise discount will be applied on due amount not advance payment amount + $total_without_discount = self::getOrderTotal() + $order_total_discount; + $due_amount = $total_without_discount - $order_total; + if ($order_total_discount_advance_product > $due_amount) { + $order_total -= ($order_total_discount_advance_product - $due_amount); + } + $order_total -= $order_total_discount - $order_total_discount_advance_product; + } else { + $order_total -= $order_total_discount; + } } if ($type == Cart::BOTH || $type == Cart::ADVANCE_PAYMENT) { diff --git a/classes/CartRule.php b/classes/CartRule.php index 88670b0de..b4059af27 100644 --- a/classes/CartRule.php +++ b/classes/CartRule.php @@ -877,7 +877,7 @@ class CartRuleCore extends ObjectModel * @param bool $use_cache Allow using cache to avoid multiple free gift using multishipping * @return float|int|string */ - public function getContextualValue($use_tax, Context $context = null, $filter = null, $package = null, $use_cache = true) + public function getContextualValue($use_tax, Context $context = null, $filter = null, $package = null, $use_cache = true, $forAdvancePayment = false) { if (!CartRule::isFeatureActive()) { return 0; @@ -890,15 +890,30 @@ class CartRuleCore extends ObjectModel } $all_products = $context->cart->getProducts(); - $package_products = (is_null($package) ? $all_products : $package['products']); + if (is_null($package)) { + $package = array( + 'products' => $all_products, + 'id_carrier' => null, + 'id_address' => 0 + ); + } $reduction_value = 0; - - $cache_id = 'getContextualValue_'.(int)$this->id.'_'.(int)$use_tax.'_'.(int)$context->cart->id.'_'.(int)$filter; - foreach ($package_products as $product) { + $objHotelAdvancePayment = new HotelAdvancedPayment(); + $cache_id = 'getContextualValue_'.(int)$this->id.'_'.(int)$use_tax.'_'.(int)$context->cart->id.'_'.(int)$filter.'_'.(int)$forAdvancePayment; + foreach ($package['products'] as $key => $product) { + if ($forAdvancePayment) { + $paymentInfo = $objHotelAdvancePayment->getIdAdvPaymentByIdProduct($product['id_product']); + if (!$paymentInfo['active']) { + unset($package['products'][$key]); + continue; + } + } $cache_id .= '_'.(int)$product['id_product'].'_'.(int)$product['id_product_attribute'].(isset($product['in_stock']) ? '_'.(int)$product['in_stock'] : ''); } + $package_products = $package['products']; + if (Cache::isStored($cache_id)) { return Cache::retrieve($cache_id); } From 4927208b1b874f33699104d3a47d03f9f3b109ce Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 21 Nov 2022 18:09:17 +0530 Subject: [PATCH 02/55] Remove module config links from Hotel Reservation System > Settings page --- .../hook/aboutHotelBlockModuleSetting.tpl | 28 ------------------- .../wkabouthotelblock/wkabouthotelblock.php | 11 ++++---- .../hook/hotelFeatureSettingLink.tpl | 28 ------------------- .../wkhotelfeaturesblock.php | 13 ++++----- .../templates/hook/hotelRoomSettingLink.tpl | 28 ------------------- modules/wkhotelroom/wkhotelroom.php | 14 ++++------ .../hook/hotelTestimonialSettingLink.tpl | 28 ------------------- .../wktestimonialblock/wktestimonialblock.php | 13 ++++----- 8 files changed, 20 insertions(+), 143 deletions(-) delete mode 100644 modules/wkabouthotelblock/views/templates/hook/aboutHotelBlockModuleSetting.tpl delete mode 100644 modules/wkhotelfeaturesblock/views/templates/hook/hotelFeatureSettingLink.tpl delete mode 100644 modules/wkhotelroom/views/templates/hook/hotelRoomSettingLink.tpl delete mode 100644 modules/wktestimonialblock/views/templates/hook/hotelTestimonialSettingLink.tpl diff --git a/modules/wkabouthotelblock/views/templates/hook/aboutHotelBlockModuleSetting.tpl b/modules/wkabouthotelblock/views/templates/hook/aboutHotelBlockModuleSetting.tpl deleted file mode 100644 index 43d2bcd9c..000000000 --- a/modules/wkabouthotelblock/views/templates/hook/aboutHotelBlockModuleSetting.tpl +++ /dev/null @@ -1,28 +0,0 @@ -{* -* 2010-2020 Webkul. -* -* NOTICE OF LICENSE -* -* All right is reserved, -* Please go through this link for complete license : https://store.webkul.com/license.html -* -* DISCLAIMER -* -* Do not edit or add to this file if you wish to upgrade this module to newer -* versions in the future. If you wish to customize this module for your -* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information. -* -* @author Webkul IN -* @copyright 2010-2020 Webkul IN -* @license https://store.webkul.com/license.html -*} - - \ No newline at end of file diff --git a/modules/wkabouthotelblock/wkabouthotelblock.php b/modules/wkabouthotelblock/wkabouthotelblock.php index 5b3b5a0c1..89e9dc0a8 100644 --- a/modules/wkabouthotelblock/wkabouthotelblock.php +++ b/modules/wkabouthotelblock/wkabouthotelblock.php @@ -67,11 +67,6 @@ class WkAboutHotelBlock extends Module return $this->display(__FILE__, 'hotelInteriorBlock.tpl'); } - public function hookDisplayAddModuleSettingLink() - { - return $this->display(__FILE__, 'aboutHotelBlockModuleSetting.tpl'); - } - /** * If admin add any language then an entry will add in defined $lang_tables array's lang table same as prestashop * @param array $params @@ -102,13 +97,17 @@ class WkAboutHotelBlock extends Module return true; } + public function getContent() + { + Tools::redirectAdmin($this->context->link->getAdminLink('AdminAboutHotelBlockSetting')); + } + public function registerModuleHooks() { return $this->registerHook( array( 'displayHome', 'displayFooterExploreSectionHook', - 'displayAddModuleSettingLink', 'actionObjectLanguageAddAfter' ) ); diff --git a/modules/wkhotelfeaturesblock/views/templates/hook/hotelFeatureSettingLink.tpl b/modules/wkhotelfeaturesblock/views/templates/hook/hotelFeatureSettingLink.tpl deleted file mode 100644 index 3eaee7b60..000000000 --- a/modules/wkhotelfeaturesblock/views/templates/hook/hotelFeatureSettingLink.tpl +++ /dev/null @@ -1,28 +0,0 @@ -{* -* 2010-2020 Webkul. -* -* NOTICE OF LICENSE -* -* All right is reserved, -* Please go through this link for complete license : https://store.webkul.com/license.html -* -* DISCLAIMER -* -* Do not edit or add to this file if you wish to upgrade this module to newer -* versions in the future. If you wish to customize this module for your -* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information. -* -* @author Webkul IN -* @copyright 2010-2020 Webkul IN -* @license https://store.webkul.com/license.html -*} - - \ No newline at end of file diff --git a/modules/wkhotelfeaturesblock/wkhotelfeaturesblock.php b/modules/wkhotelfeaturesblock/wkhotelfeaturesblock.php index b7550193a..a882e7404 100644 --- a/modules/wkhotelfeaturesblock/wkhotelfeaturesblock.php +++ b/modules/wkhotelfeaturesblock/wkhotelfeaturesblock.php @@ -63,13 +63,6 @@ class WkHotelFeaturesBlock extends Module return $this->display(__FILE__, 'hotelfeaturescontent.tpl'); } - public function hookDisplayAddModuleSettingLink() - { - $hrefFeaturesConf = $this->context->link->getAdminLink('AdminFeaturesModuleSetting'); - $this->context->smarty->assign('features_setting_link', $hrefFeaturesConf); - return $this->display(__FILE__, 'hotelFeatureSettingLink.tpl'); - } - /** * If admin add any language then an entry will add in defined $lang_tables array's lang table same as prestashop * @param array $params @@ -140,12 +133,16 @@ class WkHotelFeaturesBlock extends Module array ( 'displayHome', 'displayFooterExploreSectionHook', - 'displayAddModuleSettingLink', 'actionObjectLanguageAddAfter' ) ); } + public function getContent() + { + Tools::redirectAdmin($this->context->link->getAdminLink('AdminFeaturesModuleSetting')); + } + public function uninstall() { $objHotelFeaturesBlockDb = new WkHotelFeaturesBlockDb(); diff --git a/modules/wkhotelroom/views/templates/hook/hotelRoomSettingLink.tpl b/modules/wkhotelroom/views/templates/hook/hotelRoomSettingLink.tpl deleted file mode 100644 index c32c07def..000000000 --- a/modules/wkhotelroom/views/templates/hook/hotelRoomSettingLink.tpl +++ /dev/null @@ -1,28 +0,0 @@ -{* -* 2010-2020 Webkul. -* -* NOTICE OF LICENSE -* -* All right is reserved, -* Please go through this link for complete license : https://store.webkul.com/license.html -* -* DISCLAIMER -* -* Do not edit or add to this file if you wish to upgrade this module to newer -* versions in the future. If you wish to customize this module for your -* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information. -* -* @author Webkul IN -* @copyright 2010-2020 Webkul IN -* @license https://store.webkul.com/license.html -*} - - \ No newline at end of file diff --git a/modules/wkhotelroom/wkhotelroom.php b/modules/wkhotelroom/wkhotelroom.php index 9f8723c1a..aa8f00b4b 100644 --- a/modules/wkhotelroom/wkhotelroom.php +++ b/modules/wkhotelroom/wkhotelroom.php @@ -126,14 +126,6 @@ class WkHotelRoom extends Module } } - public function hookDisplayAddModuleSettingLink() - { - $htlRoomBlockConfigLink = $this->context->link->getAdminLink('AdminHotelRoomModuleSetting'); - $this->context->smarty->assign('htlRoomBlockConfigLink', $htlRoomBlockConfigLink); - - return $this->display(__FILE__, 'hotelRoomSettingLink.tpl'); - } - /** * If admin add any language then an entry will add in defined $lang_tables array's lang table same as prestashop * @param array $params @@ -204,7 +196,6 @@ class WkHotelRoom extends Module array ( 'displayHome', 'actionProductDelete', - 'displayAddModuleSettingLink', 'displayFooterExploreSectionHook', 'actionProductSave', 'actionObjectLanguageAddAfter' @@ -212,6 +203,11 @@ class WkHotelRoom extends Module ); } + public function getContent() + { + Tools::redirectAdmin($this->context->link->getAdminLink('AdminHotelRoomModuleSetting')); + } + public function uninstall() { $objHotelRoomDb = new WkHotelRoomDb(); diff --git a/modules/wktestimonialblock/views/templates/hook/hotelTestimonialSettingLink.tpl b/modules/wktestimonialblock/views/templates/hook/hotelTestimonialSettingLink.tpl deleted file mode 100644 index aa25d33cd..000000000 --- a/modules/wktestimonialblock/views/templates/hook/hotelTestimonialSettingLink.tpl +++ /dev/null @@ -1,28 +0,0 @@ -{* -* 2010-2020 Webkul. -* -* NOTICE OF LICENSE -* -* All right is reserved, -* Please go through this link for complete license : https://store.webkul.com/license.html -* -* DISCLAIMER -* -* Do not edit or add to this file if you wish to upgrade this module to newer -* versions in the future. If you wish to customize this module for your -* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information. -* -* @author Webkul IN -* @copyright 2010-2020 Webkul IN -* @license https://store.webkul.com/license.html -*} - - \ No newline at end of file diff --git a/modules/wktestimonialblock/wktestimonialblock.php b/modules/wktestimonialblock/wktestimonialblock.php index de379ea38..e8be980d1 100644 --- a/modules/wktestimonialblock/wktestimonialblock.php +++ b/modules/wktestimonialblock/wktestimonialblock.php @@ -44,13 +44,6 @@ class WkTestimonialBlock extends Module $this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_); } - public function hookDisplayAddModuleSettingLink() - { - $hrefTestimonialsConf = $this->context->link->getAdminLink('AdminTestimonialsModuleSetting'); - $this->context->smarty->assign('testimonials_setting_link', $hrefTestimonialsConf); - return $this->display(__FILE__, 'hotelTestimonialSettingLink.tpl'); - } - public function hookDisplayHome() { $this->context->controller->addCSS(_PS_JS_DIR_.'/owl-carousel/assets/owl.carousel.min.css'); @@ -132,12 +125,16 @@ class WkTestimonialBlock extends Module array ( 'displayHome', 'displayFooterExploreSectionHook', - 'displayAddModuleSettingLink', 'actionObjectLanguageAddAfter' ) ); } + public function getContent() + { + Tools::redirectAdmin($this->context->link->getAdminLink('AdminTestimonialsModuleSetting')); + } + public function callInstallTab() { //Controllers which are to be used in this modules but we have not to create tab for those controllers... From 2b35fb3b029c71641de9ff460535f71317085874 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Tue, 22 Nov 2022 19:31:07 +0530 Subject: [PATCH 03/55] Move tab Additional Facilities to AdminProductsController --- config/xml/themes/default.xml | 3 - controllers/admin/AdminProductsController.php | 122 +++++++++++++++++ .../hotelreservationsystem.php | 128 ------------------ .../views/css/roomTypeDemand.css | 42 ------ .../views/js/roomTypeDemand.js | 49 ------- .../views/templates/hook/roomTypeDemands.tpl | 127 ----------------- 6 files changed, 122 insertions(+), 349 deletions(-) delete mode 100644 modules/hotelreservationsystem/views/css/roomTypeDemand.css delete mode 100644 modules/hotelreservationsystem/views/js/roomTypeDemand.js delete mode 100644 modules/hotelreservationsystem/views/templates/hook/roomTypeDemands.tpl diff --git a/config/xml/themes/default.xml b/config/xml/themes/default.xml index f7c0da20f..495981b4d 100644 --- a/config/xml/themes/default.xml +++ b/config/xml/themes/default.xml @@ -65,7 +65,6 @@ - @@ -77,8 +76,6 @@ - - diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 1b9457489..487d132ec 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -113,6 +113,7 @@ class AdminProductsControllerCore extends AdminController 'Configuration' => $this->l('Configuration'), 'Occupancy' => $this->l('Occupancy'), 'Booking' => $this->l('Booking Information'), + 'AdditionalFacilities' => $this->l('Additional Facilities'), ); $this->available_tabs = array('Warehouses' => 14); @@ -134,6 +135,7 @@ class AdminProductsControllerCore extends AdminController 'Configuration' => 14, 'Occupancy' => 15, 'Booking' => 16, + 'AdditionalFacilities' => 17, )); } @@ -2231,6 +2233,9 @@ class AdminProductsControllerCore extends AdminController if ($this->isTabSubmitted('Booking')) { $this->processBooking(); } + if ($this->isTabSubmitted('AdditionalFacilities')) { + $this->processAdditionalFacilities(); + } $this->updatePackItems($object); // Disallow avanced stock management if the product become a pack @@ -3727,6 +3732,123 @@ class AdminProductsControllerCore extends AdminController } } + public function initFormAdditionalFacilities($obj) + { + $data = $this->createTemplate($this->tpl_form); + + if ($obj->id) { + $objGlobalDemand = new HotelRoomTypeGlobalDemand(); + $allDemands = $objGlobalDemand->getAllDemands(); + $objCurrency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); + + // get room type additional facilities + $objRoomDemand = new HotelRoomTypeDemand(); + $roomDemandPrices = $objRoomDemand->getRoomTypeDemands($obj->id, 0, 0); + + $data->assign(array( + 'product' => $obj, + 'idProduct' => $obj->id, + 'roomDemandPrices' => $roomDemandPrices, + 'allDemands' => $allDemands, + 'defaultcurrencySign' => $objCurrency->sign, + )); + } else { + $this->displayWarning($this->l('You must save this room type before managing additional facilities.')); + } + + $this->tpl_form_vars['custom_form'] = $data->fetch(); + } + + public function processAdditionalFacilities() + { + if ($idProduct = Tools::getValue('id_product')) { + $objRoomTypeDemand = new HotelRoomTypeDemand(); + $objRoomTypeDemandPrice = new HotelRoomTypeDemandPrice(); + // first delete all the previously saved prices and demands of this room type + $objRoomTypeDemand->deleteRoomTypeDemands($idProduct); + $objRoomTypeDemandPrice->deleteRoomTypeDemandPrices($idProduct); + if ($selectedDemands = Tools::getValue('selected_demand')) { + $objAdvOption = new HotelRoomTypeGlobalDemandAdvanceOption(); + foreach ($selectedDemands as $idGlobalDemand) { + if (Validate::isLoadedObject($objGlobalDemand = new HotelRoomTypeGlobalDemand($idGlobalDemand))) { + // save selected demands for this room type + $objRoomTypeDemand = new HotelRoomTypeDemand(); + $objRoomTypeDemand->id_product = $idProduct; + $objRoomTypeDemand->id_global_demand = $idGlobalDemand; + $objRoomTypeDemand->save(); + + // save selected demands prices for this room type + $demandPrice = Tools::getValue('demand_price_'.$idGlobalDemand); + if (Validate::isPrice($demandPrice)) { + if ($objGlobalDemand->price != $demandPrice) { + $objRoomTypeDemandPrice = new HotelRoomTypeDemandPrice(); + $objRoomTypeDemandPrice->id_product = $idProduct; + $objRoomTypeDemandPrice->id_global_demand = $idGlobalDemand; + $objRoomTypeDemandPrice->id_option = 0; + $objRoomTypeDemandPrice->price = $demandPrice; + $objRoomTypeDemandPrice->save(); + } + } else { + $this->errors[] = Tools::displayError('Invalid demand price of facility.'). + ' : '.$objGlobalDemand->name[$this->context->language->id]; + } + if ($advOptions = $objAdvOption->getGlobalDemandAdvanceOptions($idGlobalDemand)) { + foreach ($advOptions as $option) { + if (Validate::isLoadedObject($objAdvOption = new HotelRoomTypeGlobalDemandAdvanceOption($option['id']))) { + $optionPrice = Tools::getValue('option_price_'.$option['id']); + if (Validate::isPrice($optionPrice)) { + if ($optionPrice != $objAdvOption->price) { + $objRoomTypeDemandPrice = new HotelRoomTypeDemandPrice(); + $objRoomTypeDemandPrice->id_product = $idProduct; + $objRoomTypeDemandPrice->id_global_demand = $idGlobalDemand; + $objRoomTypeDemandPrice->id_option = $option['id']; + $objRoomTypeDemandPrice->price = $optionPrice; + $objRoomTypeDemandPrice->save(); + } + } else { + $this->errors[] = Tools::displayError('Invalid price of advanced option: ').$objAdvOption->name[$this->context->language->id]; + } + } + } + } + } + } + if (count($this->errors)) { + $this->warnings[] = Tools::displayError('Invalid price values are not saved. Please correct them and save again.'); + } + + $objCartBookingData = new HotelCartBookingData(); + if ($cartExtraDemands = $objCartBookingData->getCartExtraDemands(0, $idProduct)) { + // delete the demands from cart if not available in cart + $objRoomDemand = new HotelRoomTypeDemand(); + $roomTypeDemandIds = array(); + if ($roomTypeDemands = $objRoomDemand->getRoomTypeDemands($idProduct)) { + $roomTypeDemandIds = array_keys($roomTypeDemands); + } + foreach ($cartExtraDemands as &$demandInfo) { + if (isset($demandInfo['extra_demands']) && $demandInfo['extra_demands']) { + $cartChanged = 0; + foreach ($demandInfo['extra_demands'] as $key => $demand) { + if (!in_array($demand['id_global_demand'], $roomTypeDemandIds)) { + $cartChanged = 1; + unset($demandInfo['extra_demands'][$key]); + } + } + if ($cartChanged) { + if (Validate::isLoadedObject( + $objCartBooking = new HotelCartBookingData($demandInfo['id']) + )) { + $objCartBooking->extra_demands = json_encode($demandInfo['extra_demands']); + $objCartBooking->save(); + } + } + } + } + } + } + } + } + public function ajaxProcessProductRoomsBookingDetailsOnMonthChange() { $month = Tools::getValue('month'); diff --git a/modules/hotelreservationsystem/hotelreservationsystem.php b/modules/hotelreservationsystem/hotelreservationsystem.php index 8c0d55f4f..10bf1894a 100644 --- a/modules/hotelreservationsystem/hotelreservationsystem.php +++ b/modules/hotelreservationsystem/hotelreservationsystem.php @@ -194,123 +194,6 @@ class HotelReservationSystem extends Module } } - public function hookDisplayAdminProductsExtra($params) - { - if ($idProduct = Tools::getValue('id_product')) { - $objGlobalDemand = new HotelRoomTypeGlobalDemand(); - $allDemands = $objGlobalDemand->getAllDemands(); - $objCurrency = new Currency(Configuration::get('PS_CURRENCY_DEFAULT')); - // get room type additional services - $objRoomDemand = new HotelRoomTypeDemand(); - $roomDemandPrices = $objRoomDemand->getRoomTypeDemands($idProduct, 0, 0); - $this->context->smarty->assign( - array( - 'idProduct' => $idProduct, - 'roomDemandPrices' => $roomDemandPrices, - 'allDemands' => $allDemands, - 'defaultcurrencySign' => $objCurrency->sign, - ) - ); - } - return $this->display(__FILE__, 'roomTypeDemands.tpl'); - } - - public function moduleProductsExtraTabName() - { - return $this->l('Additional Facilities'); - } - - public function hookActionProductUpdate($params) - { - if ($idProduct = $params['id_product']) { - $objRoomTypeDemand = new HotelRoomTypeDemand(); - $objRoomTypeDemandPrice = new HotelRoomTypeDemandPrice(); - // first delete all the previously saved prices and demands of this room type - $objRoomTypeDemand->deleteRoomTypeDemands($idProduct); - $objRoomTypeDemandPrice->deleteRoomTypeDemandPrices($idProduct); - if ($selectedDemands = Tools::getValue('selected_demand')) { - $objAdvOption = new HotelRoomTypeGlobalDemandAdvanceOption(); - foreach ($selectedDemands as $idGlobalDemand) { - if (Validate::isLoadedObject($objGlobalDemand = new HotelRoomTypeGlobalDemand($idGlobalDemand))) { - // save selected demands for this room type - $objRoomTypeDemand = new HotelRoomTypeDemand(); - $objRoomTypeDemand->id_product = $idProduct; - $objRoomTypeDemand->id_global_demand = $idGlobalDemand; - $objRoomTypeDemand->save(); - - // save selected demands prices for this room type - $demandPrice = Tools::getValue('demand_price_'.$idGlobalDemand); - if (Validate::isPrice($demandPrice)) { - if ($objGlobalDemand->price != $demandPrice) { - $objRoomTypeDemandPrice = new HotelRoomTypeDemandPrice(); - $objRoomTypeDemandPrice->id_product = $idProduct; - $objRoomTypeDemandPrice->id_global_demand = $idGlobalDemand; - $objRoomTypeDemandPrice->id_option = 0; - $objRoomTypeDemandPrice->price = $demandPrice; - $objRoomTypeDemandPrice->save(); - } - } else { - $this->context->controller->errors[] = $this->l('Invalid demand price of facility'). - ' : '.$objGlobalDemand->name[$this->context->language->id]; - } - if ($advOptions = $objAdvOption->getGlobalDemandAdvanceOptions($idGlobalDemand)) { - foreach ($advOptions as $option) { - if (Validate::isLoadedObject($objAdvOption = new HotelRoomTypeGlobalDemandAdvanceOption($option['id']))) { - $optionPrice = Tools::getValue('option_price_'.$option['id']); - if (Validate::isPrice($optionPrice)) { - if ($optionPrice != $objAdvOption->price) { - $objRoomTypeDemandPrice = new HotelRoomTypeDemandPrice(); - $objRoomTypeDemandPrice->id_product = $idProduct; - $objRoomTypeDemandPrice->id_global_demand = $idGlobalDemand; - $objRoomTypeDemandPrice->id_option = $option['id']; - $objRoomTypeDemandPrice->price = $optionPrice; - $objRoomTypeDemandPrice->save(); - } - } else { - $this->context->controller->errors[] = $this->l('Invalid price of advance option'). - ' : '.$objAdvOption->name[$this->context->language->id]; - } - } - } - } - } - } - if (count($this->context->controller->errors)) { - $this->context->controller->warnings[] = $this->l('Invalid price values are not saved. Please correct them and save again'); - } - - $objCartBookingData = new HotelCartBookingData(); - if ($cartExtraDemands = $objCartBookingData->getCartExtraDemands(0, $idProduct)) { - // delete the demands from cart if not available in cart - $objRoomDemand = new HotelRoomTypeDemand(); - $roomTypeDemandIds = array(); - if ($roomTypeDemands = $objRoomDemand->getRoomTypeDemands($idProduct)) { - $roomTypeDemandIds = array_keys($roomTypeDemands); - } - foreach ($cartExtraDemands as &$demandInfo) { - if (isset($demandInfo['extra_demands']) && $demandInfo['extra_demands']) { - $cartChanged = 0; - foreach ($demandInfo['extra_demands'] as $key => $demand) { - if (!in_array($demand['id_global_demand'], $roomTypeDemandIds)) { - $cartChanged = 1; - unset($demandInfo['extra_demands'][$key]); - } - } - if ($cartChanged) { - if (Validate::isLoadedObject( - $objCartBooking = new HotelCartBookingData($demandInfo['id']) - )) { - $objCartBooking->extra_demands = json_encode($demandInfo['extra_demands']); - $objCartBooking->save(); - } - } - } - } - } - } - } - } - public function hookActionProductSave($params) { $isToggling = Tools::getValue('statusproduct'); @@ -360,14 +243,6 @@ class HotelReservationSystem extends Module } } - public function hookActionAdminControllerSetMedia() - { - if ('AdminProducts' == Tools::getValue('controller')) { - $this->context->controller->addJs($this->_path.'views/js/roomTypeDemand.js'); - $this->context->controller->addCSS($this->_path.'views/css/roomTypeDemand.css'); - } - } - public function hookDisplayBackOfficeHeader() { $this->context->controller->addCSS($this->_path.'views/css/admin/css/hotel_admin_tab_logo.css'); @@ -509,9 +384,6 @@ class HotelReservationSystem extends Module 'actionProductSave', 'addWebserviceResources', 'actionObjectLanguageAddAfter', - 'actionAdminControllerSetMedia', - 'displayAdminProductsExtra', - 'actionProductUpdate', 'actionObjectProfileAddAfter', 'actionObjectProfileDeleteBefore', 'actionObjectGroupDeleteBefore', diff --git a/modules/hotelreservationsystem/views/css/roomTypeDemand.css b/modules/hotelreservationsystem/views/css/roomTypeDemand.css deleted file mode 100644 index e0eb196eb..000000000 --- a/modules/hotelreservationsystem/views/css/roomTypeDemand.css +++ /dev/null @@ -1,42 +0,0 @@ -/** -* 2010-2020 Webkul. -* -* NOTICE OF LICENSE -* -* All right is reserved, -* Please go through this link for complete license : https://store.webkul.com/license.html -* -* DISCLAIMER -* -* Do not edit or add to this file if you wish to upgrade this module to newer -* versions in the future. If you wish to customize this module for your -* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information. -* -* @author Webkul IN -* @copyright 2010-2020 Webkul IN -* @license https://store.webkul.com/license.html -*/ - -/*----- Accordion -----*/ -.accordion, .accordion * { - -webkit-box-sizing:border-box; - -moz-box-sizing:border-box; - box-sizing:border-box; -} -.accordion { - overflow:hidden; - border-bottom: 1px solid #CCCCCC; -} -.accordion-section-title { - width:100%; - padding:15px; - display:inline-block; - transition:all linear 0.15s; - color:#252525 !important; - text-decoration:none !important; -} -.accordion-section-content { - display:none; - border-top: 1px solid #eee; - padding-top: 15px; -} \ No newline at end of file diff --git a/modules/hotelreservationsystem/views/js/roomTypeDemand.js b/modules/hotelreservationsystem/views/js/roomTypeDemand.js deleted file mode 100644 index 8b84ee213..000000000 --- a/modules/hotelreservationsystem/views/js/roomTypeDemand.js +++ /dev/null @@ -1,49 +0,0 @@ -/** -* 2010-2020 Webkul. -* -* NOTICE OF LICENSE -* -* All right is reserved, -* Please go through this link for complete license : https://store.webkul.com/license.html -* -* DISCLAIMER -* -* Do not edit or add to this file if you wish to upgrade this module to newer -* versions in the future. If you wish to customize this module for your -* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information. -* -* @author Webkul IN -* @copyright 2010-2020 Webkul IN -* @license https://store.webkul.com/license.html -*/ - -$(document).ready(function() { - function close_accordion_section() { - $('.accordion .accordion-section-title').removeClass('active'); - $('.accordion .accordion-section-content').slideUp(300).removeClass('open'); - } - - $(document).on('click', '.accordion-section-title', function(e) { - // Grab current anchor value - var currentAttrValue = $(this).attr('href'); - - if ($(e.target).is('.active')) { - close_accordion_section(); - $(this).find('i').removeClass('icon-angle-down'); - $(this).find('i').addClass('icon-angle-left'); - } else { - close_accordion_section(); - // Add active class to section title - $(this).addClass('active'); - $(this).find('i').removeClass('icon-angle-left'); - $(this).find('i').addClass('icon-angle-down'); - // Open up the hidden content panel - $('.accordion ' + currentAttrValue).slideDown(300).addClass('open'); - } - e.preventDefault(); - }); - - $(document).on('click', '.selected_demand', function(e) { - e.stopPropagation(); - }); -}); \ No newline at end of file diff --git a/modules/hotelreservationsystem/views/templates/hook/roomTypeDemands.tpl b/modules/hotelreservationsystem/views/templates/hook/roomTypeDemands.tpl deleted file mode 100644 index 90c2c7b0b..000000000 --- a/modules/hotelreservationsystem/views/templates/hook/roomTypeDemands.tpl +++ /dev/null @@ -1,127 +0,0 @@ -{* -* 2010-2020 Webkul. -* -* NOTICE OF LICENSE -* -* All right is reserved, -* Please go through this link for complete license : https://store.webkul.com/license.html -* -* DISCLAIMER -* -* Do not edit or add to this file if you wish to upgrade this module to newer -* versions in the future. If you wish to customize this module for your -* needs please refer to https://store.webkul.com/customisation-guidelines/ for more information. -* -* @author Webkul IN -* @copyright 2010-2020 Webkul IN -* @license https://store.webkul.com/license.html -*} - -{if isset($idProduct) && $idProduct} -
-
-
- {l s='Room Type Additional Facilities' mod='hotelreservationsystem'} -
-
- {l s='To create new please visit' mod='hotelreservationsystem'} {l s='Additional facilities' mod='hotelreservationsystem'} {l s='page' mod='hotelreservationsystem'}. -
- {if isset($allDemands) && $allDemands} -
- {foreach $allDemands as $key => $demand} -
-
- -   {$demand['name']|escape:'html':'UTF-8'} - -
- {if isset($demand['adv_option']) && count($demand['adv_option'])} - - {else} -
- -
-
- {$defaultcurrencySign|escape:'html':'UTF-8'} - -
-
-
- {/if} - {if isset($demand['adv_option']) && $demand['adv_option']} -
- -
-
- - - - - - - - {foreach from=$demand['adv_option'] key=key item=info} - - - - - {/foreach} -
- {l s='Option Name' mod='hotelreservationsystem'} - - {l s='Price' mod='hotelreservationsystem'} -
- {$info['name']|escape:'html':'UTF-8'} - -
- {$defaultcurrencySign|escape:'html':'UTF-8'} - -
-
-
-
-
- {/if} -
-
-
- {/foreach} -
- - {else} -
- {l s='No additional facilities created yet. To create please visit' mod='hotelreservationsystem'} {l s='Additional facilities' mod='hotelreservationsystem'} {l s='page' mod='hotelreservationsystem'}. -
- {/if} -
-
-{else} -
-
- - {l s='There is 1 warning.' mod='hotelreservationsystem'} -
    -
  • {l s='You must save this product before selecting room type addttional facilities.' mod='hotelreservationsystem'}
  • -
-
-
-{/if} \ No newline at end of file From ed13e9c076b72233fd0b6999db507ba6138f2e57 Mon Sep 17 00:00:00 2001 From: Sumit Panwar Date: Wed, 23 Nov 2022 13:03:38 +0530 Subject: [PATCH 04/55] Resolved : count(): Parameter must be an array or an object that implements Countable In classes/webservice/WebserviceOutputJSON.php --- classes/webservice/WebserviceOutputJSON.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/classes/webservice/WebserviceOutputJSON.php b/classes/webservice/WebserviceOutputJSON.php index f1e8cf7c5..0e2da03c4 100644 --- a/classes/webservice/WebserviceOutputJSON.php +++ b/classes/webservice/WebserviceOutputJSON.php @@ -40,7 +40,7 @@ class WebserviceOutputJSON implements WebserviceOutputInterface /** * Current association */ - protected $currentAssociatedEntity; + protected $currentAssociatedEntity = array(); /** * Json content From 20549778d9d84e29f203d491ea218c6208e41cd0 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 28 Nov 2022 15:29:27 +0530 Subject: [PATCH 05/55] Add 'Operations Today' section on admin dashboard --- config/xml/themes/default.xml | 7 +- controllers/admin/AdminStatsController.php | 89 ++++ modules/dashguestcycle/dashguestcycle.php | 400 ++++++++++++++++-- modules/dashguestcycle/translations/de.php | 43 +- modules/dashguestcycle/translations/es.php | 39 +- modules/dashguestcycle/translations/fr.php | 39 +- modules/dashguestcycle/translations/it.php | 37 +- modules/dashguestcycle/translations/nl.php | 39 +- modules/dashguestcycle/translations/pl.php | 41 +- modules/dashguestcycle/translations/pt.php | 39 +- modules/dashguestcycle/translations/ru.php | 39 +- .../views/css/dashguestcycle.css | 17 +- .../views/templates/hook/dashboard-top.tpl | 2 +- .../templates/hook/dashboard-zone-two.tpl | 101 +++++ 14 files changed, 832 insertions(+), 100 deletions(-) create mode 100644 modules/dashguestcycle/views/templates/hook/dashboard-zone-two.tpl diff --git a/config/xml/themes/default.xml b/config/xml/themes/default.xml index f7c0da20f..a3ee99833 100644 --- a/config/xml/themes/default.xml +++ b/config/xml/themes/default.xml @@ -150,14 +150,15 @@ - + + - + - + diff --git a/controllers/admin/AdminStatsController.php b/controllers/admin/AdminStatsController.php index 25aec2cc9..5c603dc07 100644 --- a/controllers/admin/AdminStatsController.php +++ b/controllers/admin/AdminStatsController.php @@ -796,6 +796,7 @@ class AdminStatsControllerCore extends AdminStatsTabController 'SELECT COUNT(hbd.`id_room`) FROM `'._DB_PREFIX_.'htl_booking_detail` hbd WHERE hbd.`is_refunded` = 0 AND hbd.`is_back_order` = 0 + AND hbd.`id_status` = '.(int) HotelBookingDetail::STATUS_CHECKED_IN.' AND hbd.`date_to` BETWEEN "'.pSQL($date).' 00:00:00" AND "'.pSQL($date).' 23:59:59"'. HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') ); @@ -1059,4 +1060,92 @@ class AdminStatsControllerCore extends AdminStatsTabController ((int) $limit ? ' LIMIT 0, '.(int) $limit : '') ); } + + public static function getArrivalsInfoByDate($date, $idHotel = null) + { + $sql = 'SELECT hbd.*, CONCAT(c.`firstname`, " ", c.`lastname`) AS customer_name, + DATEDIFF(hbd.`date_to`, hbd.`date_from`) AS los + FROM `'._DB_PREFIX_.'htl_booking_detail` hbd + LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = hbd.`id_customer`) + WHERE hbd.`is_refunded` = 0 AND hbd.`is_back_order` = 0 + AND hbd.`date_from` = "'.pSQL($date).' 00:00:00" + AND hbd.`id_status` != '.(int) HotelBookingDetail::STATUS_CHECKED_IN.' + AND hbd.`id_status` != '.(int) HotelBookingDetail::STATUS_CHECKED_OUT. + (!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : ''); + $result = Db::getInstance()->executeS($sql); + + return $result; + } + + public static function getDeparturesInfoByDate($date, $idHotel = null) + { + $sql = 'SELECT hbd.*, CONCAT(c.`firstname`, " ", c.`lastname`) AS customer_name, + DATEDIFF(hbd.`date_to`, hbd.`date_from`) AS los + FROM `'._DB_PREFIX_.'htl_booking_detail` hbd + LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = hbd.`id_customer`) + WHERE hbd.`is_refunded` = 0 AND hbd.`is_back_order` = 0 + AND hbd.`date_to` = "'.pSQL($date).' 00:00:00" + AND hbd.`id_status` = '.(int) HotelBookingDetail::STATUS_CHECKED_IN.' + AND hbd.`id_status` != '.(int) HotelBookingDetail::STATUS_CHECKED_OUT. + (!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : ''); + $result = Db::getInstance()->executeS($sql); + + return $result; + } + + public static function getInHouseInfoByDate($date, $idHotel = null) + { + $sql = 'SELECT hbd.*, CONCAT(c.`firstname`, " ", c.`lastname`) AS customer_name, + DATEDIFF(hbd.`date_to`, hbd.`date_from`) AS los + FROM `'._DB_PREFIX_.'htl_booking_detail` hbd + LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = hbd.`id_customer`) + WHERE hbd.`is_refunded` = 0 AND hbd.`is_back_order` = 0 + AND hbd.`id_status` = '.(int) HotelBookingDetail::STATUS_CHECKED_IN.' + AND hbd.`id_status` != '.(int) HotelBookingDetail::STATUS_CHECKED_OUT. + (!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : ''); + $result = Db::getInstance()->executeS($sql); + + return $result; + } + + public static function getNewBookingsInfoByDate($date, $idHotel = null) + { + $sql = 'SELECT hbd.`id_customer`, CONCAT(c.`firstname`, " ", c.`lastname`) AS customer_name, + COUNT(hbd.`id`) AS total_rooms, SUM(hbd.`adult` + hbd.`children`) AS total_guests, + hbd.`id_hotel`, hbd.`hotel_name`, hbd.`id_order`, o.`total_paid_tax_excl`, o.`id_currency`, osl.`name` AS `state_name` + FROM `'._DB_PREFIX_.'htl_booking_detail` hbd + LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = hbd.`id_order`) + LEFT JOIN `'._DB_PREFIX_.'order_state_lang` osl + ON (osl.`id_order_state` = o.`current_state` AND osl.`id_lang` = '.(int) Context::getContext()->language->id.') + LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = hbd.`id_customer`) + WHERE hbd.`is_refunded` = 0 AND hbd.`is_back_order` = 0 + AND hbd.`date_add` BETWEEN "'.pSQL($date).' 00:00:00" AND "'.pSQL($date).' 23:59:59"'. + (!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '').' + GROUP BY hbd.`id_order`'; + $result = Db::getInstance()->executeS($sql); + + return $result; + } + + public static function getCancellationsInfoByDate($date, $idHotel = null) + { + $sql = 'SELECT orr.`id_customer`, hbd.`room_num`, hbd.`id_product`, hbd.`room_type_name`, + CONCAT(c.`firstname`, " ", c.`lastname`) AS customer_name, + hbd.`id_hotel`, hbd.`hotel_name`, SUM(hbd.`adult` + hbd.`children`) AS total_guests, + hbd.`date_from`, hbd.`date_to`, orr.`id_order`, + o.`total_paid_tax_excl`, o.`id_currency`, orsl.`name` AS `state_name` + FROM `'._DB_PREFIX_.'order_return` orr + LEFT JOIN `'._DB_PREFIX_.'order_return_detail` ord ON (ord.`id_order_return` = orr.`id_order_return`) + LEFT JOIN `'._DB_PREFIX_.'orders` o ON (o.`id_order` = orr.`id_order`) + LEFT JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd ON (hbd.`id` = ord.`id_htl_booking`) + LEFT JOIN `'._DB_PREFIX_.'order_return_state_lang` orsl + ON (orsl.`id_order_return_state` = orr.`state` AND orsl.`id_lang` = '.(int) Context::getContext()->language->id.') + LEFT JOIN `'._DB_PREFIX_.'customer` c ON (c.`id_customer` = orr.`id_customer`) + WHERE orr.`date_add` BETWEEN "'.pSQL($date).' 00:00:00" AND "'.pSQL($date).' 23:59:59"'. + (!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '').' + GROUP BY orr.`id_order_return`'; + $result = Db::getInstance()->executeS($sql); + + return $result; + } } diff --git a/modules/dashguestcycle/dashguestcycle.php b/modules/dashguestcycle/dashguestcycle.php index 788071d4e..92724393f 100644 --- a/modules/dashguestcycle/dashguestcycle.php +++ b/modules/dashguestcycle/dashguestcycle.php @@ -44,6 +44,7 @@ class DashGuestCycle extends Module { return (parent::install() && $this->registerHook('dashboardTop') + && $this->registerHook('dashboardZoneTwo') && $this->registerHook('dashboardData') && $this->registerHook('actionAdminControllerSetMedia') ); @@ -56,42 +57,393 @@ class DashGuestCycle extends Module } } - public function hookDashboardTop($params) + public function hookDashboardTop() { return $this->display(__FILE__, 'dashboard-top.tpl'); } + public function hookDashboardZoneTwo($params) + { + return $this->display(__FILE__, 'dashboard-zone-two.tpl'); + } + public function hookDashboardData($params) { - $data = array(); + $dataValue = array(); + $dataTable = array(); + + $dateToday = date('Y-m-d'); if (Configuration::get('PS_DASHBOARD_SIMULATION')) { - $data['dgc_total_arrivals'] = sprintf('%02d', rand(100, 1000)); - $data['dgc_arrived'] = sprintf('%02d', rand(0, $data['dgc_total_arrivals'])); - $data['dgc_total_departures'] = sprintf('%02d', rand(100, 1000)); - $data['dgc_departed'] = sprintf('%02d', rand(0, $data['dgc_total_departures'])); - $data['dgc_new_bookings'] = sprintf('%02d', rand(10, 500)); - $data['dgc_stay_overs'] = sprintf('%02d', rand(10, 500)); - $data['dgc_new_messages'] = sprintf('%02d', rand(0, 20)); - $data['dgc_cancelled_bookings'] = sprintf('%02d', rand(0, 20)); - $data['dgc_guests_adults'] = sprintf('%02d', rand(100, 1000)); - $data['dgc_guests_children'] = sprintf('%02d', rand(0, $data['dgc_guests_adults'])); + $dataValue['dgc_total_arrivals'] = sprintf('%02d', rand(100, 1000)); + $dataValue['dgc_arrived'] = sprintf('%02d', rand(0, $dataValue['dgc_total_arrivals'])); + $dataValue['dgc_total_departures'] = sprintf('%02d', rand(100, 1000)); + $dataValue['dgc_departed'] = sprintf('%02d', rand(0, $dataValue['dgc_total_departures'])); + $dataValue['dgc_new_bookings'] = sprintf('%02d', rand(10, 500)); + $dataValue['dgc_stay_overs'] = sprintf('%02d', rand(10, 500)); + $dataValue['dgc_new_messages'] = sprintf('%02d', rand(0, 20)); + $dataValue['dgc_cancelled_bookings'] = sprintf('%02d', rand(0, 20)); + $dataValue['dgc_guests_adults'] = sprintf('%02d', rand(100, 1000)); + $dataValue['dgc_guests_children'] = sprintf('%02d', rand(0, $dataValue['dgc_guests_adults'])); } else { - $dateToday = date('Y-m-d'); + // set badges data $arrivalsData = AdminStatsController::getArrivalsByDate($dateToday, $params['id_hotel']); $departuresData = AdminStatsController::getDeparturesByDate($dateToday, $params['id_hotel']); $guestsData = AdminStatsController::getGuestsByDate($dateToday, $params['id_hotel']); - $data['dgc_arrived'] = sprintf('%02d', $arrivalsData['arrived']); - $data['dgc_total_arrivals'] = sprintf('%02d', $arrivalsData['total_arrivals']); - $data['dgc_departed'] = sprintf('%02d', $departuresData['departed']); - $data['dgc_total_departures'] = sprintf('%02d', $departuresData['total_departures']); - $data['dgc_new_bookings'] = sprintf('%02d', AdminStatsController::getBookingsByDate($dateToday, $params['id_hotel'])); - $data['dgc_stay_overs'] = sprintf('%02d', AdminStatsController::getStayOversByDate($dateToday, $params['id_hotel'])); - $data['dgc_new_messages'] = sprintf('%02d', CustomerMessage::getMessagesByDate($dateToday)); - $data['dgc_cancelled_bookings'] = sprintf('%02d', AdminStatsController::getCancelledBookingsByDate($dateToday, $params['id_hotel'])); - $data['dgc_guests_adults'] = sprintf('%02d', $guestsData['adults']); - $data['dgc_guests_children'] = sprintf('%02d', $guestsData['children']); + $dataValue['dgc_arrived'] = sprintf('%02d', $arrivalsData['arrived']); + $dataValue['dgc_total_arrivals'] = sprintf('%02d', $arrivalsData['total_arrivals']); + $dataValue['dgc_departed'] = sprintf('%02d', $departuresData['departed']); + $dataValue['dgc_total_departures'] = sprintf('%02d', $departuresData['total_departures']); + $dataValue['dgc_new_bookings'] = sprintf('%02d', AdminStatsController::getBookingsByDate($dateToday, $params['id_hotel'])); + $dataValue['dgc_stay_overs'] = sprintf('%02d', AdminStatsController::getStayOversByDate($dateToday, $params['id_hotel'])); + $dataValue['dgc_new_messages'] = sprintf('%02d', CustomerMessage::getMessagesByDate($dateToday)); + $dataValue['dgc_cancelled_bookings'] = sprintf('%02d', AdminStatsController::getCancelledBookingsByDate($dateToday, $params['id_hotel'])); + $dataValue['dgc_guests_adults'] = sprintf('%02d', $guestsData['adults']); + $dataValue['dgc_guests_children'] = sprintf('%02d', $guestsData['children']); } - return array('data_value' => $data); + // set tables data + $tableCurrentArrivals = $this->getTableArrivalsByDate($dateToday, $params['id_hotel']); + $dataValue['dgc_count_upcoming_arrivals'] = sprintf('%02d', count($tableCurrentArrivals['body'])); + + $tableCurrentDepartures = $this->getTableDeparturesByDate($dateToday, $params['id_hotel']); + $dataValue['dgc_count_upcoming_departures'] = sprintf('%02d', count($tableCurrentDepartures['body'])); + + $tableCurrentInHouse = $this->getTableInHouseByDate($dateToday, $params['id_hotel']); + $dataValue['dgc_count_current_in_house'] = sprintf('%02d', count($tableCurrentInHouse['body'])); + + $tableNewBookings = $this->getTableNewBookingsByDate($dateToday, $params['id_hotel']); + $dataValue['dgc_count_new_bookings'] = sprintf('%02d', count($tableNewBookings['body'])); + + $tableCancellations = $this->getTableCancellationsByDate($dateToday, $params['id_hotel']); + $dataValue['dgc_count_cancellations'] = sprintf('%02d', count($tableCancellations['body'])); + + $dataTable = array( + 'dgc_table_current_arrivals' => $tableCurrentArrivals, + 'dgc_table_current_departures' => $tableCurrentDepartures, + 'dgc_table_current_in_house' => $tableCurrentInHouse, + 'dgc_table_new_bookings' => $tableNewBookings, + 'dgc_table_cancellations' => $tableCancellations, + ); + + return array('data_value' => $dataValue, 'data_table' => $dataTable); + } + + public function getTableArrivalsByDate($date, $idHotel) + { + $header = array( + 'name' => array('title' => $this->l('Name'), 'class' => 'text-left'), + 'room_num' => array('title' => $this->l('Room No.'), 'class' => 'text-center'), + 'room_type' => array('title' => $this->l('Room Type'), 'class' => 'text-left'), + 'hotel' => array('title' => $this->l('Hotel'), 'class' => 'text-left'), + 'guests' => array('title' => $this->l('Guests'), 'class' => 'text-center'), + 'check_out' => array('title' => $this->l('Check-out (LOS)'), 'class' => 'text-left'), + 'order_id' => array('title' => $this->l('Order ID'), 'class' => 'text-center'), + ); + + if ($idHotel != 0) { + unset($header['hotel']); + } + + $arrivalsInfo = AdminStatsController::getArrivalsInfoByDate($date, $idHotel); + + $body = array(); + foreach ($arrivalsInfo as $arrivalInfo) { + $tr = array(); + $tr[] = array( + 'value' => ''.Tools::htmlentitiesUTF8($arrivalInfo['customer_name']).'', + 'class' => 'text-left', + ); + $tr[] = array( + 'value' => $arrivalInfo['room_num'], + 'class' => 'text-center', + ); + $tr[] = array( + 'value' => ''.Tools::htmlentitiesUTF8($arrivalInfo['room_type_name']).'', + 'class' => 'text-left', + ); + + if ($idHotel == 0) { + $tr[] = array( + 'value' => ''.Tools::htmlentitiesUTF8($arrivalInfo['hotel_name']).'', + 'class' => 'text-left', + ); + } + + $tr[] = array( + 'value' => $arrivalInfo['adult'] + $arrivalInfo['children'], + 'class' => 'text-center', + ); + $tr[] = array( + 'value' => Tools::displayDate($arrivalInfo['date_to']).' ('.$arrivalInfo['los'].' '.($arrivalInfo['los'] > 1 ? $this->l('Nights') : $this->l('Night')).')', + 'class' => 'text-left', + ); + $tr[] = array( + 'value' => '#'.Tools::htmlentitiesUTF8($arrivalInfo['id_order']).'', + 'class' => 'text-center', + ); + + $body[] = $tr; + } + + return array('header' => array_values($header), 'body' => $body); + } + + public function getTableDeparturesByDate($date, $idHotel) + { + $header = array( + 'name' => array('title' => $this->l('Name'), 'class' => 'text-left'), + 'room_num' => array('title' => $this->l('Room No.'), 'class' => 'text-center'), + 'room_type' => array('title' => $this->l('Room Type'), 'class' => 'text-left'), + 'hotel' => array('title' => $this->l('Hotel'), 'class' => 'text-left'), + 'guests' => array('title' => $this->l('Guests'), 'class' => 'text-center'), + 'check_in' => array('title' => $this->l('Check-in (LOS)'), 'class' => 'text-left'), + 'order_id' => array('title' => $this->l('Order ID'), 'class' => 'text-center'), + ); + + if ($idHotel != 0) { + unset($header['hotel']); + } + + $departuresInfo = AdminStatsController::getDeparturesInfoByDate($date, $idHotel); + + $body = array(); + foreach ($departuresInfo as $departureInfo) { + $tr = array(); + $tr[] = array( + 'value' => ''.Tools::htmlentitiesUTF8($departureInfo['customer_name']).'', + 'class' => 'text-left', + ); + $tr[] = array( + 'value' => $departureInfo['room_num'], + 'class' => 'text-center', + ); + $tr[] = array( + 'value' => ''.Tools::htmlentitiesUTF8($departureInfo['room_type_name']).'', + 'class' => 'text-left', + ); + + if ($idHotel == 0) { + $tr[] = array( + 'value' => ''.Tools::htmlentitiesUTF8($departureInfo['hotel_name']).'', + 'class' => 'text-left', + ); + } + + $tr[] = array( + 'value' => $departureInfo['adult'] + $departureInfo['children'], + 'class' => 'text-center', + ); + $tr[] = array( + 'value' => Tools::displayDate($departureInfo['date_from']).' ('.$departureInfo['los'].' '.($departureInfo['los'] > 1 ? $this->l('Nights') : $this->l('Night')).')', + 'class' => 'text-left', + ); + $tr[] = array( + 'value' => '#'.Tools::htmlentitiesUTF8($departureInfo['id_order']).'', + 'class' => 'text-center', + ); + + $body[] = $tr; + } + + return array('header' => array_values($header), 'body' => $body); + } + + public function getTableInHouseByDate($date, $idHotel) + { + $header = array( + 'name' => array('title' => $this->l('Name'), 'class' => 'text-left'), + 'room_num' => array('title' => $this->l('Room No.'), 'class' => 'text-center'), + 'room_type' => array('title' => $this->l('Room Type'), 'class' => 'text-left'), + 'hotel' => array('title' => $this->l('Hotel'), 'class' => 'text-left'), + 'guests' => array('title' => $this->l('Guests'), 'class' => 'text-center'), + 'check_in' => array('title' => $this->l('Check-in'), 'class' => 'text-left'), + 'check_out' => array('title' => $this->l('Check-out (LOS)'), 'class' => 'text-left'), + 'order_id' => array('title' => $this->l('Order ID'), 'class' => 'text-center'), + ); + + if ($idHotel != 0) { + unset($header['hotel']); + } + + $inHouseInfos = AdminStatsController::getInHouseInfoByDate($date, $idHotel); + + $body = array(); + foreach ($inHouseInfos as $inHouseInfo) { + $tr = array(); + $tr[] = array( + 'value' => ''.Tools::htmlentitiesUTF8($inHouseInfo['customer_name']).'', + 'class' => 'text-left', + ); + $tr[] = array( + 'value' => $inHouseInfo['room_num'], + 'class' => 'text-center', + ); + $tr[] = array( + 'value' => ''.Tools::htmlentitiesUTF8($inHouseInfo['room_type_name']).'', + 'class' => 'text-left', + ); + + if ($idHotel == 0) { + $tr[] = array( + 'value' => ''.Tools::htmlentitiesUTF8($inHouseInfo['hotel_name']).'', + 'class' => 'text-left', + ); + } + + $tr[] = array( + 'value' => $inHouseInfo['adult'] + $inHouseInfo['children'], + 'class' => 'text-center', + ); + $tr[] = array( + 'value' => Tools::displayDate($inHouseInfo['date_from']), + 'class' => 'text-left', + ); + $tr[] = array( + 'value' => Tools::displayDate($inHouseInfo['date_to']).' ('.$inHouseInfo['los'].' '.($inHouseInfo['los'] > 1 ? $this->l('Nights') : $this->l('Night')).')', + 'class' => 'text-left', + ); + $tr[] = array( + 'value' => '#'.Tools::htmlentitiesUTF8($inHouseInfo['id_order']).'', + 'class' => 'text-center', + ); + + $body[] = $tr; + } + + return array('header' => array_values($header), 'body' => $body); + } + + public function getTableNewBookingsByDate($date, $idHotel) + { + $header = array( + 'name' => array('title' => $this->l('Name'), 'class' => 'text-left'), + 'total' => array('title' => $this->l('Total Rooms'), 'class' => 'text-center'), + 'guests' => array('title' => $this->l('Guests'), 'class' => 'text-center'), + 'hotel' => array('title' => $this->l('Hotel'), 'class' => 'text-left'), + 'order_id' => array('title' => $this->l('Order ID'), 'class' => 'text-center'), + 'order_total' => array('title' => $this->l('Order Total'), 'class' => 'text-right'), + 'order_status' => array('title' => $this->l('Order Status'), 'class' => 'text-left'), + ); + + if ($idHotel != 0) { + unset($header['hotel']); + } + + $newBookingsInfo = AdminStatsController::getNewBookingsInfoByDate($date, $idHotel); + + $body = array(); + foreach ($newBookingsInfo as $newBookingInfo) { + $objCurrency = Currency::getCurrency($newBookingInfo['id_currency']); + + $tr = array(); + $tr[] = array( + 'value' => ''.Tools::htmlentitiesUTF8($newBookingInfo['customer_name']).'', + 'class' => 'text-left', + ); + $tr[] = array( + 'value' => $newBookingInfo['total_rooms'], + 'class' => 'text-center', + ); + $tr[] = array( + 'value' => $newBookingInfo['total_guests'], + 'class' => 'text-center', + ); + + if ($idHotel == 0) { + $tr[] = array( + 'value' => ''.Tools::htmlentitiesUTF8($newBookingInfo['hotel_name']).'', + 'class' => 'text-left', + ); + } + + $tr[] = array( + 'value' => '#'.Tools::htmlentitiesUTF8($newBookingInfo['id_order']).'', + 'class' => 'text-center', + ); + $tr[] = array( + 'value' => Tools::displayPrice($newBookingInfo['total_paid_tax_excl'], $objCurrency), + 'class' => 'text-right', + ); + $tr[] = array( + 'value' => $newBookingInfo['state_name'], + 'class' => 'text-left', + ); + + $body[] = $tr; + } + + return array('header' => array_values($header), 'body' => $body); + } + + public function getTableCancellationsByDate($date, $idHotel) + { + $header = array( + 'name' => array('title' => $this->l('Name'), 'class' => 'text-left'), + 'room_num' => array('title' => $this->l('Room No.'), 'class' => 'text-center'), + 'room_type' => array('title' => $this->l('Room Type'), 'class' => 'text-left'), + 'hotel' => array('title' => $this->l('Hotel'), 'class' => 'text-left'), + 'guests' => array('title' => $this->l('Guests'), 'class' => 'text-center'), + 'check_in' => array('title' => $this->l('Check-in'), 'class' => 'text-left'), + 'check_out' => array('title' => $this->l('Check-out'), 'class' => 'text-left'), + 'order_id' => array('title' => $this->l('Order ID'), 'class' => 'text-center'), + 'order_status' => array('title' => $this->l('Cancel Status'), 'class' => 'text-left'), + ); + + if ($idHotel != 0) { + unset($header['hotel']); + } + + $cancellationsInfo = AdminStatsController::getCancellationsInfoByDate($date, $idHotel); + + $body = array(); + foreach ($cancellationsInfo as $cancellationInfo) { + $objCurrency = Currency::getCurrency($cancellationInfo['id_currency']); + + $tr = array(); + $tr[] = array( + 'value' => ''.Tools::htmlentitiesUTF8($cancellationInfo['customer_name']).'', + 'class' => 'text-left', + ); + $tr[] = array( + 'value' => $cancellationInfo['room_num'], + 'class' => 'text-center', + ); + $tr[] = array( + 'value' => ''.Tools::htmlentitiesUTF8($cancellationInfo['room_type_name']).'', + 'class' => 'text-left', + ); + + if ($idHotel == 0) { + $tr[] = array( + 'value' => ''.Tools::htmlentitiesUTF8($cancellationInfo['hotel_name']).'', + 'class' => 'text-left', + ); + } + + $tr[] = array( + 'value' => $cancellationInfo['total_guests'], + 'class' => 'text-center', + ); + $tr[] = array( + 'value' => Tools::displayDate($cancellationInfo['date_from']), + 'class' => 'text-left', + ); + $tr[] = array( + 'value' => Tools::displayDate($cancellationInfo['date_to']), + 'class' => 'text-left', + ); + $tr[] = array( + 'value' => '#'.Tools::htmlentitiesUTF8($cancellationInfo['id_order']).'', + 'class' => 'text-center', + ); + $tr[] = array( + 'value' => $cancellationInfo['state_name'], + 'class' => 'text-left', + ); + + $body[] = $tr; + } + + return array('header' => array_values($header), 'body' => $body); } } diff --git a/modules/dashguestcycle/translations/de.php b/modules/dashguestcycle/translations/de.php index 9f1003d9d..fc325ea29 100644 --- a/modules/dashguestcycle/translations/de.php +++ b/modules/dashguestcycle/translations/de.php @@ -2,13 +2,36 @@ global $_MODULE; $_MODULE = array(); -$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e3771f089b24e39f54de4f6c7cb5ae71'] = 'Dashboard-Gästezyklus'; -$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_efbce5905c871f6ee2a35e27cd8387ca'] = 'Fügt einen Block mit einer grafischen Darstellung der Gästezyklusstatistiken hinzu.'; -$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_876f23178c29dc2552c0b48bf23cd9bd'] = 'Bist du sicher, dass du es deinstallieren willst?'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_90d11386ef0c90f27fb7ff65f1fcff83'] = 'Ankunft'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_5201bc1c95fed6725def30cb27c01b1a'] = 'Abflüge'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_1998e47006c71d5217e8fb534b0d6cf6'] = 'Neue Buchungen'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_a1f1cb8acf3d5563fae235c3a472c2f2'] = 'Übernachten'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_707e4ef7452b8f415c36af6996052f0e'] = 'Gastnachrichten'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_36c162d08af759b84421db4bcb76bde5'] = 'Stornierte Buchungen'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_15068fa48d844fd3a21a460650f81145'] = 'Gäste (Erwachsene/Kinder)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e3771f089b24e39f54de4f6c7cb5ae71'] = 'Dashboard Gastzyklus'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_efbce5905c871f6ee2a35e27cd8387ca'] = 'Fügt einen Block mit einer grafischen Darstellung der Gastzyklusstatistiken hinzu.'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_876f23178c29dc2552c0b48bf23cd9bd'] = 'Bist du dir sicher dass du es deinstallieren willst?'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_49ee3087348e8d44e1feda1917443987'] = 'Name'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_4ac28a9f6152a6b8b86f5d975a99f96b'] = 'Zimmer Nr.'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_168cd661c523acecfe5261e6a6b5e0d6'] = 'Zimmertyp'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_26e28738b51eebd25cf4d734b33b539f'] = 'Hotel'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_4229e0630f34b4f8085774240b1e39ff'] = 'Gäste'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_52da72eb7575b71bf704417043089f2c'] = 'Auschecken (LOS)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_d79cf3f429596f77db95c65074663a54'] = 'Auftragsnummer'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e10758a0bbe2e5a1bd948a8fe1a4a3dc'] = 'Nächte'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_0edc9b073397681dc9f2c479686ea0d9'] = 'Nacht'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_66911151e40ada6dabad586733fa0929'] = 'Check-in (LOS)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_ec86d6e09689fe97bb7d1a233d5e5e13'] = 'Check-In'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_c48da6e10c4223c777d3eadbb2bafe4e'] = 'Zimmer insgesamt'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_fcf35bd8e66b772c865588339b93bfec'] = 'Auftragssumme'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_bbd3a18e6d45b8331cf8a715f3f0008d'] = 'Bestellstatus'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_edfd56b38f555c58ca8f6902c39dbd04'] = 'Kasse'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_8f85cb22514fc08e5988e09836b8fb4e'] = 'Status abbrechen'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_975bfdb44b5907246ef0617e1c9c88bf'] = 'Die Anzahl der für heute geplanten Ankünfte.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_720a541d3696124de85fcd8be6144c8b'] = 'Die Anzahl der für heute geplanten Abfahrten.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_05526b5bbb4c2e6125d44b2c44990d8d'] = 'Die Anzahl der bisher erstellten neuen Buchungen.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_39d6209295eae2edc20adfea3d086a2f'] = 'Die Anzahl der für heute geplanten Übernachtungen.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_7791caa6f05fe31b25060cfa837d426b'] = 'Die Anzahl der heute von Gästen erhaltenen neuen Nachrichten.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_a51b52bed091adf999ab6c8e96a7af8a'] = 'Die Anzahl der heute bisher stornierten Buchungen.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_0f04b7b3005ef88e9ae8411cdff6aaae'] = 'Die Anzahl der Erwachsenen und Kinder, die heute bleiben sollen.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_b898f0a62dcfd02184ed0570136bb61f'] = 'Betrieb heute'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_63a6a88c066880c5ac42394a22803ca6'] = 'Aktualisierung'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_90d11386ef0c90f27fb7ff65f1fcff83'] = 'Ankünfte'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_5201bc1c95fed6725def30cb27c01b1a'] = 'Abflüge'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_c14ecb2ba5611ae4eb424bfb96676c7f'] = 'Im Haus'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_a35529bfcfdfab2dc01946af64cd2ce4'] = 'Buchungen'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_1b08b875cf875b1aeaed558ce21fe4e6'] = 'Stornierungen'; diff --git a/modules/dashguestcycle/translations/es.php b/modules/dashguestcycle/translations/es.php index f7288e0b2..699646e55 100644 --- a/modules/dashguestcycle/translations/es.php +++ b/modules/dashguestcycle/translations/es.php @@ -2,13 +2,36 @@ global $_MODULE; $_MODULE = array(); -$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e3771f089b24e39f54de4f6c7cb5ae71'] = 'Ciclo de invitado del panel'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e3771f089b24e39f54de4f6c7cb5ae71'] = 'Ciclo de invitado del tablero'; $_MODULE['<{dashguestcycle}prestashop>dashguestcycle_efbce5905c871f6ee2a35e27cd8387ca'] = 'Agrega un bloque con una representación gráfica de las estadísticas del ciclo de invitados.'; $_MODULE['<{dashguestcycle}prestashop>dashguestcycle_876f23178c29dc2552c0b48bf23cd9bd'] = '¿Estas seguro que lo quieres desinstalar?'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_90d11386ef0c90f27fb7ff65f1fcff83'] = 'Llegadas'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_5201bc1c95fed6725def30cb27c01b1a'] = 'Salidas'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_1998e47006c71d5217e8fb534b0d6cf6'] = 'Nuevas reservas'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_a1f1cb8acf3d5563fae235c3a472c2f2'] = 'Stay Overs'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_707e4ef7452b8f415c36af6996052f0e'] = 'Mensajes de invitados'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_36c162d08af759b84421db4bcb76bde5'] = 'Reservas canceladas'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_15068fa48d844fd3a21a460650f81145'] = 'Invitados (Adultos / Niños)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_49ee3087348e8d44e1feda1917443987'] = 'Nombre'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_4ac28a9f6152a6b8b86f5d975a99f96b'] = 'Habitación no.'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_168cd661c523acecfe5261e6a6b5e0d6'] = 'Tipo de habitación'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_26e28738b51eebd25cf4d734b33b539f'] = 'Hotel'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_4229e0630f34b4f8085774240b1e39ff'] = 'Huéspedes'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_52da72eb7575b71bf704417043089f2c'] = 'Salida (LOS)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_d79cf3f429596f77db95c65074663a54'] = 'Solicitar ID'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e10758a0bbe2e5a1bd948a8fe1a4a3dc'] = 'Noches'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_0edc9b073397681dc9f2c479686ea0d9'] = 'Noche'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_66911151e40ada6dabad586733fa0929'] = 'Facturación (LOS)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_ec86d6e09689fe97bb7d1a233d5e5e13'] = 'Registrarse'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_c48da6e10c4223c777d3eadbb2bafe4e'] = 'Habitaciones Totales'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_fcf35bd8e66b772c865588339b93bfec'] = 'Total del pedido'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_bbd3a18e6d45b8331cf8a715f3f0008d'] = 'Estado del pedido'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_edfd56b38f555c58ca8f6902c39dbd04'] = 'Verificar'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_8f85cb22514fc08e5988e09836b8fb4e'] = 'Cancelar estado'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_975bfdb44b5907246ef0617e1c9c88bf'] = 'El número de llegadas programadas para hoy.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_720a541d3696124de85fcd8be6144c8b'] = 'El número de salidas programadas para hoy.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_05526b5bbb4c2e6125d44b2c44990d8d'] = 'El número de nuevas reservas creadas hoy hasta el momento.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_39d6209295eae2edc20adfea3d086a2f'] = 'El número de estancias programadas para hoy.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_7791caa6f05fe31b25060cfa837d426b'] = 'El número de mensajes nuevos recibidos de invitados hoy.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_a51b52bed091adf999ab6c8e96a7af8a'] = 'El número de reservas canceladas hoy hasta ahora.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_0f04b7b3005ef88e9ae8411cdff6aaae'] = 'El número de adultos y niños programados para quedarse hoy.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_b898f0a62dcfd02184ed0570136bb61f'] = 'Operaciones hoy'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_63a6a88c066880c5ac42394a22803ca6'] = 'Actualizar'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_90d11386ef0c90f27fb7ff65f1fcff83'] = 'Llegadas'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_5201bc1c95fed6725def30cb27c01b1a'] = 'Salidas'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_c14ecb2ba5611ae4eb424bfb96676c7f'] = 'interno'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_a35529bfcfdfab2dc01946af64cd2ce4'] = 'Reservaciones'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_1b08b875cf875b1aeaed558ce21fe4e6'] = 'Cancelaciones'; diff --git a/modules/dashguestcycle/translations/fr.php b/modules/dashguestcycle/translations/fr.php index 9d0f23019..46597a724 100644 --- a/modules/dashguestcycle/translations/fr.php +++ b/modules/dashguestcycle/translations/fr.php @@ -3,12 +3,35 @@ global $_MODULE; $_MODULE = array(); $_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e3771f089b24e39f54de4f6c7cb5ae71'] = 'Cycle d\'invité du tableau de bord'; -$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_efbce5905c871f6ee2a35e27cd8387ca'] = 'Ajoute un bloc avec une représentation graphique des statistiques du cycle des invités.'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_efbce5905c871f6ee2a35e27cd8387ca'] = 'Ajoute un bloc avec une représentation graphique des statistiques du cycle client.'; $_MODULE['<{dashguestcycle}prestashop>dashguestcycle_876f23178c29dc2552c0b48bf23cd9bd'] = 'Êtes-vous sur de vouloir désinstaller?'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_90d11386ef0c90f27fb7ff65f1fcff83'] = 'Arrivées'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_5201bc1c95fed6725def30cb27c01b1a'] = 'départs'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_1998e47006c71d5217e8fb534b0d6cf6'] = 'Nouvelles réservations'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_a1f1cb8acf3d5563fae235c3a472c2f2'] = 'Séjour Overs'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_707e4ef7452b8f415c36af6996052f0e'] = 'Messages d\'invité'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_36c162d08af759b84421db4bcb76bde5'] = 'Réservations annulées'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_15068fa48d844fd3a21a460650f81145'] = 'Invités (adultes/enfants)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_49ee3087348e8d44e1feda1917443987'] = 'Nom'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_4ac28a9f6152a6b8b86f5d975a99f96b'] = 'Chambre numéro.'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_168cd661c523acecfe5261e6a6b5e0d6'] = 'Type de chambre'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_26e28738b51eebd25cf4d734b33b539f'] = 'Hôtel'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_4229e0630f34b4f8085774240b1e39ff'] = 'Invités'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_52da72eb7575b71bf704417043089f2c'] = 'Départ (LOS)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_d79cf3f429596f77db95c65074663a54'] = 'numéro de commande'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e10758a0bbe2e5a1bd948a8fe1a4a3dc'] = 'Nuits'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_0edc9b073397681dc9f2c479686ea0d9'] = 'Nuit'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_66911151e40ada6dabad586733fa0929'] = 'Enregistrement (LOS)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_ec86d6e09689fe97bb7d1a233d5e5e13'] = 'Enregistrement'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_c48da6e10c4223c777d3eadbb2bafe4e'] = 'Chambres totales'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_fcf35bd8e66b772c865588339b93bfec'] = 'Total de la commande'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_bbd3a18e6d45b8331cf8a715f3f0008d'] = 'Statut de la commande'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_edfd56b38f555c58ca8f6902c39dbd04'] = 'Vérifier'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_8f85cb22514fc08e5988e09836b8fb4e'] = 'Annuler le statut'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_975bfdb44b5907246ef0617e1c9c88bf'] = 'Le nombre d\'arrivées prévues pour aujourd\'hui.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_720a541d3696124de85fcd8be6144c8b'] = 'Le nombre de départs prévus pour aujourd\'hui.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_05526b5bbb4c2e6125d44b2c44990d8d'] = 'Le nombre de nouvelles réservations créées aujourd\'hui jusqu\'à présent.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_39d6209295eae2edc20adfea3d086a2f'] = 'Le nombre de séjours programmés pour aujourd\'hui.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_7791caa6f05fe31b25060cfa837d426b'] = 'Le nombre de nouveaux messages reçus d\'invités aujourd\'hui.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_a51b52bed091adf999ab6c8e96a7af8a'] = 'Le nombre de réservations annulées aujourd\'hui jusqu\'à présent.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_0f04b7b3005ef88e9ae8411cdff6aaae'] = 'Le nombre d\'adultes et d\'enfants qui doivent rester aujourd\'hui.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_b898f0a62dcfd02184ed0570136bb61f'] = 'Opérations aujourd\'hui'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_63a6a88c066880c5ac42394a22803ca6'] = 'Rafraîchir'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_90d11386ef0c90f27fb7ff65f1fcff83'] = 'Arrivées'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_5201bc1c95fed6725def30cb27c01b1a'] = 'départs'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_c14ecb2ba5611ae4eb424bfb96676c7f'] = 'En interne'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_a35529bfcfdfab2dc01946af64cd2ce4'] = 'Réservations'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_1b08b875cf875b1aeaed558ce21fe4e6'] = 'Annulations'; diff --git a/modules/dashguestcycle/translations/it.php b/modules/dashguestcycle/translations/it.php index 02bd85964..eda133b4f 100644 --- a/modules/dashguestcycle/translations/it.php +++ b/modules/dashguestcycle/translations/it.php @@ -5,10 +5,33 @@ $_MODULE = array(); $_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e3771f089b24e39f54de4f6c7cb5ae71'] = 'Ciclo ospite del cruscotto'; $_MODULE['<{dashguestcycle}prestashop>dashguestcycle_efbce5905c871f6ee2a35e27cd8387ca'] = 'Aggiunge un blocco con una rappresentazione grafica delle statistiche del ciclo degli ospiti.'; $_MODULE['<{dashguestcycle}prestashop>dashguestcycle_876f23178c29dc2552c0b48bf23cd9bd'] = 'Sei sicuro di voler disinstallare?'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_90d11386ef0c90f27fb7ff65f1fcff83'] = 'Arrivi'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_5201bc1c95fed6725def30cb27c01b1a'] = 'Partenze'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_1998e47006c71d5217e8fb534b0d6cf6'] = 'Nuove prenotazioni'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_a1f1cb8acf3d5563fae235c3a472c2f2'] = 'Soggiorno Overs'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_707e4ef7452b8f415c36af6996052f0e'] = 'Messaggi degli ospiti'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_36c162d08af759b84421db4bcb76bde5'] = 'Prenotazioni annullate'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_15068fa48d844fd3a21a460650f81145'] = 'Ospiti (Adulti/Bambini)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_49ee3087348e8d44e1feda1917443987'] = 'Nome'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_4ac28a9f6152a6b8b86f5d975a99f96b'] = 'Stanza No.'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_168cd661c523acecfe5261e6a6b5e0d6'] = 'Tipo di stanza'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_26e28738b51eebd25cf4d734b33b539f'] = 'Hotel'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_4229e0630f34b4f8085774240b1e39ff'] = 'Ospiti'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_52da72eb7575b71bf704417043089f2c'] = 'Partenza (LOS)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_d79cf3f429596f77db95c65074663a54'] = 'ID ordine'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e10758a0bbe2e5a1bd948a8fe1a4a3dc'] = 'Notti'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_0edc9b073397681dc9f2c479686ea0d9'] = 'Notte'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_66911151e40ada6dabad586733fa0929'] = 'Check-in (LOS)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_ec86d6e09689fe97bb7d1a233d5e5e13'] = 'Registrare'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_c48da6e10c4223c777d3eadbb2bafe4e'] = 'Camere totali'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_fcf35bd8e66b772c865588339b93bfec'] = 'Ordine totale'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_bbd3a18e6d45b8331cf8a715f3f0008d'] = 'Lo stato dell\'ordine'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_edfd56b38f555c58ca8f6902c39dbd04'] = 'Guardare'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_8f85cb22514fc08e5988e09836b8fb4e'] = 'Annulla stato'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_975bfdb44b5907246ef0617e1c9c88bf'] = 'Il numero di arrivi previsti per oggi.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_720a541d3696124de85fcd8be6144c8b'] = 'Il numero di partenze previste per oggi.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_05526b5bbb4c2e6125d44b2c44990d8d'] = 'Il numero di nuove prenotazioni create oggi finora.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_39d6209295eae2edc20adfea3d086a2f'] = 'Il numero di soggiorni programmati per oggi.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_7791caa6f05fe31b25060cfa837d426b'] = 'Il numero di nuovi messaggi ricevuti dagli ospiti oggi.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_a51b52bed091adf999ab6c8e96a7af8a'] = 'Il numero di prenotazioni cancellate oggi finora.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_0f04b7b3005ef88e9ae8411cdff6aaae'] = 'Il numero di adulti e bambini programmati per soggiornare oggi.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_b898f0a62dcfd02184ed0570136bb61f'] = 'Operazioni Oggi'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_63a6a88c066880c5ac42394a22803ca6'] = 'ricaricare'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_90d11386ef0c90f27fb7ff65f1fcff83'] = 'Arrivi'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_5201bc1c95fed6725def30cb27c01b1a'] = 'Partenze'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_c14ecb2ba5611ae4eb424bfb96676c7f'] = 'In casa'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_a35529bfcfdfab2dc01946af64cd2ce4'] = 'Prenotazioni'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_1b08b875cf875b1aeaed558ce21fe4e6'] = 'Cancellazioni'; diff --git a/modules/dashguestcycle/translations/nl.php b/modules/dashguestcycle/translations/nl.php index 10ec41c6a..e0c09ef6b 100644 --- a/modules/dashguestcycle/translations/nl.php +++ b/modules/dashguestcycle/translations/nl.php @@ -4,11 +4,34 @@ global $_MODULE; $_MODULE = array(); $_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e3771f089b24e39f54de4f6c7cb5ae71'] = 'Dashboard gastcyclus'; $_MODULE['<{dashguestcycle}prestashop>dashguestcycle_efbce5905c871f6ee2a35e27cd8387ca'] = 'Voegt een blok toe met een grafische weergave van gastcyclusstatistieken.'; -$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_876f23178c29dc2552c0b48bf23cd9bd'] = 'Weet u zeker dat u de installatie ongedaan wilt maken?'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_90d11386ef0c90f27fb7ff65f1fcff83'] = 'Aankomsten'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_5201bc1c95fed6725def30cb27c01b1a'] = 'Vertrek'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_1998e47006c71d5217e8fb534b0d6cf6'] = 'Nieuwe boekingen'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_a1f1cb8acf3d5563fae235c3a472c2f2'] = 'Overblijven'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_707e4ef7452b8f415c36af6996052f0e'] = 'Gastberichten'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_36c162d08af759b84421db4bcb76bde5'] = 'Geannuleerde boekingen'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_15068fa48d844fd3a21a460650f81145'] = 'Gasten (Volwassenen/Kinderen)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_876f23178c29dc2552c0b48bf23cd9bd'] = 'Weet u zeker dat u wilt verwijderen?'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_49ee3087348e8d44e1feda1917443987'] = 'Naam'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_4ac28a9f6152a6b8b86f5d975a99f96b'] = 'Kamer nummer.'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_168cd661c523acecfe5261e6a6b5e0d6'] = 'Kamertype'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_26e28738b51eebd25cf4d734b33b539f'] = 'Hotel'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_4229e0630f34b4f8085774240b1e39ff'] = 'Gasten'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_52da72eb7575b71bf704417043089f2c'] = 'Uitchecken (LOS)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_d79cf3f429596f77db95c65074663a54'] = 'Order ID'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e10758a0bbe2e5a1bd948a8fe1a4a3dc'] = 'Nachten'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_0edc9b073397681dc9f2c479686ea0d9'] = 'Nacht'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_66911151e40ada6dabad586733fa0929'] = 'Inchecken (LOS)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_ec86d6e09689fe97bb7d1a233d5e5e13'] = 'Check in'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_c48da6e10c4223c777d3eadbb2bafe4e'] = 'Totaal aantal kamers'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_fcf35bd8e66b772c865588339b93bfec'] = 'totale bestelling'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_bbd3a18e6d45b8331cf8a715f3f0008d'] = 'Bestelstatus'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_edfd56b38f555c58ca8f6902c39dbd04'] = 'Uitchecken'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_8f85cb22514fc08e5988e09836b8fb4e'] = 'Annuleerstatus'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_975bfdb44b5907246ef0617e1c9c88bf'] = 'Het aantal geplande aankomsten voor vandaag.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_720a541d3696124de85fcd8be6144c8b'] = 'Het aantal geplande vertrekken voor vandaag.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_05526b5bbb4c2e6125d44b2c44990d8d'] = 'Het aantal nieuwe boekingen dat tot nu toe vandaag is gemaakt.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_39d6209295eae2edc20adfea3d086a2f'] = 'Het aantal geplande overnachtingen voor vandaag.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_7791caa6f05fe31b25060cfa837d426b'] = 'Het aantal nieuwe berichten dat vandaag van gasten is ontvangen.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_a51b52bed091adf999ab6c8e96a7af8a'] = 'Het aantal boekingen dat tot nu toe vandaag is geannuleerd.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_0f04b7b3005ef88e9ae8411cdff6aaae'] = 'Het aantal volwassenen en kinderen dat gepland staat om vandaag te blijven.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_b898f0a62dcfd02184ed0570136bb61f'] = 'Operaties Vandaag'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_63a6a88c066880c5ac42394a22803ca6'] = 'Vernieuwen'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_90d11386ef0c90f27fb7ff65f1fcff83'] = 'Aankomsten'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_5201bc1c95fed6725def30cb27c01b1a'] = 'Vertrek'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_c14ecb2ba5611ae4eb424bfb96676c7f'] = 'In huis'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_a35529bfcfdfab2dc01946af64cd2ce4'] = 'Boekingen'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_1b08b875cf875b1aeaed558ce21fe4e6'] = 'Annuleringen'; diff --git a/modules/dashguestcycle/translations/pl.php b/modules/dashguestcycle/translations/pl.php index de84f9286..9e94df8a9 100644 --- a/modules/dashguestcycle/translations/pl.php +++ b/modules/dashguestcycle/translations/pl.php @@ -2,13 +2,36 @@ global $_MODULE; $_MODULE = array(); -$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e3771f089b24e39f54de4f6c7cb5ae71'] = 'Cykl gościa pulpitu nawigacyjnego'; -$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_efbce5905c871f6ee2a35e27cd8387ca'] = 'Dodaje blok z graficzną reprezentacją statystyk cyklu gościa.'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e3771f089b24e39f54de4f6c7cb5ae71'] = 'Cykl gości na pulpicie nawigacyjnym'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_efbce5905c871f6ee2a35e27cd8387ca'] = 'Dodaje blok z graficzną reprezentacją statystyk cyklu gości.'; $_MODULE['<{dashguestcycle}prestashop>dashguestcycle_876f23178c29dc2552c0b48bf23cd9bd'] = 'Jesteś pewien, że chcesz odinstalować?'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_90d11386ef0c90f27fb7ff65f1fcff83'] = 'Przyloty'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_5201bc1c95fed6725def30cb27c01b1a'] = 'Odloty'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_1998e47006c71d5217e8fb534b0d6cf6'] = 'Nowe rezerwacje'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_a1f1cb8acf3d5563fae235c3a472c2f2'] = 'Zostań na dłużej'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_707e4ef7452b8f415c36af6996052f0e'] = 'Wiadomości dla gości'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_36c162d08af759b84421db4bcb76bde5'] = 'Anulowane rezerwacje'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_15068fa48d844fd3a21a460650f81145'] = 'Goście (dorośli/dzieci)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_49ee3087348e8d44e1feda1917443987'] = 'Nazwa'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_4ac28a9f6152a6b8b86f5d975a99f96b'] = 'Pokój numer.'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_168cd661c523acecfe5261e6a6b5e0d6'] = 'Rodzaj pokoju'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_26e28738b51eebd25cf4d734b33b539f'] = 'Hotel'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_4229e0630f34b4f8085774240b1e39ff'] = 'Goście'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_52da72eb7575b71bf704417043089f2c'] = 'Wymeldowanie (LOS)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_d79cf3f429596f77db95c65074663a54'] = 'Identyfikator zamówienia'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e10758a0bbe2e5a1bd948a8fe1a4a3dc'] = 'Noce'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_0edc9b073397681dc9f2c479686ea0d9'] = 'Noc'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_66911151e40ada6dabad586733fa0929'] = 'Zameldowanie (LOS)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_ec86d6e09689fe97bb7d1a233d5e5e13'] = 'Zameldować się'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_c48da6e10c4223c777d3eadbb2bafe4e'] = 'Razem pokoje'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_fcf35bd8e66b772c865588339b93bfec'] = 'Suma zamówienia'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_bbd3a18e6d45b8331cf8a715f3f0008d'] = 'Status zamówienia'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_edfd56b38f555c58ca8f6902c39dbd04'] = 'Wymeldować się'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_8f85cb22514fc08e5988e09836b8fb4e'] = 'Anuluj stan'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_975bfdb44b5907246ef0617e1c9c88bf'] = 'Liczba przyjazdów planowanych na dziś.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_720a541d3696124de85fcd8be6144c8b'] = 'Liczba odjazdów zaplanowanych na dziś.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_05526b5bbb4c2e6125d44b2c44990d8d'] = 'Liczba nowych rezerwacji utworzonych dzisiaj do tej pory.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_39d6209295eae2edc20adfea3d086a2f'] = 'Liczba pobytów zaplanowanych na dziś.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_7791caa6f05fe31b25060cfa837d426b'] = 'Liczba nowych wiadomości otrzymanych dzisiaj od gości.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_a51b52bed091adf999ab6c8e96a7af8a'] = 'Liczba rezerwacji anulowanych dzisiaj do tej pory.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_0f04b7b3005ef88e9ae8411cdff6aaae'] = 'Liczba dorosłych i dzieci planowanych na dzisiejszy pobyt.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_b898f0a62dcfd02184ed0570136bb61f'] = 'Operacje dzisiaj'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_63a6a88c066880c5ac42394a22803ca6'] = 'Odświeżać'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_90d11386ef0c90f27fb7ff65f1fcff83'] = 'Przyloty'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_5201bc1c95fed6725def30cb27c01b1a'] = 'Odloty'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_c14ecb2ba5611ae4eb424bfb96676c7f'] = 'W domu'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_a35529bfcfdfab2dc01946af64cd2ce4'] = 'Rezerwacje'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_1b08b875cf875b1aeaed558ce21fe4e6'] = 'Rezygnacje'; diff --git a/modules/dashguestcycle/translations/pt.php b/modules/dashguestcycle/translations/pt.php index 211445ab3..9f823097a 100644 --- a/modules/dashguestcycle/translations/pt.php +++ b/modules/dashguestcycle/translations/pt.php @@ -2,13 +2,36 @@ global $_MODULE; $_MODULE = array(); -$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e3771f089b24e39f54de4f6c7cb5ae71'] = 'Ciclo de convidado do painel'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e3771f089b24e39f54de4f6c7cb5ae71'] = 'Ciclo de convidados do painel'; $_MODULE['<{dashguestcycle}prestashop>dashguestcycle_efbce5905c871f6ee2a35e27cd8387ca'] = 'Adiciona um bloco com uma representação gráfica das estatísticas do ciclo do convidado.'; $_MODULE['<{dashguestcycle}prestashop>dashguestcycle_876f23178c29dc2552c0b48bf23cd9bd'] = 'Você tem certeza que quer desinstalar?'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_90d11386ef0c90f27fb7ff65f1fcff83'] = 'Chegadas'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_5201bc1c95fed6725def30cb27c01b1a'] = 'Partidas'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_1998e47006c71d5217e8fb534b0d6cf6'] = 'Novas Reservas'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_a1f1cb8acf3d5563fae235c3a472c2f2'] = 'Fique Overs'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_707e4ef7452b8f415c36af6996052f0e'] = 'Mensagens de Convidados'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_36c162d08af759b84421db4bcb76bde5'] = 'Reservas canceladas'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_15068fa48d844fd3a21a460650f81145'] = 'Convidados (adultos / crianças)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_49ee3087348e8d44e1feda1917443987'] = 'Nome'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_4ac28a9f6152a6b8b86f5d975a99f96b'] = 'Nº do quarto'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_168cd661c523acecfe5261e6a6b5e0d6'] = 'Tipo de sala'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_26e28738b51eebd25cf4d734b33b539f'] = 'Hotel'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_4229e0630f34b4f8085774240b1e39ff'] = 'Convidados'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_52da72eb7575b71bf704417043089f2c'] = 'Saída (LOS)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_d79cf3f429596f77db95c65074663a54'] = 'ID do pedido'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e10758a0bbe2e5a1bd948a8fe1a4a3dc'] = 'noites'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_0edc9b073397681dc9f2c479686ea0d9'] = 'Noite'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_66911151e40ada6dabad586733fa0929'] = 'Entrada (LOS)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_ec86d6e09689fe97bb7d1a233d5e5e13'] = 'Check-in'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_c48da6e10c4223c777d3eadbb2bafe4e'] = 'Quartos totais'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_fcf35bd8e66b772c865588339b93bfec'] = 'total de pedidos'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_bbd3a18e6d45b8331cf8a715f3f0008d'] = 'Status do pedido'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_edfd56b38f555c58ca8f6902c39dbd04'] = 'Confira'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_8f85cb22514fc08e5988e09836b8fb4e'] = 'Cancelar status'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_975bfdb44b5907246ef0617e1c9c88bf'] = 'O número de chegadas programadas para hoje.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_720a541d3696124de85fcd8be6144c8b'] = 'O número de partidas programadas para hoje.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_05526b5bbb4c2e6125d44b2c44990d8d'] = 'O número de novas reservas criadas hoje até o momento.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_39d6209295eae2edc20adfea3d086a2f'] = 'O número de estadias programadas para hoje.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_7791caa6f05fe31b25060cfa837d426b'] = 'O número de novas mensagens recebidas de convidados hoje.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_a51b52bed091adf999ab6c8e96a7af8a'] = 'O número de reservas canceladas hoje até agora.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_0f04b7b3005ef88e9ae8411cdff6aaae'] = 'O número de adultos e crianças programados para ficar hoje.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_b898f0a62dcfd02184ed0570136bb61f'] = 'Operações hoje'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_63a6a88c066880c5ac42394a22803ca6'] = 'Atualizar'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_90d11386ef0c90f27fb7ff65f1fcff83'] = 'Chegadas'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_5201bc1c95fed6725def30cb27c01b1a'] = 'Partidas'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_c14ecb2ba5611ae4eb424bfb96676c7f'] = 'interno'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_a35529bfcfdfab2dc01946af64cd2ce4'] = 'Reservas'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_1b08b875cf875b1aeaed558ce21fe4e6'] = 'Cancelamentos'; diff --git a/modules/dashguestcycle/translations/ru.php b/modules/dashguestcycle/translations/ru.php index 6311834fa..e941b42bf 100644 --- a/modules/dashguestcycle/translations/ru.php +++ b/modules/dashguestcycle/translations/ru.php @@ -2,13 +2,36 @@ global $_MODULE; $_MODULE = array(); -$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e3771f089b24e39f54de4f6c7cb5ae71'] = 'Гостевой цикл панели инструментов'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e3771f089b24e39f54de4f6c7cb5ae71'] = 'Гостевой цикл приборной панели'; $_MODULE['<{dashguestcycle}prestashop>dashguestcycle_efbce5905c871f6ee2a35e27cd8387ca'] = 'Добавляет блок с графическим представлением статистики гостевого цикла.'; $_MODULE['<{dashguestcycle}prestashop>dashguestcycle_876f23178c29dc2552c0b48bf23cd9bd'] = 'Вы уверены, что хотите удалить?'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_90d11386ef0c90f27fb7ff65f1fcff83'] = 'Прибытие'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_5201bc1c95fed6725def30cb27c01b1a'] = 'Отправления'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_1998e47006c71d5217e8fb534b0d6cf6'] = 'Новые заказы'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_a1f1cb8acf3d5563fae235c3a472c2f2'] = 'Остаться на ночь'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_707e4ef7452b8f415c36af6996052f0e'] = 'Гостевые сообщения'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_36c162d08af759b84421db4bcb76bde5'] = 'Отмененные бронирования'; -$_MODULE['<{dashguestcycle}prestashop>dashboard-top_15068fa48d844fd3a21a460650f81145'] = 'Гости (Взрослые / Дети)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_49ee3087348e8d44e1feda1917443987'] = 'Имя'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_4ac28a9f6152a6b8b86f5d975a99f96b'] = 'Комната нет.'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_168cd661c523acecfe5261e6a6b5e0d6'] = 'Тип номера'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_26e28738b51eebd25cf4d734b33b539f'] = 'Отель'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_4229e0630f34b4f8085774240b1e39ff'] = 'Гости'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_52da72eb7575b71bf704417043089f2c'] = 'Выезд (LOS)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_d79cf3f429596f77db95c65074663a54'] = 'номер заказа'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_e10758a0bbe2e5a1bd948a8fe1a4a3dc'] = 'Ночи'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_0edc9b073397681dc9f2c479686ea0d9'] = 'Ночь'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_66911151e40ada6dabad586733fa0929'] = 'Регистрация (LOS)'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_ec86d6e09689fe97bb7d1a233d5e5e13'] = 'Регистрироваться'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_c48da6e10c4223c777d3eadbb2bafe4e'] = 'Всего номеров'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_fcf35bd8e66b772c865588339b93bfec'] = 'Весь заказ'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_bbd3a18e6d45b8331cf8a715f3f0008d'] = 'Статус заказа'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_edfd56b38f555c58ca8f6902c39dbd04'] = 'Проверить'; +$_MODULE['<{dashguestcycle}prestashop>dashguestcycle_8f85cb22514fc08e5988e09836b8fb4e'] = 'Отменить статус'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_975bfdb44b5907246ef0617e1c9c88bf'] = 'Количество заездов, запланированных на сегодня.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_720a541d3696124de85fcd8be6144c8b'] = 'Количество вылетов, запланированных на сегодня.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_05526b5bbb4c2e6125d44b2c44990d8d'] = 'Количество новых бронирований, созданных сегодня.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_39d6209295eae2edc20adfea3d086a2f'] = 'Количество пересадок, запланированных на сегодня.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_7791caa6f05fe31b25060cfa837d426b'] = 'Количество новых сообщений, полученных сегодня от гостей.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_a51b52bed091adf999ab6c8e96a7af8a'] = 'Количество бронирований, отмененных сегодня.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-top_0f04b7b3005ef88e9ae8411cdff6aaae'] = 'Количество взрослых и детей, запланированное на сегодня.'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_b898f0a62dcfd02184ed0570136bb61f'] = 'Операции сегодня'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_63a6a88c066880c5ac42394a22803ca6'] = 'Обновить'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_90d11386ef0c90f27fb7ff65f1fcff83'] = 'Прибытие'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_5201bc1c95fed6725def30cb27c01b1a'] = 'Отправления'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_c14ecb2ba5611ae4eb424bfb96676c7f'] = 'Внутренний'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_a35529bfcfdfab2dc01946af64cd2ce4'] = 'Бронирование'; +$_MODULE['<{dashguestcycle}prestashop>dashboard-zone-two_1b08b875cf875b1aeaed558ce21fe4e6'] = 'Аннулирование'; diff --git a/modules/dashguestcycle/views/css/dashguestcycle.css b/modules/dashguestcycle/views/css/dashguestcycle.css index 5dbf79889..b31121c47 100644 --- a/modules/dashguestcycle/views/css/dashguestcycle.css +++ b/modules/dashguestcycle/views/css/dashguestcycle.css @@ -18,18 +18,18 @@ */ /* scrollbar design - start */ -#dashguestcycle ::-webkit-scrollbar { +#dashguestcycle.dashboard-top ::-webkit-scrollbar { height: 12px; margin-bottom: 5px; } - -#dashguestcycle ::-webkit-scrollbar-track { + +#dashguestcycle.dashboard-top ::-webkit-scrollbar-track { background-color: #DDD; margin: 0 6px; border-radius: 10px; } - -#dashguestcycle ::-webkit-scrollbar-thumb { + +#dashguestcycle.dashboard-top ::-webkit-scrollbar-thumb { background-color: #BBB; border-radius: 10px; margin-bottom: 5px; @@ -105,4 +105,9 @@ font-weight: bold; font-size: 24px; line-height: 30px; -} \ No newline at end of file +} + +#dashguestcycle .tab-content { + max-height: 300px; + overflow-y: auto; +} diff --git a/modules/dashguestcycle/views/templates/hook/dashboard-top.tpl b/modules/dashguestcycle/views/templates/hook/dashboard-top.tpl index 9a855ed1d..480485694 100644 --- a/modules/dashguestcycle/views/templates/hook/dashboard-top.tpl +++ b/modules/dashguestcycle/views/templates/hook/dashboard-top.tpl @@ -19,7 +19,7 @@
-
+
{hook h="displayDashboardBadgeListBefore"}
diff --git a/modules/dashguestcycle/views/templates/hook/dashboard-zone-two.tpl b/modules/dashguestcycle/views/templates/hook/dashboard-zone-two.tpl new file mode 100644 index 000000000..221b28dd4 --- /dev/null +++ b/modules/dashguestcycle/views/templates/hook/dashboard-zone-two.tpl @@ -0,0 +1,101 @@ +{** +* 2010-2022 Webkul. +* +* NOTICE OF LICENSE +* +* All right is reserved, +* Please go through LICENSE.txt file inside our module +* +* DISCLAIMER +* +* Do not edit or add to this file if you wish to upgrade this module to newer +* versions in the future. If you wish to customize this module for your +* needs please refer to CustomizationPolicy.txt file inside our module for more information. +* +* @author Webkul IN +* @copyright 2010-2022 Webkul IN +* @license LICENSE.txt +*} + + +
From 41b6b4caa27e4531a2bc5757e91a1a1aeb21e28f Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 28 Nov 2022 19:35:15 +0530 Subject: [PATCH 06/55] Move search filters to Room Types configurations page --- .../admin/AdminPPreferencesController.php | 23 +++ install/data/theme.sql | 2 + install/data/xml/configuration.xml | 6 + .../wkhotelfilterblock/wkhotelfilterblock.php | 163 ------------------ 4 files changed, 31 insertions(+), 163 deletions(-) diff --git a/controllers/admin/AdminPPreferencesController.php b/controllers/admin/AdminPPreferencesController.php index 11c4203d3..3c02164d8 100644 --- a/controllers/admin/AdminPPreferencesController.php +++ b/controllers/admin/AdminPPreferencesController.php @@ -305,6 +305,29 @@ class AdminPPreferencesControllerCore extends AdminController // 'bottom' => '', // 'submit' => array('title' => $this->l('Save')) // ), + 'fo_search_filters' => array( + 'title' => $this->l('Search Filters'), + 'icon' => 'icon-search', + 'fields' => array( + 'SHOW_AMENITIES_FILTER' => array( + 'title' => $this->l('Show Amenities filter'), + 'hint' => $this->l('Enable to display Amenities filter for search.'), + 'validation' => 'isBool', + 'cast' => 'intval', + 'required' => false, + 'type' => 'bool', + ), + 'SHOW_PRICE_FILTER' => array( + 'title' => $this->l('Show Price filter'), + 'hint' => $this->l('Enable to display Price filter for search.'), + 'validation' => 'isBool', + 'cast' => 'intval', + 'required' => false, + 'type' => 'bool', + ), + ), + 'submit' => array('title' => $this->l('Save')) + ), ); } diff --git a/install/data/theme.sql b/install/data/theme.sql index 499aa07d3..f302b2c22 100644 --- a/install/data/theme.sql +++ b/install/data/theme.sql @@ -3,6 +3,8 @@ SET NAMES 'utf8'; UPDATE `PREFIX_configuration` SET value = '1' WHERE name = 'PS_CONDITIONS'; UPDATE `PREFIX_configuration` SET value = '12' WHERE name = 'PS_PRODUCTS_PER_PAGE'; UPDATE `PREFIX_configuration` SET value = '9' WHERE name = 'PS_HOTEL_IMAGES_PER_PAGE'; +UPDATE `PREFIX_configuration` SET value = '1' WHERE name = 'SHOW_AMENITIES_FILTER'; +UPDATE `PREFIX_configuration` SET value = '1' WHERE name = 'SHOW_PRICE_FILTER'; UPDATE `PREFIX_configuration` SET value = '0' WHERE name = 'PS_PRODUCTS_ORDER_WAY'; UPDATE `PREFIX_configuration` SET value = '4' WHERE name = 'PS_PRODUCTS_ORDER_BY'; UPDATE `PREFIX_configuration` SET value = '1' WHERE name = 'PS_DISPLAY_QTIES'; diff --git a/install/data/xml/configuration.xml b/install/data/xml/configuration.xml index 436515bc6..4a07b5e6c 100644 --- a/install/data/xml/configuration.xml +++ b/install/data/xml/configuration.xml @@ -59,6 +59,12 @@ 9 + + 1 + + + 1 + 0 diff --git a/modules/wkhotelfilterblock/wkhotelfilterblock.php b/modules/wkhotelfilterblock/wkhotelfilterblock.php index 79a6423c8..8aada65ce 100644 --- a/modules/wkhotelfilterblock/wkhotelfilterblock.php +++ b/modules/wkhotelfilterblock/wkhotelfilterblock.php @@ -42,129 +42,6 @@ class wkhotelfilterblock extends Module $this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_); } - public function getContent() - { - $this->html = ''; - if (Tools::isSubmit('btnConfigSubmit')) { - $this->postProcess(); - } else { - $this->html .= '
'; - } - - $this->html .= $this->renderForm(); - - return $this->html; - } - - public function renderForm() - { - $fields_form = array(); - $fields_form['form'] = array( - 'legend' => array( - 'icon' => 'icon-cog', - 'title' => $this->l('Search Results Filter Configuration'), - ), - 'input' => array( - array( - 'type' => 'switch', - 'label' => $this->l('Show Guest Rating Filter'), - 'name' => 'SHOW_RATTING_FILTER', - 'is_bool' => true, - 'values' => array( - array( - 'id' => 'active_on', - 'value' => 1, - ), - array( - 'id' => 'active_off', - 'value' => 0, - ), - ), - 'hint' => $this->l('If yes, it will display Guest Rating Filter.'), - ), - array( - 'type' => 'switch', - 'label' => $this->l('Show Amenities Filter'), - 'name' => 'SHOW_AMENITIES_FILTER', - 'is_bool' => true, - 'values' => array( - array( - 'id' => 'active_on', - 'value' => 1, - ), - array( - 'id' => 'active_off', - 'value' => 0, - ), - ), - 'hint' => $this->l('If yes, it will display Amenities Filter.'), - ), - array( - 'type' => 'switch', - 'label' => $this->l('Show Price Filter'), - 'name' => 'SHOW_PRICE_FILTER', - 'is_bool' => true, - 'values' => array( - array( - 'id' => 'active_on', - 'value' => 1, - ), - array( - 'id' => 'active_off', - 'value' => 0, - ), - ), - 'hint' => $this->l('If yes, it will display price Filter.'), - ), - ), - 'submit' => array( - 'title' => $this->l('Save'), - 'name' => 'submit_conf_filter', - ), - ); - - $helper = new HelperForm(); - $helper->show_toolbar = false; - $helper->table = $this->table; - $lang = new Language((int) Configuration::get('PS_LANG_DEFAULT')); - $helper->default_form_language = $lang->id; - $this->fields_form = array(); - $helper->identifier = $this->identifier; - $helper->submit_action = 'btnConfigSubmit'; - $helper->currentIndex = $this->context->link->getAdminLink('AdminModules', false). - '&configure='.$this->name.'&module_name='.$this->name; - $helper->token = Tools::getAdminTokenLite('AdminModules'); - - $helper->tpl_vars = array( - 'fields_value' => $this->getConfigFieldsValues(), - 'languages' => $this->context->controller->getLanguages(), - 'id_language' => $this->context->language->id, - ); - - return $helper->generateForm(array($fields_form)); - } - - public function postProcess() - { - if (Tools::isSubmit('btnConfigSubmit')) { - Configuration::updateValue( - 'SHOW_RATTING_FILTER', - Tools::getValue('SHOW_RATTING_FILTER') - ); - Configuration::updateValue( - 'SHOW_AMENITIES_FILTER', - Tools::getValue('SHOW_AMENITIES_FILTER') - ); - Configuration::updateValue('SHOW_PRICE_FILTER', Tools::getValue('SHOW_PRICE_FILTER')); - - // redirect after saving the configuration - Tools::redirectAdmin( - $this->context->link->getAdminLink('AdminModules').'&configure='.$this->name.'&tab_module='.$this->tab. - '&module_name='.$this->name.'&conf=4' - ); - } - } - public function install() { if (!parent::install() @@ -174,11 +51,6 @@ class wkhotelfilterblock extends Module return false; } - //set default config variable` - Configuration::updateValue('SHOW_RATTING_FILTER', 1); - Configuration::updateValue('SHOW_AMENITIES_FILTER', 1); - Configuration::updateValue('SHOW_PRICE_FILTER', 1); - return true; } @@ -187,15 +59,6 @@ class wkhotelfilterblock extends Module $this->context->controller->addJQueryUI('ui.slider'); } - public function uninstall($keep = true) - { - if (!parent::uninstall() || !$this->deleteConfigKeys()) { - return false; - } - - return true; - } - public function hookDisplayLeftColumn() { if ($this->context->controller->php_self == 'category') { @@ -266,30 +129,4 @@ class wkhotelfilterblock extends Module return $this->display(__FILE__, 'htlfilterblock.tpl'); } } - - public function getConfigFieldsValues() - { - $config_vars = array( - 'SHOW_RATTING_FILTER' => Tools::getValue('SHOW_RATTING_FILTER', Configuration::get('SHOW_RATTING_FILTER')), - 'SHOW_AMENITIES_FILTER' => Tools::getValue('SHOW_AMENITIES_FILTER', Configuration::get('SHOW_AMENITIES_FILTER')), - 'SHOW_PRICE_FILTER' => Tools::getValue('SHOW_PRICE_FILTER', Configuration::get('SHOW_PRICE_FILTER')), - ); - - return $config_vars; - } - - public function deleteConfigKeys() - { - $var = array('SHOW_RATTING_FILTER', - 'SHOW_AMENITIES_FILTER', - 'SHOW_PRICE_FILTER', ); - - foreach ($var as $key) { - if (!Configuration::deleteByName($key)) { - return false; - } - } - - return true; - } } From 53f1758f5f4c71650f58f8df39e6e3dc2107cfe7 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Wed, 30 Nov 2022 16:42:53 +0530 Subject: [PATCH 07/55] Add missing file --- .../products/additionalfacilities.tpl | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 admin/themes/default/template/controllers/products/additionalfacilities.tpl diff --git a/admin/themes/default/template/controllers/products/additionalfacilities.tpl b/admin/themes/default/template/controllers/products/additionalfacilities.tpl new file mode 100644 index 000000000..184db5f77 --- /dev/null +++ b/admin/themes/default/template/controllers/products/additionalfacilities.tpl @@ -0,0 +1,115 @@ +{** + * 2010-2022 Webkul. + * + * NOTICE OF LICENSE + * + * All right is reserved, + * Please go through LICENSE.txt file inside our module + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade this module to newer + * versions in the future. If you wish to customize this module for your + * needs please refer to CustomizationPolicy.txt file inside our module for more information. + * + * @author Webkul IN + * @copyright 2010-2022 Webkul IN + * @license LICENSE.txt + *} + + {if isset($product->id) && $product->id} + +
+
+ {l s='Room Type Additional Facilities'} +
+
+ {l s='To create new Additiona facilities '} {l s='click here.'} +
+ {if isset($allDemands) && $allDemands} +
+ {foreach $allDemands as $key => $demand} +
+ + + {$demand['name']|escape:'html':'UTF-8'} + +
+ {if isset($demand['adv_option']) && count($demand['adv_option'])} + + {else} +
+ +
+
+ {$defaultcurrencySign|escape:'html':'UTF-8'} + +
+
+
+ {/if} + {if isset($demand['adv_option']) && $demand['adv_option']} +
+ +
+
+ + + + + + + + {foreach from=$demand['adv_option'] key=key item=info} + + + + + {/foreach} +
+ {l s='Option Name'} + + {l s='Price'} +
+ {$info['name']|escape:'html':'UTF-8'} + +
+ {$defaultcurrencySign|escape:'html':'UTF-8'} + +
+
+
+
+
+ {/if} +
+
+ {/foreach} +
+ + {else} +
+ {l s='No additional facilities created yet. To create please visit'} {l s='Additional facilities'} {l s='page'}. +
+ {/if} +
+{/if} From 579fadee674da9ec3d342c105aa2b727953f8f0e Mon Sep 17 00:00:00 2001 From: "lakshya.chauhan193" Date: Fri, 2 Dec 2022 13:15:05 +0530 Subject: [PATCH 08/55] Allow admin user to configure the SameSite cookie attribute --- classes/Cookie.php | 54 +++++++++++++++++-- config/config.inc.php | 4 +- .../admin/AdminAdminPreferencesController.php | 16 ++++++ install/data/xml/configuration.xml | 3 ++ 4 files changed, 70 insertions(+), 7 deletions(-) diff --git a/classes/Cookie.php b/classes/Cookie.php index 920415da6..f8d66aa3a 100644 --- a/classes/Cookie.php +++ b/classes/Cookie.php @@ -26,6 +26,25 @@ class CookieCore { + const SAMESITE_NONE = 'None'; + const SAMESITE_LAX = 'Lax'; + const SAMESITE_STRICT = 'Strict'; + + const SAMESITE_AVAILABLE_VALUES = [ + [ + "type" => self::SAMESITE_NONE, + "name" => self::SAMESITE_NONE + ], + [ + "type" => self::SAMESITE_LAX, + "name" => self::SAMESITE_LAX + ], + [ + "type" => self::SAMESITE_STRICT, + "name" => self::SAMESITE_STRICT + ], + ]; + /** @var array Contain cookie content in a key => value format */ protected $_content; @@ -73,6 +92,7 @@ class CookieCore $this->_path = str_replace('%2F', '/', $this->_path); $this->_path = str_replace('%7E', '~', $this->_path); $this->_domain = $this->getDomain($shared_urls); + $this->_sameSite = Configuration::get('PS_COOKIE_SAMESITE'); $this->_name = 'PrestaShop-'.md5(($this->_standalone ? '' : _PS_VERSION_).$name.$this->_domain); $this->_allow_writing = true; $this->_salt = $this->_standalone ? str_pad('', 8, md5('ps'.__FILE__)) : _COOKIE_IV_; @@ -82,7 +102,7 @@ class CookieCore } else { $this->_cipherTool = new PhpEncryption(_NEW_COOKIE_KEY_); } - + $this->_secure = (bool)$secure; $this->update(); @@ -342,11 +362,35 @@ class CookieCore $content = 0; $time = 1; } - if (PHP_VERSION_ID <= 50200) { /* PHP version > 5.2.0 */ - return setcookie($this->_name, $content, $time, $this->_path, $this->_domain, $this->_secure); - } else { - return setcookie($this->_name, $content, $time, $this->_path, $this->_domain, $this->_secure, true); + + /* + * The alternative signature supporting an options array is only available since + * PHP 7.3.0, before there is no support for SameSite attribute. + */ + if (PHP_VERSION_ID < 70300) { + return setcookie( + $this->_name, + $content, + $time, + $this->_path, + $this->_domain . '; SameSite=' . $this->_sameSite, + $this->_secure, + true + ); } + + return setcookie( + $this->_name, + $content, + [ + 'expires' => $time, + 'path' => $this->_path, + 'domain' => $this->_domain, + 'secure' => $this->_secure, + 'httponly' => true, + 'samesite' => $this->_sameSite, + ] + ); } public function __destruct() diff --git a/config/config.inc.php b/config/config.inc.php index c9b3f60ca..6ce828748 100644 --- a/config/config.inc.php +++ b/config/config.inc.php @@ -159,10 +159,10 @@ if ($cookie_lifetime > 0) { $cookie_lifetime = time() + (max($cookie_lifetime, 1) * 3600); } +$force_ssl = Configuration::get('PS_SSL_ENABLED') && Configuration::get('PS_SSL_ENABLED_EVERYWHERE'); if (defined('_PS_ADMIN_DIR_')) { - $cookie = new Cookie('psAdmin', '', $cookie_lifetime); + $cookie = new Cookie('psAdmin', '', $cookie_lifetime, null, false, $force_ssl); } else { - $force_ssl = Configuration::get('PS_SSL_ENABLED') && Configuration::get('PS_SSL_ENABLED_EVERYWHERE'); if ($context->shop->getGroup()->share_order) { $cookie = new Cookie('ps-sg'.$context->shop->getGroup()->id, '', $cookie_lifetime, $context->shop->getUrlsSharedCart(), false, $force_ssl); } else { diff --git a/controllers/admin/AdminAdminPreferencesController.php b/controllers/admin/AdminAdminPreferencesController.php index 9e3124ecb..8179c1f26 100644 --- a/controllers/admin/AdminAdminPreferencesController.php +++ b/controllers/admin/AdminAdminPreferencesController.php @@ -85,6 +85,16 @@ class AdminAdminPreferencesControllerCore extends AdminController 'default' => '480', 'visibility' => Shop::CONTEXT_ALL ), + 'PS_COOKIE_SAMESITE' => array( + 'title' => $this->l('Same site cookie'), + 'hint' => $this->l('Allows you to declare if your cookie should be restricted to a first-party or same-site context.'), + 'validation' => 'isGenericName', + 'type' => 'select', + 'cast' => 'strval', + 'identifier' => 'type', + 'list' => CookieCore::SAMESITE_AVAILABLE_VALUES, + 'visibility' => Shop::CONTEXT_ALL + ), ), 'submit' => array('title' => $this->l('Save')) ), @@ -159,6 +169,12 @@ class AdminAdminPreferencesControllerCore extends AdminController $upload_max_size = (int)str_replace('M', '', ini_get('upload_max_filesize')); $post_max_size = (int)str_replace('M', '', ini_get('post_max_size')); $max_size = $upload_max_size < $post_max_size ? $upload_max_size : $post_max_size; + $forceSsl = Configuration::get('PS_SSL_ENABLED') && Configuration::get('PS_SSL_ENABLED_EVERYWHERE'); + + if (!$forceSsl && Tools::getValue('PS_COOKIE_SAMESITE') === Cookie::SAMESITE_NONE) { + $this->errors[] = Tools::displayError('The SameSite=None is only available in secure mode.'); + return; + } if (Tools::getValue('PS_LIMIT_UPLOAD_FILE_VALUE') > $max_size || Tools::getValue('PS_LIMIT_UPLOAD_IMAGE_VALUE') > $max_size) { $this->errors[] = Tools::displayError('The limit chosen is larger than the server\'s maximum upload limit. Please increase the limits of your server.'); diff --git a/install/data/xml/configuration.xml b/install/data/xml/configuration.xml index 436515bc6..98c79dd41 100644 --- a/install/data/xml/configuration.xml +++ b/install/data/xml/configuration.xml @@ -437,6 +437,9 @@ 480 + + Lax + 0 From 3bd98addb6321c7b96ed4a98a13ebff5fe3fa9f1 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 2 Dec 2022 15:12:32 +0530 Subject: [PATCH 09/55] Fix Book Now page isssue at back office --- classes/PaymentModule.php | 4 ++-- controllers/admin/AdminOrdersController.php | 6 ------ .../admin/AdminHotelRoomsBookingController.php | 10 +++++----- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php index 39b850a28..d40602bde 100644 --- a/classes/PaymentModule.php +++ b/classes/PaymentModule.php @@ -850,8 +850,8 @@ abstract class PaymentModuleCore extends Module HotelRoomTypeFeaturePricing::deleteByIdCart($id_cart); if (isset($_COOKIE['wk_id_cart'])) { - setcookie('wk_id_cart', ' ', time() - 86400, '/'); - setcookie('wk_id_guest', ' ', time() - 86400, '/'); + setcookie('wk_id_cart', ' ', time() - 86400, $this->context->shop->physical_uri); + setcookie('wk_id_guest', ' ', time() - 86400, $this->context->shop->physical_uri); unset($_COOKIE['wk_id_cart']); unset($_COOKIE['wk_id_guest']); diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index a7e150ecc..1fc055c12 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -864,13 +864,7 @@ class AdminOrdersControllerCore extends AdminController false, $cart->secure_key ); - /* - setcookie('wk_id_cart', ' ', time() - 86400, '/'); - setcookie('wk_id_guest', ' ', time() - 86400, '/'); - unset($_COOKIE['wk_id_cart']); - unset($_COOKIE['wk_id_guest']); - */ if ($payment_module->currentOrder) { Tools::redirectAdmin(self::$currentIndex.'&id_order='.$payment_module->currentOrder.'&vieworder'.'&token='.$this->token.'&conf=3'); } diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php index 2c8e81273..61800e722 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php @@ -42,10 +42,10 @@ class AdminHotelRoomsBookingController extends ModuleAdminController Guest::setNewGuest($this->context->cookie); } - setcookie('wk_id_guest', $this->context->cookie->id_guest, time() + 86400, "/"); + setcookie('wk_id_guest', $this->context->cookie->id_guest, time() + 86400, $this->context->shop->physical_uri); } else { $this->context->cookie->id_guest = $_COOKIE['wk_id_guest']; - setcookie('wk_id_guest', $this->context->cookie->id_guest, time() + 86400, "/"); + setcookie('wk_id_guest', $this->context->cookie->id_guest, time() + 86400, $this->context->shop->physical_uri); } $guest = new Guest($this->context->cookie->id_guest); @@ -67,13 +67,13 @@ class AdminHotelRoomsBookingController extends ModuleAdminController $this->context->cart = $cart; $this->context->cookie->id_cart = $cart->id; - setcookie('wk_id_cart', $cart->id, time() + 86400, "/"); + setcookie('wk_id_cart', $cart->id, time() + 86400, $this->context->shop->physical_uri); } else { $cart = new Cart((int)$_COOKIE['wk_id_cart']); $this->context->cart = $cart; $this->context->cookie->id_cart = $cart->id; - setcookie('wk_id_cart', $cart->id, time() + 86400, "/"); + setcookie('wk_id_cart', $cart->id, time() + 86400, $this->context->shop->physical_uri); } $customer = new Customer(); @@ -409,7 +409,7 @@ class AdminHotelRoomsBookingController extends ModuleAdminController 'rms_in_cart' => $rms_in_cart, 'total_amount' => Tools::displayPrice($total_amount), 'booking_stats' => $booking_stats, - 'id_cart_book_data' => $obj_cart_book_data->id); + 'id_cart_book_data' => $obj_cart_book_data->id ); if ($obj_cart_book_data->id) { From 74929749421a849fbaea7ac0b247799b42691edb Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 2 Dec 2022 16:46:43 +0530 Subject: [PATCH 10/55] Remove extra variable assignment --- controllers/admin/AdminProductsController.php | 1 - 1 file changed, 1 deletion(-) diff --git a/controllers/admin/AdminProductsController.php b/controllers/admin/AdminProductsController.php index 487d132ec..cbce182d6 100644 --- a/controllers/admin/AdminProductsController.php +++ b/controllers/admin/AdminProductsController.php @@ -3747,7 +3747,6 @@ class AdminProductsControllerCore extends AdminController $data->assign(array( 'product' => $obj, - 'idProduct' => $obj->id, 'roomDemandPrices' => $roomDemandPrices, 'allDemands' => $allDemands, 'defaultcurrencySign' => $objCurrency->sign, From 4e86d85132d83d17edd554a012ad3f46fa952f1b Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Fri, 2 Dec 2022 17:11:59 +0530 Subject: [PATCH 11/55] Fix search results page issue and text changes --- controllers/admin/AdminPPreferencesController.php | 6 +++--- modules/wkhotelfilterblock/wkhotelfilterblock.php | 9 +++++++++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/controllers/admin/AdminPPreferencesController.php b/controllers/admin/AdminPPreferencesController.php index 3c02164d8..8d76770bb 100644 --- a/controllers/admin/AdminPPreferencesController.php +++ b/controllers/admin/AdminPPreferencesController.php @@ -306,12 +306,12 @@ class AdminPPreferencesControllerCore extends AdminController // 'submit' => array('title' => $this->l('Save')) // ), 'fo_search_filters' => array( - 'title' => $this->l('Search Filters'), + 'title' => $this->l('Search Results Page Filters'), 'icon' => 'icon-search', 'fields' => array( 'SHOW_AMENITIES_FILTER' => array( 'title' => $this->l('Show Amenities filter'), - 'hint' => $this->l('Enable to display Amenities filter for search.'), + 'hint' => $this->l('Enable to display Amenities filter.'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, @@ -319,7 +319,7 @@ class AdminPPreferencesControllerCore extends AdminController ), 'SHOW_PRICE_FILTER' => array( 'title' => $this->l('Show Price filter'), - 'hint' => $this->l('Enable to display Price filter for search.'), + 'hint' => $this->l('Enable to display Price filter.'), 'validation' => 'isBool', 'cast' => 'intval', 'required' => false, diff --git a/modules/wkhotelfilterblock/wkhotelfilterblock.php b/modules/wkhotelfilterblock/wkhotelfilterblock.php index 8aada65ce..d385ed80c 100644 --- a/modules/wkhotelfilterblock/wkhotelfilterblock.php +++ b/modules/wkhotelfilterblock/wkhotelfilterblock.php @@ -129,4 +129,13 @@ class wkhotelfilterblock extends Module return $this->display(__FILE__, 'htlfilterblock.tpl'); } } + + public function getConfigFieldsValues() + { + return array( + 'SHOW_RATTING_FILTER' => Configuration::get('SHOW_RATTING_FILTER'), + 'SHOW_AMENITIES_FILTER' => Configuration::get('SHOW_AMENITIES_FILTER'), + 'SHOW_PRICE_FILTER' => Configuration::get('SHOW_PRICE_FILTER'), + ); + } } From 4da84bfbd42a46aa70df0eb7692aa3e742930436 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Tue, 6 Dec 2022 12:20:46 +0530 Subject: [PATCH 12/55] Remove usage of $_COOKIE when creating a booking at back office --- classes/PaymentModule.php | 8 -------- controllers/admin/AdminOrdersController.php | 7 +++++++ .../classes/HotelBookingDetail.php | 5 +++-- .../admin/AdminHotelRoomsBookingController.php | 18 +++++++----------- 4 files changed, 17 insertions(+), 21 deletions(-) diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php index d40602bde..56d60a748 100644 --- a/classes/PaymentModule.php +++ b/classes/PaymentModule.php @@ -849,14 +849,6 @@ abstract class PaymentModuleCore extends Module // delete cart feature prices after booking creation success HotelRoomTypeFeaturePricing::deleteByIdCart($id_cart); - if (isset($_COOKIE['wk_id_cart'])) { - setcookie('wk_id_cart', ' ', time() - 86400, $this->context->shop->physical_uri); - setcookie('wk_id_guest', ' ', time() - 86400, $this->context->shop->physical_uri); - - unset($_COOKIE['wk_id_cart']); - unset($_COOKIE['wk_id_guest']); - } - if (self::DEBUG_MODE) { PrestaShopLogger::addLog('PaymentModule::validateOrder - Hook validateOrder is about to be called', 1, null, 'Cart', (int)$id_cart, true); } diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index 1fc055c12..bf5d787c0 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -865,6 +865,13 @@ class AdminOrdersControllerCore extends AdminController $cart->secure_key ); + if (isset($this->context->cookie->wk_id_cart)) { + unset($this->context->cookie->wk_id_cart); + } + if (isset($this->context->cookie->wk_id_guest)) { + unset($this->context->cookie->wk_id_guest); + } + if ($payment_module->currentOrder) { Tools::redirectAdmin(self::$currentIndex.'&id_order='.$payment_module->currentOrder.'&vieworder'.'&token='.$this->token.'&conf=3'); } diff --git a/modules/hotelreservationsystem/classes/HotelBookingDetail.php b/modules/hotelreservationsystem/classes/HotelBookingDetail.php index 3f020f1ff..6e8f3c505 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDetail.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDetail.php @@ -979,8 +979,9 @@ class HotelBookingDetail extends ObjectModel */ public function getAvailableRoomsForReallocation($date_from, $date_to, $room_type, $hotel_id) { - if (isset($_COOKIE['wk_id_cart'])) { - $current_admin_cart_id = $_COOKIE['wk_id_cart']; + $context = Context::getContext(); + if (isset($context->cookie->wk_id_cart)) { + $current_admin_cart_id = $context->cookie->wk_id_cart; } $exclude_ids = 'SELECT `id_room` FROM `'._DB_PREFIX_.'htl_booking_detail` WHERE `date_from` < \''.pSQL($date_to).'\' AND `date_to` > \''.pSQL($date_from).'\' diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php index 61800e722..9a3a79eca 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelRoomsBookingController.php @@ -30,26 +30,22 @@ class AdminHotelRoomsBookingController extends ModuleAdminController parent::__construct(); - //unset($_COOKIE['wk_id_guest']); - //unset($_COOKIE['wk_id_cart']); $this->setPhpCookieData(); } public function setPhpCookieData() { - if (!isset($_COOKIE['wk_id_guest']) || !$_COOKIE['wk_id_guest']) { + if (!isset($this->context->cookie->wk_id_guest) || !$this->context->cookie->wk_id_guest) { if (!isset($this->context->cookie->id_guest)) { Guest::setNewGuest($this->context->cookie); } - setcookie('wk_id_guest', $this->context->cookie->id_guest, time() + 86400, $this->context->shop->physical_uri); + $this->context->cookie->wk_id_guest = $this->context->cookie->id_guest; } else { - $this->context->cookie->id_guest = $_COOKIE['wk_id_guest']; - setcookie('wk_id_guest', $this->context->cookie->id_guest, time() + 86400, $this->context->shop->physical_uri); + $this->context->cookie->id_guest = $this->context->cookie->wk_id_guest; } - $guest = new Guest($this->context->cookie->id_guest); - if (!isset($_COOKIE['wk_id_cart']) && !isset($this->context->cart->id)) { + if (!isset($this->context->cookie->wk_id_cart) && !isset($this->context->cart->id)) { $cart = new Cart(); $cart->recyclable = 0; @@ -67,13 +63,13 @@ class AdminHotelRoomsBookingController extends ModuleAdminController $this->context->cart = $cart; $this->context->cookie->id_cart = $cart->id; - setcookie('wk_id_cart', $cart->id, time() + 86400, $this->context->shop->physical_uri); + $this->context->cookie->wk_id_cart = $cart->id; } else { - $cart = new Cart((int)$_COOKIE['wk_id_cart']); + $cart = new Cart((int) $this->context->cookie->wk_id_cart); $this->context->cart = $cart; $this->context->cookie->id_cart = $cart->id; - setcookie('wk_id_cart', $cart->id, time() + 86400, $this->context->shop->physical_uri); + $this->context->cookie->wk_id_cart = $cart->id; } $customer = new Customer(); From 50491e7f128f6f44cfcdd1029f08fbb407a7fa61 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Tue, 31 May 2022 18:18:49 +0530 Subject: [PATCH 13/55] Fix applied voucher amount exceeds restricted room type price --- classes/CartRule.php | 28 ++++++++++++++++++++++++++-- classes/PaymentModule.php | 24 +++++++++++++++++++----- 2 files changed, 45 insertions(+), 7 deletions(-) diff --git a/classes/CartRule.php b/classes/CartRule.php index b4059af27..22726708e 100644 --- a/classes/CartRule.php +++ b/classes/CartRule.php @@ -1016,7 +1016,7 @@ class CartRuleCore extends ObjectModel $reduction_value += $selected_products_reduction * $this->reduction_percent / 100; } - // Discount (¤) + // Discount (by amount) if ((float)$this->reduction_amount > 0) { $prorata = 1; if (!is_null($package) && count($all_products)) { @@ -1026,7 +1026,31 @@ class CartRuleCore extends ObjectModel } } + $restricted_product = null; + // If the cart rule is restricted to one room type it can't exceed this room type price + if ($this->reduction_product > 0) { + foreach ($package_products as $product) { + if ($product['id_product'] == $this->reduction_product) { + $restricted_product = $product; + } + } + } + $reduction_amount = $this->reduction_amount; + if ($this->reduction_product) { + if ($restricted_product) { + $prorata = 1; // do not split this cart rule + if ($this->reduction_tax) { + $max_reduction_amount = (int)$restricted_product['cart_quantity'] * (float)$restricted_product['price_wt']; + } else { + $max_reduction_amount = (int)$restricted_product['cart_quantity'] * (float)$restricted_product['price']; + } + $reduction_amount = min($reduction_amount, $max_reduction_amount); + } else { + $reduction_amount = 0; + } + } + // If we need to convert the voucher value to the cart currency if (isset($context->currency) && $this->reduction_currency != $context->currency->id) { $voucherCurrency = new Currency($this->reduction_currency); @@ -1073,7 +1097,7 @@ class CartRuleCore extends ObjectModel } } } - // Discount (¤) on the whole order + // Discount (by amount) on the whole order elseif ($this->reduction_product == 0) { $cart_amount_te = null; $cart_amount_ti = null; diff --git a/classes/PaymentModule.php b/classes/PaymentModule.php index c73fbc854..24c15fcb8 100644 --- a/classes/PaymentModule.php +++ b/classes/PaymentModule.php @@ -547,6 +547,10 @@ abstract class PaymentModuleCore extends Module $total_reduction_value_ti = 0; $total_reduction_value_tex = 0; foreach ($cart_rules as $cart_rule) { + if ($cart_rule['obj']->reduction_product > 0 && !$order->orderContainProduct($cart_rule['obj']->reduction_product)) { + continue; + } + $package = array('id_carrier' => $order->id_carrier, 'id_address' => $order->id_address_delivery, 'products' => $order->product_list); $values = array( 'tax_incl' => $cart_rule['obj']->getContextualValue(true, $this->context, CartRule::FILTER_ACTION_ALL_NOCAP, $package), @@ -565,7 +569,20 @@ abstract class PaymentModuleCore extends Module // This is an "amount" reduction, not a reduction in % or a gift // THEN // The voucher is cloned with a new value corresponding to the remainder - if (count($order_list) == 1 && $values['tax_incl'] > ($order->total_products_wt - $total_reduction_value_ti) && $cart_rule['obj']->partial_use == 1 && $cart_rule['obj']->reduction_amount > 0) { + $reduction_amount_converted = $cart_rule['obj']->reduction_amount; + if ((int) $cart_rule['obj']->reduction_currency !== (int) $cart->id_currency) { + $reduction_amount_converted = Tools::convertPriceFull( + $cart_rule['obj']->reduction_amount, + new Currency($cart_rule['obj']->reduction_currency), + new Currency($cart->id_currency) + ); + } + if ($cart_rule['obj']->reduction_tax) { + $remaining_amount = $reduction_amount_converted - $values['tax_incl']; + } else { + $remaining_amount = $reduction_amount_converted - $values['tax_excl']; + } + if (count($order_list) == 1 && $remaining_amount > 0 && $cart_rule['obj']->partial_use == 1 && $reduction_amount_converted > 0) { // Create a new voucher from the original $voucher = new CartRule((int)$cart_rule['obj']->id); // We need to instantiate the CartRule without lang parameter to allow saving it unset($voucher->id); @@ -577,16 +594,13 @@ abstract class PaymentModuleCore extends Module } // Set the new voucher value + $voucher->reduction_amount = $remaining_amount; if ($voucher->reduction_tax) { - $voucher->reduction_amount = ($total_reduction_value_ti + $values['tax_incl']) - $order->total_products_wt; - // Add total shipping amout only if reduction amount > total shipping if ($voucher->free_shipping == 1 && $voucher->reduction_amount >= $order->total_shipping_tax_incl) { $voucher->reduction_amount -= $order->total_shipping_tax_incl; } } else { - $voucher->reduction_amount = ($total_reduction_value_tex + $values['tax_excl']) - $order->total_products; - // Add total shipping amout only if reduction amount > total shipping if ($voucher->free_shipping == 1 && $voucher->reduction_amount >= $order->total_shipping_tax_excl) { $voucher->reduction_amount -= $order->total_shipping_tax_excl; From 0e5b3b8dba0f148f13c449b076d696c3b511272b Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Tue, 13 Dec 2022 12:02:32 +0530 Subject: [PATCH 14/55] Change tab labels --- modules/dashguestcycle/dashguestcycle.php | 10 +++++----- .../views/templates/hook/dashboard-zone-two.tpl | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/dashguestcycle/dashguestcycle.php b/modules/dashguestcycle/dashguestcycle.php index 92724393f..7539d96b4 100644 --- a/modules/dashguestcycle/dashguestcycle.php +++ b/modules/dashguestcycle/dashguestcycle.php @@ -103,19 +103,19 @@ class DashGuestCycle extends Module // set tables data $tableCurrentArrivals = $this->getTableArrivalsByDate($dateToday, $params['id_hotel']); - $dataValue['dgc_count_upcoming_arrivals'] = sprintf('%02d', count($tableCurrentArrivals['body'])); + $dataValue['dgc_count_upcoming_arrivals'] = count($tableCurrentArrivals['body']); $tableCurrentDepartures = $this->getTableDeparturesByDate($dateToday, $params['id_hotel']); - $dataValue['dgc_count_upcoming_departures'] = sprintf('%02d', count($tableCurrentDepartures['body'])); + $dataValue['dgc_count_upcoming_departures'] = count($tableCurrentDepartures['body']); $tableCurrentInHouse = $this->getTableInHouseByDate($dateToday, $params['id_hotel']); - $dataValue['dgc_count_current_in_house'] = sprintf('%02d', count($tableCurrentInHouse['body'])); + $dataValue['dgc_count_current_in_house'] = count($tableCurrentInHouse['body']); $tableNewBookings = $this->getTableNewBookingsByDate($dateToday, $params['id_hotel']); - $dataValue['dgc_count_new_bookings'] = sprintf('%02d', count($tableNewBookings['body'])); + $dataValue['dgc_count_new_bookings'] = count($tableNewBookings['body']); $tableCancellations = $this->getTableCancellationsByDate($dateToday, $params['id_hotel']); - $dataValue['dgc_count_cancellations'] = sprintf('%02d', count($tableCancellations['body'])); + $dataValue['dgc_count_cancellations'] = count($tableCancellations['body']); $dataTable = array( 'dgc_table_current_arrivals' => $tableCurrentArrivals, diff --git a/modules/dashguestcycle/views/templates/hook/dashboard-zone-two.tpl b/modules/dashguestcycle/views/templates/hook/dashboard-zone-two.tpl index 221b28dd4..18185c442 100644 --- a/modules/dashguestcycle/views/templates/hook/dashboard-zone-two.tpl +++ b/modules/dashguestcycle/views/templates/hook/dashboard-zone-two.tpl @@ -34,31 +34,31 @@
  • {l s='Arrivals' mod='dashguestcycle'} - -- + 0
  • {l s='Departures' mod='dashguestcycle'} - -- + 0
  • {l s='In-house' mod='dashguestcycle'} - -- + 0
  • {l s='Bookings' mod='dashguestcycle'} - -- + 0
  • {l s='Cancellations' mod='dashguestcycle'} - -- + 0
  • From d998279ef4e1f2fccc8c046f3f1a203f3d3fd116 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Tue, 13 Dec 2022 16:48:20 +0530 Subject: [PATCH 15/55] Allow admin to create new links on Hotel Reservation System > Settings page --- .../classes/HotelHelper.php | 75 ++++ .../classes/HotelReservationSystemDb.php | 25 +- .../classes/HotelSettingsLink.php | 148 ++++++++ ...minHotelConfigurationSettingController.php | 326 +++++++++++++++++- modules/hotelreservationsystem/define.php | 2 + .../helpers/form/form.tpl | 172 +++++++++ .../helpers/form/index.php | 29 ++ .../helpers/list/index.php | 29 ++ .../helpers/list/link-icon.tpl | 20 ++ .../helpers/list/link-page.tpl | 20 ++ .../helpers/view/view.tpl | 68 ++-- 11 files changed, 863 insertions(+), 51 deletions(-) create mode 100644 modules/hotelreservationsystem/classes/HotelSettingsLink.php create mode 100644 modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/form/form.tpl create mode 100644 modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/form/index.php create mode 100644 modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/list/index.php create mode 100644 modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/list/link-icon.tpl create mode 100644 modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/list/link-page.tpl diff --git a/modules/hotelreservationsystem/classes/HotelHelper.php b/modules/hotelreservationsystem/classes/HotelHelper.php index 44b43a517..55a118145 100644 --- a/modules/hotelreservationsystem/classes/HotelHelper.php +++ b/modules/hotelreservationsystem/classes/HotelHelper.php @@ -527,6 +527,80 @@ class HotelHelper } } + public function saveDefaultHotelSettingsLinks() + { + $settingsLinks = array( + array( + 'name' => 'General Settings', + 'hint' => 'Configure Your Hotel general Settings using this option.', + 'icon' => 'icon-cogs', + 'link' => 'index.php?controller=AdminHotelGeneralSettings', + 'unremovable' => 1, + ), + array( + 'name' => 'Order Restrict', + 'hint' => 'Configure if you want to restrict orders till a specific date for your hotels.', + 'icon' => 'icon-list-alt', + 'link' => 'index.php?controller=AdminOrderRestrictSettings', + 'unremovable' => 1, + ), + array( + 'name' => 'Advanced Price Rules', + 'hint' => 'Here set advanced price rules for specific dates.', + 'icon' => 'icon-cog', + 'link' => 'index.php?controller=AdminHotelFeaturePricesSettings', + 'unremovable' => 1, + ), + array( + 'name' => 'Additional Facilities', + 'hint' => 'Here create additional facilities and their prices for room types.', + 'icon' => 'icon-cog', + 'link' => 'index.php?controller=AdminRoomTypeGlobalDemand', + 'unremovable' => 1, + ), + array( + 'name' => 'Hotel Interior Block', + 'hint' => 'Configure Hotel Interior block. You can display hotel interior images using this block. This block will be displayed on home page.', + 'icon' => 'icon-file-text', + 'link' => 'index.php?controller=AdminAboutHotelBlockSetting', + 'unremovable' => 0, + ), + array( + 'name' => 'Hotel Amenities Block', + 'hint' => 'Configure Hotels Amenities settings. You can display hotel amenities images using this block. This block will be displayed on home page.', + 'icon' => 'icon-th-list', + 'link' => 'index.php?controller=AdminFeaturesModuleSetting', + 'unremovable' => 0, + ), + ); + + $languages = Language::getLanguages(); + foreach ($settingsLinks as $key => $settingsLink) { + $name = array(); + $hint = array(); + foreach ($languages as $language) { + $name[$language['id_lang']] = $settingsLink['name']; + $hint[$language['id_lang']] = $settingsLink['hint']; + } + + $objHotelSettingsLink = new HotelSettingsLink(); + $objHotelSettingsLink->name = $name; + $objHotelSettingsLink->hint = $hint; + $objHotelSettingsLink->icon = $settingsLink['icon']; + $objHotelSettingsLink->link = $settingsLink['link']; + $objHotelSettingsLink->new_window = 0; + $objHotelSettingsLink->position = (int) $key; + $objHotelSettingsLink->unremovable = $settingsLink['unremovable']; + $objHotelSettingsLink->active = 1; + + if (!$objHotelSettingsLink->save()) { + return false; + } + } + + return true; + } + public function saveAdvancedPaymentInfo($id_product) { $obj_adv_pmt = new HotelAdvancedPayment(); @@ -573,6 +647,7 @@ class HotelHelper $this->saveDummyHotelImages($htl_id); $this->saveDummyHotelFeatures($htl_id); $this->saveDummyProductsAndRelatedInfo($htl_id); + $this->saveDefaultHotelSettingsLinks(); return true; } diff --git a/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php b/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php index 26d3c5a4b..b1d6436a0 100644 --- a/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php +++ b/modules/hotelreservationsystem/classes/HotelReservationSystemDb.php @@ -358,6 +358,27 @@ class HotelReservationSystemDb `access` int(11) NOT NULL, PRIMARY KEY (`id_profile`, `id_hotel`) ) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;", + + "CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_settings_link` ( + `id_settings_link` int(11) NOT NULL AUTO_INCREMENT, + `icon` varchar(32) character set utf8 NOT NULL, + `link` text NOT NULL, + `new_window` tinyint(1) NOT NULL DEFAULT '0', + `position` int(11) unsigned NOT NULL DEFAULT '0', + `unremovable` tinyint(1) NOT NULL DEFAULT '0', + `active` tinyint(1) NOT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_settings_link`) + ) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;", + + "CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_settings_link_lang` ( + `id_settings_link` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(255) character set utf8 NOT NULL, + `hint` varchar(255) character set utf8 NOT NULL, + PRIMARY KEY (`id_settings_link`, `id_lang`) + ) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;", ); } @@ -408,7 +429,9 @@ class HotelReservationSystemDb `'._DB_PREFIX_.'htl_room_type_demand_price`, `'._DB_PREFIX_.'htl_room_type_demand`, `'._DB_PREFIX_.'htl_room_disable_dates`, - `'._DB_PREFIX_.'htl_access`' + `'._DB_PREFIX_.'htl_access`, + `'._DB_PREFIX_.'htl_settings_link`, + `'._DB_PREFIX_.'htl_settings_link_lang`' ); } } diff --git a/modules/hotelreservationsystem/classes/HotelSettingsLink.php b/modules/hotelreservationsystem/classes/HotelSettingsLink.php new file mode 100644 index 000000000..06229d2c5 --- /dev/null +++ b/modules/hotelreservationsystem/classes/HotelSettingsLink.php @@ -0,0 +1,148 @@ + 'htl_settings_link', + 'primary' => 'id_settings_link', + 'multilang' => true, + 'fields' => array( + 'name' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'lang' => true, 'required' => true), + 'hint' => array('type' => self::TYPE_STRING, 'validate' => 'isGenericName', 'lang' => true, 'required' => true), + 'icon' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml', 'required' => true), + 'link' => array('type' => self::TYPE_STRING, 'validate' => 'isUrl', 'required' => true), + 'new_window' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), + 'position' => array('type' => self::TYPE_INT, 'validate' => 'isUnsignedInt'), + 'unremovable' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), + 'active' => array('type' => self::TYPE_BOOL, 'validate' => 'isBool'), + 'date_add' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false), + 'date_upd' => array('type' => self::TYPE_DATE, 'validate' => 'isDate', 'copy_post' => false), + ), + ); + + public function getAll($active = true) + { + return Db::getInstance()->executeS( + 'SELECT * FROM `'._DB_PREFIX_.'htl_settings_link` hsl + LEFT JOIN `'._DB_PREFIX_.'htl_settings_link_lang` hsll + ON hsll.`id_settings_link` = hsl.`id_settings_link` AND hsll.`id_lang` = '.(int) Context::getContext()->language->id. + ($active ? ' WHERE hsl.`active` = 1' : '').' + ORDER BY hsl.`position`' + ); + } + + public function generateLink($link = null, $id_employee = null) + { + if ($link) { + $this->link = $link; + } + + $context = Context::getContext(); + if ($this->link == '../') { + return $context->shop->getBaseURL(); + } else { + preg_match('/controller=(.+)(&.+)?$/', $this->link, $adminTab); + if (isset($adminTab[1])) { + if (strpos($adminTab[1], '&')) { + $adminTab[1] = substr($adminTab[1], 0, strpos($adminTab[1], '&')); + } + + $token = Tools::getAdminToken($adminTab[1].(int) Tab::getIdFromClassName($adminTab[1]).(int) ($id_employee ? $id_employee : $context->employee->id)); + return $link.'&token='.$token; + } + } + + return $link; + } + + public function getUnremovableLinks() + { + return Db::getInstance()->executeS( + 'SELECT * + FROM `'._DB_PREFIX_.'htl_settings_link` hsl + WHERE hsl.`unremovable` = 1' + ); + } + + public function getHigherPosition() + { + $position = Db::getInstance()->getValue( + 'SELECT MAX(`position`) FROM `'._DB_PREFIX_.'htl_settings_link`' + ); + + $result = (is_numeric($position)) ? $position : -1; + + return $result + 1; + } + + public function updatePosition($way, $position) + { + if (!$result = Db::getInstance()->executeS( + 'SELECT hsl.`id_settings_link`, hsl.`position` + FROM `'._DB_PREFIX_.'htl_settings_link` hsl + WHERE hsl.`id_settings_link` = '.(int) $this->id.' ORDER BY `position` ASC') + ) { + return false; + } + + $movedBlock = false; + foreach ($result as $block) { + if ((int)$block['id_settings_link'] == (int) $this->id) { + $movedBlock = $block; + } + } + + if ($movedBlock === false) { + return false; + } + + return (Db::getInstance()->execute( + 'UPDATE `'._DB_PREFIX_.'htl_settings_link` SET `position`= `position` '.($way ? '- 1' : '+ 1'). + ' WHERE `position`'.($way ? '> '. + (int) $movedBlock['position'].' AND `position` <= '.(int) $position : '< ' + .(int) $movedBlock['position'].' AND `position` >= '.(int) $position) + ) && Db::getInstance()->execute( + 'UPDATE `'._DB_PREFIX_.'htl_settings_link` + SET `position` = '.(int) $position.' + WHERE `id_settings_link`='.(int) $movedBlock['id_settings_link'] + )); + } + + public function cleanPositions() + { + Db::getInstance()->execute('SET @i = -1', false); + $sql = 'UPDATE `'._DB_PREFIX_.'htl_settings_link` SET `position` = @i:=@i+1 ORDER BY `position` ASC'; + + return Db::getInstance()->execute($sql); + } +} \ No newline at end of file diff --git a/modules/hotelreservationsystem/controllers/admin/AdminHotelConfigurationSettingController.php b/modules/hotelreservationsystem/controllers/admin/AdminHotelConfigurationSettingController.php index aa756be79..77b1ebae6 100644 --- a/modules/hotelreservationsystem/controllers/admin/AdminHotelConfigurationSettingController.php +++ b/modules/hotelreservationsystem/controllers/admin/AdminHotelConfigurationSettingController.php @@ -2,37 +2,339 @@ class AdminHotelConfigurationSettingController extends ModuleAdminController { + protected $position_identifier = 'id_settings_link'; + public function __construct() { - $this->table = 'configuration'; - $this->className = 'Configuration'; + $this->table = 'htl_settings_link'; + $this->identifier = 'id_settings_link'; + $this->className = 'HotelSettingsLink'; + $this->_defaultOrderBy = 'position'; + $this->lang = true; $this->bootstrap = true; - if (!($obj = $this->loadObject(true))) { - return; - } - $this->toolbar_title = $this->l('Manage Hotel Settings'); + $this->list_no_link = true; + parent::__construct(); + + $this->addRowAction('edit'); + $this->addRowAction('delete'); + + $this->fields_list = array( + 'id_settings_link' => array( + 'title' => $this->l('ID'), + 'hint' => $this->l('ID of the settings link.'), + 'align' => 'center', + 'class' => 'fixed-width-xs', + ), + 'name' => array( + 'title' => $this->l('Name'), + 'hint' => $this->l('Name of the settings link.'), + 'align' => 'left', + 'class' => 'fixed-width-xxl', + ), + 'link' => array( + 'title' => $this->l('Link'), + 'hint' => $this->l('Link of the page where admin is redirected.'), + 'align' => 'left', + 'callback' => 'displayColumnLink', + ), + 'icon' => array( + 'title' => $this->l('Icon'), + 'hint' => $this->l('Icon of the settings link.'), + 'align' => 'center', + 'callback' => 'displayColumnIcon', + ), + 'new_window' => array( + 'title' => $this->l('New Window'), + 'hint' => $this->l('Active if link is opened in a new window.'), + 'align' => 'center', + 'active' => 'new_window', + 'ajax' => true, + 'orderby' => false, + 'type' => 'bool', + 'class' => 'fixed-width-sm', + ), + 'position' => array( + 'title' => $this->l('Position'), + 'filter_key' => 'a!position', + 'position' => 'position', + 'align' => 'center', + 'class' => 'fixed-width-md', + ), + 'active' => array( + 'title' => $this->l('Status'), + 'hint' => $this->l('Current status of the settings link.'), + 'type' => 'bool', + 'active' => 'status', + 'align' => 'center', + 'class' => 'fixed-width-lg', + 'filter_key' => 'a!active', + ), + ); + + $this->bulk_actions = array( + 'enableSelection' => array( + 'text' => $this->l('Enable selection'), + 'icon' => 'icon-power-off text-success' + ), + 'disableSelection' => array( + 'text' => $this->l('Disable selection'), + 'icon' => 'icon-power-off text-danger' + ), + 'divider' => array( + 'text' => 'divider' + ), + 'delete' => array( + 'text' => $this->l('Delete selected'), + 'confirm' => $this->l('Delete selected items?'), + 'icon' => 'icon-trash' + ) + ); + } + + public function displayColumnIcon($icon) + { + $tpl = $this->context->smarty->createTemplate( + $this->module->getLocalPath().'views/templates/admin/'.$this->tpl_folder.'helpers/list/link-icon.tpl' + ); + + $tpl->assign('icon', $icon); + + return $tpl->fetch(); + } + + public function displayColumnLink($link) + { + $this->loadObject(true); + $tpl = $this->context->smarty->createTemplate( + $this->module->getLocalPath().'views/templates/admin/'.$this->tpl_folder.'helpers/list/link-page.tpl' + ); + + $tpl->assign(array( + 'saved_link' => $link, + 'generated_link' => $this->object->generateLink($link), + )); + + return $tpl->fetch(); + } + + public function initToolbar() + { + parent::initToolbar(); + if ($this->display == 'view') { + $this->toolbar_title = $this->l('Hotel Settings'); + $this->page_header_toolbar_btn['manage_links'] = array( + 'icon' => 'process-icon-cogs', + 'href' => self::$currentIndex.'&display=list&token='.$this->token, + 'desc' => $this->l('Manage links'), + ); + } elseif ($this->display == 'list') { + $this->page_header_toolbar_title = $this->l('Settings Links'); + $this->page_header_toolbar_btn['new'] = array( + 'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token, + 'desc' => $this->l('Add new link'), + ); + } } public function initContent() { - $this->show_toolbar = false; - $this->display = 'view'; + if (!$this->ajax) { + if (Tools::getValue('display') == 'list') { + $this->display = 'list'; + } elseif (empty($this->display) + && !Tools::isSubmit('submitFilter'.$this->table) + ) { + $this->display = 'view'; + } + } + parent::initContent(); } + public function renderList() + { + $this->context->smarty->assign('icon', 'icon-list'); + $this->toolbar_title = $this->l('Settings Links'); + + $this->loadObject(true); + $unremovableLinks = $this->object->getUnremovableLinks(); + if (is_array($unremovableLinks) && count($unremovableLinks)) { + $ids = array(); + foreach ($unremovableLinks as $unremovableLink) { + $ids[] = $unremovableLink['id_settings_link']; + } + $this->addRowActionSkipList('delete', $ids); + } + + return parent::renderList(); + } + + public function renderForm() + { + $smartyVars = array(); + $idSettingsLink = (int) Tools::getValue($this->identifier); + $objHotelSettingsLink = $this->loadObject(true); + + $smartyVars['id_hotel_settings_link'] = $idSettingsLink; + $smartyVars['currentTab'] = $this; + $smartyVars['currentObject'] = $objHotelSettingsLink; + + $this->fields_form = $this->getFieldsForm(); + $this->context->smarty->assign($smartyVars); + + return parent::renderForm(); + } + + public function getFieldsForm() + { + $fields_form = array(); + + $fields_form[] = array( + 'form' => array( + 'submit' => array( + 'title' => $this->l('Save'), + 'name' => 'submitHotelSettingsLink', + 'class' => 'btn btn-default pull-right', + ), + ), + ); + + return $fields_form; + } + public function renderView() { + $settingsLinks = $this->object->getAll(); + foreach ($settingsLinks as $index => &$settingsLink) { + $settingsLink['generated_link'] = $this->object->generateLink($settingsLink['link']); + } + $this->tpl_view_vars = array( - 'feature_price_setting_link' => $this->context->link->getAdminLink('AdminHotelFeaturePricesSettings'), - 'general_setting_link' => $this->context->link->getAdminLink('AdminHotelGeneralSettings'), - 'order_restrict_setting_link' => $this->context->link->getAdminLink('AdminOrderRestrictSettings'), - 'additional_demand_setting_link' => $this->context->link->getAdminLink('AdminRoomTypeGlobalDemand'), + 'settings_links' => $settingsLinks, ); return parent::renderView(); } + public function postProcess() + { + if (Tools::isSubmit('submitHotelSettingsLink') || Tools::isSubmit('submitHotelSettingsLinkAndStay')) { + $idHotelSettingsLink = Tools::getValue($this->identifier); + $this->validateRules(); + + if (is_array($this->errors) && !count($this->errors)) { + $objHotelSettingsLink = new HotelSettingsLink($idHotelSettingsLink); + $this->copyFromPost($objHotelSettingsLink, $this->table); + if (!$idHotelSettingsLink) { + $objHotelSettingsLink->position = $objHotelSettingsLink->getHigherPosition(); + } + if ($objHotelSettingsLink->save()) { + $newId = $objHotelSettingsLink->id; + + if (is_array($this->errors) && !count($this->errors)) { + if (Tools::isSubmit('submitHotelSettingsLinkAndStay')) { + if ($idHotelSettingsLink) { + Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token. + '&update'.$this->table.'&'.$this->identifier.'='.$newId); + } else { + Tools::redirectAdmin(self::$currentIndex.'&conf=3&token='.$this->token. + '&update'.$this->table.'&'.$this->identifier.'='.$newId); + } + } else { + self::$currentIndex .= '&display=list'; + if ($idHotelSettingsLink) { + Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token); + } else { + Tools::redirectAdmin(self::$currentIndex.'&conf=3&token='.$this->token); + } + } + } + } + } + } + + parent::postProcess(); + } + + public function processStatus() + { + self::$currentIndex .= '&display=list'; + return parent::processStatus(); + } + + public function processDelete() + { + self::$currentIndex .= '&display=list'; + return parent::processDelete(); + } + + public function processBulkDelete() + { + self::$currentIndex .= '&display=list'; + return parent::processBulkDelete(); + } + + public function ajaxProcessNewWindowHtlSettingsLink() + { + $response = array( + 'success' => 0, + 'text' => $this->l('An error occurred while updating object.') + ); + + $idSettingsLink = Tools::getValue('id_settings_link'); + $objHotelSettingsLink = new HotelSettingsLink($idSettingsLink); + + if (Validate::isLoadedObject($objHotelSettingsLink)) { + $objHotelSettingsLink->new_window = (int) !$objHotelSettingsLink->new_window; + + if ($objHotelSettingsLink->save()) { + $response['success'] = 1; + $response['text'] = $this->l('The object has been updated successfully.'); + } + } + + $this->ajaxDie(json_encode($response)); + } + + public function ajaxProcessUpdatePositions() + { + $way = (int) Tools::getValue('way'); + $idSettingsLink = (int) Tools::getValue('id'); + $positions = Tools::getValue('settings_link'); + + foreach ($positions as $position => $value) { + $pos = explode('_', $value); + + if (isset($pos[2]) && (int) $pos[2] === $idSettingsLink) { + if ($objHotelSettingsLink = new HotelSettingsLink((int) $pos[2])) { + if (isset($position) && $objHotelSettingsLink->updatePosition($way, $position, $idSettingsLink)) { + $this->ajaxDie(json_encode(true)); + } else { + $this->ajaxDie(json_encode(array( + 'hasError' => true, + 'errors' => sprintf( + $this->l('Can not update position for object ID: %d to position %d'), + (int) $idSettingsLink, + $position + ), + ))); + } + } else { + $this->ajaxDie(json_encode(array( + 'hasError' => true, + 'errors' => sprintf( + $this->l('The object with ID: %d can not be loaded.'), + (int) $idSettingsLink + ), + ))); + } + + break; + } + } + } + public function setMedia() { parent::setMedia(); diff --git a/modules/hotelreservationsystem/define.php b/modules/hotelreservationsystem/define.php index 6218e15af..607004e33 100644 --- a/modules/hotelreservationsystem/define.php +++ b/modules/hotelreservationsystem/define.php @@ -45,6 +45,8 @@ require_once 'classes/QloRoomType.php'; require_once 'classes/HotelRoomDisableDates.php'; require_once 'classes/HotelBranchRefundRules.php'; +require_once 'classes/HotelSettingsLink.php'; + // Web services classes require_once 'classes/WebserviceSpecificManagementQlo.php'; require_once 'classes/WebserviceSpecificManagementHotelImages.php'; \ No newline at end of file diff --git a/modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/form/form.tpl b/modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/form/form.tpl new file mode 100644 index 000000000..e94b57449 --- /dev/null +++ b/modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/form/form.tpl @@ -0,0 +1,172 @@ +{** + * 2010-2022 Webkul. + * + * NOTICE OF LICENSE + * + * All right is reserved, + * Please go through LICENSE.txt file inside our module + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade this module to newer + * versions in the future. If you wish to customize this module for your + * needs please refer to CustomizationPolicy.txt file inside our module for more information. + * + * @author Webkul IN + * @copyright 2010-2022 Webkul IN + * @license LICENSE.txt + *} + +{extends file='helpers/form/form.tpl'} + +{block name='fieldset'} +
    +
    + + {l s='Link Information' mod='hotelreservationsystem'} +
    + +
    +
    + +
    + + getFieldValue($currentObject, 'active')|intval}checked="checked"{/if}> + + getFieldValue($currentObject, 'active')|intval}checked="checked"{/if}> + + + +
    +
    + +
    + +
    + {if $languages|count > 0} + {foreach $languages as $language} + {assign var='value_text' value=$currentTab->getFieldValue($currentObject, 'name', $language.id_lang)} +
    +
    + +
    + {if $languages|count > 1} +
    + + +
    + {/if} +
    + {/foreach} + {/if} +
    +
    + +
    + +
    + {if $languages|count > 0} + {foreach $languages as $language} + {assign var='value_text' value=$currentTab->getFieldValue($currentObject, 'hint', $language.id_lang)} +
    +
    + +
    + {if $languages|count > 1} +
    + + +
    + {/if} +
    + {/foreach} + {/if} +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + +
    +
    + +
    + +
    + + getFieldValue($currentObject, 'new_window')|intval}checked="checked"{/if}> + + getFieldValue($currentObject, 'new_window')|intval}checked="checked"{/if}> + + + +
    +
    +
    + + +
    +{/block} diff --git a/modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/form/index.php b/modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/form/index.php new file mode 100644 index 000000000..b2366adc9 --- /dev/null +++ b/modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/form/index.php @@ -0,0 +1,29 @@ + diff --git a/modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/list/link-page.tpl b/modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/list/link-page.tpl new file mode 100644 index 000000000..bb307b859 --- /dev/null +++ b/modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/list/link-page.tpl @@ -0,0 +1,20 @@ +{** + * 2010-2022 Webkul. + * + * NOTICE OF LICENSE + * + * All right is reserved, + * Please go through LICENSE.txt file inside our module + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade this module to newer + * versions in the future. If you wish to customize this module for your + * needs please refer to CustomizationPolicy.txt file inside our module for more information. + * + * @author Webkul IN + * @copyright 2010-2022 Webkul IN + * @license LICENSE.txt + *} + +{$saved_link} diff --git a/modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/view/view.tpl b/modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/view/view.tpl index e354b8d0a..976a956f9 100644 --- a/modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/view/view.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/view/view.tpl @@ -1,44 +1,36 @@ +{** + * 2010-2022 Webkul. + * + * NOTICE OF LICENSE + * + * All right is reserved, + * Please go through LICENSE.txt file inside our module + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade this module to newer + * versions in the future. If you wish to customize this module for your + * needs please refer to CustomizationPolicy.txt file inside our module for more information. + * + * @author Webkul IN + * @copyright 2010-2022 Webkul IN + * @license LICENSE.txt + *} +

       {l s='Hotel Configuration' mod='hotelreservationsystem'}

    From 5a7aa606ec808f7da839768d8654115953ea7cea Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Wed, 14 Dec 2022 20:49:19 +0530 Subject: [PATCH 16/55] Add icons link for icons --- .../hotel_configuration_setting/helpers/form/form.tpl | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/form/form.tpl b/modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/form/form.tpl index e94b57449..aba822fce 100644 --- a/modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/form/form.tpl +++ b/modules/hotelreservationsystem/views/templates/admin/hotel_configuration_setting/helpers/form/form.tpl @@ -121,6 +121,15 @@
    +
    +
    + {l s='Refer to the following link for available icons.' mod='hotelreservationsystem'} + + https://fontawesome.com/v4/cheatsheet + + {l s=' Note: Replace fa- with icon- in icon name.' mod='hotelreservationsystem'} +
    +
    From c96890cff2d9d7a68d7c3b9cd1d43264a96e3dfc Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Thu, 15 Dec 2022 20:31:38 +0530 Subject: [PATCH 17/55] Use object methods for HotelCartBookingData and HotelBookingDetail --- controllers/admin/AdminOrdersController.php | 4 +- .../classes/HotelBookingDetail.php | 525 +++++++++++------- .../classes/HotelCartBookingData.php | 236 +++++--- 3 files changed, 506 insertions(+), 259 deletions(-) diff --git a/controllers/admin/AdminOrdersController.php b/controllers/admin/AdminOrdersController.php index e45271256..30cad6edc 100644 --- a/controllers/admin/AdminOrdersController.php +++ b/controllers/admin/AdminOrdersController.php @@ -459,7 +459,7 @@ class AdminOrdersControllerCore extends AdminController if (!$room_swapped) { $this->errors[] = Tools::displayError('Some error occured. Please try again.'); } else { - Tools::redirectAdmin(self::$currentIndex.'&id_order='.(int) $order_id.'&vieworder&token='.$this->token); + Tools::redirectAdmin(self::$currentIndex.'&id_order='.(int) $order_id.'&vieworder&token='.$this->token.'&conf=4'); } } } else { @@ -494,7 +494,7 @@ class AdminOrdersControllerCore extends AdminController if (!$room_swapped) { $this->errors[] = Tools::displayError('Some error occured. Please try again.'); } else { - Tools::redirectAdmin(self::$currentIndex.'&id_order='.(int) $order_id.'&vieworder&token='.$this->token); + Tools::redirectAdmin(self::$currentIndex.'&id_order='.(int) $order_id.'&vieworder&token='.$this->token.'&conf=4'); } } } else { diff --git a/modules/hotelreservationsystem/classes/HotelBookingDetail.php b/modules/hotelreservationsystem/classes/HotelBookingDetail.php index 3f020f1ff..7671d5380 100644 --- a/modules/hotelreservationsystem/classes/HotelBookingDetail.php +++ b/modules/hotelreservationsystem/classes/HotelBookingDetail.php @@ -787,45 +787,39 @@ class HotelBookingDetail extends ObjectModel * @return [Boolean] [Returns true if successfully updated else returns false] */ public function updateBookingOrderStatusByOrderId( - $order_id, - $new_status, - $id_room, - $date_from, - $date_to, - $status_date = '' + $idOrder, + $newStatus, + $idRoom, + $dateFrom, + $dateTo, + $statusDate = '' ) { - if ($status_date) { - $status_date = date('Y-m-d H:i:s', strtotime($status_date)); - } else { - $status_date = date('Y-m-d H:i:s'); + $roomBookingData = $this->getRoomBookingData($idRoom, $idOrder, $dateFrom, $dateTo); + $objHotelBookingDetail = new self($roomBookingData['id']); + + if (!Validate::isLoadedObject($objHotelBookingDetail)) { + return false; } - $table = 'htl_booking_detail'; - - // create date to update in the table - if ($new_status == self::STATUS_CHECKED_IN) { - $data = array( - 'id_status' => $new_status, - 'check_in' => ($status_date > $date_to ? $date_to : $status_date) - ); - } elseif ($new_status == self::STATUS_CHECKED_OUT) { - $data = array( - 'id_status' => $new_status, - 'check_out' => ($status_date > $date_to ? $date_to : $status_date) - ); + if ($statusDate) { + $statusDate = date('Y-m-d H:i:s', strtotime($statusDate)); } else { - $data = array( - 'id_status' => $new_status, - 'check_in' => '', - 'check_out' => '' - ); + $statusDate = date('Y-m-d H:i:s'); } - // where conditions - $where = 'id_order = '.(int)$order_id.' AND id_room = '.(int)$id_room. - ' AND `date_from` = \''.pSQL($date_from).'\' AND `date_to` = \''.pSQL($date_to).'\''; + if ($newStatus == self::STATUS_CHECKED_IN) { + $objHotelBookingDetail->id_status = $newStatus; + $objHotelBookingDetail->check_in = ($statusDate > $dateTo ? $dateTo : $statusDate); + } elseif ($newStatus == self::STATUS_CHECKED_OUT) { + $objHotelBookingDetail->id_status = $newStatus; + $objHotelBookingDetail->check_out = ($statusDate > $dateTo ? $dateTo : $statusDate); + } else { + $objHotelBookingDetail->id_status = $newStatus; + $objHotelBookingDetail->check_in = ''; + $objHotelBookingDetail->check_out = ''; + } - return Db::getInstance()->update($table, $data, $where); + return $objHotelBookingDetail->save(); } /** @@ -1049,36 +1043,52 @@ class HotelBookingDetail extends ObjectModel * * @return [boolean] [true if rooms successfully reallocated else returns false] */ - public function reallocateRoomWithAvailableSameRoomType($current_room_id, $date_from, $date_to, $swapped_room_id) + public function reallocateRoomWithAvailableSameRoomType($currentRoomId, $dateFrom, $dateTo, $swappedRoomId) { - $date_from = date('Y-m-d H:i:s', strtotime($date_from)); - $date_to = date('Y-m-d H:i:s', strtotime($date_to)); - $table = 'htl_cart_booking_data'; - $table2 = 'htl_booking_detail'; - $data = array('id_room' => $swapped_room_id); - $where = 'date_from=\''.pSQL($date_from).'\' AND date_to=\''.pSQL($date_to).'\' AND id_room='. - (int)$current_room_id; + $dateFrom = date('Y-m-d H:i:s', strtotime($dateFrom)); + $dateTo = date('Y-m-d H:i:s', strtotime($dateTo)); - if ($result = Db::getInstance()->update($table, $data, $where)) { - if($room_num = Db::getInstance()->getValue( - 'SELECT `room_num` FROM `'._DB_PREFIX_.'htl_room_information` WHERE `id` = '.$swapped_room_id - )) { - $data['room_num'] = $room_num; + $idHotelCartBookingData = Db::getInstance()->getValue( + 'SELECT `id` + FROM `'._DB_PREFIX_.'htl_cart_booking_data` + WHERE date_from = "'.pSQL($dateFrom).'" AND date_to = "'.pSQL($dateTo).'" + AND id_room = '.(int) $currentRoomId + ); + + if ($idHotelCartBookingData) { + $objHotelCartBookingData = new HotelCartBookingData($idHotelCartBookingData); + if (!Validate::isLoadedObject($objHotelCartBookingData)) { + return false; } - if ($result2 = Db::getInstance()->update($table2, $data, $where)) { - Hook::exec( - 'actionRoomReAllocateAfter', - array( - 'room_id' => $current_room_id, - 'realloc_room_id' => $swapped_room_id, - 'date_from' => $date_from, - 'date_to' => $date_to, - ) - ); - return true; + + $objHotelCartBookingData->id_room = $swappedRoomId; + if ($objHotelCartBookingData->save()) { + $objHotelRoomInformation = new HotelRoomInformation($swappedRoomId); + + $roomBookingData = $this->getRoomBookingData($currentRoomId, $objHotelCartBookingData->id_order, $dateFrom, $dateTo); + $objHotelBookingDetail = new self($roomBookingData['id']); + if (!Validate::isLoadedObject($objHotelBookingDetail)) { + return false; + } + + $objHotelBookingDetail->id_room = $swappedRoomId; + $objHotelBookingDetail->room_num = $objHotelRoomInformation->room_num; + if ($objHotelBookingDetail->save()) { + Hook::exec( + 'actionRoomReAllocateAfter', + array( + 'room_id' => $currentRoomId, + 'realloc_room_id' => $swappedRoomId, + 'date_from' => $dateFrom, + 'date_to' => $dateTo, + ) + ); + + return true; + } } - return false; } + return false; } @@ -1091,58 +1101,69 @@ class HotelBookingDetail extends ObjectModel * * @return [boolean] [true if rooms successfully swapped else returns false] */ - public function swapRoomWithAvailableSameRoomType($current_room_id, $date_from, $date_to, $swapped_room_id) + public function swapRoomWithAvailableSameRoomType($currentRoomId, $dateFrom, $dateTo, $swappedRoomId) { - $date_from = date('Y-m-d H:i:s', strtotime($date_from)); - $date_to = date('Y-m-d H:i:s', strtotime($date_to)); + $dateFrom = date('Y-m-d H:i:s', strtotime($dateFrom)); + $dateTo = date('Y-m-d H:i:s', strtotime($dateTo)); - $idcrt1 = Db::getInstance()->getValue( + $idHotelCartBookingData1 = Db::getInstance()->getValue( 'SELECT `id` FROM `'._DB_PREFIX_.'htl_cart_booking_data` WHERE `is_refunded` = 0 - AND `date_from`=\''.pSQL($date_from).'\' AND `date_to`=\''.pSQL($date_to).'\' - AND `id_room`='.(int)$swapped_room_id + AND `date_from`=\''.pSQL($dateFrom).'\' AND `date_to`=\''.pSQL($dateTo).'\' + AND `id_room`='.(int)$swappedRoomId ); - $idcrt2 = Db::getInstance()->getValue( + $idHotelCartBookingData2 = Db::getInstance()->getValue( 'SELECT `id` FROM `'._DB_PREFIX_.'htl_cart_booking_data` WHERE `is_refunded` = 0 - AND `date_from`=\''.pSQL($date_from).'\' AND `date_to`=\''.pSQL($date_to).'\' - AND `id_room`='.(int)$current_room_id + AND `date_from`=\''.pSQL($dateFrom).'\' AND `date_to`=\''.pSQL($dateTo).'\' + AND `id_room`='.(int)$currentRoomId ); - $swap_room = Db::getInstance()->getRow( - 'SELECT `id`, `room_num` FROM `'._DB_PREFIX_.'htl_booking_detail` WHERE `is_refunded` = 0 - AND `date_from`=\''.pSQL($date_from).'\' AND `date_to`=\''.pSQL($date_to).'\' - AND `id_room`='.(int)$swapped_room_id + $idHotelBookingDetail1 = Db::getInstance()->getValue( + 'SELECT `id` FROM `'._DB_PREFIX_.'htl_booking_detail` WHERE `is_refunded` = 0 + AND `date_from`=\''.pSQL($dateFrom).'\' AND `date_to`=\''.pSQL($dateTo).'\' + AND `id_room`='.(int)$swappedRoomId ); - $curr_room = Db::getInstance()->getRow( - 'SELECT `id`, `room_num` FROM `'._DB_PREFIX_.'htl_booking_detail` WHERE `is_refunded` = 0 - AND `date_from`=\''.pSQL($date_from).'\' AND `date_to`=\''.pSQL($date_to).'\' - AND `id_room`='.(int)$current_room_id + $idHotelBookingDetail2 = Db::getInstance()->getValue( + 'SELECT `id` FROM `'._DB_PREFIX_.'htl_booking_detail` WHERE `is_refunded` = 0 + AND `date_from`=\''.pSQL($dateFrom).'\' AND `date_to`=\''.pSQL($dateTo).'\' + AND `id_room`='.(int)$currentRoomId ); - $sql = 'UPDATE `'._DB_PREFIX_.'htl_cart_booking_data` SET `id_room`=IF(`id`='.(int)$idcrt1.','. - (int)$current_room_id.','.(int)$swapped_room_id.') WHERE `id` IN('.(int)$idcrt1.','.(int)$idcrt2.')'; - $sql1 = 'UPDATE `'._DB_PREFIX_.'htl_booking_detail` - SET `id_room`=IF(`id`='.(int)$swap_room['id'].','.(int)$current_room_id.','.(int)$swapped_room_id.'), - `room_num`=IF( - `id`='.(int)$swap_room['id'].',\''.pSQL($curr_room['room_num']).'\',\''.pSQL($swap_room['room_num']).'\' - ) - WHERE `id` IN('.(int)$swap_room['id'].','.(int)$curr_room['id'].')'; + $objHotelCartBookingData1 = new HotelCartBookingData($idHotelCartBookingData1); + $objHotelCartBookingData2 = new HotelCartBookingData($idHotelCartBookingData2); - if ($result = Db::getInstance()->execute($sql)) { - $result2 = Db::getInstance()->execute($sql1); - if ($result2) { - Hook::exec( - 'actionRoomSwapAfter', - array( - 'room_id' => $current_room_id, - 'swapped_room_id' => $swapped_room_id, - 'date_from' => $date_from, - 'date_to' => $date_to, - ) - ); - return true; - } - return false; + $temp = $objHotelCartBookingData1->id_room; + $objHotelCartBookingData1->id_room = $objHotelCartBookingData2->id_room; + $objHotelCartBookingData2->id_room = $temp; + + $objHotelBookingDetail1 = new HotelBookingDetail($idHotelBookingDetail1); + $objHotelBookingDetail2 = new HotelBookingDetail($idHotelBookingDetail2); + + $temp = $objHotelBookingDetail1->id_room; + $objHotelBookingDetail1->id_room = $objHotelBookingDetail2->id_room; + $objHotelBookingDetail2->id_room = $temp; + + $temp = $objHotelBookingDetail1->room_num; + $objHotelBookingDetail1->room_num = $objHotelBookingDetail2->room_num; + $objHotelBookingDetail2->room_num = $temp; + + if ($objHotelCartBookingData1->save() + && $objHotelCartBookingData2->save() + && $objHotelBookingDetail1->save() + && $objHotelBookingDetail2->save() + ) { + Hook::exec( + 'actionRoomSwapAfter', + array( + 'room_id' => $currentRoomId, + 'swapped_room_id' => $swappedRoomId, + 'date_from' => $dateFrom, + 'date_to' => $dateTo, + ) + ); + + return true; } + return false; } @@ -1155,20 +1176,39 @@ class HotelBookingDetail extends ObjectModel * * @return [boolean] [true if updated otherwise false] */ - public function updateOrderRefundStatus($id_order, $date_from = false, $date_to = false, $id_rooms = array()) + public function updateOrderRefundStatus($idOrder, $dateFrom = false, $dateTo = false, $idsRoom = array()) { - $table = 'htl_booking_detail'; - $data = array('is_refunded' => 1); - if ($id_rooms) { - foreach ($id_rooms as $key_rm => $val_rm) { - $where = 'id_order='.(int)$id_order.' AND id_room = '.(int)$val_rm['id_room'].' AND `date_from`= \''. - pSQL($date_from).'\' AND `date_to` = \''.pSQL($date_to).'\''; - $result = Db::getInstance()->update($table, $data, $where); + if ($idsRoom) { + foreach ($idsRoom as $idRoom) { + $roomBookingData = $this->getRoomBookingData($idRoom, $idOrder, $dateFrom, $dateTo); + $objHotelBookingDetail = new self($roomBookingData['id']); + if (!Validate::isLoadedObject($objHotelBookingDetail)) { + return false; + } + + $objHotelBookingDetail->is_refunded = 1; + if (!$objHotelBookingDetail->save()) { + return false; + } } } else { - return Db::getInstance()->update($table, $data, 'id_order='.(int)$id_order); + $bookingsData = $this->getBookingDataByOrderId($idOrder); + if (is_array($bookingsData) && count($bookingsData)) { + foreach ($bookingsData as $bookingData) { + $objHotelBookingDetail = new self($bookingData['id']); + if (!Validate::isLoadedObject($objHotelBookingDetail)) { + return false; + } + + $objHotelBookingDetail->is_refunded = 1; + if (!$objHotelBookingDetail->save()) { + return false; + } + } + } } - return $result; + + return true; } /** @@ -1211,15 +1251,16 @@ class HotelBookingDetail extends ObjectModel * * @return [Boolean] [True if deleted else false] */ - public function deleteOrderedRoomFromOrder($id_order, $id_hotel, $id_room, $date_from, $date_to) + public function deleteOrderedRoomFromOrder($idOrder, $idHotel, $idRoom, $dateFrom, $dateTo) { - return Db::getInstance()->delete( - 'htl_booking_detail', - '`id_order`='.(int) $id_order.' AND `id_hotel`='.(int) $id_hotel.' AND `id_room`='.(int) $id_room. - ' AND `date_from`=\''.pSQL($date_from).'\' AND `date_to`=\''.pSQL($date_to).'\'' - ); + $roomBookingData = $this->getRoomBookingData($idRoom, $idOrder, $dateFrom, $dateTo); + $objHotelBookingDetail = new self($roomBookingData['id']); - return $delete; + if (!Validate::isLoadedObject($objHotelBookingDetail)) { + return false; + } + + return $objHotelBookingDetail->delete(); } public function getRoomBookinInformationForDateRangeByOrder( @@ -1238,79 +1279,89 @@ class HotelBookingDetail extends ObjectModel } public function UpdateHotelCartHotelOrderOnOrderEdit( - $id_order, - $id_room, - $old_date_from, - $old_date_to, - $new_date_from, - $new_date_to, - $new_total_price = null + $idOrder, + $idRoom, + $oldDateFrom, + $oldDateTo, + $newDateFrom, + $newDateTo, + $newTotalPrice = null ) { - $rowByIdOrderIdRoom = Db::getInstance()->getRow('SELECT * FROM `'._DB_PREFIX_.'htl_booking_detail` WHERE `id_room`='.(int)$id_room.' AND `id_order`='.(int)$id_order); + // retrieve HotelBookingDetail row + $roomBookingData = $this->getRoomBookingData($idRoom, $idOrder, $oldDateFrom, $oldDateTo); + $objHotelBookingDetail = new self($roomBookingData['id']); + if (!Validate::isLoadedObject($objHotelBookingDetail)) { + return false; + } + + // retrieve HotelCartBookingData row + $idHotelCartBookingData = Db::getInstance()->getValue( + 'SELECT `id` + FROM `'._DB_PREFIX_.'htl_cart_booking_data` + WHERE date_from = "'.pSQL($oldDateFrom).'" AND date_to = "'.pSQL($oldDateTo).'" + AND id_room = '.(int) $idRoom + ); + + $objHotelCartBookingData = new HotelCartBookingData($idHotelCartBookingData); + if (!Validate::isLoadedObject($objHotelCartBookingData)) { + return false; + } + + // calculate new prices $newTotalPriceTE = ''; $newTotalPriceTI = ''; - $newNumDays = $this->getNumberOfDays($new_date_from, $new_date_to); - if ($new_total_price) { - $newTotalPriceTE = $new_total_price['tax_excl']; - $newTotalPriceTI = $new_total_price['tax_incl']; + $newNumDays = $this->getNumberOfDays($newDateFrom, $newDateTo); + if ($newTotalPrice) { + $newTotalPriceTE = $newTotalPrice['tax_excl']; + $newTotalPriceTI = $newTotalPrice['tax_incl']; } else { - $oldNumDays = $this->getNumberOfDays($old_date_from, $old_date_to); - $unitRoomPriceTE = $rowByIdOrderIdRoom['total_price_tax_excl'] / $oldNumDays; - $unitRoomPriceTI = $rowByIdOrderIdRoom['total_price_tax_incl'] / $oldNumDays; + $oldNumDays = $this->getNumberOfDays($oldDateFrom, $oldDateTo); + $unitRoomPriceTE = $objHotelBookingDetail->total_price_tax_excl / $oldNumDays; + $unitRoomPriceTI = $objHotelBookingDetail->total_price_tax_incl / $oldNumDays; $newTotalPriceTE = $unitRoomPriceTE * $newNumDays; $newTotalPriceTI = $unitRoomPriceTI * $newNumDays; } - // update `total_paid_amount` on database + // calculate `total_paid_amount` $totalPaidAmount = 0; $isAdvancePayment = Db::getInstance()->getValue( 'SELECT o.`is_advance_payment` FROM `'._DB_PREFIX_.'orders` o - WHERE o.`id_order` = '.(int) $id_order + WHERE o.`id_order` = '.(int) $idOrder ); if ($isAdvancePayment) { $objHotelAdvancedPayment = new HotelAdvancedPayment(); - $productAdvancePayment = $objHotelAdvancedPayment->getIdAdvPaymentByIdProduct($rowByIdOrderIdRoom['id_product']); + $productAdvancePayment = $objHotelAdvancedPayment->getIdAdvPaymentByIdProduct($objHotelBookingDetail->id_product); if (!$productAdvancePayment || (isset($productAdvancePayment['payment_type']) && $productAdvancePayment['payment_type'])) { $totalPaidAmount = $objHotelAdvancedPayment->getRoomMinAdvPaymentAmount( - $rowByIdOrderIdRoom['id_product'], - $new_date_from, - $new_date_to + $objHotelBookingDetail->id_product, + $newDateFrom, + $newDateTo ); } } else { $totalPaidAmount = $newTotalPriceTI; } - $cart_booking = array( - 'table' => 'htl_cart_booking_data', - 'data' => array( - 'date_from' => $new_date_from, - 'date_to' => $new_date_to, - 'quantity' => $newNumDays, - ), - ); + // update $objHotelCartBookingData + $objHotelCartBookingData->date_from = $newDateFrom; + $objHotelCartBookingData->date_to = $newDateTo; + $objHotelCartBookingData->quantity = $newNumDays; - $booking_detail = array( - 'table' => 'htl_booking_detail', - 'data' => array( - 'date_from' => $new_date_from, - 'date_to' => $new_date_to, - 'total_price_tax_excl' => $newTotalPriceTE, - 'total_price_tax_incl' => $newTotalPriceTI, - 'total_paid_amount' => $totalPaidAmount, - ), - ); + // update $objHotelBookingDetail + $objHotelBookingDetail->date_from = $newDateFrom; + $objHotelBookingDetail->date_to = $newDateTo; + $objHotelBookingDetail->total_price_tax_excl = Tools::ps_round($newTotalPriceTE, 6); + $objHotelBookingDetail->total_price_tax_incl = Tools::ps_round($newTotalPriceTI, 6); + $objHotelBookingDetail->total_paid_amount = Tools::ps_round($totalPaidAmount, 6); - $where = 'id_order = '.(int)$id_order.' AND id_room = '.(int)$id_room.' AND date_from= \''.pSQL($old_date_from). - '\' AND date_to = \''.pSQL($old_date_to).'\' AND `is_refunded`=0 AND `is_back_order`=0'; + if ($objHotelCartBookingData->save() && $objHotelBookingDetail->save()) { + return true; + } - $result = Db::getInstance()->update($cart_booking['table'], $cart_booking['data'], $where); - $result &= Db::getInstance()->update($booking_detail['table'], $booking_detail['data'], $where); - - return $result; + return false; } /** @@ -1717,37 +1768,126 @@ class HotelBookingDetail extends ObjectModel } } - public function deleteHotelOrderInfo($id_order) + public function deleteHotelOrderInfo($idOrder) { - $cartTable = 'htl_cart_booking_data'; - $orderTable = 'htl_booking_detail'; - $condition = 'id_order = '.(int)$id_order; - if (Db::getInstance()->delete($orderTable, $condition)) { - return Db::getInstance()->delete($cartTable, $condition); + $objHotelCartBookingData = new HotelCartBookingData(); + $bookingsCartData = $objHotelCartBookingData->getCartCurrentDataByOrderId($idOrder); + if (is_array($bookingsCartData) && count($bookingsCartData)) { + foreach ($bookingsData as $bookingCartData) { + $objHotelCartBookingData = new HotelCartBookingData($bookingCartData['id']); + if (!Validate::isLoadedObject($objHotelCartBookingData)) { + return false; + } + + if (!$objHotelCartBookingData->delete()) { + return false; + } + } } - return false; + + $bookingsData = $this->getBookingDataByOrderId($idOrder); + if (is_array($bookingsData) && count($bookingsData)) { + foreach ($bookingsData as $bookingData) { + $objHotelBookingDetail = new self($bookingData['id']); + if (!Validate::isLoadedObject($objHotelBookingDetail)) { + return false; + } + + if (!$objHotelBookingDetail->delete()) { + return false; + } + } + } + + return true; } - public function deleteHotelOrderRoomInfo($id_order, $id_product, $id_room) + public function deleteHotelOrderRoomInfo($idOrder, $idProduct, $idRoom) { - $cartTable = 'htl_cart_booking_data'; - $orderTable = 'htl_booking_detail'; - $condition = 'id_order = '.(int)$id_order.' AND id_product = '.(int)$id_product.' AND id_room = '.(int)$id_room; - if (Db::getInstance()->delete($orderTable, $condition)) { - return Db::getInstance()->delete($cartTable, $condition); + $result = Db::getInstance()->executeS( + 'SELECT `id` + FROM `'._DB_PREFIX_.'htl_cart_booking_data` + WHERE `id_order` = '.(int) $idOrder.' AND `id_product` = '.(int) $idProduct.' + AND `id_room` = '.(int) $idRoom + ); + + if (is_array($result) && count($result)) { + foreach ($result as $row) { + $objHotelCartBookingData = new HotelCartBookingData($row['id']); + if (!Validate::isLoadedObject($objHotelCartBookingData)) { + return false; + } + + if (!$objHotelCartBookingData->delete()) { + return false; + } + } } - return false; + + $result = Db::getInstance()->executeS( + 'SELECT `id` + FROM `'._DB_PREFIX_.'htl_booking_detail` + WHERE `id_order` = '.(int) $idOrder.' AND `id_product` = '.(int) $idProduct.' + AND `id_room` = '.(int) $idRoom + ); + + if (is_array($result) && count($result)) { + foreach ($result as $row) { + $objHotelBookingDetail = new self($row['id']); + if (!Validate::isLoadedObject($objHotelBookingDetail)) { + return false; + } + + if (!$objHotelBookingDetail->delete()) { + return false; + } + } + } + + return true; } - public function deleteHotelOrderRoomTypeInfo($id_order, $id_product) + public function deleteHotelOrderRoomTypeInfo($idOrder, $idProduct) { - $cartTable = 'htl_cart_booking_data'; - $orderTable = 'htl_booking_detail'; - $condition = 'id_order = '.(int)$id_order.' AND id_product = '.(int)$id_product; - if (Db::getInstance()->delete($orderTable, $condition)) { - return Db::getInstance()->delete($cartTable, $condition); + $result = Db::getInstance()->executeS( + 'SELECT `id` + FROM `'._DB_PREFIX_.'htl_cart_booking_data` + WHERE `id_order` = '.(int) $idOrder.' AND `id_product` = '.(int) $idProduct + ); + + if (is_array($result) && count($result)) { + foreach ($result as $row) { + $objHotelCartBookingData = new HotelCartBookingData($row['id']); + if (!Validate::isLoadedObject($objHotelCartBookingData)) { + return false; + } + + if (!$objHotelCartBookingData->delete()) { + return false; + } + } } - return false; + + $result = Db::getInstance()->executeS( + 'SELECT `id` + FROM `'._DB_PREFIX_.'htl_booking_detail` + WHERE `id_order` = '.(int) $idOrder.' AND `id_product` = '.(int) $idProduct + ); + + if (is_array($result) && count($result)) { + foreach ($result as $row) { + $objHotelBookingDetail = new self($row['id']); + if (!Validate::isLoadedObject($objHotelBookingDetail)) { + return false; + } + + if (!$objHotelBookingDetail->delete()) { + return false; + } + } + } + + return true; } public function enterHotelOrderBookingFormCartBookingData($id_cart) @@ -1799,6 +1939,8 @@ class HotelBookingDetail extends ObjectModel public function updateHotelOrderRoomDurationInfo($id_order, $id_product, $id_room, $update_params) { + Tools::displayAsDeprecated(); + $cartTable = 'htl_cart_booking_data'; $orderTable = 'htl_booking_detail'; $condition = '`id_order` = '.(int)$id_order.' AND `id_product` = '.(int)$id_product. @@ -1843,11 +1985,22 @@ class HotelBookingDetail extends ObjectModel // Add new entry to the table if ($orderDetail->save()) { - return Db::getInstance()->update( - 'htl_booking_detail', - array('id_order_detail' => $orderDetail->id_order_detail), - '`id_order` = '.(int)$id_order.' AND `id_product` = '.(int)$id_product - ); + $bookingsData = self::getOrderInfoIdOrderIdProduct($id_order, $id_product); + if (is_array($bookingsData) && count($bookingsData)) { + foreach ($bookingsData as $bookingData) { + $objHotelBookingDetail = new self($bookingData['id']); + if (!Validate::isLoadedObject($objHotelBookingDetail)) { + return false; + } + + $objHotelBookingDetail->id_order_detail = $orderDetail->id_order_detail; + if (!$objHotelBookingDetail->save()) { + return false; + } + } + + return true; + } } } return false; @@ -1872,7 +2025,7 @@ class HotelBookingDetail extends ObjectModel public function getRoomBookingData($idRoom, $idOrder, $date_from, $date_to) { - $sql = 'SELECT `id_product`, `id_order_detail`, `id_hotel`, `id_customer`, `booking_type`, `id_status`, `check_in`, `check_out` + $sql = 'SELECT `id`, `id_product`, `id_order_detail`, `id_hotel`, `id_customer`, `booking_type`, `id_status`, `check_in`, `check_out` FROM `'._DB_PREFIX_.'htl_booking_detail` WHERE `id_order`='.(int)$idOrder.' AND `id_room`='.(int)$idRoom.' AND `date_from`=\''.pSQL($date_from).'\' AND `date_to`= \''.pSQL($date_to).'\''; diff --git a/modules/hotelreservationsystem/classes/HotelCartBookingData.php b/modules/hotelreservationsystem/classes/HotelCartBookingData.php index dd0fb2cf8..50a7a2d4f 100644 --- a/modules/hotelreservationsystem/classes/HotelCartBookingData.php +++ b/modules/hotelreservationsystem/classes/HotelCartBookingData.php @@ -224,9 +224,12 @@ class HotelCartBookingData extends ObjectModel */ public function deleteRowById($id) { - $delete = Db::getInstance()->delete('htl_cart_booking_data', '`id`='.(int) $id); + $objHotelCartBookingData = new self($id); + if (!Validate::isLoadedObject($objHotelCartBookingData)) { + return false; + } - return $delete; + return $objHotelCartBookingData->delete(); } /** @@ -289,28 +292,34 @@ class HotelCartBookingData extends ObjectModel * * @return [boolean] [If cart updated with quantity successfully returns true else returns false] */ - public function changeProductDataByRoomId($roomid, $id_product, $days_diff, $cart_id) + public function changeProductDataByRoomId($idRoom, $idProduct, $daysDiff, $idCart) { - $deleted = Db::getInstance()->delete('htl_cart_booking_data', '`id_room` = '.(int) $roomid.' AND `id_cart` = '.(int) $cart_id); + $result = Db::getInstance()->executeS( + 'SELECT `id` + FROM `'._DB_PREFIX_.'htl_cart_booking_data` + WHERE `id_room` = '.(int) $idRoom.' AND `id_cart` = '.(int) $idCart + ); - $cart_product_quantity = Db::getInstance()->getValue('SELECT `quantity` FROM `'._DB_PREFIX_.'cart_product` WHERE `id_cart`='.$cart_id.' AND `id_product`='.$id_product); + if (is_array($result) && count($result)) { + foreach ($result as $row) { + $objHotelCartBookingData = new self($row['id']); + if (!Validate::isLoadedObject($objHotelCartBookingData)) { + return false; + } - $new_quantity = $cart_product_quantity - $days_diff; - - if ($new_quantity > 0) { - $update_quantity = Db::getInstance()->update('cart_product', array('quantity' => $new_quantity), '`id_cart`='.$cart_id.' AND `id_product`='.$id_product); - if ($update_quantity) { - return true; + if (!$objHotelCartBookingData->delete()) { + return false; + } } + } - return false; + $cartProductQuantity = Db::getInstance()->getValue('SELECT `quantity` FROM `'._DB_PREFIX_.'cart_product` WHERE `id_cart`='.$idCart.' AND `id_product`='.$idProduct); + $newQuantity = $cartProductQuantity - $daysDiff; + + if ($newQuantity > 0) { + return Db::getInstance()->update('cart_product', array('quantity' => $newQuantity), '`id_cart`='.$idCart.' AND `id_product`='.$idProduct); } else { - $delete_product = Db::getInstance()->delete('cart_product', '`id_cart`='.$cart_id.' AND `id_product`='.$id_product); - if ($delete_product) { - return true; - } - - return false; + return Db::getInstance()->delete('cart_product', '`id_cart`='.$idCart.' AND `id_product`='.$idProduct); } } @@ -402,13 +411,22 @@ class HotelCartBookingData extends ObjectModel } } } + // delete rows from table - if (!Db::getInstance()->delete('htl_cart_booking_data', $where)) { - return false; + foreach ($cartBookingInfo as $row) { + $objHotelCartBookingData = new HotelCartBookingData($row['id']); + if (!Validate::isLoadedObject($objHotelCartBookingData)) { + return false; + } + + if (!$objHotelCartBookingData->delete()) { + return false; + } } } + // return number of rooms deleted - return true; + return $numRooms; } /** @@ -443,14 +461,23 @@ class HotelCartBookingData extends ObjectModel * * @return [boolean] [Returns true if deleted successfully else returns false] */ - public function deleteCartDataByIdProductIdCart($id_cart, $id_product, $date_from, $date_to) + public function deleteCartDataByIdProductIdCart($idCart, $idProduct, $dateFrom, $dateTo) { - $result = Db::getInstance()->delete('htl_cart_booking_data', '`id_cart`='.$id_cart.' AND `id_product`='.$id_product." AND `date_from` = '$date_from' AND `date_to` = '$date_to'"); - if ($result) { - return true; + $result = $this->getHotelCartRoomsInfoByRoomType($idCart, $idProduct, $dateFrom, $dateTo); + if (is_array($result) && count($result)) { + foreach ($result as $row) { + $objHotelCartBookingData = new self($row['id']); + if (!Validate::isLoadedObject($objHotelCartBookingData)) { + return false; + } + + if (!$objHotelCartBookingData->delete()) { + return false; + } + } } - return false; + return true; } /** @@ -478,15 +505,23 @@ class HotelCartBookingData extends ObjectModel $this->context = Context::getContext(); $update_quantity = $this->context->cart->updateQty($qty, $id_product, null, false, 'down'); - $delete_rooms = Db::getInstance()->delete('htl_cart_booking_data', '`id_cart`='.$id_cart.' AND `id_guest`='.$id_guest.' AND `id_product`='.$id_product." AND `date_from`= '$date_from' AND `date_to`= '$date_to'"); - if ($delete_rooms) { - return true; + if (is_array($result) && count($result)) { + foreach ($result as $row) { + $objHotelCartBookingData = new self($row['id']); + if (!Validate::isLoadedObject($objHotelCartBookingData)) { + return false; + } + + if (!$objHotelCartBookingData->delete()) { + return false; + } + } } - return false; - } else { - return false; + return true; } + + return false; } /** @@ -498,37 +533,26 @@ class HotelCartBookingData extends ObjectModel */ public function deleteBookingCartDataNotOrderedByProductId($id_product) { - return Db::getInstance()->delete( - 'htl_cart_booking_data', - '`id_product`='.(int) $id_product.' AND `id_order`= 0' + $result = Db::getInstance()->executeS( + 'SELECT `id` + FROM `'._DB_PREFIX_.'htl_cart_booking_data` + WHERE `id_product`='.(int) $id_product.' AND `id_order`= 0' ); - } - /** - * [updateOrderRefundStatus :: To update the refund status of a room booked in the Cart(htl_cart_booking_data) if amount refunded by the admin]. - * - * @param [int] $id_cart [Id of the Cart] - * @param [date] $date_from [start date of the bookin of the room] - * @param [date] $date_to [end date of the bookin of the room] - * @param [int] $id_room [id of the room for which refund is done] - * - * @return [boolean] [true if updated otherwise false] - */ - public function updateOrderRefundStatus($id_cart, $date_from, $date_to, $id_rooms) - { - $table = 'htl_cart_booking_data'; - $data = array('is_refunded' => 1); + if (is_array($result) && count($result)) { + foreach ($result as $row) { + $objHotelCartBookingData = new self($row['id']); + if (!Validate::isLoadedObject($objHotelCartBookingData)) { + return false; + } - foreach ($id_rooms as $key_rm => $val_rm) { - $where = '`id_cart` = '.$id_cart.' AND `id_room` = '.$val_rm['id_room']." AND `date_from` = '$date_from' AND `date_to` = '$date_to'"; - $result = Db::getInstance()->update($table, $data, $where); + if (!$objHotelCartBookingData->delete()) { + return false; + } + } } - if ($result) { - return $result; - } - - return false; + return true; } /** @@ -564,7 +588,7 @@ class HotelCartBookingData extends ObjectModel return false; } - $dltdata = false; + $dltdata = ''; $stringArr = array('date_from', 'date_to'); @@ -579,9 +603,27 @@ class HotelCartBookingData extends ObjectModel $dltdata .= $c_key.' = '.$c_val; } } - $delete = Db::getInstance()->delete('htl_cart_booking_data', $dltdata); - return $delete; + $result = Db::getInstance()->executeS( + 'SELECT `id` + FROM `'._DB_PREFIX_.'htl_cart_booking_data` + WHERE '.$dltdata + ); + + if (is_array($result) && count($result)) { + foreach ($result as $row) { + $objHotelCartBookingData = new self($row['id']); + if (!Validate::isLoadedObject($objHotelCartBookingData)) { + return false; + } + + if (!$objHotelCartBookingData->delete()) { + return false; + } + } + } + + return true; } /** @@ -598,7 +640,7 @@ class HotelCartBookingData extends ObjectModel return false; } - $where = false; + $where = ''; $stringArr = array('date_from', 'date_to'); foreach ($updBy as $u_key => $u_val) { if ($where) { @@ -611,9 +653,31 @@ class HotelCartBookingData extends ObjectModel $where .= $u_key.' = '.$u_val; } } - $update = Db::getInstance()->update('htl_cart_booking_data', $updData, $where); + // $update = Db::getInstance()->update('htl_cart_booking_data', $updData, $where); + $result = Db::getInstance()->executeS( + 'SELECT `id` + FROM `'._DB_PREFIX_.'htl_cart_booking_data` + WHERE '.$where + ); - return $update; + if (is_array($result) && count($result)) { + foreach ($result as $row) { + $objHotelCartBookingData = new self($row['id']); + if (!Validate::isLoadedObject($objHotelCartBookingData)) { + return false; + } + + foreach ($updData as $key => $value) { + $objHotelCartBookingData->$key = $value; + } + + if (!$objHotelCartBookingData->save()) { + return false; + } + } + } + + return true; } /** @@ -725,12 +789,25 @@ class HotelCartBookingData extends ObjectModel */ public function updateIdCurrencyByIdCart($id_cart, $id_currency) { - $update_currency = Db::getInstance()->update('htl_cart_booking_data', array('id_currency' => $id_currency), '`id_cart`='.$id_cart); - if ($update_currency) { - return true; - } + $result = Db::getInstance()->executeS( + 'SELECT `id` + FROM `'._DB_PREFIX_.'htl_cart_booking_data` + WHERE `id_cart` = '.(int) $idCart + ); - return false; + if (is_array($result) && count($result)) { + foreach ($result as $row) { + $objHotelCartBookingData = new HotelCartBookingData($row['id']); + if (!Validate::isLoadedObject($objHotelCartBookingData)) { + return false; + } + + $objHotelCartBookingData->id_currency = $id_currency; + if (!$objHotelCartBookingData->save()) { + return false; + } + } + } } /** @@ -745,9 +822,26 @@ class HotelCartBookingData extends ObjectModel */ public function deleteOrderedRoomFromCart($id_order, $id_hotel, $id_room, $date_from, $date_to) { - $delete = Db::getInstance()->delete('htl_cart_booking_data', '`id_order`='.(int) $id_order.' AND `id_hotel`='.(int) $id_hotel.' AND `id_room`='.(int) $id_room." AND `date_from`='$date_from' AND `date_to`='$date_to'"); + $result = Db::getInstance()->executeS( + 'SELECT `id` + FROM `'._DB_PREFIX_.'htl_cart_booking_data` + WHERE '.'`id_order`='.(int) $id_order.' AND `id_hotel`='.(int) $id_hotel.' AND `id_room`='.(int) $id_room." AND `date_from`='$date_from' AND `date_to`='$date_to'" + ); - return $delete; + if (is_array($result) && count($result)) { + foreach ($result as $row) { + $objHotelCartBookingData = new HotelCartBookingData($row['id']); + if (!Validate::isLoadedObject($objHotelCartBookingData)) { + return false; + } + + if (!$objHotelCartBookingData->delete()) { + return false; + } + } + } + + return true; } /** From 366950d2d7c06ecbde76c69b921baa8f3beb562a Mon Sep 17 00:00:00 2001 From: shreesh arora Date: Fri, 11 Mar 2022 17:19:37 +0530 Subject: [PATCH 18/55] Added feature occupancy wise search --- .../sass/vendor/bootstrap-sass/_buttons.scss | 10 +- .../orders/_current_cart_details_data.tpl | 67 +- .../controllers/orders/_new_product.tpl | 90 +- .../controllers/orders/_product_line.tpl | 85 +- .../template/controllers/orders/form.tpl | 260 +- .../controllers/orders/helpers/view/view.tpl | 16 + .../controllers/products/occupancy.tpl | 48 +- classes/Cart.php | 30 +- classes/Cookie.php | 2 +- classes/PaymentModule.php | 18 +- classes/Product.php | 6 +- classes/controller/FrontController.php | 14 + classes/order/Order.php | 6 + classes/pdf/HTMLTemplateInvoice.php | 7 +- controllers/admin/AdminCartsController.php | 70 + controllers/admin/AdminOrdersController.php | 343 ++- .../admin/AdminPPreferencesController.php | 71 +- controllers/admin/AdminProductsController.php | 37 +- controllers/admin/AdminStatsController.php | 2 +- controllers/front/CartController.php | 241 +- controllers/front/CategoryController.php | 41 +- .../front/OrderConfirmationController.php | 8 + controllers/front/OrderDetailController.php | 8 +- controllers/front/ProductController.php | 102 +- install/data/db_structure.sql | 2 +- js/admin/orders.js | 310 +- js/daterangepicker/LICENSE.txt | 21 + js/daterangepicker/jquery.daterangepicker.css | 460 +++ js/daterangepicker/jquery.daterangepicker.js | 2638 +++++++++++++++++ .../jquery.daterangepicker.min.css | 1 + .../jquery.daterangepicker.min.js | 7 + js/daterangepicker/moment.min.js | 2 + js/daterangepicker/qlodaterangepicker.js | 43 + js/validate.js | 2 - modules/blockcart/ajax-cart.js | 203 +- modules/blockcart/blockcart.php | 48 +- modules/blockcart/blockcart.tpl | 13 +- .../checkroomavailabilityajaxprocess.php | 24 +- .../classes/HotelBookingDemands.php | 4 +- .../classes/HotelBookingDetail.php | 1553 +++++++--- .../classes/HotelCartBookingData.php | 184 +- .../classes/HotelHelper.php | 42 + .../classes/HotelOrderRestrictDate.php | 15 +- .../classes/HotelReservationSystemDb.php | 11 +- .../classes/HotelRoomType.php | 60 +- .../classes/HotelRoomTypeFeaturePricing.php | 54 +- .../admin/AdminAddHotelController.php | 1 + .../admin/AdminHotelFeaturePricesSettings.php | 2 + .../AdminHotelGeneralSettingsController.php | 32 + .../AdminHotelRoomsBookingController.php | 90 +- .../views/js/HotelReservationAdmin.js | 467 ++- .../hotel_rooms_booking/helpers/view/view.tpl | 244 +- .../statsbestproducts/statsbestproducts.php | 2 +- modules/statscheckup/statscheckup.php | 2 +- modules/statsproduct/statsproduct.php | 2 +- .../wkhotelfilterblock/wkhotelfilterblock.php | 27 +- .../classes/WkRoomSearchHelper.php | 128 +- .../views/css/wk-category-search.css | 91 +- .../views/css/wk-global-search.css | 207 +- .../views/css/wk-landing-page-search.css | 30 +- .../views/css/wk-roomtype-search.css | 77 +- .../views/js/wk-room-search-block.js | 461 ++- .../templates/hook/categoryPageSearch.tpl | 55 +- .../templates/hook/landingPageSearch.tpl | 100 +- .../templates/hook/roomTypePageSearch.tpl | 64 +- .../views/templates/hook/searchForm.tpl | 200 ++ .../wkroomsearchblock/wkroomsearchblock.php | 49 +- pdf/invoice.product-tab.tpl | 9 +- .../_partials/booking-form.tpl | 104 +- .../_partials/cart_booking_demands.tpl | 3 +- .../_partials/occupancy_field.tpl | 155 + .../_partials/order_booking_demands.tpl | 3 +- .../_partials/quantity_field.tpl | 16 + .../_partials/room_type_list.tpl | 145 +- .../hotel-reservation-theme/css/category.css | 90 +- .../css/daterangepicker.css | 85 + themes/hotel-reservation-theme/css/global.css | 121 +- .../hotel-reservation-theme/css/product.css | 64 +- themes/hotel-reservation-theme/global.tpl | 23 + .../img/icon/icon-dropdown-arrow.svg | 20 + .../img/icon/icon-hotel.svg | 25 + .../img/icon/icon-users.svg | 25 + .../js/autoload/15-jquery.uniform-modified.js | 2 +- themes/hotel-reservation-theme/js/category.js | 81 - themes/hotel-reservation-theme/js/global.js | 322 +- .../js/modules/blockcart/ajax-cart.js | 203 +- themes/hotel-reservation-theme/js/product.js | 234 +- .../modules/blockcart/blockcart.tpl | 11 +- .../order-confirmation.tpl | 2 +- .../hotel-reservation-theme/order-detail.tpl | 12 +- .../hotel-reservation-theme/shopping-cart.tpl | 12 +- 91 files changed, 9230 insertions(+), 2147 deletions(-) create mode 100644 js/daterangepicker/LICENSE.txt create mode 100644 js/daterangepicker/jquery.daterangepicker.css create mode 100755 js/daterangepicker/jquery.daterangepicker.js create mode 100644 js/daterangepicker/jquery.daterangepicker.min.css create mode 100755 js/daterangepicker/jquery.daterangepicker.min.js create mode 100644 js/daterangepicker/moment.min.js create mode 100644 js/daterangepicker/qlodaterangepicker.js create mode 100644 modules/wkroomsearchblock/views/templates/hook/searchForm.tpl create mode 100644 themes/hotel-reservation-theme/_partials/occupancy_field.tpl create mode 100644 themes/hotel-reservation-theme/_partials/quantity_field.tpl create mode 100644 themes/hotel-reservation-theme/css/daterangepicker.css create mode 100644 themes/hotel-reservation-theme/img/icon/icon-dropdown-arrow.svg create mode 100644 themes/hotel-reservation-theme/img/icon/icon-hotel.svg create mode 100644 themes/hotel-reservation-theme/img/icon/icon-users.svg diff --git a/admin/themes/default/sass/vendor/bootstrap-sass/_buttons.scss b/admin/themes/default/sass/vendor/bootstrap-sass/_buttons.scss index 271ae468f..75c8d0700 100644 --- a/admin/themes/default/sass/vendor/bootstrap-sass/_buttons.scss +++ b/admin/themes/default/sass/vendor/bootstrap-sass/_buttons.scss @@ -50,6 +50,14 @@ } } +// buttons text align +.btn-left { + text-align: left; +} +.btn-right { + text-align: right; +} + // Alternate buttons // -------------------------------------------------- @@ -140,8 +148,6 @@ .btn-block { display: block; width: 100%; - padding-left: 0; - padding-right: 0; } // Vertically space out multiple block buttons diff --git a/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl b/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl index c26576861..d3d517b2f 100644 --- a/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl +++ b/admin/themes/default/template/controllers/orders/_current_cart_details_data.tpl @@ -23,7 +23,7 @@ {l s='Cart Details'}
    -
    +
    @@ -31,6 +31,9 @@ + {if $occupancy_wise_booking} + + {/if} @@ -42,7 +45,7 @@ {if isset($cart_detail_data) && $cart_detail_data} {assign var=curr_id value=$cart->id_currency|intval} {foreach from=$cart_detail_data item=data} - + + {if $occupancy_wise_booking} + + {/if} - - + {* *} {*{if ($order->hasBeenPaid())}{/if} {if $display_warehouse}{/if} {if ($order->hasBeenDelivered())}{/if} *} - + + {if isset($refundReqBookings) && $refundReqBookings} @@ -1412,6 +1413,21 @@ {addJsDefL name=txtSomeErr}{l s='Some error occurred. Please try again.' js=1}{/addJsDefL} {addJsDefL name=txtDeleteSucc}{l s='Deleted successfully' js=1}{/addJsDefL} {addJsDefL name=txtInvalidDemandVal}{l s='Invalid demand value found' js=1}{/addJsDefL} + {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} + {addJsDefL name='rooms_txt'}{l s='Rooms' js=1}{/addJsDefL} + {addJsDefL name='remove_txt'}{l s='Remove' js=1}{/addJsDefL} + {addJsDefL name='adult_txt'}{l s='Adult' js=1}{/addJsDefL} + {addJsDefL name='adults_txt'}{l s='Adults' js=1}{/addJsDefL} + {addJsDefL name='child_txt'}{l s='Child' js=1}{/addJsDefL} + {addJsDefL name='children_txt'}{l s='Children' js=1}{/addJsDefL} + {addJsDefL name='below_txt'}{l s='Below' js=1}{/addJsDefL} + {addJsDefL name='years_txt'}{l s='years' js=1}{/addJsDefL} + {addJsDefL name='all_children_txt'}{l s='years' js=1}{/addJsDefL} + {addJsDefL name='invalid_occupancy_txt'}{l s='Invalid occupancy(adults/children) found.' 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'} {/strip} {* Apply javascript for the page *} diff --git a/admin/themes/default/template/controllers/products/occupancy.tpl b/admin/themes/default/template/controllers/products/occupancy.tpl index c38cd0b92..15b7b3527 100644 --- a/admin/themes/default/template/controllers/products/occupancy.tpl +++ b/admin/themes/default/template/controllers/products/occupancy.tpl @@ -24,16 +24,14 @@

    {l s='Occupancy'}

    - {l s='Set the occupancy of this room type. Enter how much adults and children this room type can accomodate.'} -

    - {l s='Note'} : {l s='These occupancy settings will not affect "ROOM TYPE ADDITIONAL FACILITIES" any way. It will work separately.'} + {l s='Below, enter the base occupancy of this room type.'}
    @@ -44,7 +42,7 @@
    @@ -53,6 +51,46 @@
    +
    + +
    + {l s='Below, enter the maximum of adult or children which can be accommodated in a room of this room type. Also, enter maximum number of guests for this room type.'} +
    + +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    + +
    + +
    +
    +
    {l s='Room Image'} {l s='Room Type'} {l s='Duration'}{l s='Occupancy'}{l s='Unit Price (tax excl)'} {l s='Additinal Facilities (tax excl)'} {l s='Total Rooms Price (tax excl)'}
    {$data.room_num|escape:'html':'UTF-8'} @@ -58,13 +61,71 @@ {/if} {dateFormat date=$data.date_from} - {dateFormat date=$data.date_to} + + {if $data.feature_price_diff != 0} {assign var=shown_room_type_price value=$data.feature_price_tax_excl} {else} {assign var=shown_room_type_price value=$data.product_price_tax_excl} {/if} - + {if isset($data.extra_demands) && $data.extra_demands} diff --git a/admin/themes/default/template/controllers/orders/_new_product.tpl b/admin/themes/default/template/controllers/orders/_new_product.tpl index e67cc63ff..5aa06c218 100644 --- a/admin/themes/default/template/controllers/orders/_new_product.tpl +++ b/admin/themes/default/template/controllers/orders/_new_product.tpl @@ -64,7 +64,7 @@ + {if $order->is_occupnacy_provided && $data['children']} + + {else} + {if $data['adult']}{$data['adult']}{/if} {if $data['adult'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$data['children']}}, {$data['children']} {if $data['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if} + {/if} + {if $order->is_occupnacy_provided} + + {else} + + {/if} diff --git a/admin/themes/default/template/controllers/orders/form.tpl b/admin/themes/default/template/controllers/orders/form.tpl index 1d80ec936..209f9495a 100644 --- a/admin/themes/default/template/controllers/orders/form.tpl +++ b/admin/themes/default/template/controllers/orders/form.tpl @@ -241,12 +241,13 @@ e.preventDefault(); var cart_row = $(this).closest('tr'); var params = { - id_booking_data: parseInt($(this).attr('data-id-booking-data')), - id_product: parseInt($(this).attr('data-id-product')), - id_room: parseInt($(this).attr('data-id-room')), - date_from: $(this).attr('data-date-from'), - date_to: $(this).attr('data-date-to'), + id_booking_data: parseInt($(cart_row).attr('data-id-booking-data')), + id_product: parseInt($(cart_row).attr('data-id-product')), + id_room: parseInt($(cart_row).attr('data-id-room')), + date_from: $(cart_row).attr('data-date-from'), + date_to: $(cart_row).attr('data-date-to'), price: $(this).val(), + id_cart: id_cart }; updateProductPrice(params, cart_row); }) @@ -272,6 +273,8 @@ } }); }); + + initOccupancyField(); resetBind(); $('#customer').focus(); @@ -334,6 +337,213 @@ }); }); + {literal} + function initOccupancyField() + { + $(document).on('click', '.booking_occupancy_wrapper .remove-room-link', function(e) { + e.preventDefault(); + + booking_occupancy_inner = $(this).closest('.booking_occupancy_inner'); + $(this).closest('.occupancy_info_block').remove(); + $(booking_occupancy_inner).find('.room_num_wrapper').each(function(key, val) { + $(this).text(room_txt + ' - '+ (key+1) ); + }); + setRoomTypeGuestOccupancy($(booking_occupancy_inner).closest('.booking_occupancy_wrapper')); + }); + + $(document).on('change', '.num_occupancy', function(e) { + let current_room_occupancy = 0; + $(this).closest('.occupancy_info_block').find('.num_occupancy').each(function(){ + current_room_occupancy += parseInt($(this).val()); + }); + let max_guests_in_room = $(this).closest(".booking_occupancy_wrapper").find('.max_guests').val(); + let max_allowed_for_current = (max_guests_in_room - current_room_occupancy) + parseInt($(this).val()); + if ($(this).val() > $(this).attr('max')) { + $(this).val($(this).attr('max')); + } + if ($(this).val() > max_allowed_for_current) { + $(this).val(max_allowed_for_current); + } + if ($(this).hasClass('num_children')) { + var totalChilds = $(this).closest('.occupancy_info_block').find('.guest_child_age').length; + if (totalChilds < $(this).val()) { + if (totalChilds < max_child_in_room) { + $(this).closest('.occupancy_info_block').find('.children_age_info_block').show(); + while ($(this).closest('.occupancy_info_block').find('.guest_child_age').length < $(this).val()) { + + + var roomBlockIndex = parseInt($(this).closest('.occupancy_info_block').attr('occ_block_index')); + + var childAgeSelect = '

    '; + childAgeSelect += ''; + childAgeSelect += '

    '; + $(this).closest('.occupancy_info_block').find('.children_ages').append(childAgeSelect); + } + } + } else { + let child = $(this).val(); + $(this).closest('.occupancy_info_block').find('.guest_child_age').each(function(ind, element) { + if (child <= ind) { + $(element).parent().remove(); + } + }); + if (child == 0) { + $(this).closest('.occupancy_info_block').find('.children_age_info_block').hide(); + } + + } + } + setRoomTypeGuestOccupancy($(this).closest('.booking_occupancy_wrapper')); + + }); + + + $(document).on('click', '.booking_guest_occupancy', function(e) { + $(this).parent().toggleClass('open'); + }); + + $(document).on('click', function(e) { + if ($('.booking_occupancy_wrapper:visible').length) { + var occupancy_wrapper = $('.booking_occupancy_wrapper:visible'); + $(occupancy_wrapper).find(".occupancy_info_block").addClass('selected'); + if (!($(e.target).closest(".booking_occupancy_wrapper").length || $(e.target).closest(".booking_guest_occupancy").length || $(e.target).closest(".ajax_add_to_cart_button").length || $(e.target).closest(".exclusive.book_now_submit").length)) { + let hasErrors = 0; + + let adult = $(occupancy_wrapper).find(".num_adults").map(function(){return $(this).val();}).get(); + let children = $(occupancy_wrapper).find(".num_children").map(function(){return $(this).val();}).get(); + let child_ages = $(occupancy_wrapper).find(".guest_child_age").map(function(){return $(this).val();}).get(); + + // start validating above values + if (!adult.length || (adult.length != children.length)) { + hasErrors = 1; + showErrorMessage(invalid_occupancy_txt); + } else { + $(occupancy_wrapper).find('.occupancy_count').removeClass('error_border'); + + // validate values of adult and children + adult.forEach(function (item, index) { + if (isNaN(item) || parseInt(item) < 1) { + hasErrors = 1; + $(occupancy_wrapper).find(".num_adults").eq(index).closest('.occupancy_count_block').find('.occupancy_count').addClass('error_border'); + } + if (isNaN(children[index])) { + hasErrors = 1; + $(occupancy_wrapper).find(".num_children").eq(index).closest('.occupancy_count_block').find('.occupancy_count').addClass('error_border'); + } + }); + + // validate values of selected child ages + $(occupancy_wrapper).find('.guest_child_age').parent().removeClass('has-error'); + child_ages.forEach(function (age, index) { + age = parseInt(age); + if (isNaN(age) || (age < 0) || (age >= parseInt(max_child_age))) { + hasErrors = 1; + $(occupancy_wrapper).find(".guest_child_age").eq(index).parent().addClass('has-error'); + } + }); + } + if (hasErrors == 0) { + $(occupancy_wrapper).parent().removeClass('open'); + $(document).trigger( "QloApps:updateRoomOccupancy", [occupancy_wrapper]); + } + } + } + }); + + $(document).on('QloApps:updateRoomOccupancy', function (e, occupancy_wrapper) { + e.preventDefault(); + let cart_row = $(occupancy_wrapper).closest('tr'); + let occupancy = getBookingOccupancyDetails(cart_row); + let params = { + id_cart: id_cart, + id_booking_data: parseInt($(cart_row).attr('data-id-booking-data')), + occupancy : occupancy.shift(), + }; + updateProductOccupancy(params, cart_row); + }); + } + function getBookingOccupancyDetails(bookingform) + { + let occupancy; + let selected_occupancy = $(bookingform).find(".occupancy_info_block.selected") + if (selected_occupancy.length) { + occupancy = []; + $(selected_occupancy).each(function(ind, element) { + if (parseInt($(element).find('.num_adults').val())) { + let child_ages = []; + $(element).find('.guest_child_age').each(function(index) { + if ($(this).val() > -1) { + child_ages.push($(this).val()); + } + }); + if ($(element).find('.num_children').val()) { + if (child_ages.length != $(element).find('.num_children').val()) { + $(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open'); + occupancy = false; + return false; + } + } + occupancy.push({ + 'adult': $(element).find('.num_adults').val(), + 'children': $(element).find('.num_children').val(), + 'child_ages': child_ages + }); + } else { + $(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open'); + occupancy = false; + return false; + } + }); + } else { + $(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open'); + occupancy = false; + } + + return occupancy; + } + {/literal} + + function setRoomTypeGuestOccupancy(booking_occupancy_wrapper) + { + var adult = 0; + var children = 0; + var rooms = $(booking_occupancy_wrapper).find('.occupancy_info_block').length; + + $(booking_occupancy_wrapper).find(".num_adults" ).each(function(key, val) { + adult += parseInt($(this).val()); + }); + $(booking_occupancy_wrapper).find(".num_children" ).each(function(key, val) { + children += parseInt($(this).val()); + }); + + var guestButtonVal = parseInt(adult) + ' '; + if (parseInt(adult) > 1) { + guestButtonVal += adults_txt; + } else { + guestButtonVal += adult_txt; + } + if (parseInt(children) > 0) { + if (parseInt(children) > 1) { + guestButtonVal += ', ' + parseInt(children) + ' ' + children_txt; + } else { + guestButtonVal += ', ' + parseInt(children) + ' ' + child_txt; + } + } + // if (parseInt(rooms) > 1) { + // guestButtonVal += ', ' + parseInt(rooms) + ' ' + rooms_txt; + // } else { + // guestButtonVal += ', ' + parseInt(rooms) + ' ' + room_txt; + // } + // console.log($(booking_occupancy_wrapper).siblings('.booking_guest_occupancy > span')); + $(booking_occupancy_wrapper).siblings('.booking_guest_occupancy').find('span').text(guestButtonVal); + } + function resetBind() { $('.fancybox').fancybox({ @@ -391,7 +601,6 @@ function updateProductPrice(params, cart_row) { $.extend(params, { - id_cart: id_cart, price: new Number(params.price.replace(",",".")).toFixed(4).toString(), }); @@ -414,6 +623,28 @@ }); } + function updateProductOccupancy(params, cart_row) + { + $.ajax({ + type:"POST", + url: "{$link->getAdminLink('AdminCarts')|addslashes}", + async: true, + dataType: "JSON", + data: { + ajax: "1", + token: "{getAdminToken tab='AdminCarts'}", + tab: "AdminCarts", + action: "updateProductOccupancy", + params: params, + }, + success : function(response) { + updateCartLine(response.curr_booking_info, cart_row); + updateCartSummaryData(response.cart_info); + } + }); + } + + function updateCartLine(data, cart_row) { $(cart_row).find('.cart_line_total_rooms_price').html(data.amt_with_qty); $(cart_row).find('.cart_line_total_price').html(data.total_price); @@ -1687,6 +1918,23 @@ +{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} + {addJsDefL name='rooms_txt'}{l s='Rooms' js=1}{/addJsDefL} + {addJsDefL name='remove_txt'}{l s='Remove' js=1}{/addJsDefL} + {addJsDefL name='adult_txt'}{l s='Adult' js=1}{/addJsDefL} + {addJsDefL name='adults_txt'}{l s='Adults' js=1}{/addJsDefL} + {addJsDefL name='child_txt'}{l s='Child' js=1}{/addJsDefL} + {addJsDefL name='children_txt'}{l s='Children' js=1}{/addJsDefL} + {addJsDefL name='below_txt'}{l s='Below' js=1}{/addJsDefL} + {addJsDefL name='years_txt'}{l s='years' js=1}{/addJsDefL} + {addJsDefL name='all_children_txt'}{l s='years' js=1}{/addJsDefL} + {addJsDefL name='invalid_occupancy_txt'}{l s='Invalid occupancy(adults/children) found.' js=1}{/addJsDefL} +{/strip}
    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 ea80d46a9..b03f3d1af 100644 --- a/admin/themes/default/template/controllers/orders/helpers/view/view.tpl +++ b/admin/themes/default/template/controllers/orders/helpers/view/view.tpl @@ -981,6 +981,7 @@
    {l s='Room Type'} {l s='Hotel Name'} {l s='Duration'}{l s='Occupancy'} {l s='Unit Price (Tax excl.)'} {l s='Total Price (Tax incl.)'}
    ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + getWeekHead() + + ' ' + + ' ' + + '
    ' + + ' ' + + arrowPrev + + ' ' + + ' ' + + ' ' + + (opt.singleDate || !opt.stickyMonths ? '' + arrowNext + '' : '') + + '
    '; + + if (hasMonth2()) { + html += '
    ' + getGapHTML() + '
    ' + + '' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + + ' ' + getWeekHead() + + ' ' + + ' ' + + '
    ' + + (!opt.stickyMonths ? '' + arrowPrev + '' : '') + + ' ' + + ' ' + + ' ' + arrowNext + '' + + '
    '; + + } + //+'
    ' + html += '
    ' + + '
    ' + + '
    '; + if (!opt.singleDate) { + html += '
    '; + } + html += '
    ' + + '
    ' + + '
    '; + + html += ''; + + + return $(html); + } + + function getApplyBtnClass() { + var klass = ''; + if (opt.autoClose === true) { + klass += ' hide'; + } + if (opt.applyBtnClass !== '') { + klass += ' ' + opt.applyBtnClass; + } + return klass; + } + + function getWeekHead() { + var prepend = opt.showWeekNumbers ? '' + translate('week-number') + '' : ''; + if (opt.startOfWeek == 'monday') { + return prepend + '' + translate('week-1') + '' + + '' + translate('week-2') + '' + + '' + translate('week-3') + '' + + '' + translate('week-4') + '' + + '' + translate('week-5') + '' + + '' + translate('week-6') + '' + + '' + translate('week-7') + ''; + } else { + return prepend + '' + translate('week-7') + '' + + '' + translate('week-1') + '' + + '' + translate('week-2') + '' + + '' + translate('week-3') + '' + + '' + translate('week-4') + '' + + '' + translate('week-5') + '' + + '' + translate('week-6') + ''; + } + } + + function isMonthOutOfBounds(month) { + month = moment(month); + if (opt.startDate && month.endOf('month').isBefore(opt.startDate)) { + return true; + } + if (opt.endDate && month.startOf('month').isAfter(opt.endDate)) { + return true; + } + return false; + } + + function getGapHTML() { + var html = ['
    ']; + for (var i = 0; i < 20; i++) { + html.push('
    ' + + '
    ' + + '
    ' + + '
    ' + + '
    '); + } + html.push('
    '); + return html.join(''); + } + + function hasMonth2() { + return (!opt.singleMonth); + } + + function attributesCallbacks(initialObject, callbacksArray, today) { + var resultObject = $.extend(true, {}, initialObject); + + $.each(callbacksArray, function(cbAttrIndex, cbAttr) { + var addAttributes = cbAttr(today); + for (var attr in addAttributes) { + if (resultObject.hasOwnProperty(attr)) { + resultObject[attr] += addAttributes[attr]; + } else { + resultObject[attr] = addAttributes[attr]; + } + } + }); + + var attrString = ''; + + for (var attr in resultObject) { + if (resultObject.hasOwnProperty(attr)) { + attrString += attr + '="' + resultObject[attr] + '" '; + } + } + + return attrString; + } + + function createMonthHTML(d) { + var days = []; + d.setDate(1); + var lastMonth = new Date(d.getTime() - 86400000); + var now = new Date(); + + var dayOfWeek = d.getDay(); + if ((dayOfWeek === 0) && (opt.startOfWeek === 'monday')) { + // add one week + dayOfWeek = 7; + } + var today, valid; + + if (dayOfWeek > 0) { + for (var i = dayOfWeek; i > 0; i--) { + var day = new Date(d.getTime() - 86400000 * i); + valid = isValidTime(day.getTime()); + if (opt.startDate && compare_day(day, opt.startDate) < 0) valid = false; + if (opt.endDate && compare_day(day, opt.endDate) > 0) valid = false; + days.push({ + date: day, + type: 'lastMonth', + day: day.getDate(), + time: day.getTime(), + valid: valid + }); + } + } + var toMonth = d.getMonth(); + for (var i = 0; i < 40; i++) { + today = moment(d).add(i, 'days').toDate(); + valid = isValidTime(today.getTime()); + if (opt.startDate && compare_day(today, opt.startDate) < 0) valid = false; + if (opt.endDate && compare_day(today, opt.endDate) > 0) valid = false; + days.push({ + date: today, + type: today.getMonth() == toMonth ? 'toMonth' : 'nextMonth', + day: today.getDate(), + time: today.getTime(), + valid: valid + }); + } + var html = []; + for (var week = 0; week < 6; week++) { + if (days[week * 7].type == 'nextMonth') break; + html.push(''); + + for (var day = 0; day < 7; day++) { + var _day = (opt.startOfWeek == 'monday') ? day + 1 : day; + today = days[week * 7 + _day]; + var highlightToday = moment(today.time).format('L') == moment(now).format('L'); + today.extraClass = ''; + today.tooltip = ''; + if (today.valid && opt.beforeShowDay && typeof opt.beforeShowDay == 'function') { + var _r = opt.beforeShowDay(moment(today.time).toDate()); + today.valid = _r[0]; + today.extraClass = _r[1] || ''; + today.tooltip = _r[2] || ''; + if (today.tooltip !== '') today.extraClass += ' has-tooltip '; + } + + var todayDivAttr = { + time: today.time, + 'data-tooltip': today.tooltip, + 'class': 'day ' + today.type + ' ' + today.extraClass + ' ' + (today.valid ? 'valid' : 'invalid') + ' ' + (highlightToday ? 'real-today' : '') + }; + + if (day === 0 && opt.showWeekNumbers) { + html.push('
    ' + opt.getWeekNumber(today.date) + '
    '); + } + + html.push('
    ' + showDayHTML(today.time, today.day) + '
    '); + } + html.push(''); + } + return html.join(''); + } + + function showDayHTML(time, date) { + if (opt.showDateFilter && typeof opt.showDateFilter == 'function') return opt.showDateFilter(time, date); + return date; + } + + function getLanguages() { + if (opt.language == 'auto') { + var language = navigator.language ? navigator.language : navigator.browserLanguage; + if (!language) { + return $.dateRangePickerLanguages['default']; + } + language = language.toLowerCase(); + if(language in $.dateRangePickerLanguages){ + return $.dateRangePickerLanguages[language]; + } + + return $.dateRangePickerLanguages['default']; + } else if (opt.language && opt.language in $.dateRangePickerLanguages) { + return $.dateRangePickerLanguages[opt.language]; + } else { + return $.dateRangePickerLanguages['default']; + } + } + + /** + * Translate language string, try both the provided translation key, as the lower case version + */ + function translate(translationKey) { + var translationKeyLowerCase = translationKey.toLowerCase(); + console.log(languages); + var result = (translationKey in languages) ? languages[translationKey] : (translationKeyLowerCase in languages) ? languages[translationKeyLowerCase] : null; + var defaultLanguage = $.dateRangePickerLanguages['default']; + if (result == null) result = (translationKey in defaultLanguage) ? defaultLanguage[translationKey] : (translationKeyLowerCase in defaultLanguage) ? defaultLanguage[translationKeyLowerCase] : ''; + console.log(result); + + return result; + } + + function getDefaultTime() { + var defaultTime = opt.defaultTime ? opt.defaultTime : new Date(); + + if (opt.lookBehind) { + if (opt.startDate && compare_month(defaultTime, opt.startDate) < 0) defaultTime = nextMonth(moment(opt.startDate).toDate()); + if (opt.endDate && compare_month(defaultTime, opt.endDate) > 0) defaultTime = moment(opt.endDate).toDate(); + } else { + if (opt.startDate && compare_month(defaultTime, opt.startDate) < 0) defaultTime = moment(opt.startDate).toDate(); + if (opt.endDate && compare_month(nextMonth(defaultTime), opt.endDate) > 0) defaultTime = prevMonth(moment(opt.endDate).toDate()); + } + + if (opt.singleDate) { + if (opt.startDate && compare_month(defaultTime, opt.startDate) < 0) defaultTime = moment(opt.startDate).toDate(); + if (opt.endDate && compare_month(defaultTime, opt.endDate) > 0) defaultTime = moment(opt.endDate).toDate(); + } + + return defaultTime; + } + + function resetMonthsView(time) { + if (!time) { + time = getDefaultTime(); + } + + if (opt.lookBehind) { + showMonth(prevMonth(time), 'month1'); + showMonth(time, 'month2'); + } else { + showMonth(time, 'month1'); + showMonth(nextMonth(time), 'month2'); + } + + if (opt.singleDate) { + showMonth(time, 'month1'); + } + + showSelectedDays(); + showGap(); + } + + function outsideClickClose(evt) { + if (!IsOwnDatePickerClicked(evt, self[0])) { + if (box.is(':visible')) closeDatePicker(); + } + } + + }; +})); diff --git a/js/daterangepicker/jquery.daterangepicker.min.css b/js/daterangepicker/jquery.daterangepicker.min.css new file mode 100644 index 000000000..45d658857 --- /dev/null +++ b/js/daterangepicker/jquery.daterangepicker.min.css @@ -0,0 +1 @@ +.date-picker{width:170px;height:25px;padding:0;border:0;line-height:25px;padding-left:10px;font-size:12px;font-family:Arial,sans-serif;font-weight:700;cursor:pointer;color:#303030;position:relative;z-index:2}.date-picker-wrapper{position:absolute;z-index:1;border:1px solid #bfbfbf;background-color:#efefef;padding:5px 12px;font-size:12px;line-height:20px;color:#aaa;font-family:Arial,sans-serif;-webkit-box-shadow:3px 3px 10px rgba(0,0,0,.5);box-shadow:3px 3px 10px rgba(0,0,0,.5);-webkit-box-sizing:initial;box-sizing:initial}.dp-clearfix{clear:both;height:0;font-size:0}.date-picker-wrapper.inline-wrapper{position:relative;-webkit-box-shadow:none;box-shadow:none;display:inline-block}.date-picker-wrapper.single-date{width:auto}.date-picker-wrapper.no-shortcuts{padding-bottom:12px}.date-picker-wrapper.no-topbar{padding-top:12px}.date-picker-wrapper .footer{font-size:11px;padding-top:3px}.date-picker-wrapper b{color:#666;font-weight:700}.date-picker-wrapper a{color:#6bb4d6;text-decoration:underline}.date-picker-wrapper .month-name{text-transform:uppercase}.date-picker-wrapper .select-wrapper{position:relative;overflow:hidden;display:inline-block;vertical-align:middle}.date-picker-wrapper .select-wrapper:hover{text-decoration:underline}.date-picker-wrapper .month-element{display:inline-block;vertical-align:middle}.date-picker-wrapper .select-wrapper select{position:absolute;margin:0;padding:0;left:0;top:-1px;font-size:inherit;font-style:inherit;font-weight:inherit;text-transform:inherit;color:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none;background:0 0;border:0;outline:0;-ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=1)";filter:alpha(opacity=1);opacity:.01}.date-picker-wrapper .month-wrapper{border:1px solid #bfbfbf;border-radius:3px;background-color:#fff;padding:5px;cursor:default;position:relative;_overflow:hidden}.date-picker-wrapper .month-wrapper table{width:190px;float:left}.date-picker-wrapper .month-wrapper table.month2{width:190px;float:left}.date-picker-wrapper .month-wrapper table td,.date-picker-wrapper .month-wrapper table th{vertical-align:middle;text-align:center;line-height:14px;margin:0;padding:0}.date-picker-wrapper .month-wrapper table .day{padding:5px 0;line-height:1;font-size:12px;margin-bottom:1px;color:#ccc;cursor:default}.date-picker-wrapper .month-wrapper table div.day.lastMonth,.date-picker-wrapper .month-wrapper table div.day.nextMonth{color:#999;cursor:default}.date-picker-wrapper .month-wrapper table .day.checked{background-color:#9cdbf7}.date-picker-wrapper .month-wrapper table .week-name{height:20px;line-height:20px;font-weight:100;text-transform:uppercase}.date-picker-wrapper .month-wrapper table .day.has-tooltip{cursor:help!important}.date-picker-wrapper .month-wrapper table .day.has-tooltip .tooltip{white-space:nowrap}.date-picker-wrapper .time label{white-space:nowrap}.date-picker-wrapper .month-wrapper table .day.toMonth.valid{color:#333;cursor:pointer}.date-picker-wrapper .month-wrapper table .day.toMonth.hovering{background-color:#cdecfa}.date-picker-wrapper .month-wrapper table .day.lastMonth,.date-picker-wrapper .month-wrapper table .day.nextMonth{display:none}.date-picker-wrapper .month-wrapper table .day.real-today{background-color:#ffe684}.date-picker-wrapper .month-wrapper table .day.real-today.checked,.date-picker-wrapper .month-wrapper table .day.real-today.hovering{background-color:#70ccd5}.date-picker-wrapper table .caption{height:40px}.date-picker-wrapper table .caption>th:first-of-type,.date-picker-wrapper table .caption>th:last-of-type{width:27px}.date-picker-wrapper table .caption .next,.date-picker-wrapper table .caption .prev{padding:0 5px;cursor:pointer}.date-picker-wrapper table .caption .next:hover,.date-picker-wrapper table .caption .prev:hover{background-color:#ccc;color:#fff}.date-picker-wrapper .gap{position:relative;z-index:1;width:15px;height:100%;background-color:red;font-size:0;line-height:0;float:left;top:-5px;margin:0 10px -10px;visibility:hidden;height:0}.date-picker-wrapper .gap .gap-lines{height:100%;overflow:hidden}.date-picker-wrapper .gap .gap-line{height:15px;width:15px;position:relative}.date-picker-wrapper .gap .gap-line .gap-1{z-index:1;height:0;border-left:8px solid #fff;border-top:8px solid #eee;border-bottom:8px solid #eee}.date-picker-wrapper .gap .gap-line .gap-2{position:absolute;right:0;top:0;z-index:2;height:0;border-left:8px solid transparent;border-top:8px solid #fff}.date-picker-wrapper .gap .gap-line .gap-3{position:absolute;right:0;top:8px;z-index:2;height:0;border-left:8px solid transparent;border-bottom:8px solid #fff}.date-picker-wrapper .gap .gap-top-mask{width:6px;height:1px;position:absolute;top:-1px;left:1px;background-color:#eee;z-index:3}.date-picker-wrapper .gap .gap-bottom-mask{width:6px;height:1px;position:absolute;bottom:-1px;left:7px;background-color:#eee;z-index:3}.date-picker-wrapper .selected-days{display:none}.date-picker-wrapper .drp_top-bar{line-height:1.4;position:relative;padding:10px 40px 10px 0}.date-picker-wrapper .drp_top-bar .error-top,.date-picker-wrapper .drp_top-bar .normal-top{display:none}.date-picker-wrapper .drp_top-bar .default-top{display:block}.date-picker-wrapper .drp_top-bar.error .default-top{display:none}.date-picker-wrapper .drp_top-bar.error .error-top{display:block;color:red}.date-picker-wrapper .drp_top-bar.normal .default-top{display:none}.date-picker-wrapper .drp_top-bar.normal .normal-top{display:block}.date-picker-wrapper .drp_top-bar.normal .normal-top .selection-top{color:#333}.date-picker-wrapper .drp_top-bar .apply-btn{position:absolute;right:0;top:6px;padding:3px 5px;margin:0;font-size:12px;border-radius:4px;cursor:pointer;color:#d9eef7;border:solid 1px #0076a3;background:#0095cd;background:-moz-linear-gradient(top,#00adee,#0078a5);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00adee', endColorstr='#0078a5');color:#fff;line-height:initial}.date-picker-wrapper .drp_top-bar .apply-btn.disabled{cursor:pointer;color:#606060;border:solid 1px #b7b7b7;background:#fff;background:-moz-linear-gradient(top,#fff,#ededed);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#ededed')}.date-picker-wrapper .time{position:relative}.date-picker-wrapper.single-month .time{display:block}.date-picker-wrapper .time input[type=range]{vertical-align:middle;width:129px;padding:0;margin:0;height:20px}.date-picker-wrapper .time1{width:180px;padding:0 5px;text-align:center}.time2{width:180px;padding:0 5px;text-align:center}.date-picker-wrapper .time1{float:left}.date-picker-wrapper .time2{float:right}.date-picker-wrapper .hour{text-align:right}.minute{text-align:right}.date-picker-wrapper .hide{display:none}.date-picker-wrapper .first-date-selected,.date-picker-wrapper .last-date-selected{background-color:#49e!important;color:#fff!important}.date-picker-wrapper .date-range-length-tip{position:absolute;margin-top:-4px;margin-left:-8px;-webkit-box-shadow:0 0 3px rgba(0,0,0,.3);box-shadow:0 0 3px rgba(0,0,0,.3);display:none;background-color:#ff0;padding:0 6px;border-radius:2px;font-size:12px;line-height:16px;-webkit-filter:drop-shadow(0 0 3px rgba(0, 0, 0, .3));-moz-filter:drop-shadow(0 0 3px rgba(0, 0, 0, .3));-ms-filter:drop-shadow(0 0 3px rgba(0, 0, 0, .3));-o-filter:drop-shadow(0 0 3px rgba(0, 0, 0, .3));filter:drop-shadow(0 0 3px rgba(0, 0, 0, .3))}.date-picker-wrapper .date-range-length-tip:after{content:'';position:absolute;border-left:4px solid transparent;border-right:4px solid transparent;border-top:4px solid #ff0;left:50%;margin-left:-4px;bottom:-4px}.date-picker-wrapper.two-months.no-gap .month1 .next,.date-picker-wrapper.two-months.no-gap .month2 .prev{display:none}.date-picker-wrapper .week-number{padding:5px 0;line-height:1;font-size:12px;margin-bottom:1px;color:#999;cursor:pointer}.date-picker-wrapper .week-number.week-number-selected{color:#49e;font-weight:700} \ No newline at end of file diff --git a/js/daterangepicker/jquery.daterangepicker.min.js b/js/daterangepicker/jquery.daterangepicker.min.js new file mode 100755 index 000000000..508ddcce6 --- /dev/null +++ b/js/daterangepicker/jquery.daterangepicker.min.js @@ -0,0 +1,7 @@ +/** + * jquery-date-range-picker + * @version v0.21.1 + * @link https://github.com/longbill/jquery-date-range-picker + * @license MIT + */ +!function(e){"function"==typeof define&&define.amd?define(["jquery","moment"],e):"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("jquery"),require("moment")):e(jQuery,moment)}(function(U,Q){"use strict";U.dateRangePickerLanguages={default:{selected:"Selected:",day:"Day",days:"Days",apply:"Close","week-1":"mo","week-2":"tu","week-3":"we","week-4":"th","week-5":"fr","week-6":"sa","week-7":"su","week-number":"W","month-name":["january","february","march","april","may","june","july","august","september","october","november","december"],shortcuts:"Shortcuts","custom-values":"Custom Values",past:"Past",following:"Following",previous:"Previous","prev-week":"Week","prev-month":"Month","prev-year":"Year",next:"Next","next-week":"Week","next-month":"Month","next-year":"Year","less-than":"Date range should not be more than %d days","more-than":"Date range should not be less than %d days","default-more":"Please select a date range longer than %d days","default-single":"Please select a date","default-less":"Please select a date range less than %d days","default-range":"Please select a date range between %d and %d days","default-default":"Please select a date range",time:"Time",hour:"Hour",minute:"Minute"},id:{selected:"Terpilih:",day:"Hari",days:"Hari",apply:"Tutup","week-1":"sen","week-2":"sel","week-3":"rab","week-4":"kam","week-5":"jum","week-6":"sab","week-7":"min","week-number":"W","month-name":["januari","februari","maret","april","mei","juni","juli","agustus","september","oktober","november","desember"],shortcuts:"Pintas","custom-values":"Nilai yang ditentukan",past:"Yang Lalu",following:"Mengikuti",previous:"Sebelumnya","prev-week":"Minggu","prev-month":"Bulan","prev-year":"Tahun",next:"Selanjutnya","next-week":"Minggu","next-month":"Bulan","next-year":"Tahun","less-than":"Tanggal harus lebih dari %d hari","more-than":"Tanggal harus kurang dari %d hari","default-more":"Jarak tanggal harus lebih lama dari %d hari","default-single":"Silakan pilih tanggal","default-less":"Jarak rentang tanggal tidak boleh lebih lama dari %d hari","default-range":"Rentang tanggal harus antara %d dan %d hari","default-default":"Silakan pilih rentang tanggal",time:"Waktu",hour:"Jam",minute:"Menit"},az:{selected:"Seçildi:",day:" gün",days:" gün",apply:"tətbiq","week-1":"1","week-2":"2","week-3":"3","week-4":"4","week-5":"5","week-6":"6","week-7":"7","month-name":["yanvar","fevral","mart","aprel","may","iyun","iyul","avqust","sentyabr","oktyabr","noyabr","dekabr"],shortcuts:"Qısayollar",past:"Keçmiş",following:"Növbəti",previous:"   ","prev-week":"Öncəki həftə","prev-month":"Öncəki ay","prev-year":"Öncəki il",next:"   ","next-week":"Növbəti həftə","next-month":"Növbəti ay","next-year":"Növbəti il","less-than":"Tarix aralığı %d gündən çox olmamalıdır","more-than":"Tarix aralığı %d gündən az olmamalıdır","default-more":"%d gündən çox bir tarix seçin","default-single":"Tarix seçin","default-less":"%d gündən az bir tarix seçin","default-range":"%d və %d gün aralığında tarixlər seçin","default-default":"Tarix aralığı seçin"},bg:{selected:"Избрано:",day:"Ден",days:"Дни",apply:"Затвори","week-1":"пн","week-2":"вт","week-3":"ср","week-4":"чт","week-5":"пт","week-6":"сб","week-7":"нд","week-number":"С","month-name":["януари","февруари","март","април","май","юни","юли","август","септември","октомври","ноември","декември"],shortcuts:"Преки пътища","custom-values":"Персонализирани стойности",past:"Минал",following:"Следващ",previous:"Предишен","prev-week":"Седмица","prev-month":"Месец","prev-year":"Година",next:"Следващ","next-week":"Седмица","next-month":"Месец","next-year":"Година","less-than":"Периодът от време не трябва да е повече от %d дни","more-than":"Периодът от време не трябва да е по-малко от %d дни","default-more":"Моля изберете период по-дълъг от %d дни","default-single":"Моля изберете дата","default-less":"Моля изберете период по-къс от %d дни","default-range":"Моля изберете период между %d и %d дни","default-default":"Моля изберете период",time:"Време",hour:"Час",minute:"Минута"},cn:{selected:"已选择:",day:"天",days:"天",apply:"确定","week-1":"一","week-2":"二","week-3":"三","week-4":"四","week-5":"五","week-6":"六","week-7":"日","week-number":"周","month-name":["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],shortcuts:"快捷选择",past:"过去",following:"将来",previous:"   ","prev-week":"上周","prev-month":"上个月","prev-year":"去年",next:"   ","next-week":"下周","next-month":"下个月","next-year":"明年","less-than":"所选日期范围不能大于%d天","more-than":"所选日期范围不能小于%d天","default-more":"请选择大于%d天的日期范围","default-less":"请选择小于%d天的日期范围","default-range":"请选择%d天到%d天的日期范围","default-single":"请选择一个日期","default-default":"请选择一个日期范围",time:"时间",hour:"小时",minute:"分钟"},cz:{selected:"Vybráno:",day:"Den",days:"Dny",apply:"Zavřít","week-1":"po","week-2":"út","week-3":"st","week-4":"čt","week-5":"pá","week-6":"so","week-7":"ne","month-name":["leden","únor","březen","duben","květen","červen","červenec","srpen","září","říjen","listopad","prosinec"],shortcuts:"Zkratky",past:"po",following:"následující",previous:"předchozí","prev-week":"týden","prev-month":"měsíc","prev-year":"rok",next:"další","next-week":"týden","next-month":"měsíc","next-year":"rok","less-than":"Rozsah data by neměl být větší než %d dnů","more-than":"Rozsah data by neměl být menší než %d dnů","default-more":"Prosím zvolte rozsah data větší než %d dnů","default-single":"Prosím zvolte datum","default-less":"Prosím zvolte rozsah data menší než %d dnů","default-range":"Prosím zvolte rozsah data mezi %d a %d dny","default-default":"Prosím zvolte rozsah data"},de:{selected:"Auswahl:",day:"Tag",days:"Tage",apply:"Schließen","week-1":"mo","week-2":"di","week-3":"mi","week-4":"do","week-5":"fr","week-6":"sa","week-7":"so","month-name":["januar","februar","märz","april","mai","juni","juli","august","september","oktober","november","dezember"],shortcuts:"Schnellwahl",past:"Vorherige",following:"Folgende",previous:"Vorherige","prev-week":"Woche","prev-month":"Monat","prev-year":"Jahr",next:"Nächste","next-week":"Woche","next-month":"Monat","next-year":"Jahr","less-than":"Datumsbereich darf nicht größer sein als %d Tage","more-than":"Datumsbereich darf nicht kleiner sein als %d Tage","default-more":"Bitte mindestens %d Tage auswählen","default-single":"Bitte ein Datum auswählen","default-less":"Bitte weniger als %d Tage auswählen","default-range":"Bitte einen Datumsbereich zwischen %d und %d Tagen auswählen","default-default":"Bitte ein Start- und Enddatum auswählen",Time:"Zeit",hour:"Stunde",minute:"Minute"},es:{selected:"Seleccionado:",day:"Día",days:"Días",apply:"Cerrar","week-1":"lu","week-2":"ma","week-3":"mi","week-4":"ju","week-5":"vi","week-6":"sa","week-7":"do","month-name":["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre"],shortcuts:"Accesos directos",past:"Pasado",following:"Siguiente",previous:"Anterior","prev-week":"Semana","prev-month":"Mes","prev-year":"Año",next:"Siguiente","next-week":"Semana","next-month":"Mes","next-year":"Año","less-than":"El rango no debería ser mayor de %d días","more-than":"El rango no debería ser menor de %d días","default-more":"Por favor selecciona un rango mayor a %d días","default-single":"Por favor selecciona un día","default-less":"Por favor selecciona un rango menor a %d días","default-range":"Por favor selecciona un rango entre %d y %d días","default-default":"Por favor selecciona un rango de fechas."},fr:{selected:"Sélection:",day:"Jour",days:"Jours",apply:"Fermer","week-1":"lu","week-2":"ma","week-3":"me","week-4":"je","week-5":"ve","week-6":"sa","week-7":"di","month-name":["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre"],shortcuts:"Raccourcis",past:"Passé",following:"Suivant",previous:"Précédent","prev-week":"Semaine","prev-month":"Mois","prev-year":"Année",next:"Suivant","next-week":"Semaine","next-month":"Mois","next-year":"Année","less-than":"L'intervalle ne doit pas être supérieure à %d jours","more-than":"L'intervalle ne doit pas être inférieure à %d jours","default-more":"Merci de choisir une intervalle supérieure à %d jours","default-single":"Merci de choisir une date","default-less":"Merci de choisir une intervalle inférieure %d jours","default-range":"Merci de choisir une intervalle comprise entre %d et %d jours","default-default":"Merci de choisir une date"},hu:{selected:"Kiválasztva:",day:"Nap",days:"Nap",apply:"Ok","week-1":"h","week-2":"k","week-3":"sz","week-4":"cs","week-5":"p","week-6":"sz","week-7":"v","month-name":["január","február","március","április","május","június","július","augusztus","szeptember","október","november","december"],shortcuts:"Gyorsválasztó",past:"Múlt",following:"Következő",previous:"Előző","prev-week":"Hét","prev-month":"Hónap","prev-year":"Év",next:"Következő","next-week":"Hét","next-month":"Hónap","next-year":"Év","less-than":"A kiválasztás nem lehet több %d napnál","more-than":"A kiválasztás nem lehet több %d napnál","default-more":"Válassz ki egy időszakot ami hosszabb mint %d nap","default-single":"Válassz egy napot","default-less":"Válassz ki egy időszakot ami rövidebb mint %d nap","default-range":"Válassz ki egy %d - %d nap hosszú időszakot","default-default":"Válassz ki egy időszakot"},it:{selected:"Selezionati:",day:"Giorno",days:"Giorni",apply:"Chiudi","week-1":"lu","week-2":"ma","week-3":"me","week-4":"gi","week-5":"ve","week-6":"sa","week-7":"do","month-name":["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre"],shortcuts:"Scorciatoie",past:"Scorso",following:"Successivo",previous:"Precedente","prev-week":"Settimana","prev-month":"Mese","prev-year":"Anno",next:"Prossimo","next-week":"Settimana","next-month":"Mese","next-year":"Anno","less-than":"L'intervallo non dev'essere maggiore di %d giorni","more-than":"L'intervallo non dev'essere minore di %d giorni","default-more":"Seleziona un intervallo maggiore di %d giorni","default-single":"Seleziona una data","default-less":"Seleziona un intervallo minore di %d giorni","default-range":"Seleziona un intervallo compreso tra i %d e i %d giorni","default-default":"Seleziona un intervallo di date"},ko:{selected:"기간:",day:"일",days:"일간",apply:"닫기","week-1":"월","week-2":"화","week-3":"수","week-4":"목","week-5":"금","week-6":"토","week-7":"일","week-number":"주","month-name":["1월","2월","3월","4월","5월","6월","7월","8월","9월","10월","11월","12월"],shortcuts:"단축키들",past:"지난(오늘기준)",following:"이후(오늘기준)",previous:"이전","prev-week":"1주","prev-month":"1달","prev-year":"1년",next:"다음","next-week":"1주","next-month":"1달","next-year":"1년","less-than":"날짜 범위는 %d 일보다 많을 수 없습니다","more-than":"날짜 범위는 %d 일보다 작을 수 없습니다","default-more":"날짜 범위를 %d 일보다 길게 선택해 주세요","default-single":"날짜를 선택해 주세요","default-less":"%d 일보다 작은 날짜를 선택해 주세요","default-range":"%d와 %d 일 사이의 날짜 범위를 선택해 주세요","default-default":"날짜 범위를 선택해 주세요",time:"시각",hour:"시",minute:"분"},no:{selected:"Valgt:",day:"Dag",days:"Dager",apply:"Lukk","week-1":"ma","week-2":"ti","week-3":"on","week-4":"to","week-5":"fr","week-6":"lø","week-7":"sø","month-name":["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember"],shortcuts:"Snarveier","custom-values":"Egendefinerte Verdier",past:"Over",following:"Følger",previous:"Forrige","prev-week":"Uke","prev-month":"Måned","prev-year":"År",next:"Neste","next-week":"Uke","next-month":"Måned","next-year":"År","less-than":"Datoperioden skal ikkje være lengre enn %d dager","more-than":"Datoperioden skal ikkje være kortere enn %d dager","default-more":"Vennligst velg ein datoperiode lengre enn %d dager","default-single":"Vennligst velg ein dato","default-less":"Vennligst velg ein datoperiode mindre enn %d dager","default-range":"Vennligst velg ein datoperiode mellom %d og %d dager","default-default":"Vennligst velg ein datoperiode",time:"Tid",hour:"Time",minute:"Minutter"},nl:{selected:"Geselecteerd:",day:"Dag",days:"Dagen",apply:"Ok","week-1":"ma","week-2":"di","week-3":"wo","week-4":"do","week-5":"vr","week-6":"za","week-7":"zo","month-name":["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december"],shortcuts:"Snelkoppelingen","custom-values":"Aangepaste waarden",past:"Verleden",following:"Komend",previous:"Vorige","prev-week":"Week","prev-month":"Maand","prev-year":"Jaar",next:"Volgende","next-week":"Week","next-month":"Maand","next-year":"Jaar","less-than":"Interval moet langer dan %d dagen zijn","more-than":"Interval mag niet minder dan %d dagen zijn","default-more":"Selecteer een interval langer dan %dagen","default-single":"Selecteer een datum","default-less":"Selecteer een interval minder dan %d dagen","default-range":"Selecteer een interval tussen %d en %d dagen","default-default":"Selecteer een interval",time:"Tijd",hour:"Uur",minute:"Minuut"},ru:{selected:"Выбрано:",day:"День",days:"Дней",apply:"Применить","week-1":"пн","week-2":"вт","week-3":"ср","week-4":"чт","week-5":"пт","week-6":"сб","week-7":"вс","month-name":["январь","февраль","март","апрель","май","июнь","июль","август","сентябрь","октябрь","ноябрь","декабрь"],shortcuts:"Быстрый выбор","custom-values":"Пользовательские значения",past:"Прошедшие",following:"Следующие",previous:"   ","prev-week":"Неделя","prev-month":"Месяц","prev-year":"Год",next:"   ","next-week":"Неделя","next-month":"Месяц","next-year":"Год","less-than":"Диапазон не может быть больше %d дней","more-than":"Диапазон не может быть меньше %d дней","default-more":"Пожалуйста выберите диапазон больше %d дней","default-single":"Пожалуйста выберите дату","default-less":"Пожалуйста выберите диапазон меньше %d дней","default-range":"Пожалуйста выберите диапазон между %d и %d днями","default-default":"Пожалуйста выберите диапазон",time:"Время",hour:"Часы",minute:"Минуты"},uk:{selected:"Вибрано:",day:"День",days:"Днів",apply:"Застосувати","week-1":"пн","week-2":"вт","week-3":"ср","week-4":"чт","week-5":"пт","week-6":"сб","week-7":"нд","month-name":["січень","лютий","березень","квітень","травень","червень","липень","серпень","вересень","жовтень","листопад","грудень"],shortcuts:"Швидкий вибір","custom-values":"Значення користувача",past:"Минулі",following:"Наступні",previous:"   ","prev-week":"Тиждень","prev-month":"Місяць","prev-year":"Рік",next:"   ","next-week":"Тиждень","next-month":"Місяць","next-year":"Рік","less-than":"Діапазон не може бути більш ніж %d днів","more-than":"Діапазон не може бути меньш ніж %d днів","default-more":"Будь ласка виберіть діапазон більше %d днів","default-single":"Будь ласка виберіть дату","default-less":"Будь ласка виберіть діапазон менше %d днів","default-range":"Будь ласка виберіть діапазон між %d та %d днями","default-default":"Будь ласка виберіть діапазон",time:"Час",hour:"Години",minute:"Хвилини"},pl:{selected:"Wybrany:",day:"Dzień",days:"Dni",apply:"Zamknij","week-1":"pon","week-2":"wt","week-3":"śr","week-4":"czw","week-5":"pt","week-6":"so","week-7":"nd","month-name":["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień"],shortcuts:"Skróty","custom-values":"Niestandardowe wartości",past:"Przeszłe",following:"Następne",previous:"Poprzednie","prev-week":"tydzień","prev-month":"miesiąc","prev-year":"rok",next:"Następny","next-week":"tydzień","next-month":"miesiąc","next-year":"rok","less-than":"Okres nie powinien być dłuższy niż %d dni","more-than":"Okres nie powinien być krótszy niż %d ni","default-more":"Wybierz okres dłuższy niż %d dni","default-single":"Wybierz datę","default-less":"Wybierz okres krótszy niż %d dni","default-range":"Wybierz okres trwający od %d do %d dni","default-default":"Wybierz okres",time:"Czas",hour:"Godzina",minute:"Minuta"},se:{selected:"Vald:",day:"dag",days:"dagar",apply:"godkänn","week-1":"ma","week-2":"ti","week-3":"on","week-4":"to","week-5":"fr","week-6":"lö","week-7":"sö","month-name":["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december"],shortcuts:"genvägar","custom-values":"Anpassade värden",past:"över",following:"följande",previous:"förra","prev-week":"vecka","prev-month":"månad","prev-year":"år",next:"nästa","next-week":"vecka","next-month":"måned","next-year":"år","less-than":"Datumintervall bör inte vara mindre än %d dagar","more-than":"Datumintervall bör inte vara mer än %d dagar","default-more":"Välj ett datumintervall längre än %d dagar","default-single":"Välj ett datum","default-less":"Välj ett datumintervall mindre än %d dagar","default-range":"Välj ett datumintervall mellan %d och %d dagar","default-default":"Välj ett datumintervall",time:"tid",hour:"timme",minute:"minut"},pt:{selected:"Selecionado:",day:"Dia",days:"Dias",apply:"Fechar","week-1":"seg","week-2":"ter","week-3":"qua","week-4":"qui","week-5":"sex","week-6":"sab","week-7":"dom","week-number":"N","month-name":["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro"],shortcuts:"Atalhos","custom-values":"Valores Personalizados",past:"Passado",following:"Seguinte",previous:"Anterior","prev-week":"Semana","prev-month":"Mês","prev-year":"Ano",next:"Próximo","next-week":"Próxima Semana","next-month":"Próximo Mês","next-year":"Próximo Ano","less-than":"O período selecionado não deve ser maior que %d dias","more-than":"O período selecionado não deve ser menor que %d dias","default-more":"Selecione um período superior a %d dias","default-single":"Selecione uma data","default-less":"Selecione um período inferior a %d dias","default-range":"Selecione um período de %d a %d dias","default-default":"Selecione um período",time:"Tempo",hour:"Hora",minute:"Minuto"},tc:{selected:"已選擇:",day:"天",days:"天",apply:"確定","week-1":"一","week-2":"二","week-3":"三","week-4":"四","week-5":"五","week-6":"六","week-7":"日","week-number":"週","month-name":["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"],shortcuts:"快速選擇",past:"過去",following:"將來",previous:"   ","prev-week":"上週","prev-month":"上個月","prev-year":"去年",next:"   ","next-week":"下週","next-month":"下個月","next-year":"明年","less-than":"所選日期範圍不能大於%d天","more-than":"所選日期範圍不能小於%d天","default-more":"請選擇大於%d天的日期範圍","default-less":"請選擇少於%d天的日期範圍","default-range":"請選擇%d天到%d天的日期範圍","default-single":"請選擇一個日期","default-default":"請選擇一個日期範圍",time:"日期",hour:"小時",minute:"分鐘"},ja:{selected:"選択しました:",day:"日",days:"日",apply:"確定","week-1":"月","week-2":"火","week-3":"水","week-4":"木","week-5":"金","week-6":"土","week-7":"日","month-name":["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月"],shortcuts:"クイック選択",past:"過去",following:"将来",previous:"   ","prev-week":"先週","prev-month":"先月","prev-year":"昨年",next:"   ","next-week":"来週","next-month":"来月","next-year":"来年","less-than":"日付の範囲は%d日以上にすべきではありません","more-than":"日付の範囲は%d日を下回ってはいけません","default-more":"%d日よりも長い期間を選択してください","default-less":"%d日未満の期間を選択してください","default-range":"%d日と%d日の間の日付範囲を選択してください","default-single":"日付を選択してください","default-default":"日付範囲を選択してください",time:"時間",hour:"時間",minute:"分"},da:{selected:"Valgt:",day:"Dag",days:"Dage",apply:"Luk","week-1":"ma","week-2":"ti","week-3":"on","week-4":"to","week-5":"fr","week-6":"lø","week-7":"sø","month-name":["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december"],shortcuts:"genveje","custom-values":"Brugerdefinerede værdier",past:"Forbi",following:"Følgende",previous:"Forrige","prev-week":"uge","prev-month":"måned","prev-year":"år",next:"Næste","next-week":"uge","next-month":"måned","next-year":"år","less-than":"Dato interval bør ikke være med end %d dage","more-than":"Dato interval bør ikke være mindre end %d dage","default-more":"Vælg datointerval længere end %d dage","default-single":"Vælg dato","default-less":"Vælg datointerval mindre end %d dage","default-range":"Vælg datointerval mellem %d og %d dage","default-default":"Vælg datointerval",time:"tid",hour:"time",minute:"minut"},fi:{selected:"Valittu:",day:"Päivä",days:"Päivää",apply:"Sulje","week-1":"ma","week-2":"ti","week-3":"ke","week-4":"to","week-5":"pe","week-6":"la","week-7":"su","week-number":"V","month-name":["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu"],shortcuts:"Pikavalinnat","custom-values":"Mukautetut Arvot",past:"Menneet",following:"Tulevat",previous:"Edellinen","prev-week":"Viikko","prev-month":"Kuukausi","prev-year":"Vuosi",next:"Seuraava","next-week":"Viikko","next-month":"Kuukausi","next-year":"Vuosi","less-than":"Aikajakson tulisi olla vähemmän kuin %d päivää","more-than":"Aikajakson ei tulisi olla vähempää kuin %d päivää","default-more":"Valitse pidempi aikajakso kuin %d päivää","default-single":"Valitse päivä","default-less":"Valitse lyhyempi aikajakso kuin %d päivää","default-range":"Valitse aikajakso %d ja %d päivän väliltä","default-default":"Valitse aikajakso",time:"Aika",hour:"Tunti",minute:"Minuutti"},cat:{selected:"Seleccionats:",day:"Dia",days:"Dies",apply:"Tanca","week-1":"Dl","week-2":"Dm","week-3":"Dc","week-4":"Dj","week-5":"Dv","week-6":"Ds","week-7":"Dg","week-number":"S","month-name":["gener","febrer","març","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre"],shortcuts:"Dreçeres","custom-values":"Valors personalitzats",past:"Passat",following:"Futur",previous:"Anterior","prev-week":"Setmana","prev-month":"Mes","prev-year":"Any",next:"Següent","next-week":"Setmana","next-month":"Mes","next-year":"Any","less-than":"El període no hauria de ser de més de %d dies","more-than":"El període no hauria de ser de menys de %d dies","default-more":"Perfavor selecciona un període més gran de %d dies","default-single":"Perfavor selecciona una data","default-less":"Perfavor selecciona un període de menys de %d dies","default-range":"Perfavor selecciona un període d'entre %d i %d dies","default-default":"Perfavor selecciona un període",time:"Temps",hour:"Hora",minute:"Minut"},sk:{selected:"Vybrané:",day:"Deň",days:"Dni",apply:"Zavrieť","week-1":"po","week-2":"út","week-3":"st","week-4":"št","week-5":"pi","week-6":"so","week-7":"ne","week-number":"T","month-name":["január","február","marec","apríl","máj","jún","júl","august","september","október","november","december"],shortcuts:"Skratky","custom-values":"Vlastné hodnoty",past:"po",following:"nasledujúci",previous:"predchádzajúci","prev-week":"týždeň","prev-month":"mesiac","prev-year":"rok",next:"ďalší","next-week":"týždeň","next-month":"mesiac","next-year":"rok","less-than":"Rozsah dátumu by nemal byť väčší ako %d dní","more-than":"Rozsah dátumu by nemal byť menší ako %d dní","default-more":"Prosím zvoľte rozsah dlhší ako %d dní","default-single":"Prosím zvoľte dátum","default-less":"Prosím zvoľte rozsah menší ako %d dní","default-range":"Prosím zvoľte rozsah medzi %d a %d dňami","default-default":"Prosím zvoľte rozsah",time:"Čas",hour:"Hodina",minute:"Minúta"}},U.fn.dateRangePicker=function(f){f||(f={}),(f=U.extend(!0,{autoClose:!1,format:"YYYY-MM-DD",separator:" to ",language:"auto",startOfWeek:"sunday",getValue:function(){return U(this).val()},setValue:function(e){U(this).attr("readonly")||U(this).is(":disabled")||e==U(this).val()||U(this).val(e)},startDate:!1,endDate:!1,time:{enabled:!1},minDays:0,maxDays:0,showShortcuts:!1,shortcuts:{},customShortcuts:[],inline:!1,container:"body",alwaysOpen:!1,singleDate:!1,lookBehind:!1,batchMode:!1,duration:200,stickyMonths:!1,dayDivAttrs:[],dayTdAttrs:[],selectForward:!1,selectBackward:!1,applyBtnClass:"",singleMonth:"auto",hoveringTooltip:function(e,t,a){return 1'+f.customTopBar+"
    "):(t+='
    '+K("selected")+' ...',f.singleDate||(t+=' '+f.separator+' ... (3 '+K("days")+")"),t+="
    ",t+='
    error
    default
    '),t+='',t+="
    ");var a=f.showWeekNumbers?6:5,n="<";f.customArrowPrevSymbol&&(n=f.customArrowPrevSymbol);var r=">";if(f.customArrowNextSymbol&&(r=f.customArrowNextSymbol),t+='
    '+E()+"
    '+n+' '+(f.singleDate||!f.stickyMonths?''+r+"":"")+'
    ",f.singleMonth||(t+='
    '+function(){for(var e=['
    '],t=0;t<20;t++)e.push('
    ');return e.push("
    "),e.join("")}()+'
    '+E()+"
    '+(f.stickyMonths?"":''+n+"")+' '+r+'
    "),t+='
    ',f.singleDate||(t+='
    '),t+='
    ',t+='")}().hide()).append('
    '),U(f.container).append(m),f.inline?m.addClass("inline-wrapper"):i();f.alwaysOpen&&m.find(".apply-btn").hide();var e=_();if(G(e),f.time.enabled)if(f.startDate&&f.endDate||f.start&&f.end)Y(Q(f.start||f.startDate).toDate(),"time1"),Y(Q(f.end||f.endDate).toDate(),"time2");else{var a=f.defaultEndTime?f.defaultEndTime:e;Y(e,"time1"),Y(a,"time2")}var n="";n=f.singleDate?K("default-single"):f.minDays&&f.maxDays?K("default-range"):f.minDays?K("default-more"):f.maxDays?K("default-less"):K("default-default");m.find(".default-top").html(n.replace(/\%d/,f.minDays).replace(/\%d/,f.maxDays)),f.singleMonth?m.addClass("single-month"):m.addClass("two-months");setTimeout(function(){l(),s=!0},0),m.on("click",function(e){e.stopPropagation()}),U(document).on("click.datepicker",Z),m.find(".next").on("click",function(){f.stickyMonths?function(e){var t=F(f.month1),a=F(f.month2);if(q(a))return;if(!f.singleDate&&0<=L(t,a))return;O(t,"month1"),O(a,"month2"),C()}():function(e){var t=U(e).parents("table").hasClass("month2"),a=t?f.month2:f.month1;if(a=F(a),!f.singleMonth&&!f.singleDate&&!t&&0<=L(a,f.month2)||q(a))return;O(a,t?"month2":"month1"),I()}(this)}),m.find(".prev").on("click",function(){f.stickyMonths?function(e){var t=R(f.month1),a=R(f.month2);if(q(t))return;if(!f.singleDate&&L(a,t)<=0)return;O(a,"month2"),O(t,"month1"),C()}():function(e){var t=U(e).parents("table").hasClass("month2"),a=t?f.month2:f.month1;if(a=R(a),t&&L(a,f.month1)<=0||q(a))return;O(a,t?"month2":"month1"),I()}(this)}),m.attr("unselectable","on").css("user-select","none").on("selectstart",function(e){return e.preventDefault(),!1}),m.find(".apply-btn").on("click",function(){B();var e=W(new Date(f.start))+f.separator+W(new Date(f.end));U(t).trigger("datepicker-apply",{value:e,date1:new Date(f.start),date2:new Date(f.end)})}),m.find("[custom]").on("click",function(){var e=U(this).attr("custom");f.start=!1,f.end=!1,m.find(".day.checked").removeClass("checked"),f.setValue.call(o,e),M(),S(!0),C(),f.autoClose&&B()}),m.find("[shortcut]").on("click",function(){var e,t=U(this).attr("shortcut"),a=new Date,n=!1;if(-1!=t.indexOf("day")){var r=parseInt(t.split(",",2)[1],10);n=new Date((new Date).getTime()+864e5*r),a=new Date(a.getTime()+864e5*(0f.end){var a=f.end;f.end=v(f.start),f.start=p(a),f.time.enabled&&f.swapTime&&(u("time1",f.start),u("time2",f.end))}f.start=parseInt(f.start),f.end=parseInt(f.end),b(),f.start&&!f.end&&(U(n).trigger("datepicker-first-date-selected",{date1:new Date(f.start)}),y(e)),w(),M(),S(),C(),x()}}function g(e){if(e=parseInt(e,10),f.startDate&&H(e,f.startDate)<0)return!1;if(f.endDate&&0f.maxDays)return!1;if(0f.start)return!1;if(f.beforeShowDay&&"function"==typeof f.beforeShowDay){for(var t=!0,a=e;1f.start&&(a-=864e5),a'+e.attr("data-tooltip")+"";else if(!e.hasClass("invalid"))if(f.singleDate)m.find(".day.hovering").removeClass("hovering"),e.addClass("hovering");else if(m.find(".day").each(function(){var e=parseInt(U(this).attr("time"));f.start,f.end;e==t?U(this).addClass("hovering"):U(this).removeClass("hovering"),f.start&&!f.end&&(f.starte&&t<=e)?U(this).addClass("hovering"):U(this).removeClass("hovering")}),f.start&&!f.end){var n=z(t,f.start);f.hoveringTooltip&&("function"==typeof f.hoveringTooltip?a=f.hoveringTooltip(n,f.start,t):!0===f.hoveringTooltip&&1f.maxDays?(f.start=!1,f.end=!1,m.find(".day").removeClass("checked"),m.find(".drp_top-bar").removeClass("normal").addClass("error").find(".error-top").html(K("less-than").replace("%d",f.maxDays))):f.minDays&&et.getTime()){var n=t;t=e,e=n,n=null}var r=!0;if(f.startDate&&H(e,f.startDate)<0&&(r=!1),f.endDate&&0'+A(a)+"
    ";if(!f.monthSelect)return n;var r=!!f.startDate&&Q(f.startDate).add(f.singleMonth||"month2"!==t?0:1,"month"),s=!!f.endDate&&Q(f.endDate).add(f.singleMonth||"month1"!==t?0:-1,"month"),o=r&&e.isSame(r,"year")?r.get("month"):0,i=s&&e.isSame(s,"year")?s.get("month"):11,d=Math.min(o,a),l=Math.max(i,a);if(d===l)return n;return P("month",V({minSelectable:o,maxSelectable:i,minVisible:d,maxVisible:l},a,function(e){return A(e)}))}(e=Q(e).toDate(),t),n=function(e,t){var a=(e=Q(e)).get("year"),n='
    '+a+"
    ";if(!f.yearSelect)return n;var r=f.yearSelect&&"function"==typeof f.yearSelect,s=!!f.startDate&&Q(f.startDate).add(f.singleMonth||"month2"!==t?0:1,"month"),o=!!f.endDate&&Q(f.endDate).add(f.singleMonth||"month1"!==t?0:-1,"month"),i=r?f.yearSelect(a):f.yearSelect.slice(),d=s?Math.max(i[0],s.get("year")):Math.min(i[0],a),l=o?Math.min(i[1],o.get("year")):Math.max(i[1],a),u=Math.min(d,a),m=Math.max(l,a);if(u===m)return n;return P("year",V({minSelectable:d,maxSelectable:l,minVisible:u,maxVisible:m},a))}(e,t);m.find("."+t+" .month-name").html(a+" "+n),m.find("."+t+" tbody").html(function(e){var t=[];e.setDate(1);new Date(e.getTime()-864e5);var a,n,r=new Date,s=e.getDay();0===s&&"monday"===f.startOfWeek&&(s=7);if(0");for(var i=0;i<7;i++){var m="monday"==f.startOfWeek?i+1:i;a=t[7*u+m];var h=Q(a.time).format("L")==Q(r).format("L");if(a.extraClass="",a.tooltip="",a.valid&&f.beforeShowDay&&"function"==typeof f.beforeShowDay){var c=f.beforeShowDay(Q(a.time).toDate());a.valid=c[0],a.extraClass=c[1]||"",a.tooltip=c[2]||"",""!==a.tooltip&&(a.extraClass+=" has-tooltip ")}var p={time:a.time,"data-tooltip":a.tooltip,class:"day "+a.type+" "+a.extraClass+" "+(a.valid?"valid":"invalid")+" "+(h?"real-today":"")};0===i&&f.showWeekNumbers&&l.push('
    '+f.getWeekNumber(a.date)+"
    "),l.push("
    "+J(a.time,a.day)+"
    ")}l.push("")}return l.join("")}(e)),f[t]=e,w(),m.find(".day").off("click").on("click",function(e){k(U(this))}),m.find(".day").off("mouseenter").on("mouseenter",function(e){y(U(this))}),m.find(".day").off("mouseleave").on("mouseleave",function(e){m.find(".date-range-length-tip").hide(),f.singleDate&&b()}),m.find(".week-number").off("click").on("click",function(e){var t,a,n,r;t=U(this),r=parseInt(t.attr("data-start-time"),10),f.startWeek?(m.find(".week-number-selected").removeClass("week-number-selected"),a=new Date(re.maxSelectable});return n}function P(e,t){for(var a,n='
    "+a+"
    "}function Y(e,t){m.find("."+t).append("
    "+K("Time")+': 00:00
    '),u(t,e)}function A(e){return K("month-name")[e]}function W(e){return Q(e).format(f.format)}function I(){C();var e=parseInt(Q(f.month1).format("YYYYMM")),t=parseInt(Q(f.month2).format("YYYYMM")),a=Math.abs(e-t);1"+K("week-number")+"":"";return"monday"==f.startOfWeek?e+""+K("week-1")+""+K("week-2")+""+K("week-3")+""+K("week-4")+""+K("week-5")+""+K("week-6")+""+K("week-7")+"":e+""+K("week-7")+""+K("week-1")+""+K("week-2")+""+K("week-3")+""+K("week-4")+""+K("week-5")+""+K("week-6")+""}function q(e){return e=Q(e),!(!f.startDate||!e.endOf("month").isBefore(f.startDate))||!(!f.endDate||!e.startOf("month").isAfter(f.endDate))}function $(e,t,r){var s=U.extend(!0,{},e);U.each(t,function(e,t){var a=t(r);for(var n in a)s.hasOwnProperty(n)?s[n]+=a[n]:s[n]=a[n]});var a="";for(var n in s)s.hasOwnProperty(n)&&(a+=n+'="'+s[n]+'" ');return a}function J(e,t){return f.showDateFilter&&"function"==typeof f.showDateFilter?f.showDateFilter(e,t):t}function K(e){var t=e.toLowerCase(),a=e in r?r[e]:t in r?r[t]:null,n=U.dateRangePickerLanguages.default;return null==a&&(a=e in n?n[e]:t in n?n[t]:""),a}function _(){var e=f.defaultTime?f.defaultTime:new Date;return f.lookBehind?(f.startDate&&L(e,f.startDate)<0&&(e=F(Q(f.startDate).toDate())),f.endDate&&0>>0,s=0;sAe(e)?(r=e+1,t-Ae(e)):(r=e,t);return{year:r,dayOfYear:n}}function qe(e,t,n){var s,i,r=ze(e.year(),t,n),r=Math.floor((e.dayOfYear()-r-1)/7)+1;return r<1?s=r+P(i=e.year()-1,t,n):r>P(e.year(),t,n)?(s=r-P(e.year(),t,n),i=e.year()+1):(i=e.year(),s=r),{week:s,year:i}}function P(e,t,n){var s=ze(e,t,n),t=ze(e+1,t,n);return(Ae(e)-s+t)/7}s("w",["ww",2],"wo","week"),s("W",["WW",2],"Wo","isoWeek"),t("week","w"),t("isoWeek","W"),n("week",5),n("isoWeek",5),v("w",p),v("ww",p,w),v("W",p),v("WW",p,w),Te(["w","ww","W","WW"],function(e,t,n,s){t[s.substr(0,1)]=g(e)});function Be(e,t){return e.slice(t,7).concat(e.slice(0,t))}s("d",0,"do","day"),s("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),s("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),s("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),s("e",0,0,"weekday"),s("E",0,0,"isoWeekday"),t("day","d"),t("weekday","e"),t("isoWeekday","E"),n("day",11),n("weekday",11),n("isoWeekday",11),v("d",p),v("e",p),v("E",p),v("dd",function(e,t){return t.weekdaysMinRegex(e)}),v("ddd",function(e,t){return t.weekdaysShortRegex(e)}),v("dddd",function(e,t){return t.weekdaysRegex(e)}),Te(["dd","ddd","dddd"],function(e,t,n,s){s=n._locale.weekdaysParse(e,s,n._strict);null!=s?t.d=s:m(n).invalidWeekday=e}),Te(["d","e","E"],function(e,t,n,s){t[s]=g(e)});var Je="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Qe="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Xe="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Ke=k,et=k,tt=k;function nt(){function e(e,t){return t.length-e.length}for(var t,n,s,i=[],r=[],a=[],o=[],u=0;u<7;u++)s=l([2e3,1]).day(u),t=M(this.weekdaysMin(s,"")),n=M(this.weekdaysShort(s,"")),s=M(this.weekdays(s,"")),i.push(t),r.push(n),a.push(s),o.push(t),o.push(n),o.push(s);i.sort(e),r.sort(e),a.sort(e),o.sort(e),this._weekdaysRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+r.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+i.join("|")+")","i")}function st(){return this.hours()%12||12}function it(e,t){s(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function rt(e,t){return t._meridiemParse}s("H",["HH",2],0,"hour"),s("h",["hh",2],0,st),s("k",["kk",2],0,function(){return this.hours()||24}),s("hmm",0,0,function(){return""+st.apply(this)+r(this.minutes(),2)}),s("hmmss",0,0,function(){return""+st.apply(this)+r(this.minutes(),2)+r(this.seconds(),2)}),s("Hmm",0,0,function(){return""+this.hours()+r(this.minutes(),2)}),s("Hmmss",0,0,function(){return""+this.hours()+r(this.minutes(),2)+r(this.seconds(),2)}),it("a",!0),it("A",!1),t("hour","h"),n("hour",13),v("a",rt),v("A",rt),v("H",p),v("h",p),v("k",p),v("HH",p,w),v("hh",p,w),v("kk",p,w),v("hmm",ge),v("hmmss",we),v("Hmm",ge),v("Hmmss",we),D(["H","HH"],x),D(["k","kk"],function(e,t,n){e=g(e);t[x]=24===e?0:e}),D(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),D(["h","hh"],function(e,t,n){t[x]=g(e),m(n).bigHour=!0}),D("hmm",function(e,t,n){var s=e.length-2;t[x]=g(e.substr(0,s)),t[T]=g(e.substr(s)),m(n).bigHour=!0}),D("hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[x]=g(e.substr(0,s)),t[T]=g(e.substr(s,2)),t[N]=g(e.substr(i)),m(n).bigHour=!0}),D("Hmm",function(e,t,n){var s=e.length-2;t[x]=g(e.substr(0,s)),t[T]=g(e.substr(s))}),D("Hmmss",function(e,t,n){var s=e.length-4,i=e.length-2;t[x]=g(e.substr(0,s)),t[T]=g(e.substr(s,2)),t[N]=g(e.substr(i))});k=de("Hours",!0);var at,ot={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:Ce,monthsShort:Ue,week:{dow:0,doy:6},weekdays:Je,weekdaysMin:Xe,weekdaysShort:Qe,meridiemParse:/[ap]\.?m?\.?/i},R={},ut={};function lt(e){return e&&e.toLowerCase().replace("_","-")}function ht(e){for(var t,n,s,i,r=0;r=t&&function(e,t){for(var n=Math.min(e.length,t.length),s=0;s=t-1)break;t--}r++}return at}function dt(t){var e;if(void 0===R[t]&&"undefined"!=typeof module&&module&&module.exports&&null!=t.match("^[^/\\\\]*$"))try{e=at._abbr,require("./locale/"+t),ct(e)}catch(e){R[t]=null}return R[t]}function ct(e,t){return e&&((t=o(t)?mt(e):ft(e,t))?at=t:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),at._abbr}function ft(e,t){if(null===t)return delete R[e],null;var n,s=ot;if(t.abbr=e,null!=R[e])Q("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),s=R[e]._config;else if(null!=t.parentLocale)if(null!=R[t.parentLocale])s=R[t.parentLocale]._config;else{if(null==(n=dt(t.parentLocale)))return ut[t.parentLocale]||(ut[t.parentLocale]=[]),ut[t.parentLocale].push({name:e,config:t}),null;s=n._config}return R[e]=new K(X(s,t)),ut[e]&&ut[e].forEach(function(e){ft(e.name,e.config)}),ct(e),R[e]}function mt(e){var t;if(!(e=e&&e._locale&&e._locale._abbr?e._locale._abbr:e))return at;if(!a(e)){if(t=dt(e))return t;e=[e]}return ht(e)}function _t(e){var t=e._a;return t&&-2===m(e).overflow&&(t=t[O]<0||11We(t[Y],t[O])?b:t[x]<0||24P(r,u,l)?m(s)._overflowWeeks=!0:null!=h?m(s)._overflowWeekday=!0:(d=$e(r,a,o,u,l),s._a[Y]=d.year,s._dayOfYear=d.dayOfYear)),null!=e._dayOfYear&&(i=bt(e._a[Y],n[Y]),(e._dayOfYear>Ae(i)||0===e._dayOfYear)&&(m(e)._overflowDayOfYear=!0),h=Ze(i,0,e._dayOfYear),e._a[O]=h.getUTCMonth(),e._a[b]=h.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=c[t]=n[t];for(;t<7;t++)e._a[t]=c[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[x]&&0===e._a[T]&&0===e._a[N]&&0===e._a[Ne]&&(e._nextDay=!0,e._a[x]=0),e._d=(e._useUTC?Ze:je).apply(null,c),r=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[x]=24),e._w&&void 0!==e._w.d&&e._w.d!==r&&(m(e).weekdayMismatch=!0)}}function Tt(e){if(e._f===f.ISO_8601)St(e);else if(e._f===f.RFC_2822)Ot(e);else{e._a=[],m(e).empty=!0;for(var t,n,s,i,r,a=""+e._i,o=a.length,u=0,l=ae(e._f,e._locale).match(te)||[],h=l.length,d=0;de.valueOf():e.valueOf()"}),i.toJSON=function(){return this.isValid()?this.toISOString():null},i.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},i.unix=function(){return Math.floor(this.valueOf()/1e3)},i.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},i.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},i.eraName=function(){for(var e,t=this.localeData().eras(),n=0,s=t.length;nthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},i.isLocal=function(){return!!this.isValid()&&!this._isUTC},i.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},i.isUtc=At,i.isUTC=At,i.zoneAbbr=function(){return this._isUTC?"UTC":""},i.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},i.dates=e("dates accessor is deprecated. Use date instead.",ke),i.months=e("months accessor is deprecated. Use month instead",Ge),i.years=e("years accessor is deprecated. Use year instead",Ie),i.zone=e("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?(this.utcOffset(e="string"!=typeof e?-e:e,t),this):-this.utcOffset()}),i.isDSTShifted=e("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!o(this._isDSTShifted))return this._isDSTShifted;var e,t={};return $(t,this),(t=Nt(t))._a?(e=(t._isUTC?l:W)(t._a),this._isDSTShifted=this.isValid()&&0', + customArrowNextSymbol: '', + getValue: function() + { + return $(this).find('span').html(); + }, + setValue: function(s, s1, s2) { + if (s) { + $(this).find('span').html(s.replace('to', '  ')); + } else { + $(this).find('span').html( + RangePickerCheckin + '    ' + RangePickerCheckout + ); + } + } + } + $.each(opt, function(index) { + delete custom_opt[index]; + }); + + $.extend(true, opt, custom_opt); + + } + + var args = Array.prototype.slice.call(arguments,0); + return dateRangePickerOrg.apply(this, args); + } +})(jQuery); \ No newline at end of file diff --git a/js/validate.js b/js/validate.js index 85b041fbb..b8c011e0e 100644 --- a/js/validate.js +++ b/js/validate.js @@ -184,9 +184,7 @@ function validate_field(that) var selector = '#id_country'; if ($(that).attr('name') == 'postcode_invoice') selector += '_invoice'; - var id_country = $(selector + ' option:selected').val(); - if (typeof(countriesNeedZipCode[id_country]) != 'undefined' && typeof(countries[id_country]) != 'undefined') var result = window['validate_'+$(that).attr('data-validate')]($(that).val(), countriesNeedZipCode[id_country], countries[id_country]['iso_code']); } diff --git a/modules/blockcart/ajax-cart.js b/modules/blockcart/ajax-cart.js index d92610635..a355d77bc 100644 --- a/modules/blockcart/ajax-cart.js +++ b/modules/blockcart/ajax-cart.js @@ -134,26 +134,28 @@ var ajaxCart = { var dateFrom = $(this).attr('cat_rm_check_in'); var dateTo = $(this).attr('cat_rm_check_out'); - + var occupancy = getBookingOccupancyDetails($(this).closest('.booking_room_fields')); /* By Webkul * Note : In our case minimalQuantity is taken from Qty. field */ // var minimalQuantity = parseInt($(this).data('minimal_quantity')); - var minimalQuantity = parseInt($(this).data('minimal_quantity')); - var minimalQuantity = $("#cat_quantity_wanted_" + idProduct).val(); - if (!minimalQuantity) - minimalQuantity = 1; - if ($(this).prop('disabled') != 'disabled') - ajaxCart.add(idProduct, idProductAttribute, false, this, minimalQuantity, null, dateFrom, dateTo); + // var minimalQuantity = parseInt($(this).data('minimal_quantity')); + // var minimalQuantity = $("#quantity_wanted_" + idProduct).val(); + // if (!minimalQuantity) + // minimalQuantity = 1; + if ($(this).prop('disabled') != 'disabled' && occupancy) + ajaxCart.add(idProduct, idProductAttribute, false, this, occupancy, null, dateFrom, dateTo); }); //for product page 'add' button... if ($('.cart_block').length) { - $(document).off('click', '#add_to_cart button').on('click', '#add_to_cart button', function(e) { + $(document).off('click', '#add_to_cartadd_to_cart button').on('click', '#add_to_cart button', function(e) { e.preventDefault(); - var date_from = $.datepicker.formatDate('yy-mm-dd', $.datepicker.parseDate(ajaxCart.dateFormat, $('#room_check_in').val())); - var date_to = $.datepicker.formatDate('yy-mm-dd', $.datepicker.parseDate(ajaxCart.dateFormat, $('#room_check_out').val())); - ajaxCart.add($('#product_page_product_id').val(), $('#idCombination').val(), true, null, $('#quantity_wanted').val(), null, date_from, date_to); - + var date_from = $.datepicker.formatDate('yy-mm-dd', $.datepicker.parseDate('yy-mm-dd', $('#room_check_in').val())); + var date_to = $.datepicker.formatDate('yy-mm-dd', $.datepicker.parseDate('yy-mm-dd', $('#room_check_out').val())); + var occupancy = getBookingOccupancyDetails($(this).closest('.booking_room_fields')); + if (occupancy) { + ajaxCart.add($('#product_page_product_id').val(), $('#idCombination').val(), true, null, occupancy, null, date_from, date_to); + } }); } @@ -214,8 +216,8 @@ var ajaxCart = { /*by webkul*/ if (pagename == 'product') { - dateFrom = $.datepicker.formatDate('yy-mm-dd', $.datepicker.parseDate(ajaxCart.dateFormat, $('#room_check_in').val())); - dateTo = $.datepicker.formatDate('yy-mm-dd', $.datepicker.parseDate(ajaxCart.dateFormat, $('#room_check_out').val())); + dateFrom = $.datepicker.formatDate('yy-mm-dd', $.datepicker.parseDate('yy-mm-dd', $('#room_check_in').val())); + dateTo = $.datepicker.formatDate('yy-mm-dd', $.datepicker.parseDate('yy-mm-dd', $('#room_check_out').val())); } else if (pagename == 'category') { dateFrom = $('#check_in_time').val(); dateTo = $('#check_out_time').val(); @@ -319,7 +321,7 @@ var ajaxCart = { // close fancybox updateFancyBox: function() {}, // add a product in the cart via ajax - add: function(idProduct, idCombination, addedFromProductPage, callerElement, quantity, whishlist, dateFrom, dateTo) { + add: function(idProduct, idCombination, addedFromProductPage, callerElement, occupancy, whishlist, dateFrom, dateTo) { if (addedFromProductPage && !checkCustomizations()) { if (contentOnly) { @@ -346,8 +348,9 @@ var ajaxCart = { if (addedFromProductPage) { $('#add_to_cart button').prop('disabled', 'disabled').addClass('disabled'); $('.filled').removeClass('filled'); - } else + } else { $(callerElement).prop('disabled', 'disabled'); + } if ($('.cart_block_list').hasClass('collapsed')) this.expand(); @@ -365,7 +368,7 @@ var ajaxCart = { async: true, cache: false, dataType: "json", - data: 'controller=cart&add=1&dateFrom=' + dateFrom + '&dateTo=' + dateTo + '&ajax=true&qty=' + ((quantity && quantity != null) ? quantity : '1') + '&id_product=' + idProduct + '&roomDemands=' + JSON.stringify(roomDemands) + '&token=' + static_token + ((parseInt(idCombination) && idCombination != null) ? '&ipa=' + parseInt(idCombination) : '' + '&id_customization=' + ((typeof customizationId !== 'undefined') ? customizationId : 0)), + data: 'controller=cart&add=1&dateFrom=' + dateFrom + '&dateTo=' + dateTo + '&ajax=true&occupancy=' + JSON.stringify(occupancy) + '&id_product=' + idProduct + '&roomDemands=' + JSON.stringify(roomDemands) + '&token=' + static_token + ((parseInt(idCombination) && idCombination != null) ? '&ipa=' + parseInt(idCombination) : '' + '&id_customization=' + ((typeof customizationId !== 'undefined') ? customizationId : 0)), success: function(jsonData, textStatus, jqXHR) { /*by webkul checking and setting availability of rooms*/ /*for product page add to cart quantity management*/ @@ -375,7 +378,7 @@ var ajaxCart = { } else { $('.num_quantity_alert').hide(); } - $("#max_avail_type_qty").val(jsonData.avail_rooms); + $(".max_avail_type_qty").val(jsonData.avail_rooms); $(".num_searched_avail_rooms").text(jsonData.avail_rooms); if (jsonData.avail_rooms == 0) { @@ -388,18 +391,17 @@ var ajaxCart = { if (pagename == 'category') { if (jsonData.avail_rooms <= room_warning_num) { - $(".cat_remain_rm_qty_" + idProduct).closest('.rm_left').show(); + $(callerElement).closest(".room_cont").find(".rm_left").show(); } else { - $("cat_remain_rm_qty_" + idProduct).closest('.rm_left').hide(); + $(callerElement).closest(".room_cont").find(".rm_left").hide(); } /*for category page add to cart quantity management*/ - - $(".cat_remain_rm_qty_" + idProduct).text(jsonData.avail_rooms); + $(callerElement).closest(".room_cont").find(".remain_rm_qty").text(jsonData.avail_rooms); if (jsonData.avail_rooms == 0) { - $(".cat_remain_rm_qty_" + idProduct).closest('.room_cont').hide(); + $(callerElement).closest(".room_cont").hide(); } - //$('#cat_quantity_wanted_'+idProduct).val(1); + //$('#quantity_wanted_'+idProduct).val(1); } @@ -416,22 +418,27 @@ var ajaxCart = { if (jsonData.crossSelling) $('.crossseling').html(jsonData.crossSelling); - if (idCombination) - $(jsonData.products).each(function() { - if (this.id != undefined && this.id == parseInt(idProduct) && this.idCombination == parseInt(idCombination)) - if (contentOnly) - window.parent.ajaxCart.updateLayer(this); - else - ajaxCart.updateLayer(this); - }); - else - $(jsonData.products).each(function() { - if (this.id != undefined && this.id == parseInt(idProduct)) - if (contentOnly) - window.parent.ajaxCart.updateLayer(this); - else - ajaxCart.updateLayer(this); - }); + // if (idCombination) + // $(jsonData.products).each(function() { + // if (this.id != undefined && this.id == parseInt(idProduct) && this.idCombination == parseInt(idCombination)) + // if (contentOnly) + // window.parent.ajaxCart.updateLayer(this); + // else + // ajaxCart.updateLayer(this); + // }); + // else + // $(jsonData.products).each(function() { + // if (this.id != undefined && this.id == parseInt(idProduct)) + // if (contentOnly) + // window.parent.ajaxCart.updateLayer(this); + // else { + // ajaxCart.updateLayer(this); + // } + // }); + if (jsonData.last_added_product) { + ajaxCart.updateLayer(jsonData.last_added_product); + + } if (contentOnly) parent.$.fancybox.close(); } else { @@ -444,7 +451,9 @@ var ajaxCart = { else $(callerElement).removeProp('disabled'); } - + if (!addedFromProductPage) { + resetOccupancyField($(callerElement).closest('.booking_room_fields').find('.booking_occupancy_wrapper')); + } emptyCustomizations(); }, @@ -505,8 +514,8 @@ var ajaxCart = { /*by webkul checking and setting availability of rooms*/ /*for product page add to cart quantity management*/ if (pagename == 'product') { - var date_checkIn = $.datepicker.formatDate('yy-mm-dd', $.datepicker.parseDate(ajaxCart.dateFormat, $('#room_check_in').val())); - var date_checkOut = $.datepicker.formatDate('yy-mm-dd', $.datepicker.parseDate(ajaxCart.dateFormat, $('#room_check_out').val())); + var date_checkIn = $.datepicker.formatDate('yy-mm-dd', $.datepicker.parseDate('yy-mm-dd', $('#room_check_in').val())); + var date_checkOut = $.datepicker.formatDate('yy-mm-dd', $.datepicker.parseDate('yy-mm-dd', $('#room_check_out').val())); var product_page_id_product = $('#product_page_product_id').val(); if (idProduct == product_page_id_product && dateFrom < date_checkOut && dateTo >= date_checkIn) { if (jsonData.avail_rooms <= room_warning_num) { @@ -514,7 +523,7 @@ var ajaxCart = { } else { $('.num_quantity_alert').hide(); } - $("#max_avail_type_qty").val(jsonData.avail_rooms); + $(".max_avail_type_qty").val(jsonData.avail_rooms); $(".num_searched_avail_rooms").text(jsonData.avail_rooms); if (jsonData.avail_rooms == 0) { @@ -529,18 +538,18 @@ var ajaxCart = { if (pagename == 'category') { if (jsonData.avail_rooms <= room_warning_num) { - $(".cat_remain_rm_qty_" + idProduct).closest('.rm_left').show(); + $(".room_cont").find('[data-id-product="'+idProduct+'"] .rm_left').show(); } else { - $("cat_remain_rm_qty_" + idProduct).closest('.rm_left').hide(); + $("room_cont").find('[data-id-product="'+idProduct+'"] .rm_left').hide(); } /*for category page add to cart quantity management*/ - $(".cat_remain_rm_qty_" + idProduct).text(jsonData.avail_rooms); + $(".room_cont").find('[data-id-product="'+idProduct+'"] .remain_rm_qty').text(jsonData.avail_rooms); if (jsonData.avail_rooms == 0) { - $(".cat_remain_rm_qty_" + idProduct).closest('.room_cont').hide(); + $(".room_cont").find('[data-id-product="'+idProduct+'"]').hide(); } - //$('#cat_quantity_wanted_'+idProduct).val(1); + //$('#quantity_wanted_'+idProduct).val(1); } ajaxCart.updateCart(jsonData); @@ -628,28 +637,27 @@ var ajaxCart = { data: 'controller=cart&delete=1&dateFrom=' + dateFrom + '&dateTo=' + dateTo + '&id_product=' + idProduct + '&ipa=' + ((idCombination != null && parseInt(idCombination)) ? idCombination : '') + ((customizationId && customizationId != null) ? '&id_customization=' + customizationId : '') + '&id_address_delivery=' + idAddressDelivery + '&token=' + static_token + '&ajax=true', success: function(jsonData) { if (pagename == 'product') { - if (jsonData.avail_rooms <= room_warning_num) { - $('.num_quantity_alert').show(); - } else { - $('.num_quantity_alert').hide(); - } + // if (jsonData.avail_rooms <= room_warning_num) { + // $('.num_quantity_alert').show(); + // } else { + // $('.num_quantity_alert').hide(); + // } - $("#max_avail_type_qty").val(jsonData.avail_rooms); - $(".num_searched_avail_rooms").text(jsonData.avail_rooms); - $('.sold_out_alert').hide(); - disableRoomTypeDemands(0); - $('.unvail_rooms_cond_display').show(); + // $(".max_avail_type_qty").val(jsonData.avail_rooms); + // $(".num_searched_avail_rooms").text(jsonData.avail_rooms); + // $('.sold_out_alert').hide(); + // disableRoomTypeDemands(0); + // $('.unvail_rooms_cond_display').show(); } if (pagename == 'category') { // for category page.... - $(".cat_remain_rm_qty_" + idProduct).text(jsonData.avail_rooms); - - $(".cat_remain_rm_qty_" + idProduct).closest('.room_cont').show(0, function() { + $('.room_cont[data-id-product="'+idProduct+'"]').find(".remain_rm_qty").text(jsonData.avail_rooms); + $('.room_cont[data-id-product="'+idProduct+'"]').show(0, function() { if (jsonData.avail_rooms <= room_warning_num) { - $(".cat_remain_rm_qty_" + idProduct).closest('.rm_left').show(); + $('.room_cont[data-id-product="'+idProduct+'"]').find('.rm_left').show(); } else { - $(".cat_remain_rm_qty_" + idProduct).closest('.rm_left').hide(); + $('.room_cont[data-id-product="'+idProduct+'"]').find('.rm_left').hide(); } }); } @@ -1037,17 +1045,20 @@ var ajaxCart = { $('#layer_cart_product_price').text(product.price); //by webkul has to work on it more.. - if (pagename == 'product') { - $('#layer_cart_product_time_duration').text($('#room_check_in').val() + ' - ' + $('#room_check_out').val()); - $('#layer_cart_product_quantity').text($('#quantity_wanted').val()); - $('#quantity_wanted').val(1); - } - if (pagename == 'category') { - $('#layer_cart_product_time_duration').text($('#check_in_time').val() + ' - ' + $('#check_out_time').val()); - $('#layer_cart_product_quantity').text($('#cat_quantity_wanted_' + product.id).val()); - $('#cat_quantity_wanted_' + product.id).val(1); + $('#layer_cart_product_time_duration').text( + product.date_from + ' - ' + product.date_to + ); - } + let rooms = 0; + let adult = 0; + let children = 0; + $.each(product.occupancy, function(index, val) { + rooms++; + adult += parseInt(val.adult); + children += parseInt(val.children); + + }); + $('#layer_cart_product_quantity').text(getRoomTypeGuestOccupancyFormated(adult, children, rooms)); $('.layer_cart_img').html('' + product.name + ''); @@ -1216,4 +1227,48 @@ function getRoomsExtraDemands() }); return roomDemands; +} + +function getBookingOccupancyDetails(bookingform) +{ + let occupancy; + if (occupancy_wise_booking) { + let selected_occupancy = $(bookingform).find(".occupancy_info_block.selected") + if (selected_occupancy.length) { + occupancy = []; + $(selected_occupancy).each(function(ind, element) { + if (parseInt($(element).find('.num_adults').val())) { + let child_ages = []; + $(element).find('.guest_child_age').each(function(index) { + if ($(this).val() > -1) { + child_ages.push($(this).val()); + } + }); + if ($(element).find('.num_children').val()) { + if (child_ages.length != $(element).find('.num_children').val()) { + $(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open') + occupancy = false; + return false; + } + } + occupancy.push({ + 'adult': $(element).find('.num_adults').val(), + 'children': $(element).find('.num_children').val(), + 'child_ages': child_ages + }); + } else { + $(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open') + occupancy = false; + return false; + } + }); + } else { + $(bookingform).find('.booking_occupancy_wrapper').parent().addClass('open') + occupancy = false; + } + } else { + occupancy = parseInt($(bookingform).find(".quantity_wanted").val()); + } + + return occupancy; } \ No newline at end of file diff --git a/modules/blockcart/blockcart.php b/modules/blockcart/blockcart.php index 2ad83363e..c011e9992 100644 --- a/modules/blockcart/blockcart.php +++ b/modules/blockcart/blockcart.php @@ -195,6 +195,52 @@ class Blockcart extends Module 1 ); + $addedProduct = false; + // get currently added product if exists + if (!empty($params['cookie']->currentAddedProduct)) { + $addedProduct = json_decode($params['cookie']->currentAddedProduct, true); + $objProduct = new Product($addedProduct['id_product'], false, $this->context->language->id); + + $addedProduct['name'] = $objProduct->name; + $addedProduct['link'] = $this->context->link->getProductLink( + $objProduct->id, + $objProduct->link_rewrite, + $objProduct->category, + null, + null, + $this->context->cart->id_shop + ); + $image = Product::getCover($objProduct->id); + $image['id_product'] = $objProduct->id; + // Product::defineProductImage(array(Product::getCover($objProduct->id)['id_image']/), $this->id_lang) + $addedProduct['image'] = $this->context->link->getImageLink( + $objProduct->link_rewrite, + Product::defineProductImage($image, $this->context->language->id), + 'home_default' + ); + $addedProduct['image_cart'] = $this->context->link->getImageLink( + $objProduct->link_rewrite, + Product::defineProductImage($image, $this->context->language->id), + 'cart_default' + ); + $price = $addedProduct['price'] = HotelRoomTypeFeaturePricing::getRoomTypeTotalPrice( + $objProduct->id, + $addedProduct['date_from'], + $addedProduct['date_to'], + $addedProduct['req_rm'] + ); + + if ($priceDisplayMethod == PS_TAX_EXC) { + $addedProduct['price'] = Tools::displayPrice($price['total_price_tax_incl']); + } else { + $addedProduct['price'] = Tools::displayPrice($price['total_price_tax_excl']); + } + $addedProduct['date_from'] = Tools::displayDate($addedProduct['date_from']); + $addedProduct['date_to'] = Tools::displayDate($addedProduct['date_to']); + + unset($this->context->cookie->currentAddedProduct); + } + $response = array( 'products' => $products, 'customizedDatas' => Product::getAllCustomizedDatas((int) ($params['cart']->id)), @@ -218,7 +264,7 @@ class Blockcart extends Module 'static_token' => Tools::getToken(false), 'free_shipping' => Tools::displayPrice($total_free_shipping), 'free_shipping_float' => $total_free_shipping, - + 'last_added_product' => $addedProduct, 'cart_booking_data' => $htlCartData, 'total_rooms_in_cart' => $totalRooms, ); diff --git a/modules/blockcart/blockcart.tpl b/modules/blockcart/blockcart.tpl index 6192288d3..f5ec9906f 100644 --- a/modules/blockcart/blockcart.tpl +++ b/modules/blockcart/blockcart.tpl @@ -24,7 +24,7 @@ *} {if isset($blockcart_top) && $blockcart_top} -
    + {if $occupancy_wise_search} +
    + +
    + +
    +
    + {/if}