diff --git a/controllers/admin/AdminStatsController.php b/controllers/admin/AdminStatsController.php index ae35d50bd..cdca3016d 100644 --- a/controllers/admin/AdminStatsController.php +++ b/controllers/admin/AdminStatsController.php @@ -1686,8 +1686,8 @@ class AdminStatsControllerCore extends AdminStatsTabController WHERE o.`valid` = 1 AND hbi.`active` = 1 AND hbd.`is_refunded` = 0 AND o.`invoice_date` BETWEEN "'.pSQL($dateFrom).' 00:00:00" AND "'.pSQL($dateTo).' 23:59:59" AND o.`source` = "'.pSQL(Configuration::get('PS_SHOP_DOMAIN')).'"'. - (!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : ''). - 'GROUP BY o.`id_order` + (!is_null($idHotel) ? HotelBranchInformation::addHotelRestriction($idHotel, 'hbd') : '').' + GROUP BY o.`id_order` ) AS t'; $directRevenue = (float) Db::getInstance()->getValue($sql); diff --git a/modules/blocknavigationmenu/blocknavigationmenu.php b/modules/blocknavigationmenu/blocknavigationmenu.php index 05cd5c775..e60b3ed2d 100644 --- a/modules/blocknavigationmenu/blocknavigationmenu.php +++ b/modules/blocknavigationmenu/blocknavigationmenu.php @@ -112,7 +112,7 @@ class blocknavigationmenu extends Module || !$this->callInstallTab() || !$this->registerModuleHooks() || !Configuration::updateValue('WK_SHOW_FOOTER_NAVIGATION_BLOCK', 1) - || !$objCustomNavigationLink->insertDemoData() + || !$objCustomNavigationLink->insertDemoData(isset($this->populateData) ? $this->populateData : null) ) { return false; } diff --git a/modules/blocknavigationmenu/classes/WkCustomNavigationLink.php b/modules/blocknavigationmenu/classes/WkCustomNavigationLink.php index 7382bab49..b7e62b93e 100644 --- a/modules/blocknavigationmenu/classes/WkCustomNavigationLink.php +++ b/modules/blocknavigationmenu/classes/WkCustomNavigationLink.php @@ -147,7 +147,7 @@ class WkCustomNavigationLink extends ObjectModel return (bool) Db::getInstance()->execute($sql); } - public function insertDemoData($qloInstallData = 0) + public function insertDemoData($populateData = null) { //insert home link to the list $languages = Language::getLanguages(false); @@ -166,8 +166,8 @@ class WkCustomNavigationLink extends ObjectModel // enter modules links $modsElems = array(); - if ($qloInstallData) { - // if module is installing or resetting + // if module is installing or resetting + if (is_null($populateData)) { if (Module::isEnabled('wkabouthotelblock')) { $modsElems['Interior'] = 'hotelInteriorBlock'; } @@ -181,12 +181,15 @@ class WkCustomNavigationLink extends ObjectModel $modsElems['Testimonials'] = 'hotelTestimonialBlock'; } } else { - // if QloApps is installing then enter modules links directly - $modsElems['Interior'] = 'hotelInteriorBlock'; - $modsElems['Amenities'] = 'hotelAmenitiesBlock'; - $modsElems['Rooms'] = 'hotelRoomsBlock'; - $modsElems['Testimonials'] = 'hotelTestimonialBlock'; + // if QloApps is installing and $populateData = 1 then enter modules links directly + if ($populateData) { + $modsElems['Interior'] = 'hotelInteriorBlock'; + $modsElems['Amenities'] = 'hotelAmenitiesBlock'; + $modsElems['Rooms'] = 'hotelRoomsBlock'; + $modsElems['Testimonials'] = 'hotelTestimonialBlock'; + } } + if ($modsElems) { $indexLink = Context::getContext()->shop->getBaseURI(); foreach ($modsElems as $name => $modElm) { diff --git a/modules/hotelreservationsystem/hotelreservationsystem.php b/modules/hotelreservationsystem/hotelreservationsystem.php index 5e85ac22d..5ade95914 100644 --- a/modules/hotelreservationsystem/hotelreservationsystem.php +++ b/modules/hotelreservationsystem/hotelreservationsystem.php @@ -598,16 +598,15 @@ class HotelReservationSystem extends Module || !$this->registerModuleHooks() || !$this->callInstallTab() || !$objHtlHelper->insertDefaultHotelEntries() + || !$objHtlHelper->createHotelRoomDefaultFeatures() + || !$objHtlHelper->insertHotelCommonFeatures() ) { return false; } // if module should be populated while installation if (isset($this->populateData) && $this->populateData) { - if (!$objHtlHelper->createHotelRoomDefaultFeatures() - || !$objHtlHelper->insertHotelCommonFeatures() - || !$objHtlHelper->createDummyDataForProject() - ) { + if (!$objHtlHelper->createDummyDataForProject()) { return false; } } diff --git a/modules/wkabouthotelblock/classes/WkHotelInteriorImage.php b/modules/wkabouthotelblock/classes/WkHotelInteriorImage.php index 7d0e5dfb4..85c077abe 100644 --- a/modules/wkabouthotelblock/classes/WkHotelInteriorImage.php +++ b/modules/wkabouthotelblock/classes/WkHotelInteriorImage.php @@ -145,7 +145,6 @@ class WkHotelInteriorImage extends ObjectModel $HOTEL_INTERIOR_HEADING[$lang['id_lang']] = 'Interior'; $HOTEL_INTERIOR_DESCRIPTION[$lang['id_lang']] = 'Families travelling with kids will find Amboseli national park a safari destination matched to no other, with less tourist traffic, breathtaking open space.'; } - Configuration::updateValue('HOTEL_INTERIOR_BLOCK_NAV_LINK', 1); // update global configuration values in multilang Configuration::updateValue('HOTEL_INTERIOR_HEADING', $HOTEL_INTERIOR_HEADING); Configuration::updateValue('HOTEL_INTERIOR_DESCRIPTION', $HOTEL_INTERIOR_DESCRIPTION); diff --git a/modules/wkabouthotelblock/controllers/admin/AdminAboutHotelBlockSettingController.php b/modules/wkabouthotelblock/controllers/admin/AdminAboutHotelBlockSettingController.php index 8ffe12603..6321141ac 100644 --- a/modules/wkabouthotelblock/controllers/admin/AdminAboutHotelBlockSettingController.php +++ b/modules/wkabouthotelblock/controllers/admin/AdminAboutHotelBlockSettingController.php @@ -36,14 +36,6 @@ class AdminAboutHotelBlockSettingController extends ModuleAdminController 'title' => $this->l('Hotel Interior Description'), 'icon' => 'icon-cogs', 'fields' => array( - 'HOTEL_INTERIOR_BLOCK_NAV_LINK' => array( - 'title' => $this->l('Show link at navigation'), - 'hint' => $this->l('Enable, if you want to display a link at navigation menu for the interior block at home page.'), - 'validation' => 'isBool', - 'cast' => 'intval', - 'type' => 'bool', - 'required' => true - ), 'HOTEL_INTERIOR_HEADING' => array( 'title' => $this->l('Interior Block Title'), 'type' => 'textLang', diff --git a/modules/wkabouthotelblock/wkabouthotelblock.php b/modules/wkabouthotelblock/wkabouthotelblock.php index 89e9dc0a8..45173f401 100644 --- a/modules/wkabouthotelblock/wkabouthotelblock.php +++ b/modules/wkabouthotelblock/wkabouthotelblock.php @@ -85,15 +85,24 @@ class WkAboutHotelBlock extends Module public function install() { $objAboutHotelBlockDb = new WkAboutHotelBlockDb(); - $objHtlInteriorImg = new WkHotelInteriorImage(); if (!parent::install() || !$objAboutHotelBlockDb->createTables() || !$this->registerModuleHooks() || !$this->callInstallTab() - || !$objHtlInteriorImg->insertModuleDemoData() ) { return false; } + + // if module should create demo data during installation + if (isset($this->populateData) && $this->populateData) { + $objHtlInteriorImg = new WkHotelInteriorImage(); + if (!$objHtlInteriorImg->insertModuleDemoData()) { + return false; + } + } else { + Tools::deleteDirectory($this->local_path.'views/img/dummy_img'); + } + return true; } diff --git a/modules/wkhotelfeaturesblock/classes/WkHotelFeaturesData.php b/modules/wkhotelfeaturesblock/classes/WkHotelFeaturesData.php index f1f6949ea..23d5990c2 100644 --- a/modules/wkhotelfeaturesblock/classes/WkHotelFeaturesData.php +++ b/modules/wkhotelfeaturesblock/classes/WkHotelFeaturesData.php @@ -138,8 +138,6 @@ class WkHotelFeaturesData extends ObjectModel // enter the default demo data of the module public function insertModuleDemoData() { - Configuration::updateValue('HOTEL_AMENITIES_BLOCK_NAV_LINK', 1); - $languages = Language::getLanguages(false); $HOTEL_AMENITIES_HEADING = array(); $HOTEL_AMENITIES_DESCRIPTION = array(); diff --git a/modules/wkhotelfeaturesblock/controllers/admin/AdminFeaturesModuleSettingController.php b/modules/wkhotelfeaturesblock/controllers/admin/AdminFeaturesModuleSettingController.php index 510e448c7..1cfd97200 100644 --- a/modules/wkhotelfeaturesblock/controllers/admin/AdminFeaturesModuleSettingController.php +++ b/modules/wkhotelfeaturesblock/controllers/admin/AdminFeaturesModuleSettingController.php @@ -42,14 +42,6 @@ class AdminFeaturesModuleSettingController extends ModuleAdminController 'title' => $this->l('Hotel Amenity Setting'), 'icon' => 'icon-cogs', 'fields' => array( - 'HOTEL_AMENITIES_BLOCK_NAV_LINK' => array( - 'title' => $this->l('Show link at navigation'), - 'hint' => $this->l('Enable, if you want to display a link at navigation menu for the amenities block at home page.'), - 'validation' => 'isBool', - 'cast' => 'intval', - 'type' => 'bool', - 'required' => true - ), 'HOTEL_AMENITIES_HEADING' => array( 'title' => $this->l('Amenity Block Title'), 'type' => 'textLang', diff --git a/modules/wkhotelfeaturesblock/views/img/hotels_features_img/1.jpg b/modules/wkhotelfeaturesblock/views/img/hotels_features_img/1.jpg deleted file mode 100644 index 6c0c9709d..000000000 Binary files a/modules/wkhotelfeaturesblock/views/img/hotels_features_img/1.jpg and /dev/null differ diff --git a/modules/wkhotelfeaturesblock/views/img/hotels_features_img/2.jpg b/modules/wkhotelfeaturesblock/views/img/hotels_features_img/2.jpg deleted file mode 100644 index 8694ca69a..000000000 Binary files a/modules/wkhotelfeaturesblock/views/img/hotels_features_img/2.jpg and /dev/null differ diff --git a/modules/wkhotelfeaturesblock/views/img/hotels_features_img/3.jpg b/modules/wkhotelfeaturesblock/views/img/hotels_features_img/3.jpg deleted file mode 100644 index acec2836f..000000000 Binary files a/modules/wkhotelfeaturesblock/views/img/hotels_features_img/3.jpg and /dev/null differ diff --git a/modules/wkhotelfeaturesblock/views/img/hotels_features_img/4.jpg b/modules/wkhotelfeaturesblock/views/img/hotels_features_img/4.jpg deleted file mode 100644 index 68cae0fb2..000000000 Binary files a/modules/wkhotelfeaturesblock/views/img/hotels_features_img/4.jpg and /dev/null differ diff --git a/modules/wkhotelfeaturesblock/wkhotelfeaturesblock.php b/modules/wkhotelfeaturesblock/wkhotelfeaturesblock.php index a882e7404..8e08eed18 100644 --- a/modules/wkhotelfeaturesblock/wkhotelfeaturesblock.php +++ b/modules/wkhotelfeaturesblock/wkhotelfeaturesblock.php @@ -115,15 +115,24 @@ class WkHotelFeaturesBlock extends Module public function install() { $objHotelFeaturesBlockDb = new WkHotelFeaturesBlockDb(); - $objFeaturesData = new WkHotelFeaturesData(); if (!parent::install() || !$objHotelFeaturesBlockDb->createTables() || !$this->registerModuleHooks() || !$this->callInstallTab() - || !$objFeaturesData->insertModuleDemoData() ) { return false; } + + // if module should create demo data during installation + if (isset($this->populateData) && $this->populateData) { + $objHotelFeaturesData = new WkHotelFeaturesData(); + if (!$objHotelFeaturesData->insertModuleDemoData()) { + return false; + } + } else { + Tools::deleteDirectory($this->local_path.'views/img/dummy_img'); + } + return true; } diff --git a/modules/wkhotelroom/classes/WkHotelRoomDisplay.php b/modules/wkhotelroom/classes/WkHotelRoomDisplay.php index 56aef9532..f324aba82 100644 --- a/modules/wkhotelroom/classes/WkHotelRoomDisplay.php +++ b/modules/wkhotelroom/classes/WkHotelRoomDisplay.php @@ -148,7 +148,7 @@ class WkHotelRoomDisplay extends ObjectModel $HOTEL_ROOM_DISPLAY_HEADING[$lang['id_lang']] = 'Our Rooms'; $HOTEL_ROOM_DISPLAY_DESCRIPTION[$lang['id_lang']] = 'Families travelling with kids will find Amboseli national park a safari destination matched to no other, with less tourist traffic, breathtaking open space.'; } - Configuration::updateValue('HOTEL_ROOM_BLOCK_NAV_LINK', 1); + // update global configuration values in multilang Configuration::updateValue('HOTEL_ROOM_DISPLAY_HEADING', $HOTEL_ROOM_DISPLAY_HEADING); Configuration::updateValue('HOTEL_ROOM_DISPLAY_DESCRIPTION', $HOTEL_ROOM_DISPLAY_DESCRIPTION); diff --git a/modules/wkhotelroom/controllers/admin/AdminHotelRoomModuleSettingController.php b/modules/wkhotelroom/controllers/admin/AdminHotelRoomModuleSettingController.php index af26bfe6d..5e54ca3db 100644 --- a/modules/wkhotelroom/controllers/admin/AdminHotelRoomModuleSettingController.php +++ b/modules/wkhotelroom/controllers/admin/AdminHotelRoomModuleSettingController.php @@ -34,14 +34,6 @@ class AdminHotelRoomModuleSettingController extends ModuleAdminController 'title' => $this->l('Hotel Room Display Setting'), 'icon' => 'icon-cogs', 'fields' => array( - 'HOTEL_ROOM_BLOCK_NAV_LINK' => array( - 'title' => $this->l('Show link at navigation'), - 'hint' => $this->l('Enable, if you want to display a link at navigation menu for the hotel rooms block at home page.'), - 'validation' => 'isBool', - 'cast' => 'intval', - 'type' => 'bool', - 'required' => true - ), 'HOTEL_ROOM_DISPLAY_HEADING' => array( 'title' => $this->l('Hotel Room Block Title'), 'type' => 'textLang', diff --git a/modules/wkroomsearchblock/wkroomsearchblock.php b/modules/wkroomsearchblock/wkroomsearchblock.php index e959bf65d..24ff623c8 100644 --- a/modules/wkroomsearchblock/wkroomsearchblock.php +++ b/modules/wkroomsearchblock/wkroomsearchblock.php @@ -47,42 +47,42 @@ class WkRoomSearchBlock extends Module { $controller = Tools::getValue('controller'); // apply assets globally for all pages of search panel - if ('category' == $controller - || 'index' == $controller - || 'product' == $controller - ) { + if ('category' == $controller || 'index' == $controller || 'product' == $controller ) { + $objHotelBranchInformation = new HotelBranchInformation(); + $hotelBranchesInfo = $objHotelBranchInformation->hotelBranchesInfo(0, 1); + if (is_array($hotelBranchesInfo) && count($hotelBranchesInfo)) { + $this->context->controller->addCSS($this->_path.'/views/css/wk-global-search.css'); + $this->context->controller->addJS($this->_path.'/views/js/wk-room-search-block.js'); - $this->context->controller->addCSS($this->_path.'/views/css/wk-global-search.css'); - $this->context->controller->addJS($this->_path.'/views/js/wk-room-search-block.js'); - - Media::addJsDef( - array ( - 'autocomplete_search_url' => $this->context->link->getModuleLink( - 'wkroomsearchblock', - 'autocompletesearch' - ), - 'no_results_found_cond' => $this->l('No results found for this search', false, true), - 'hotel_name_cond' => $this->l('Please select a hotel name', false, true), - 'check_in_time_cond' => $this->l('Please enter Check In time', false, true), - 'check_out_time_cond' => $this->l('Please enter Check Out time', false, true), - 'less_checkin_date' => $this->l('Check In date can not be before current date.', false, true), - 'more_checkout_date' => $this->l('Check Out date must be greater than Check In date.', false, true), - 'select_htl_txt' => $this->l('Select Hotel', false, true), - 'select_age_txt' => $this->l('Select age', false, true), - 'under_1_age' => $this->l('Under 1', false, true), - 'room_txt' => $this->l('Room', false, true), - 'rooms_txt' => $this->l('Rooms', false, true), - 'remove_txt' => $this->l('Remove', false, true), - 'adult_txt' => $this->l('Adult', false, true), - 'adults_txt' => $this->l('Adults', false, true), - 'child_txt' => $this->l('Child', false, true), - 'children_txt' => $this->l('Children', false, true), - 'below_txt' => $this->l('Below', false, true), - 'years_txt' => $this->l('years', false, true), - 'all_children_txt' => $this->l('All Children', false, true), - 'invalid_occupancy_txt' => $this->l('Invalid occupancy(adults/children) found.', false, true), - ) - ); + Media::addJsDef( + array ( + 'autocomplete_search_url' => $this->context->link->getModuleLink( + 'wkroomsearchblock', + 'autocompletesearch' + ), + 'no_results_found_cond' => $this->l('No results found for this search', false, true), + 'hotel_name_cond' => $this->l('Please select a hotel name', false, true), + 'check_in_time_cond' => $this->l('Please enter Check In time', false, true), + 'check_out_time_cond' => $this->l('Please enter Check Out time', false, true), + 'less_checkin_date' => $this->l('Check In date can not be before current date.', false, true), + 'more_checkout_date' => $this->l('Check Out date must be greater than Check In date.', false, true), + 'select_htl_txt' => $this->l('Select Hotel', false, true), + 'select_age_txt' => $this->l('Select age', false, true), + 'under_1_age' => $this->l('Under 1', false, true), + 'room_txt' => $this->l('Room', false, true), + 'rooms_txt' => $this->l('Rooms', false, true), + 'remove_txt' => $this->l('Remove', false, true), + 'adult_txt' => $this->l('Adult', false, true), + 'adults_txt' => $this->l('Adults', false, true), + 'child_txt' => $this->l('Child', false, true), + 'children_txt' => $this->l('Children', false, true), + 'below_txt' => $this->l('Below', false, true), + 'years_txt' => $this->l('years', false, true), + 'all_children_txt' => $this->l('All Children', false, true), + 'invalid_occupancy_txt' => $this->l('Invalid occupancy(adults/children) found.', false, true), + ) + ); + } } // apply assets as per pages diff --git a/modules/wktestimonialblock/classes/WkHotelTestimonialData.php b/modules/wktestimonialblock/classes/WkHotelTestimonialData.php index f8138c5bc..28ce78361 100644 --- a/modules/wktestimonialblock/classes/WkHotelTestimonialData.php +++ b/modules/wktestimonialblock/classes/WkHotelTestimonialData.php @@ -144,7 +144,7 @@ class WkHotelTestimonialData extends ObjectModel $HOTEL_TESIMONIAL_BLOCK_HEADING[$lang['id_lang']] = 'What our guests say?'; $HOTEL_TESIMONIAL_BLOCK_CONTENT[$lang['id_lang']] = 'Fap put a bird on it next level, sustainable disrupt polaroid flannel Helvetica Kickstarter quinoa bicycle rights narwhal wolf Fap put a bird on it next level.'; } - Configuration::updateValue('HOTEL_TESIMONIAL_BLOCK_NAV_LINK', 1); + // update global configuration values in multilang Configuration::updateValue('HOTEL_TESIMONIAL_BLOCK_HEADING', $HOTEL_TESIMONIAL_BLOCK_HEADING); Configuration::updateValue('HOTEL_TESIMONIAL_BLOCK_CONTENT', $HOTEL_TESIMONIAL_BLOCK_CONTENT); diff --git a/modules/wktestimonialblock/controllers/admin/AdminTestimonialsModuleSettingController.php b/modules/wktestimonialblock/controllers/admin/AdminTestimonialsModuleSettingController.php index 2bffd0fd9..0eec6e98b 100644 --- a/modules/wktestimonialblock/controllers/admin/AdminTestimonialsModuleSettingController.php +++ b/modules/wktestimonialblock/controllers/admin/AdminTestimonialsModuleSettingController.php @@ -36,14 +36,6 @@ class AdminTestimonialsModuleSettingController extends ModuleAdminController 'modulesetting' => array( 'title' => $this->l('Hotel Testimonials Setting'), 'fields' => array( - 'HOTEL_TESIMONIAL_BLOCK_NAV_LINK' => array( - 'title' => $this->l('Show link at navigation'), - 'hint' => $this->l('Enable, if you want to display a link at navigation menu for the testimonial block at home page.'), - 'validation' => 'isBool', - 'cast' => 'intval', - 'type' => 'bool', - 'required' => true - ), 'HOTEL_TESIMONIAL_BLOCK_HEADING' => array( 'title' => $this->l('Testimonial block title'), 'type' => 'textLang', diff --git a/modules/wktestimonialblock/views/img/hotels_testimonials_img/1.jpg b/modules/wktestimonialblock/views/img/hotels_testimonials_img/1.jpg deleted file mode 100644 index 5a4e16ee5..000000000 Binary files a/modules/wktestimonialblock/views/img/hotels_testimonials_img/1.jpg and /dev/null differ diff --git a/modules/wktestimonialblock/views/img/hotels_testimonials_img/2.jpg b/modules/wktestimonialblock/views/img/hotels_testimonials_img/2.jpg deleted file mode 100644 index 15f0d03ae..000000000 Binary files a/modules/wktestimonialblock/views/img/hotels_testimonials_img/2.jpg and /dev/null differ diff --git a/modules/wktestimonialblock/views/img/hotels_testimonials_img/3.jpg b/modules/wktestimonialblock/views/img/hotels_testimonials_img/3.jpg deleted file mode 100644 index 3de9dd9f5..000000000 Binary files a/modules/wktestimonialblock/views/img/hotels_testimonials_img/3.jpg and /dev/null differ diff --git a/modules/wktestimonialblock/wktestimonialblock.php b/modules/wktestimonialblock/wktestimonialblock.php index 663142985..ff8461f13 100644 --- a/modules/wktestimonialblock/wktestimonialblock.php +++ b/modules/wktestimonialblock/wktestimonialblock.php @@ -107,15 +107,24 @@ class WkTestimonialBlock extends Module public function install() { $objTestimonialBlockDb = new WkTestimonialBlockDb(); - $objTestimonialData = new WkHotelTestimonialData(); if (!parent::install() || !$objTestimonialBlockDb->createTables() || !$this->registerModuleHooks() || !$this->callInstallTab() - || !$objTestimonialData->insertModuleDemoData() ) { return false; } + + // if module should create demo data during installation + if (isset($this->populateData) && $this->populateData) { + $objTestimonialData = new WkHotelTestimonialData(); + if (!$objTestimonialData->insertModuleDemoData()) { + return false; + } + } else { + Tools::deleteDirectory($this->local_path.'views/img/dummy_img'); + } + return true; }