diff --git a/install/upgrade/php/change_feature_image_to_jpg.php b/install/upgrade/php/change_feature_image_to_jpg.php index 9519ecdda..d785b3ee4 100644 --- a/install/upgrade/php/change_feature_image_to_jpg.php +++ b/install/upgrade/php/change_feature_image_to_jpg.php @@ -1,6 +1,6 @@ -* @copyright 2010-2021 Webkul IN +* @copyright 2010-2022 Webkul IN * @license https://store.webkul.com/license.html */ diff --git a/modules/blocknavigationmenu/upgrade/index.php b/modules/blocknavigationmenu/upgrade/index.php new file mode 100644 index 000000000..8d2cf16fe --- /dev/null +++ b/modules/blocknavigationmenu/upgrade/index.php @@ -0,0 +1,29 @@ + +* @copyright 2010-2022 Webkul IN +* @license https://store.webkul.com/license.html +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../../../'); +exit; diff --git a/modules/blocknavigationmenu/upgrade/upgrade-1.1.0.php b/modules/blocknavigationmenu/upgrade/upgrade-1.1.0.php new file mode 100644 index 000000000..1f5d55bc9 --- /dev/null +++ b/modules/blocknavigationmenu/upgrade/upgrade-1.1.0.php @@ -0,0 +1,196 @@ + +* @copyright 2010-2022 Webkul IN +* @license https://store.webkul.com/license.html +*/ + +if (!defined('_PS_VERSION_')) + exit; + +function upgrade_module_1_1_0($module) +{ + $objUpgrade = new upgradeBlockNavigationMenu110(); + return ($objUpgrade->createTables() + && $objUpgrade->registerModuleHooks($module) + && $module->installTab('AdminCustomNavigationLinkSetting', 'Manage Custom Navigation Links') + && Configuration::updateValue('WK_SHOW_FOOTER_NAVIGATION_BLOCK', 1) + && $objUpgrade->insertData($module) + ); +} + +class upgradeBlockNavigationMenu110 +{ + public function insertData($module) + { + //insert home link to the list + $languages = Language::getLanguages(false); + $objCustomNavigationLink = new WkCustomNavigationLink(); + foreach ($languages as $language) { + $objCustomNavigationLink->name[$language['id_lang']] = 'Home'; + } + $objCustomNavigationLink->position = $objCustomNavigationLink->getHigherPosition(); + $objCustomNavigationLink->id_cms = 0; + $objCustomNavigationLink->show_at_navigation = 1; + $objCustomNavigationLink->show_at_footer = 0; + $objCustomNavigationLink->active = 1; + $objCustomNavigationLink->is_custom_link = 0; + $objCustomNavigationLink->link = 'index'; + $objCustomNavigationLink->save(); + + $modsElems = array(); + if (Module::isEnabled('wkabouthotelblock')) { + $modsElems['Interior'] = 'hotelInteriorBlock'; + } + if (Module::isEnabled('wkhotelfeaturesblock')) { + $modsElems['Amenities'] = 'hotelAmenitiesBlock'; + } + if (Module::isEnabled('wkhotelroom')) { + $modsElems['Rooms'] = 'hotelRoomsBlock'; + } + if (Module::isEnabled('wktestimonialblock')) { + $modsElems['Testimonials'] = 'hotelTestimonialBlock'; + } + if ($modsElems) { + $indexLink = Context::getContext()->shop->getBaseURI(); + foreach ($modsElems as $name => $modElm) { + $objCustomNavigationLink = new WkCustomNavigationLink(); + foreach ($languages as $language) { + $objCustomNavigationLink->name[$language['id_lang']] = $name; + } + $objCustomNavigationLink->position = $objCustomNavigationLink->getHigherPosition(); + $objCustomNavigationLink->id_cms = 0; + $objCustomNavigationLink->show_at_navigation = 1; + $objCustomNavigationLink->show_at_footer = 0; + $objCustomNavigationLink->active = 1; + $objCustomNavigationLink->link = $indexLink.'#'.$modElm; + $objCustomNavigationLink->is_custom_link = 1; + $objCustomNavigationLink->save(); + } + } + + // get data from old navigation menu + $exploreLinks = $this->getOldExploreLinks(); + if (!empty($exploreLinks)) { + foreach ($exploreLinks as $link) { + $objCustomNavigationLink = new WkCustomNavigationLink(); + foreach ($languages as $language) { + if (isset($link['lang'][$language['id_lang']]['name']) && $link['lang'][$language['id_lang']]['name']) { + $objCustomNavigationLink->name[$language['id_lang']] = $link['lang'][$language['id_lang']]['name']; + } else { + $objCustomNavigationLink->name[$language['id_lang']] = $link['name']; + } + } + $objCustomNavigationLink->position = $objCustomNavigationLink->getHigherPosition(); + $objCustomNavigationLink->id_cms = $link['id_cms']; + $objCustomNavigationLink->show_at_navigation = $link['show_at_navigation']; + $objCustomNavigationLink->show_at_footer = $link['show_at_footer']; + $objCustomNavigationLink->active = $link['active']; + // $objCustomNavigationLink->is_custom_link = 1; + $objCustomNavigationLink->save(); + } + } + + //insert contact link to the list + $objCustomNavigationLink = new WkCustomNavigationLink(); + foreach ($languages as $language) { + $objCustomNavigationLink->name[$language['id_lang']] = 'Contact'; + } + $objCustomNavigationLink->position = $objCustomNavigationLink->getHigherPosition(); + $objCustomNavigationLink->id_cms = 0; + $objCustomNavigationLink->show_at_navigation = 1; + $objCustomNavigationLink->show_at_footer = 1; + $objCustomNavigationLink->active = 1; + $objCustomNavigationLink->is_custom_link = 0; + $objCustomNavigationLink->link = 'contact'; + $objCustomNavigationLink->save(); + return true; + } + + public function getOldExploreLinks() + { + $links = Db::getInstance()->executeS( + 'SELECT * FROM `'._DB_PREFIX_.'htl_custom_explore_link`' + ); + foreach ($links as &$link) { + $link_lang = Db::getInstance()->executeS( + 'SELECT * FROM `'._DB_PREFIX_.'htl_custom_explore_link_lang` + WHERE `id_explore_link` = '.$link['id_explore_link'] + ); + // set default name + if (!isset($link['name'])) { + $link['name'] = $link_lang[0]['name']; + } + foreach ($link_lang as $lang) { + $link['lang'][$lang['id_lang']]['name'] = $lang['name']; + } + + } + + return $links; + } + + public function registerModuleHooks($module) + { + return $module->registerHook( + array ( + 'footer', + 'displayAddModuleSettingLink', + 'actionObjectLanguageAddAfter', + 'displayDefaultNavigationHook' + ) + ); + } + + public function getModuleSql() + { + return array ( + "CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_custom_navigation_link` ( + `id_navigation_link` int(11) NOT NULL AUTO_INCREMENT, + `link` text NOT NULL, + `is_custom_link` tinyint(1) NOT NULL, + `id_cms` int(11) NOT NULL DEFAULT '0', + `position` int(11) unsigned NOT NULL DEFAULT '0', + `show_at_navigation` tinyint(1) NOT NULL DEFAULT '0', + `show_at_footer` tinyint(1) NOT NULL DEFAULT '0', + `active` tinyint(1) NOT NULL, + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_navigation_link`) + ) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;", + "CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_custom_navigation_link_lang` ( + `id_navigation_link` int(11) NOT NULL, + `id_lang` int(11) NOT NULL, + `name` varchar(255) NOT NULL, + PRIMARY KEY (`id_navigation_link`, `id_lang`) + ) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 ;", + ); + } + + public function createTables() + { + if ($sql = $this->getModuleSql()) { + foreach ($sql as $query) { + if ($query) { + if (!Db::getInstance()->execute(trim($query))) { + return false; + } + } + } + } + return true; + } +} diff --git a/modules/dashproducts/upgrade/index.php b/modules/dashproducts/upgrade/index.php new file mode 100644 index 000000000..8d2cf16fe --- /dev/null +++ b/modules/dashproducts/upgrade/index.php @@ -0,0 +1,29 @@ + +* @copyright 2010-2022 Webkul IN +* @license https://store.webkul.com/license.html +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../../../'); +exit; diff --git a/modules/dashproducts/upgrade/upgrade-1.0.1.php b/modules/dashproducts/upgrade/upgrade-1.0.1.php new file mode 100644 index 000000000..a07a096a5 --- /dev/null +++ b/modules/dashproducts/upgrade/upgrade-1.0.1.php @@ -0,0 +1,28 @@ + +* @copyright 2010-2022 Webkul IN +* @license https://store.webkul.com/license.html +*/ + +if (!defined('_PS_VERSION_')) + exit; + +function upgrade_module_1_0_1($module) +{ + return $module->registerHook('actionAdminControllerSetMedia'); +} + diff --git a/modules/hotelreservationsystem/upgrade/index.php b/modules/hotelreservationsystem/upgrade/index.php new file mode 100644 index 000000000..8d2cf16fe --- /dev/null +++ b/modules/hotelreservationsystem/upgrade/index.php @@ -0,0 +1,29 @@ + +* @copyright 2010-2022 Webkul IN +* @license https://store.webkul.com/license.html +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../../../'); +exit; diff --git a/modules/hotelreservationsystem/upgrade/upgrade-1.4.0.php b/modules/hotelreservationsystem/upgrade/upgrade-1.4.0.php new file mode 100644 index 000000000..380414413 --- /dev/null +++ b/modules/hotelreservationsystem/upgrade/upgrade-1.4.0.php @@ -0,0 +1,76 @@ + +* @copyright 2010-2022 Webkul IN +* @license https://store.webkul.com/license.html +*/ + +if (!defined('_PS_VERSION_')) + exit; + +function upgrade_module_1_4_0($module) +{ + return ($module->registerHook('actionObjectProfileAddAfter') + && $module->registerHook('actionObjectProfileDeleteBefore') + && updateTables() + && createDataForNewTables($module) + ); +} + +function createDataForNewTables() +{ + $htlBranches = Db::getInstance()->executes( + 'SELECT p.`id_profile`, hbi.`id` as id_hotel, \'1\' as access FROM `'._DB_PREFIX_.'htl_branch_info` hbi + CROSS JOIN `'._DB_PREFIX_.'profile` p' + ); + + return Db::getInstance()->insert('htl_access', $htlBranches); +} + +function updateTables() +{ + return Db::getInstance()->execute( + 'CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'htl_booking_demands_tax` ( + `id_booking_demand` int(11) NOT NULL AUTO_INCREMENT, + `id_tax` int(11) NOT NULL, + `unit_amount` DECIMAL(16, 6) NOT NULL DEFAULT \'0.00\', + `total_amount` DECIMAL(16, 6) NOT NULL DEFAULT \'0.00\', + PRIMARY KEY (`id_booking_demand`, `id_tax`) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; + + ALTER TABLE `'._DB_PREFIX_.'htl_booking_demands` + CHANGE `price` `unit_price_tax_excl`decimal(20,6) NOT NULL DEFAULT \'0.000000\', + ADD `unit_price_tax_incl` decimal(20,6) NOT NULL DEFAULT \'0.000000\' AFTER `unit_price_tax_excl`, + ADD `total_price_tax_excl` decimal(20,6) NOT NULL DEFAULT \'0.000000\' AFTER `unit_price_tax_incl`, + ADD `total_price_tax_incl` decimal(20,6) NOT NULL DEFAULT \'0.000000\' AFTER `total_price_tax_excl`, + ADD `price_calc_method` int(11) NOT NULL DEFAULT \'0\' AFTER `total_price_tax_incl`, + ADD `id_tax_rules_group` int(11) NOT NULL DEFAULT \'0\' AFTER `price_calc_method`, + ADD `tax_computation_method` tinyint(1) NOT NULL DEFAULT \'0\' AFTER `id_tax_rules_group`; + + ALTER TABLE `'._DB_PREFIX_.'htl_room_type_global_demand` + ADD `id_tax_rules_group` int(10) unsigned NOT NULL DEFAULT \'0\' AFTER `price`, + ADD `price_calc_method` tinyint(1) NOT NULL AFTER `id_tax_rules_group`; + + CREATE TABLE IF NOT EXISTS `'._DB_PREFIX_.'htl_access` ( + `id_profile` int(10) unsigned NOT NULL, + `id_hotel` int(10) unsigned NOT NULL, + `access` int(11) NOT NULL, + PRIMARY KEY (`id_profile`, `id_hotel`) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;' + ); +} + + diff --git a/modules/hotelreservationsystem/upgrade/upgrade-1.4.1.php b/modules/hotelreservationsystem/upgrade/upgrade-1.4.1.php new file mode 100644 index 000000000..c731bf621 --- /dev/null +++ b/modules/hotelreservationsystem/upgrade/upgrade-1.4.1.php @@ -0,0 +1,238 @@ + +* @copyright 2010-2022 Webkul IN +* @license https://store.webkul.com/license.html +*/ + +if (!defined('_PS_VERSION_')) + exit; + +function upgrade_module_1_4_1($module) +{ + return ($module->registerHook('actionObjectGroupDeleteBefore') + && $module->registerHook('actionOrderStatusPostUpdate') + && updateTables141() + && createDataForNewTables141($module) + && deleteUnusedTables() + ); +} + +function createDataForNewTables141($module) +{ + populateBookingDetail(); + updateRefundRules(); + populateRefundData(); + + return true; +} + +function populateBookingDetail() +{ + $htlBookings = Db::getInstance()->executes( + 'SELECT hbd.*, o.`id_lang` FROM `'._DB_PREFIX_.'htl_booking_detail` hbd + INNER JOIN `'._DB_PREFIX_.'orders` o ON(hbd.`id_order` = o.`id_order`)' + ); + if($htlBookings) { + foreach($htlBookings as $htlBooking) { + $objHtlBranchInfo = new HotelBranchInformation($htlBooking['id_hotel'], $htlBooking['id_lang']); + $objRoomInfo = new HotelRoomInformation($htlBooking['id_room']); + $objHtlRoomType = new HotelRoomType(); + $roomTypeInfo = $objHtlRoomType->getRoomTypeInfoByIdProduct($htlBooking['id_product']); + $objProduct = new Product($htlBooking['id_product'], false, $htlBooking['id_lang']); + $objHtlBkDtl = new HotelBookingDetail($htlBooking['id']); + $objHtlBkDtl->hotel_name = $objHtlBranchInfo->hotel_name; + $objHtlBkDtl->room_type_name = $objProduct->name; + $objHtlBkDtl->city = $objHtlBranchInfo->city; + $objHtlBkDtl->state = State::getNameById($objHtlBranchInfo->state_id); + $objHtlBkDtl->country = Country::getNameById($htlBooking['id_lang'], $objHtlBranchInfo->country_id); + $objHtlBkDtl->zipcode = $objHtlBranchInfo->zipcode; + $objHtlBkDtl->phone = $objHtlBranchInfo->phone; + $objHtlBkDtl->email = $objHtlBranchInfo->email; + $objHtlBkDtl->check_in_time = $objHtlBranchInfo->check_in; + $objHtlBkDtl->check_out_time = $objHtlBranchInfo->check_out; + $objHtlBkDtl->room_num = $objRoomInfo->room_num; + $objHtlBkDtl->adult = $roomTypeInfo['adult']; + $objHtlBkDtl->children = $roomTypeInfo['children']; + $objHtlBkDtl->save(); + } + } +} + +function updateRefundRules() +{ + $refundRules = Db::getInstance()->executes( + 'SELECT * FROM `'._DB_PREFIX_.'htl_order_refund_rules`' + ); + foreach($refundRules as $rule) { + $objRefundRule = new HotelOrderRefundRules($rule['id_refund_rule']); + foreach (Language::getLanguages(true) as $lang) { + $objRefundRule->name[$lang['id_lang']] = 'Refund_rule_'.$lang['id_lang']; + $objRefundRule->description[$lang['id_lang']] = 'Refund_desc_'.$lang['id_lang']; + } + $objRefundRule->payment_type = $objRefundRule->payment_type == 2 ? 1 : 2; + $objRefundRule->save(); + } +} + +function populateRefundData() +{ + $odrRefunds = Db::getInstance()->executes( + 'SELECT *, SUM(`refunded_amount`) as `total_refund_amount` FROM `'._DB_PREFIX_.'htl_order_refund_info` hor + GROUP BY `id_order`' + ); + foreach($odrRefunds as $odrRefund) { + $refundState = $odrRefund['refund_stage_id']; + if($refundState == 3) { + $refundState = 4; + } else if ($refundState == 4) { + $refundState = 3; + } + $objOrderReturn = new OrderReturn(); + $objOrderReturn->id_customer = $odrRefund['id_customer']; + $objOrderReturn->id_order = $odrRefund['id_order']; + $objOrderReturn->question = $odrRefund['cancellation_reason']; + // $objOrderReturn->id_transaction = $odrRefund['id_customer']; + // $objOrderReturn->payment_mode = $odrRefund['id_customer']; + $objOrderReturn->refunded_amount = $odrRefund['total_refund_amount']; + $objOrderReturn->state = $refundState; + $objOrderReturn->by_admin = 0; + $objOrderReturn->save(); + } + + $odrRefunds = Db::getInstance()->executes( + 'SELECT hor.*, odr.`id_order_return`, hbd.`id` as `id_htl_booking`, hbd.`id_order_detail` FROM `'._DB_PREFIX_.'htl_order_refund_info` hor + INNER JOIN `'._DB_PREFIX_.'order_return` odr ON (odr.`id_order` = hor.`id_order`) + INNER JOIN `'._DB_PREFIX_.'htl_booking_detail` hbd ON + (hbd.`id_order` = hor.`id_order` + AND hbd.`id_product` = hor.`id_product` + AND hbd.`date_from` = hor.`date_from` + AND hbd.`date_to` = hor.`date_to` + ) + ' + ); + $objHtlBooking = new HotelBookingDetail(); + foreach($odrRefunds as $odrRefund) { + $numDays = $objHtlBooking->getNumberOfDays( + $odrRefund['date_from'], + $odrRefund['date_to'] + ); + $objOrderReturnDetail = new OrderReturnDetail(); + $objOrderReturnDetail->id_order_return = $odrRefund['id_order_return']; + $objOrderReturnDetail->id_htl_booking = $odrRefund['id_htl_booking']; + $objOrderReturnDetail->refunded_amount = $odrRefund['refunded_amount']; + $objOrderReturnDetail->id_order_detail = $odrRefund['id_order_detail']; + $objOrderReturnDetail->product_quantity = $numDays; + $objOrderReturnDetail->save(); + } +} + +function deleteUnusedTables(){ + + return Db::getInstance()->execute( + "DROP TABLE IF EXISTS `"._DB_PREFIX_."htl_customer_adv_payment`; + DROP TABLE IF EXISTS `"._DB_PREFIX_."htl_customer_adv_product_payment`; + DROP TABLE IF EXISTS `"._DB_PREFIX_."htl_order_refund_info`; + DROP TABLE IF EXISTS `"._DB_PREFIX_."htl_order_refund_stages`;" + ); +} + +function updateTables141() +{ + if ($sql = getModuleSql()) { + foreach ($sql as $query) { + if ($query) { + if (!Db::getInstance()->execute(trim($query))) { + return false; + } + } + } + } + return true; +} + +function getModuleSql() +{ + return array ( + "ALTER TABLE `"._DB_PREFIX_."htl_branch_info` + ADD `active_refund` tinyint(1) unsigned NOT NULL DEFAULT '0' AFTER `map_input_text`;", + + "ALTER TABLE `"._DB_PREFIX_."htl_cart_booking_data` + CHANGE `is_refunded` `is_refunded` TINYINT(1) NOT NULL DEFAULT '0';", + + "ALTER TABLE `"._DB_PREFIX_."htl_booking_detail` + CHANGE `is_refunded` `is_refunded` tinyint(1) NOT NULL DEFAULT '0', + ADD `total_paid_amount` decimal(20,6) NOT NULL DEFAULT '0.000000' AFTER `total_price_tax_incl`, + ADD `hotel_name` varchar(255) DEFAULT NULL AFTER `is_back_order`, + ADD `room_type_name` varchar(255) DEFAULT NULL AFTER `hotel_name`, + ADD `city` varchar(255) NOT NULL AFTER `room_type_name`, + ADD `state` varchar(255) DEFAULT NULL AFTER `city`, + ADD `country` varchar(255) DEFAULT NULL AFTER `state`, + ADD `zipcode` varchar(12) DEFAULT NULL AFTER `country`, + ADD `phone` varchar(32) DEFAULT NULL AFTER `zipcode`, + ADD `email` varchar(128) DEFAULT NULL AFTER `phone`, + ADD `check_in_time` varchar(32) DEFAULT NULL AFTER `email`, + ADD `check_out_time` varchar(32) DEFAULT NULL AFTER `check_in_time`, + ADD `room_num` varchar(225) DEFAULT NULL AFTER `check_out_time`, + ADD `adult` smallint(6) NOT NULL DEFAULT '0' AFTER `room_num`, + ADD `children` smallint(6) NOT NULL DEFAULT '0' AFTER `adult`;", + + + "ALTER TABLE `"._DB_PREFIX_."htl_order_refund_rules` + CHANGE `id` `id_refund_rule` int(11) NOT NULL AUTO_INCREMENT;", + + "CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_order_refund_rules_lang` ( + `id_refund_rule` int(10) unsigned NOT NULL, + `id_lang` int(10) unsigned NOT NULL, + `name` varchar(255) DEFAULT NULL, + `description` text, + PRIMARY KEY (`id_refund_rule`, `id_lang`) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;", + + "CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type_feature_pricing_group` ( + `id_feature_price` int(10) unsigned NOT NULL, + `id_group` int(10) unsigned NOT NULL, + PRIMARY KEY (`id_feature_price`,`id_group`) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8;", + + "CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_branch_refund_rules` ( + `id_hotel_refund_rule` int(11) NOT NULL AUTO_INCREMENT, + `id_refund_rule` int(10) unsigned NOT NULL, + `id_hotel` int(10) unsigned NOT NULL, + `position` int(10) unsigned NOT NULL DEFAULT '0', + `date_add` datetime NOT NULL, + `date_upd` datetime NOT NULL, + PRIMARY KEY (`id_hotel_refund_rule`) + ) ENGINE='._MYSQL_ENGINE_.' DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;", + + // "ALTER TABLE `"._DB_PREFIX_."order_return` + // CHANGE `state` `state` int(10) unsigned NOT NULL DEFAULT '1', + // ADD `id_transaction` varchar(100) NOT NULL DEFAULT '' AFTER `state`, + // ADD `payment_mode` varchar(255) NOT NULL DEFAULT '' AFTER `id_transaction`, + // ADD `refunded_amount` decimal(20,6) NOT NULL DEFAULT '0.000000' AFTER `payment_mode`, + // ADD `by_admin` tinyint(1) unsigned NOT NULL DEFAULT '0' AFTER `question`;", + + // "ALTER TABLE `"._DB_PREFIX_."order_return_detail` + // ADD `id_order_return_detail` int(10) unsigned NOT NULL auto_increment FIRST, + // ADD `id_htl_booking` int(11) NOT NULL AFTER `id_order_return`, + // ADD `refunded_amount` decimal(20,6) NOT NULL DEFAULT '0.000000' AFTER id_htl_booking, + // CHANGE `id_order_detail` `id_order_detail` int(10) unsigned NOT NULL DEFAULT '0', + // ADD KEY `id_htl_booking` (`id_htl_booking`), + // DROP PRIMARY KEY, + // ADD PRIMARY KEY (`id_order_return_detail`);", + ); +} + diff --git a/modules/wkabouthotelblock/upgrade/index.php b/modules/wkabouthotelblock/upgrade/index.php new file mode 100644 index 000000000..8d2cf16fe --- /dev/null +++ b/modules/wkabouthotelblock/upgrade/index.php @@ -0,0 +1,29 @@ + +* @copyright 2010-2022 Webkul IN +* @license https://store.webkul.com/license.html +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../../../'); +exit; diff --git a/modules/wkabouthotelblock/upgrade/upgrade-1.1.3.php b/modules/wkabouthotelblock/upgrade/upgrade-1.1.3.php new file mode 100644 index 000000000..5b1dffa39 --- /dev/null +++ b/modules/wkabouthotelblock/upgrade/upgrade-1.1.3.php @@ -0,0 +1,28 @@ + +* @copyright 2010-2022 Webkul IN +* @license https://store.webkul.com/license.html +*/ + +if (!defined('_PS_VERSION_')) + exit; + +function upgrade_module_1_1_3($module) +{ + + return $module->unregisterHook('displayDefaultNavigationHook'); +} diff --git a/modules/wkabouthotelblock/upgrade/upgrade-1.1.5.php b/modules/wkabouthotelblock/upgrade/upgrade-1.1.5.php new file mode 100644 index 000000000..4c40ee97e --- /dev/null +++ b/modules/wkabouthotelblock/upgrade/upgrade-1.1.5.php @@ -0,0 +1,43 @@ + +* @copyright 2010-2022 Webkul IN +* @license https://store.webkul.com/license.html +*/ + +if (!defined('_PS_VERSION_')) + exit; + +function upgrade_module_1_1_5($module) +{ + return updateTableData(); +} + +function updateTableData() +{ + $interiorImages = $htlBookings = Db::getInstance()->executes( + 'SELECT `id_interior_image` FROM `'._DB_PREFIX_.'htl_interior_image`' + ); + + foreach ($interiorImages as $img) { + $objHtlInteriorImg = new WkHotelInteriorImage($img['id_interior_image']); + if(explode('.', $objHtlInteriorImg->name)[0]) { + $objHtlInteriorImg->name = explode('.', $objHtlInteriorImg->name)[0]; + } + $objHtlInteriorImg->save(); + } + return true; +} \ No newline at end of file diff --git a/modules/wkhotelfeaturesblock/upgrade/index.php b/modules/wkhotelfeaturesblock/upgrade/index.php new file mode 100644 index 000000000..8d2cf16fe --- /dev/null +++ b/modules/wkhotelfeaturesblock/upgrade/index.php @@ -0,0 +1,29 @@ + +* @copyright 2010-2022 Webkul IN +* @license https://store.webkul.com/license.html +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../../../'); +exit; diff --git a/modules/wkhotelfeaturesblock/upgrade/upgrade-2.0.2.php b/modules/wkhotelfeaturesblock/upgrade/upgrade-2.0.2.php new file mode 100644 index 000000000..9f860bb49 --- /dev/null +++ b/modules/wkhotelfeaturesblock/upgrade/upgrade-2.0.2.php @@ -0,0 +1,28 @@ + +* @copyright 2010-2022 Webkul IN +* @license https://store.webkul.com/license.html +*/ + +if (!defined('_PS_VERSION_')) + exit; + +function upgrade_module_2_0_2($module) +{ + + return $module->unregisterHook('displayDefaultNavigationHook'); +} diff --git a/modules/wkhotelroom/upgrade/index.php b/modules/wkhotelroom/upgrade/index.php new file mode 100644 index 000000000..8d2cf16fe --- /dev/null +++ b/modules/wkhotelroom/upgrade/index.php @@ -0,0 +1,29 @@ + +* @copyright 2010-2022 Webkul IN +* @license https://store.webkul.com/license.html +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../../../'); +exit; diff --git a/modules/wkhotelroom/upgrade/upgrade-1.1.4.php b/modules/wkhotelroom/upgrade/upgrade-1.1.4.php new file mode 100644 index 000000000..e34a7c236 --- /dev/null +++ b/modules/wkhotelroom/upgrade/upgrade-1.1.4.php @@ -0,0 +1,28 @@ + +* @copyright 2010-2022 Webkul IN +* @license https://store.webkul.com/license.html +*/ + +if (!defined('_PS_VERSION_')) + exit; + +function upgrade_module_1_1_4($module) +{ + + return $module->unregisterHook('displayDefaultNavigationHook'); +} diff --git a/modules/wkroomsearchblock/upgrade/index.php b/modules/wkroomsearchblock/upgrade/index.php new file mode 100644 index 000000000..8d2cf16fe --- /dev/null +++ b/modules/wkroomsearchblock/upgrade/index.php @@ -0,0 +1,29 @@ + +* @copyright 2010-2022 Webkul IN +* @license https://store.webkul.com/license.html +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../../../'); +exit; diff --git a/modules/wkroomsearchblock/upgrade/upgrade-1.1.0.php b/modules/wkroomsearchblock/upgrade/upgrade-1.1.0.php new file mode 100644 index 000000000..6f60b4193 --- /dev/null +++ b/modules/wkroomsearchblock/upgrade/upgrade-1.1.0.php @@ -0,0 +1,37 @@ + +* @copyright 2010-2022 Webkul IN +* @license https://store.webkul.com/license.html +*/ + +if (!defined('_PS_VERSION_')) + exit; + +function upgrade_module_1_1_0($module) +{ + $module->registerHook(array( + 'displayLeftColumn', + 'actionFrontControllerSetMedia', + 'displayAddModuleSettingLink', + )); + + if($id_hook = Hook::getIdByName('displayLeftColumn')) { + $module->updatePosition($id_hook, 0, 1); + } + + return true; +} diff --git a/modules/wktestimonialblock/upgrade/index.php b/modules/wktestimonialblock/upgrade/index.php new file mode 100644 index 000000000..8d2cf16fe --- /dev/null +++ b/modules/wktestimonialblock/upgrade/index.php @@ -0,0 +1,29 @@ + +* @copyright 2010-2022 Webkul IN +* @license https://store.webkul.com/license.html +*/ + +header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); + +header('Cache-Control: no-store, no-cache, must-revalidate'); +header('Cache-Control: post-check=0, pre-check=0', false); +header('Pragma: no-cache'); + +header('Location: ../../../'); +exit; diff --git a/modules/wktestimonialblock/upgrade/upgrade-1.1.3.php b/modules/wktestimonialblock/upgrade/upgrade-1.1.3.php new file mode 100644 index 000000000..b31880d4c --- /dev/null +++ b/modules/wktestimonialblock/upgrade/upgrade-1.1.3.php @@ -0,0 +1,28 @@ + +* @copyright 2010-2022 Webkul IN +* @license https://store.webkul.com/license.html +*/ + +if (!defined('_PS_VERSION_')) + exit; + +function upgrade_module_1_1_3($module) +{ + $module->unregisterHook('displayDefaultNavigationHook'); + return true; +}