Merge pull request #707 from abhishek-webkul/update-demo-data
Remove demo data creation if 'Install demo data' is set to 'No' during installation
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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',
|
||||
|
||||
|
Before Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 42 KiB |
|
Before Width: | Height: | Size: 59 KiB |
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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',
|
||||
|
||||
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 15 KiB |
@@ -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;
|
||||
}
|
||||
|
||||
|
||||