Remove install.sql file from modules
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
-----------------------------
|
||||
# V1.3.2 to V1.3.3
|
||||
-----------------------------
|
||||
|
||||
## Improved/Changed Features:
|
||||
|
||||
* [CO] : Removed install.sql
|
||||
|
||||
-----------------------------
|
||||
# V1.3.1 to V1.3.2
|
||||
-----------------------------
|
||||
|
||||
@@ -27,19 +27,18 @@
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
include_once(dirname(__FILE__).'/WishList.php');
|
||||
include_once (dirname(__FILE__).'/classes/BlockWishlistDb.php');
|
||||
include_once (dirname(__FILE__).'/WishList.php');
|
||||
|
||||
class BlockWishList extends Module
|
||||
{
|
||||
const INSTALL_SQL_FILE = 'install.sql';
|
||||
|
||||
private $html = '';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'blockwishlist';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.3.2';
|
||||
$this->version = '1.3.3';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->need_instance = 0;
|
||||
|
||||
@@ -57,18 +56,11 @@ class BlockWishList extends Module
|
||||
|
||||
public function install($delete_params = true)
|
||||
{
|
||||
if ($delete_params)
|
||||
{
|
||||
if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE))
|
||||
return (false);
|
||||
else if (!$sql = file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE))
|
||||
return (false);
|
||||
$sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql);
|
||||
$sql = preg_split("/;\s*[\r\n]+/", $sql);
|
||||
foreach ($sql as $query)
|
||||
if ($query)
|
||||
if (!Db::getInstance()->execute(trim($query)))
|
||||
return false;
|
||||
if ($delete_params) {
|
||||
$objBlockWishListDb = new BlockWishlistDb();
|
||||
if (!$objBlockWishListDb->createTables()) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (!parent::install() ||
|
||||
@@ -89,8 +81,10 @@ class BlockWishList extends Module
|
||||
|
||||
public function uninstall($delete_params = true)
|
||||
{
|
||||
if (($delete_params && !$this->deleteTables()) || !parent::uninstall())
|
||||
$objBlockWishListDb = new BlockWishlistDb();
|
||||
if (($delete_params && !$objBlockWishListDb->dropTables()) || !parent::uninstall()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
89
modules/blockwishlist/classes/BlockWishlistDb.php
Normal file
89
modules/blockwishlist/classes/BlockWishlistDb.php
Normal file
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
class BlockWishListDb
|
||||
{
|
||||
public function getModuleSql()
|
||||
{
|
||||
return array(
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."wishlist` (
|
||||
`id_wishlist` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_customer` int(10) unsigned NOT NULL,
|
||||
`token` varchar(64) character set utf8 NOT NULL,
|
||||
`name` varchar(64) character set utf8 NOT NULL,
|
||||
`counter` int(10) unsigned NULL,
|
||||
`id_shop` int(10) unsigned default 1,
|
||||
`id_shop_group` int(10) unsigned default 1,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
`default` int(10) unsigned default 0,
|
||||
PRIMARY KEY (`id_wishlist`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."wishlist_email` (
|
||||
`id_wishlist` int(10) unsigned NOT NULL,
|
||||
`email` varchar(128) character set utf8 NOT NULL,
|
||||
`date_add` datetime NOT NULL
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."wishlist_product` (
|
||||
`id_wishlist_product` int(10) NOT NULL auto_increment,
|
||||
`id_wishlist` int(10) unsigned NOT NULL,
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_product_attribute` int(10) unsigned NOT NULL,
|
||||
`quantity` int(10) unsigned NOT NULL,
|
||||
`priority` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_wishlist_product`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."wishlist_product_cart` (
|
||||
`id_wishlist_product` int(10) unsigned NOT NULL,
|
||||
`id_cart` int(10) unsigned NOT NULL,
|
||||
`quantity` int(10) unsigned NOT NULL,
|
||||
`date_add` datetime NOT NULL
|
||||
) 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;
|
||||
}
|
||||
|
||||
public function dropTables()
|
||||
{
|
||||
return Db::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'wishlist`,
|
||||
`'._DB_PREFIX_.'wishlist_email`,
|
||||
`'._DB_PREFIX_.'wishlist_product`,
|
||||
`'._DB_PREFIX_.'wishlist_product_cart`'
|
||||
);
|
||||
}
|
||||
}
|
||||
35
modules/blockwishlist/classes/index.php
Normal file
35
modules/blockwishlist/classes/index.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2015 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2015 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
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;
|
||||
@@ -1,36 +0,0 @@
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_wishlist` (
|
||||
`id_wishlist` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_customer` int(10) unsigned NOT NULL,
|
||||
`token` varchar(64) character set utf8 NOT NULL,
|
||||
`name` varchar(64) character set utf8 NOT NULL,
|
||||
`counter` int(10) unsigned NULL,
|
||||
`id_shop` int(10) unsigned default 1,
|
||||
`id_shop_group` int(10) unsigned default 1,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
`default` int(10) unsigned default 0,
|
||||
PRIMARY KEY (`id_wishlist`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_wishlist_email` (
|
||||
`id_wishlist` int(10) unsigned NOT NULL,
|
||||
`email` varchar(128) character set utf8 NOT NULL,
|
||||
`date_add` datetime NOT NULL
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_wishlist_product` (
|
||||
`id_wishlist_product` int(10) NOT NULL auto_increment,
|
||||
`id_wishlist` int(10) unsigned NOT NULL,
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_product_attribute` int(10) unsigned NOT NULL,
|
||||
`quantity` int(10) unsigned NOT NULL,
|
||||
`priority` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_wishlist_product`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_wishlist_product_cart` (
|
||||
`id_wishlist_product` int(10) unsigned NOT NULL,
|
||||
`id_cart` int(10) unsigned NOT NULL,
|
||||
`quantity` int(10) unsigned NOT NULL,
|
||||
`date_add` datetime NOT NULL
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
@@ -1,3 +1,11 @@
|
||||
-------------------------
|
||||
# V1.4.3 to V1.4.4
|
||||
-------------------------
|
||||
|
||||
## Improved/changed features:
|
||||
|
||||
[*] CO : Removed install.sql
|
||||
|
||||
-------------------------
|
||||
# V1.4.2 to V1.4.3
|
||||
-------------------------
|
||||
|
||||
@@ -0,0 +1,423 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
class HotelReservationSystemDb
|
||||
{
|
||||
public function getModuleSql()
|
||||
{
|
||||
return array(
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`id_hotel` int(11) NOT NULL,
|
||||
`adult` smallint(6) NOT NULL,
|
||||
`children` smallint(6) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_information` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`id_hotel` int(11) NOT NULL,
|
||||
`room_num` varchar(225) NOT NULL,
|
||||
`id_status` int(11) NOT NULL,
|
||||
`floor` text NOT NULL,
|
||||
`comment` text NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_branch_info` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`id_category` int(10) unsigned NOT NULL,
|
||||
`phone` varchar(32) DEFAULT NULL,
|
||||
`email` varchar(128) NOT NULL,
|
||||
`check_in` varchar(255) DEFAULT NULL,
|
||||
`check_out` varchar(255) DEFAULT NULL,
|
||||
`rating` int(2) unsigned NOT NULL,
|
||||
`city` varchar(64) NOT NULL,
|
||||
`state_id` int(10) unsigned NOT NULL,
|
||||
`country_id` int(10) unsigned NOT NULL,
|
||||
`zipcode` varchar(12) NOT NULL,
|
||||
`address` text DEFAULT NULL,
|
||||
`active` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`latitude` decimal(10,8) NOT NULL,
|
||||
`longitude` decimal(11,8) NOT NULL,
|
||||
`map_formated_address` text NOT NULL,
|
||||
`map_input_text` text NOT NULL,
|
||||
`active_refund` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_branch_info_lang` (
|
||||
`id` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`hotel_name` varchar(255) DEFAULT NULL,
|
||||
`short_description` text,
|
||||
`description` text,
|
||||
`policies` text,
|
||||
PRIMARY KEY (`id`, `id_lang`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_image` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`id_hotel` int(10) unsigned NOT NULL,
|
||||
`hotel_image_id` varchar(32) NOT NULL,
|
||||
`cover` tinyint(1) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_branch_features` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`id_hotel` int(10) unsigned NOT NULL,
|
||||
`feature_id` varchar(255) DEFAULT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_features` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`parent_feature_id` int(10) unsigned NOT NULL,
|
||||
`position` int(10) unsigned NOT NULL,
|
||||
`active` int(2) NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_features_lang` (
|
||||
`id` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id`, `id_lang`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_cart_booking_data` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_cart` int(11) NOT NULL,
|
||||
`id_guest` int(11) NOT NULL,
|
||||
`id_order` int(11) NOT NULL,
|
||||
`id_customer` int(11) NOT NULL,
|
||||
`id_currency` int(11) NOT NULL,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`id_room` int(11) NOT NULL,
|
||||
`id_hotel` int(11) NOT NULL,
|
||||
`quantity` int(11) NOT NULL,
|
||||
`booking_type` tinyint(4) NOT NULL,
|
||||
`comment` text NOT NULL,
|
||||
`is_back_order` tinyint(4) NOT NULL,
|
||||
`extra_demands` text NOT NULL,
|
||||
`date_from` datetime NOT NULL,
|
||||
`date_to` datetime NOT NULL,
|
||||
`is_refunded` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_booking_detail` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`id_order` int(11) NOT NULL,
|
||||
`id_order_detail` int(11) NOT NULL,
|
||||
`id_cart` int(11) NOT NULL,
|
||||
`id_room` int(11) NOT NULL,
|
||||
`id_hotel` int(11) NOT NULL,
|
||||
`id_customer` int(11) NOT NULL,
|
||||
`booking_type` tinyint(4) NOT NULL,
|
||||
`id_status` int(11) NOT NULL,
|
||||
`comment` text NOT NULL,
|
||||
`check_in` datetime NOT NULL,
|
||||
`check_out` datetime NOT NULL,
|
||||
`date_from` datetime NOT NULL,
|
||||
`date_to` datetime NOT NULL,
|
||||
`total_price_tax_excl` decimal(20,6) NOT NULL,
|
||||
`total_price_tax_incl` decimal(20,6) NOT NULL,
|
||||
`total_paid_amount` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`is_back_order` tinyint(4) NOT NULL,
|
||||
`hotel_name` varchar(255) DEFAULT NULL,
|
||||
`room_type_name` varchar(255) DEFAULT NULL,
|
||||
`city` varchar(255) NOT NULL,
|
||||
`state` varchar(255) DEFAULT NULL,
|
||||
`country` varchar(255) DEFAULT NULL,
|
||||
`zipcode` varchar(12) DEFAULT NULL,
|
||||
`phone` varchar(32) DEFAULT NULL,
|
||||
`email` varchar(128) DEFAULT NULL,
|
||||
`check_in_time` varchar(32) DEFAULT NULL,
|
||||
`check_out_time` varchar(32) DEFAULT NULL,
|
||||
`room_num` varchar(225) DEFAULT NULL,
|
||||
`adult` smallint(6) NOT NULL DEFAULT '0',
|
||||
`children` smallint(6) NOT NULL DEFAULT '0',
|
||||
`is_refunded` tinyint(1) NOT NULL DEFAULT '0',
|
||||
-- `available_for_order` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_booking_demands` (
|
||||
`id_booking_demand` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_htl_booking` int(11) NOT NULL,
|
||||
`name` varchar(255) character set utf8 NOT NULL,
|
||||
`unit_price_tax_excl` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`unit_price_tax_incl` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`total_price_tax_excl` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`total_price_tax_incl` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`price_calc_method` int(11) unsigned DEFAULT '0',
|
||||
`id_tax_rules_group` int(11) unsigned DEFAULT '0',
|
||||
`tax_computation_method` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_booking_demand`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"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;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_status` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`status` text NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_allotment_type` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`type` text NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_advance_payment` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`payment_type` tinyint(4) NOT NULL,
|
||||
`value` decimal(20,6) NOT NULL,
|
||||
`id_currency` int(11) NOT NULL,
|
||||
`tax_include` tinyint(4) NOT NULL,
|
||||
`calculate_from` tinyint(4) NOT NULL,
|
||||
`active` tinyint(4) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_order_refund_rules` (
|
||||
`id_refund_rule` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`payment_type` int(2) unsigned NOT NULL,
|
||||
`deduction_value_full_pay` decimal(20,6) NOT NULL,
|
||||
`deduction_value_adv_pay` decimal(20,6) NOT NULL,
|
||||
`days` decimal(35,0) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_refund_rule`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"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_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;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_order_restrict_date` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_hotel` int(11) NOT NULL,
|
||||
`max_order_date` datetime NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type_feature_pricing` (
|
||||
`id_feature_price` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`date_from` date NOT NULL,
|
||||
`date_to` date NOT NULL,
|
||||
`is_special_days_exists` tinyint(1) NOT NULL,
|
||||
`date_selection_type` tinyint(1) NOT NULL,
|
||||
`special_days` text,
|
||||
`impact_way` tinyint(1) NOT NULL,
|
||||
`impact_type` tinyint(1) NOT NULL,
|
||||
`impact_value` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`active` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_feature_price`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type_feature_pricing_lang` (
|
||||
`id_feature_price` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`feature_price_name` varchar(255) character set utf8 NOT NULL,
|
||||
PRIMARY KEY (`id_feature_price`, `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_room_type_global_demand` (
|
||||
`id_global_demand` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`price` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`id_tax_rules_group` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`price_calc_method` tinyint(1) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_global_demand`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type_global_demand_lang` (
|
||||
`id_global_demand` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`name` varchar(255) character set utf8 NOT NULL,
|
||||
PRIMARY KEY (`id_global_demand`, `id_lang`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type_global_demand_advance_option` (
|
||||
`id_option` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_global_demand` int(11) NOT NULL,
|
||||
`price` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_option`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type_global_demand_advance_option_lang` (
|
||||
`id_option` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`name` varchar(255) character set utf8 NOT NULL,
|
||||
PRIMARY KEY (`id_option`, `id_lang`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type_demand_price` (
|
||||
`id_room_type_demand_price` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_global_demand` int(10) unsigned NOT NULL,
|
||||
`id_option` int(10) unsigned NOT NULL,
|
||||
`price` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_room_type_demand_price`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_type_demand` (
|
||||
`id_room_type_demand` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_global_demand` int(10) unsigned NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_room_type_demand`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_disable_dates` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_room_type` int(11) NOT NULL,
|
||||
`id_room` int(11) NOT NULL,
|
||||
`date_from` date NOT NULL,
|
||||
`date_to` date NOT NULL,
|
||||
`reason` text,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"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;",
|
||||
);
|
||||
}
|
||||
|
||||
public function createTables()
|
||||
{
|
||||
if ($sql = $this->getModuleSql()) {
|
||||
foreach ($sql as $query) {
|
||||
if ($query) {
|
||||
if (!Db::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function dropTables()
|
||||
{
|
||||
return Db::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'htl_room_type`,
|
||||
`'._DB_PREFIX_.'htl_room_information`,
|
||||
`'._DB_PREFIX_.'htl_branch_info`,
|
||||
`'._DB_PREFIX_.'htl_branch_info_lang`,
|
||||
`'._DB_PREFIX_.'htl_image`,
|
||||
`'._DB_PREFIX_.'htl_branch_features`,
|
||||
`'._DB_PREFIX_.'htl_features`,
|
||||
`'._DB_PREFIX_.'htl_features_lang`,
|
||||
`'._DB_PREFIX_.'htl_cart_booking_data`,
|
||||
`'._DB_PREFIX_.'htl_booking_detail`,
|
||||
`'._DB_PREFIX_.'htl_booking_demands`,
|
||||
`'._DB_PREFIX_.'htl_booking_demands_tax`,
|
||||
`'._DB_PREFIX_.'htl_room_status`,
|
||||
`'._DB_PREFIX_.'htl_room_allotment_type`,
|
||||
`'._DB_PREFIX_.'htl_advance_payment`,
|
||||
`'._DB_PREFIX_.'htl_order_refund_rules`,
|
||||
`'._DB_PREFIX_.'htl_order_refund_rules_lang`,
|
||||
`'._DB_PREFIX_.'htl_branch_refund_rules`,
|
||||
`'._DB_PREFIX_.'htl_order_restrict_date`,
|
||||
`'._DB_PREFIX_.'htl_room_type_feature_pricing`,
|
||||
`'._DB_PREFIX_.'htl_room_type_feature_pricing_lang`,
|
||||
`'._DB_PREFIX_.'htl_room_type_feature_pricing_group`,
|
||||
`'._DB_PREFIX_.'htl_room_type_global_demand`,
|
||||
`'._DB_PREFIX_.'htl_room_type_global_demand_lang`,
|
||||
`'._DB_PREFIX_.'htl_room_type_global_demand_advance_option`,
|
||||
`'._DB_PREFIX_.'htl_room_type_global_demand_advance_option_lang`,
|
||||
`'._DB_PREFIX_.'htl_room_type_demand_price`,
|
||||
`'._DB_PREFIX_.'htl_room_type_demand`,
|
||||
`'._DB_PREFIX_.'htl_room_disable_dates`,
|
||||
`'._DB_PREFIX_.'htl_access`'
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
require_once 'classes/HotelReservationSystemDb.php';
|
||||
require_once 'classes/HotelRoomType.php';
|
||||
require_once 'classes/HotelRoomInformation.php';
|
||||
require_once 'classes/HotelBranchInformation.php';
|
||||
|
||||
@@ -25,11 +25,10 @@ include_once 'define.php';
|
||||
|
||||
class hotelreservationsystem extends Module
|
||||
{
|
||||
const INSTALL_SQL_FILE = 'install.sql';
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'hotelreservationsystem';
|
||||
$this->version = '1.4.3';
|
||||
$this->version = '1.4.4';
|
||||
$this->author = 'Webkul';
|
||||
$this->need_instance = 0;
|
||||
$this->bootstrap = true;
|
||||
@@ -636,21 +635,9 @@ class hotelreservationsystem extends Module
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
$objModuleDb = new HotelReservationSystemDb();
|
||||
if (!$objModuleDb->createTables()) {
|
||||
return false;
|
||||
} elseif (!$sql = Tools::file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql);
|
||||
$sql = preg_split("/;\s*[\r\n]+/", $sql);
|
||||
|
||||
foreach ($sql as $query) {
|
||||
if ($query) {
|
||||
if (!Db::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// if module should be populated while installation
|
||||
@@ -673,7 +660,6 @@ class hotelreservationsystem extends Module
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -704,43 +690,6 @@ class hotelreservationsystem extends Module
|
||||
);
|
||||
}
|
||||
|
||||
public function deleteTables()
|
||||
{
|
||||
return Db::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'htl_room_type`,
|
||||
`'._DB_PREFIX_.'htl_room_information`,
|
||||
`'._DB_PREFIX_.'htl_branch_info`,
|
||||
`'._DB_PREFIX_.'htl_branch_info_lang`,
|
||||
`'._DB_PREFIX_.'htl_image`,
|
||||
`'._DB_PREFIX_.'htl_branch_features`,
|
||||
`'._DB_PREFIX_.'htl_features`,
|
||||
`'._DB_PREFIX_.'htl_features_lang`,
|
||||
`'._DB_PREFIX_.'htl_cart_booking_data`,
|
||||
`'._DB_PREFIX_.'htl_booking_detail`,
|
||||
`'._DB_PREFIX_.'htl_booking_demands`,
|
||||
`'._DB_PREFIX_.'htl_booking_demands_tax`,
|
||||
`'._DB_PREFIX_.'htl_room_status`,
|
||||
`'._DB_PREFIX_.'htl_room_allotment_type`,
|
||||
`'._DB_PREFIX_.'htl_advance_payment`,
|
||||
`'._DB_PREFIX_.'htl_order_refund_rules`,
|
||||
`'._DB_PREFIX_.'htl_order_refund_rules_lang`,
|
||||
`'._DB_PREFIX_.'htl_branch_refund_rules`,
|
||||
`'._DB_PREFIX_.'htl_order_restrict_date`,
|
||||
`'._DB_PREFIX_.'htl_room_type_feature_pricing`,
|
||||
`'._DB_PREFIX_.'htl_room_type_feature_pricing_lang`,
|
||||
`'._DB_PREFIX_.'htl_room_type_feature_pricing_group`,
|
||||
`'._DB_PREFIX_.'htl_room_type_global_demand`,
|
||||
`'._DB_PREFIX_.'htl_room_type_global_demand_lang`,
|
||||
`'._DB_PREFIX_.'htl_room_type_global_demand_advance_option`,
|
||||
`'._DB_PREFIX_.'htl_room_type_global_demand_advance_option_lang`,
|
||||
`'._DB_PREFIX_.'htl_room_type_demand_price`,
|
||||
`'._DB_PREFIX_.'htl_room_type_demand`,
|
||||
`'._DB_PREFIX_.'htl_room_disable_dates`,
|
||||
`'._DB_PREFIX_.'htl_access`'
|
||||
);
|
||||
}
|
||||
|
||||
public function uninstallTab()
|
||||
{
|
||||
$moduleTabs = Tab::getCollectionFromModule($this->name);
|
||||
@@ -783,9 +732,10 @@ class hotelreservationsystem extends Module
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
$objModuleDb = new HotelReservationSystemDb();
|
||||
if (!parent::uninstall()
|
||||
|| !$this->deleteConfigVars()
|
||||
|| !$this->deleteTables()
|
||||
|| !$objModuleDb->dropTables()
|
||||
|| !$this->uninstallTab()
|
||||
) {
|
||||
return false;
|
||||
|
||||
@@ -1,363 +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 <support@webkul.com>
|
||||
* @copyright 2010-2020 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_type` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`id_hotel` int(11) NOT NULL,
|
||||
`adult` smallint(6) NOT NULL,
|
||||
`children` smallint(6) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_information` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`id_hotel` int(11) NOT NULL,
|
||||
`room_num` varchar(225) NOT NULL,
|
||||
`id_status` int(11) NOT NULL,
|
||||
`floor` text NOT NULL,
|
||||
`comment` text NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_branch_info` (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_category` int(10) unsigned NOT NULL,
|
||||
`phone` varchar(32) DEFAULT NULL,
|
||||
`email` varchar(128) NOT NULL,
|
||||
`check_in` varchar(255) DEFAULT NULL,
|
||||
`check_out` varchar(255) DEFAULT NULL,
|
||||
`rating` int(2) unsigned NOT NULL,
|
||||
`city` varchar(64) NOT NULL,
|
||||
`state_id` int(10) unsigned NOT NULL,
|
||||
`country_id` int(10) unsigned NOT NULL,
|
||||
`zipcode` varchar(12) NOT NULL,
|
||||
`address` text DEFAULT NULL,
|
||||
`active` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`latitude` decimal(10,8) NOT NULL,
|
||||
`longitude` decimal(11,8) NOT NULL,
|
||||
`map_formated_address` text NOT NULL,
|
||||
`map_input_text` text NOT NULL,
|
||||
`active_refund` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_branch_info_lang` (
|
||||
`id` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`hotel_name` varchar(255) DEFAULT NULL,
|
||||
`short_description` text,
|
||||
`description` text,
|
||||
`policies` text,
|
||||
PRIMARY KEY (`id`, `id_lang`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_image` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`id_hotel` int(10) unsigned NOT NULL,
|
||||
`hotel_image_id` varchar(32) NOT NULL,
|
||||
`cover` tinyint(1) NOT NULL DEFAULT '0',
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_branch_features` (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_hotel` int(10) unsigned NOT NULL,
|
||||
`feature_id` varchar(255) DEFAULT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_features` (
|
||||
`id` int(10) unsigned NOT NULL auto_increment,
|
||||
`parent_feature_id` int(10) unsigned NOT NULL,
|
||||
`position` int(10) unsigned NOT NULL,
|
||||
`active` int(2) NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_features_lang` (
|
||||
`id` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id`, `id_lang`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_cart_booking_data` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_cart` int(11) NOT NULL,
|
||||
`id_guest` int(11) NOT NULL,
|
||||
`id_order` int(11) NOT NULL,
|
||||
`id_customer` int(11) NOT NULL,
|
||||
`id_currency` int(11) NOT NULL,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`id_room` int(11) NOT NULL,
|
||||
`id_hotel` int(11) NOT NULL,
|
||||
`quantity` int(11) NOT NULL,
|
||||
`booking_type` tinyint(4) NOT NULL,
|
||||
`comment` text NOT NULL,
|
||||
`is_back_order` tinyint(4) NOT NULL,
|
||||
`extra_demands` text NOT NULL,
|
||||
`date_from` datetime NOT NULL,
|
||||
`date_to` datetime NOT NULL,
|
||||
`is_refunded` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_booking_detail` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`id_order` int(11) NOT NULL,
|
||||
`id_order_detail` int(11) NOT NULL,
|
||||
`id_cart` int(11) NOT NULL,
|
||||
`id_room` int(11) NOT NULL,
|
||||
`id_hotel` int(11) NOT NULL,
|
||||
`id_customer` int(11) NOT NULL,
|
||||
`booking_type` tinyint(4) NOT NULL,
|
||||
`id_status` int(11) NOT NULL,
|
||||
`comment` text NOT NULL,
|
||||
`check_in` datetime NOT NULL,
|
||||
`check_out` datetime NOT NULL,
|
||||
`date_from` datetime NOT NULL,
|
||||
`date_to` datetime NOT NULL,
|
||||
`total_price_tax_excl` decimal(20,6) NOT NULL,
|
||||
`total_price_tax_incl` decimal(20,6) NOT NULL,
|
||||
`total_paid_amount` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`is_back_order` tinyint(4) NOT NULL,
|
||||
`hotel_name` varchar(255) DEFAULT NULL,
|
||||
`room_type_name` varchar(255) DEFAULT NULL,
|
||||
`city` varchar(255) NOT NULL,
|
||||
`state` varchar(255) DEFAULT NULL,
|
||||
`country` varchar(255) DEFAULT NULL,
|
||||
`zipcode` varchar(12) DEFAULT NULL,
|
||||
`phone` varchar(32) DEFAULT NULL,
|
||||
`email` varchar(128) DEFAULT NULL,
|
||||
`check_in_time` varchar(32) DEFAULT NULL,
|
||||
`check_out_time` varchar(32) DEFAULT NULL,
|
||||
`room_num` varchar(225) DEFAULT NULL,
|
||||
`adult` smallint(6) NOT NULL DEFAULT '0',
|
||||
`children` smallint(6) NOT NULL DEFAULT '0',
|
||||
`is_refunded` tinyint(1) NOT NULL DEFAULT '0',
|
||||
-- `available_for_order` tinyint(1) NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_booking_demands` (
|
||||
`id_booking_demand` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_htl_booking` int(11) NOT NULL,
|
||||
`name` varchar(255) character set utf8 NOT NULL,
|
||||
`unit_price_tax_excl` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`unit_price_tax_incl` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`total_price_tax_excl` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`total_price_tax_incl` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`price_calc_method` int(11) unsigned DEFAULT '0',
|
||||
`id_tax_rules_group` int(11) unsigned DEFAULT '0',
|
||||
`tax_computation_method` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_booking_demand`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `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=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_status` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`status` text NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_allotment_type` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`type` text NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_advance_payment` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`payment_type` tinyint(4) NOT NULL,
|
||||
`value` decimal(20,6) NOT NULL,
|
||||
`id_currency` int(11) NOT NULL,
|
||||
`tax_include` tinyint(4) NOT NULL,
|
||||
`calculate_from` tinyint(4) NOT NULL,
|
||||
`active` tinyint(4) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_order_refund_rules` (
|
||||
`id_refund_rule` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`payment_type` int(2) unsigned NOT NULL,
|
||||
`deduction_value_full_pay` decimal(20,6) NOT NULL,
|
||||
`deduction_value_adv_pay` decimal(20,6) NOT NULL,
|
||||
`days` decimal(35,0) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_refund_rule`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `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=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `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=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_order_restrict_date` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_hotel` int(11) NOT NULL,
|
||||
`max_order_date` datetime NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_type_feature_pricing` (
|
||||
`id_feature_price` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`date_from` date NOT NULL,
|
||||
`date_to` date NOT NULL,
|
||||
`is_special_days_exists` tinyint(1) NOT NULL,
|
||||
`date_selection_type` tinyint(1) NOT NULL,
|
||||
`special_days` text,
|
||||
`impact_way` tinyint(1) NOT NULL,
|
||||
`impact_type` tinyint(1) NOT NULL,
|
||||
`impact_value` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`active` tinyint(1) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_feature_price`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_type_feature_pricing_lang` (
|
||||
`id_feature_price` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`feature_price_name` varchar(255) character set utf8 NOT NULL,
|
||||
PRIMARY KEY (`id_feature_price`, `id_lang`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE `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=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_type_global_demand` (
|
||||
`id_global_demand` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`price` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`id_tax_rules_group` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`price_calc_method` tinyint(1) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_global_demand`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_type_global_demand_lang` (
|
||||
`id_global_demand` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`name` varchar(255) character set utf8 NOT NULL,
|
||||
PRIMARY KEY (`id_global_demand`, `id_lang`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_type_global_demand_advance_option` (
|
||||
`id_option` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_global_demand` int(11) NOT NULL,
|
||||
`price` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_option`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_type_global_demand_advance_option_lang` (
|
||||
`id_option` int(10) unsigned NOT NULL,
|
||||
`id_lang` int(10) unsigned NOT NULL,
|
||||
`name` varchar(255) character set utf8 NOT NULL,
|
||||
PRIMARY KEY (`id_option`, `id_lang`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_type_demand_price` (
|
||||
`id_room_type_demand_price` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_global_demand` int(10) unsigned NOT NULL,
|
||||
`id_option` int(10) unsigned NOT NULL,
|
||||
`price` decimal(20,6) NOT NULL DEFAULT '0.000000',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_room_type_demand_price`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_type_demand` (
|
||||
`id_room_type_demand` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_global_demand` int(10) unsigned NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_room_type_demand`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_disable_dates` (
|
||||
`id` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_room_type` int(11) NOT NULL,
|
||||
`id_room` int(11) NOT NULL,
|
||||
`date_from` date NOT NULL,
|
||||
`date_to` date NOT NULL,
|
||||
`reason` text,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `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=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
@@ -1,3 +1,11 @@
|
||||
-------------------------
|
||||
# V3.6.1 to V3.6.2
|
||||
-------------------------
|
||||
|
||||
## Improved/changed features:
|
||||
|
||||
* [CO] : Removed install.sql
|
||||
|
||||
-------------------------
|
||||
# V3.6.0 to V3.6.1
|
||||
-------------------------
|
||||
|
||||
131
modules/productcomments/classes/ProductCommentsDb.php
Normal file
131
modules/productcomments/classes/ProductCommentsDb.php
Normal file
@@ -0,0 +1,131 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
class ProductCommentsDb
|
||||
{
|
||||
public function getModuleSql()
|
||||
{
|
||||
return array(
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."product_comment` (
|
||||
`id_product_comment` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_customer` int(10) unsigned NOT NULL,
|
||||
`id_guest` int(10) unsigned NULL,
|
||||
`title` varchar(64) NULL,
|
||||
`content` text NOT NULL,
|
||||
`customer_name` varchar(64) NULL,
|
||||
`grade` float unsigned NOT NULL,
|
||||
`validate` tinyint(1) NOT NULL,
|
||||
`deleted` tinyint(1) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment`),
|
||||
KEY `id_product` (`id_product`),
|
||||
KEY `id_customer` (`id_customer`),
|
||||
KEY `id_guest` (`id_guest`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."product_comment_criterion` (
|
||||
`id_product_comment_criterion` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_product_comment_criterion_type` tinyint(1) NOT NULL,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment_criterion`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."product_comment_criterion_product` (
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_product_comment_criterion` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY(`id_product`, `id_product_comment_criterion`),
|
||||
KEY `id_product_comment_criterion` (`id_product_comment_criterion`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."product_comment_criterion_lang` (
|
||||
`id_product_comment_criterion` INT(11) UNSIGNED NOT NULL ,
|
||||
`id_lang` INT(11) UNSIGNED NOT NULL ,
|
||||
`name` VARCHAR(64) NOT NULL ,
|
||||
PRIMARY KEY ( `id_product_comment_criterion` , `id_lang` )
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."product_comment_criterion_category` (
|
||||
`id_product_comment_criterion` int(10) unsigned NOT NULL,
|
||||
`id_category` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY(`id_product_comment_criterion`, `id_category`),
|
||||
KEY `id_category` (`id_category`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."product_comment_grade` (
|
||||
`id_product_comment` int(10) unsigned NOT NULL,
|
||||
`id_product_comment_criterion` int(10) unsigned NOT NULL,
|
||||
`grade` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment`, `id_product_comment_criterion`),
|
||||
KEY `id_product_comment_criterion` (`id_product_comment_criterion`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."product_comment_usefulness` (
|
||||
`id_product_comment` int(10) unsigned NOT NULL,
|
||||
`id_customer` int(10) unsigned NOT NULL,
|
||||
`usefulness` tinyint(1) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment`, `id_customer`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."product_comment_report` (
|
||||
`id_product_comment` int(10) unsigned NOT NULL,
|
||||
`id_customer` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment`, `id_customer`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;",
|
||||
|
||||
"INSERT IGNORE INTO `"._DB_PREFIX_."product_comment_criterion` VALUES ('1', '1', '1');",
|
||||
|
||||
"INSERT IGNORE INTO `"._DB_PREFIX_."product_comment_criterion_lang` (`id_product_comment_criterion`, `id_lang`, `name`)
|
||||
(
|
||||
SELECT '1', l.`id_lang`, 'Quality'
|
||||
FROM `"._DB_PREFIX_."lang` l
|
||||
);",
|
||||
);
|
||||
}
|
||||
|
||||
public function createTables()
|
||||
{
|
||||
if ($sql = $this->getModuleSql()) {
|
||||
foreach ($sql as $query) {
|
||||
if ($query) {
|
||||
if (!Db::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function dropTables()
|
||||
{
|
||||
return Db::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'product_comment`,
|
||||
`'._DB_PREFIX_.'product_comment_criterion`,
|
||||
`'._DB_PREFIX_.'product_comment_criterion_product`,
|
||||
`'._DB_PREFIX_.'product_comment_criterion_lang`,
|
||||
`'._DB_PREFIX_.'product_comment_criterion_category`,
|
||||
`'._DB_PREFIX_.'product_comment_grade`,
|
||||
`'._DB_PREFIX_.'product_comment_usefulness`,
|
||||
`'._DB_PREFIX_.'product_comment_report`'
|
||||
);
|
||||
}
|
||||
}
|
||||
35
modules/productcomments/classes/index.php
Normal file
35
modules/productcomments/classes/index.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
/*
|
||||
* 2007-2015 PrestaShop
|
||||
*
|
||||
* NOTICE OF LICENSE
|
||||
*
|
||||
* This source file is subject to the Academic Free License (AFL 3.0)
|
||||
* that is bundled with this package in the file LICENSE.txt.
|
||||
* It is also available through the world-wide-web at this URL:
|
||||
* http://opensource.org/licenses/afl-3.0.php
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@prestashop.com so we can send you a copy immediately.
|
||||
*
|
||||
* DISCLAIMER
|
||||
*
|
||||
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
|
||||
* versions in the future. If you wish to customize PrestaShop for your
|
||||
* needs please refer to http://www.prestashop.com for more information.
|
||||
*
|
||||
* @author PrestaShop SA <contact@prestashop.com>
|
||||
* @copyright 2007-2015 PrestaShop SA
|
||||
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
||||
* International Registered Trademark & Property of PrestaShop SA
|
||||
*/
|
||||
|
||||
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;
|
||||
@@ -1,75 +0,0 @@
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_product_comment` (
|
||||
`id_product_comment` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_customer` int(10) unsigned NOT NULL,
|
||||
`id_guest` int(10) unsigned NULL,
|
||||
`title` varchar(64) NULL,
|
||||
`content` text NOT NULL,
|
||||
`customer_name` varchar(64) NULL,
|
||||
`grade` float unsigned NOT NULL,
|
||||
`validate` tinyint(1) NOT NULL,
|
||||
`deleted` tinyint(1) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment`),
|
||||
KEY `id_product` (`id_product`),
|
||||
KEY `id_customer` (`id_customer`),
|
||||
KEY `id_guest` (`id_guest`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_criterion` (
|
||||
`id_product_comment_criterion` int(10) unsigned NOT NULL auto_increment,
|
||||
`id_product_comment_criterion_type` tinyint(1) NOT NULL,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment_criterion`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_criterion_product` (
|
||||
`id_product` int(10) unsigned NOT NULL,
|
||||
`id_product_comment_criterion` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY(`id_product`, `id_product_comment_criterion`),
|
||||
KEY `id_product_comment_criterion` (`id_product_comment_criterion`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_criterion_lang` (
|
||||
`id_product_comment_criterion` INT(11) UNSIGNED NOT NULL ,
|
||||
`id_lang` INT(11) UNSIGNED NOT NULL ,
|
||||
`name` VARCHAR(64) NOT NULL ,
|
||||
PRIMARY KEY ( `id_product_comment_criterion` , `id_lang` )
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_criterion_category` (
|
||||
`id_product_comment_criterion` int(10) unsigned NOT NULL,
|
||||
`id_category` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY(`id_product_comment_criterion`, `id_category`),
|
||||
KEY `id_category` (`id_category`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_grade` (
|
||||
`id_product_comment` int(10) unsigned NOT NULL,
|
||||
`id_product_comment_criterion` int(10) unsigned NOT NULL,
|
||||
`grade` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment`, `id_product_comment_criterion`),
|
||||
KEY `id_product_comment_criterion` (`id_product_comment_criterion`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_usefulness` (
|
||||
`id_product_comment` int(10) unsigned NOT NULL,
|
||||
`id_customer` int(10) unsigned NOT NULL,
|
||||
`usefulness` tinyint(1) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment`, `id_customer`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_product_comment_report` (
|
||||
`id_product_comment` int(10) unsigned NOT NULL,
|
||||
`id_customer` int(10) unsigned NOT NULL,
|
||||
PRIMARY KEY (`id_product_comment`, `id_customer`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_product_comment_criterion` VALUES ('1', '1', '1');
|
||||
|
||||
INSERT IGNORE INTO `PREFIX_product_comment_criterion_lang` (`id_product_comment_criterion`, `id_lang`, `name`)
|
||||
(
|
||||
SELECT '1', l.`id_lang`, 'Quality'
|
||||
FROM `PREFIX_lang` l
|
||||
);
|
||||
|
||||
@@ -27,10 +27,10 @@
|
||||
if (!defined('_PS_VERSION_'))
|
||||
exit;
|
||||
|
||||
include_once (dirname(__FILE__).'/classes/ProductCommentsDb.php');
|
||||
|
||||
class ProductComments extends Module
|
||||
{
|
||||
const INSTALL_SQL_FILE = 'install.sql';
|
||||
|
||||
private $_html = '';
|
||||
private $_postErrors = array();
|
||||
private $_filters = array();
|
||||
@@ -42,7 +42,7 @@ class ProductComments extends Module
|
||||
{
|
||||
$this->name = 'productcomments';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '3.6.1';
|
||||
$this->version = '3.6.2';
|
||||
$this->author = 'PrestaShop';
|
||||
$this->need_instance = 0;
|
||||
$this->bootstrap = true;
|
||||
@@ -59,19 +59,11 @@ class ProductComments extends Module
|
||||
|
||||
public function install($keep = true)
|
||||
{
|
||||
if ($keep)
|
||||
{
|
||||
if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE))
|
||||
if ($keep) {
|
||||
$objProductCommentsDb = new ProductCommentsDb();
|
||||
if (!$objProductCommentsDb->createTables()) {
|
||||
return false;
|
||||
else if (!$sql = file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE))
|
||||
return false;
|
||||
$sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql);
|
||||
$sql = preg_split("/;\s*[\r\n]+/", trim($sql));
|
||||
|
||||
foreach ($sql as $query)
|
||||
if (!Db::getInstance()->execute(trim($query)))
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
if (parent::install() == false ||
|
||||
@@ -90,7 +82,8 @@ class ProductComments extends Module
|
||||
|
||||
public function uninstall($keep = true)
|
||||
{
|
||||
if (!parent::uninstall() || ($keep && !$this->deleteTables()) ||
|
||||
$objProductCommentsDb = new ProductCommentsDb();
|
||||
if (!parent::uninstall() || ($keep && !$objProductCommentsDb->dropTables()) ||
|
||||
!Configuration::deleteByName('PRODUCT_COMMENTS_MODERATE') ||
|
||||
!Configuration::deleteByName('PRODUCT_COMMENTS_ALLOW_GUESTS') ||
|
||||
!Configuration::deleteByName('PRODUCT_COMMENTS_MINIMAL_TIME') ||
|
||||
@@ -114,20 +107,6 @@ class ProductComments extends Module
|
||||
return true;
|
||||
}
|
||||
|
||||
public function deleteTables()
|
||||
{
|
||||
return Db::getInstance()->execute('
|
||||
DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'product_comment`,
|
||||
`'._DB_PREFIX_.'product_comment_criterion`,
|
||||
`'._DB_PREFIX_.'product_comment_criterion_product`,
|
||||
`'._DB_PREFIX_.'product_comment_criterion_lang`,
|
||||
`'._DB_PREFIX_.'product_comment_criterion_category`,
|
||||
`'._DB_PREFIX_.'product_comment_grade`,
|
||||
`'._DB_PREFIX_.'product_comment_usefulness`,
|
||||
`'._DB_PREFIX_.'product_comment_report`');
|
||||
}
|
||||
|
||||
public function getCacheId($id_product = null)
|
||||
{
|
||||
return parent::getCacheId().'|'.(int)$id_product;
|
||||
@@ -496,7 +475,6 @@ class ProductComments extends Module
|
||||
return $helper->generateList($comments, $fields_list);
|
||||
}
|
||||
|
||||
|
||||
public function getConfigFieldsValues()
|
||||
{
|
||||
return array(
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
------------------------------
|
||||
# V1.1.7 to V1.1.8
|
||||
------------------------------
|
||||
|
||||
## Improved/Changed Features:
|
||||
|
||||
[*] CO : Removed install.sql
|
||||
|
||||
------------------------------
|
||||
# V1.1.6 to V1.1.7
|
||||
------------------------------
|
||||
|
||||
60
modules/wkabouthotelblock/classes/WkAboutHotelBlockDb.php
Normal file
60
modules/wkabouthotelblock/classes/WkAboutHotelBlockDb.php
Normal file
@@ -0,0 +1,60 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
class WkAboutHotelBlockDb
|
||||
{
|
||||
public function createTables()
|
||||
{
|
||||
if ($sqls = $this->getModuleSqls()) {
|
||||
foreach ($sqls as $query) {
|
||||
if ($query) {
|
||||
if (!DB::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getModuleSqls()
|
||||
{
|
||||
return array(
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_interior_image` (
|
||||
`id_interior_image` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` text NOT NULL,
|
||||
`display_name` text NOT NULL,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
`position` int(11) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_interior_image`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
);
|
||||
}
|
||||
|
||||
public function dropTables()
|
||||
{
|
||||
return DB::getInstance()->execute('
|
||||
DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'htl_interior_image`;
|
||||
');
|
||||
}
|
||||
}
|
||||
@@ -18,4 +18,5 @@
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
require_once 'classes/WkAboutHotelBlockDb.php';
|
||||
require_once 'classes/WkHotelInteriorImage.php';
|
||||
|
||||
@@ -1,29 +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 <support@webkul.com>
|
||||
* @copyright 2010-2020 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_interior_image` (
|
||||
`id_interior_image` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` text NOT NULL,
|
||||
`display_name` text NOT NULL,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
`position` int(11) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_interior_image`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
@@ -26,13 +26,12 @@ require_once dirname(__FILE__).'/define.php';
|
||||
|
||||
class WkAboutHotelBlock extends Module
|
||||
{
|
||||
const INSTALL_SQL_FILE = 'install.sql';
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'wkabouthotelblock';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.1.7';
|
||||
$this->author = 'webkul';
|
||||
$this->version = '1.1.8';
|
||||
$this->author = 'Webkul';
|
||||
$this->need_instance = 0;
|
||||
|
||||
$this->bootstrap = true;
|
||||
@@ -90,22 +89,11 @@ class WkAboutHotelBlock extends Module
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
return false;
|
||||
} elseif (!$sql = Tools::file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
$objAboutHotelBlockDb = new WkAboutHotelBlockDb();
|
||||
if (!$objAboutHotelBlockDb->createTables()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql);
|
||||
$sql = preg_split("/;\s*[\r\n]+/", $sql);
|
||||
|
||||
foreach ($sql as $query) {
|
||||
if ($query) {
|
||||
if (!Db::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
$objHtlInteriorImg = new WkHotelInteriorImage();
|
||||
if (!parent::install()
|
||||
|| !$this->registerModuleHooks()
|
||||
@@ -161,9 +149,10 @@ class WkAboutHotelBlock extends Module
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
$objAboutHotelBlockDb = new WkAboutHotelBlockDb();
|
||||
if (!parent::uninstall()
|
||||
|| !$this->deleteHotelInterierImg()
|
||||
|| !$this->deleteTables()
|
||||
|| !$objAboutHotelBlockDb->dropTables()
|
||||
|| !$this->deleteConfigKeys()
|
||||
|| !$this->uninstallTab()
|
||||
) {
|
||||
@@ -207,12 +196,4 @@ class WkAboutHotelBlock extends Module
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function deleteTables()
|
||||
{
|
||||
return Db::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'htl_interior_image`'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
------------------------------
|
||||
# V1.1.4 to V1.1.5
|
||||
------------------------------
|
||||
|
||||
## Improved/Changed Features:
|
||||
|
||||
[*] FO : Removed install.sql
|
||||
|
||||
------------------------------
|
||||
# V1.1.3 to V1.1.4
|
||||
------------------------------
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
class WkFooterPaymentBlockDb
|
||||
{
|
||||
public function createTables()
|
||||
{
|
||||
if ($sqls = $this->getModuleSqls()) {
|
||||
foreach ($sqls as $query) {
|
||||
if ($query) {
|
||||
if (!DB::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getModuleSqls()
|
||||
{
|
||||
return array(
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_footer_payment_block_info` (
|
||||
`id_payment_block` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
`position` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_payment_block`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
);
|
||||
}
|
||||
|
||||
public function dropTables()
|
||||
{
|
||||
return DB::getInstance()->execute('
|
||||
DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'htl_footer_payment_block_info`;
|
||||
');
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
/**
|
||||
* 2010-2018 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 <support@webkul.com>
|
||||
* @copyright 2010-2018 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_footer_payment_block_info` (
|
||||
`id_payment_block` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
`position` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_payment_block`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
@@ -22,18 +22,17 @@ if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__).'/classes/WkFooterPaymentBlockDb.php';
|
||||
require_once dirname(__FILE__).'/classes/WkFooterPaymentBlockInfo.php';
|
||||
|
||||
class WkFooterPaymentBlock extends Module
|
||||
{
|
||||
const INSTALL_SQL_FILE = 'install.sql';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'wkfooterpaymentblock';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.1.4';
|
||||
$this->author = 'webkul';
|
||||
$this->version = '1.1.5';
|
||||
$this->author = 'Webkul';
|
||||
$this->need_instance = 0;
|
||||
|
||||
$this->bootstrap = true;
|
||||
@@ -99,22 +98,11 @@ class WkFooterPaymentBlock extends Module
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
return false;
|
||||
} elseif (!$sql = Tools::file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
$objFooterPaymentBlockDb = new WkFooterPaymentBlockDb();
|
||||
if (!$objFooterPaymentBlockDb->createTables()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql);
|
||||
$sql = preg_split("/;\s*[\r\n]+/", $sql);
|
||||
|
||||
foreach ($sql as $query) {
|
||||
if ($query) {
|
||||
if (!Db::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!parent::install()
|
||||
||!$this->registerHook('displayFooterPaymentInfo')
|
||||
||!$this->registerHook('displayAddModuleSettingLink')
|
||||
@@ -128,9 +116,10 @@ class WkFooterPaymentBlock extends Module
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
$objFooterPaymentBlockDb = new WkFooterPaymentBlockDb();
|
||||
if (!parent::uninstall()
|
||||
|| !$this->uninstallTab()
|
||||
|| !$this->dropTables()
|
||||
|| !$objFooterPaymentBlockDb->dropTables()
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
@@ -150,13 +139,6 @@ class WkFooterPaymentBlock extends Module
|
||||
return true;
|
||||
}
|
||||
|
||||
private function dropTables()
|
||||
{
|
||||
return Db::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS `'._DB_PREFIX_.'htl_footer_payment_block_info`'
|
||||
);
|
||||
}
|
||||
|
||||
public function insertDefaultModuleData()
|
||||
{
|
||||
$paymentNames = array(
|
||||
|
||||
@@ -1,3 +1,11 @@
|
||||
------------------------------
|
||||
# V2.0.5 to V2.0.6
|
||||
------------------------------
|
||||
|
||||
## Improved/Changed Features:
|
||||
|
||||
[*] CO : Removed install.sql
|
||||
|
||||
------------------------------
|
||||
# V2.0.4 to V2.0.5
|
||||
------------------------------
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
class WkHotelFeaturesBlockDb
|
||||
{
|
||||
public function createTables()
|
||||
{
|
||||
if ($sqls = $this->getModuleSqls()) {
|
||||
foreach ($sqls as $query) {
|
||||
if ($query) {
|
||||
if (!DB::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getModuleSqls()
|
||||
{
|
||||
return array(
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_features_block_data` (
|
||||
`id_features_block` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
`position` int(11) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_features_block`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_features_block_data_lang` (
|
||||
`id_features_block` int(11) NOT NULL,
|
||||
`id_lang` int(11) NOT NULL,
|
||||
`feature_title` text NOT NULL,
|
||||
`feature_description` text NOT NULL,
|
||||
PRIMARY KEY (`id_features_block`, `id_lang`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8;"
|
||||
);
|
||||
}
|
||||
|
||||
public function dropTables()
|
||||
{
|
||||
return DB::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'htl_features_block_data`,
|
||||
`'._DB_PREFIX_.'htl_features_block_data_lang`;
|
||||
');
|
||||
}
|
||||
}
|
||||
@@ -1,35 +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 <support@webkul.com>
|
||||
* @copyright 2010-2020 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_features_block_data` (
|
||||
`id_features_block` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
`position` int(11) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_features_block`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_features_block_data_lang` (
|
||||
`id_features_block` int(11) NOT NULL,
|
||||
`id_lang` int(11) NOT NULL,
|
||||
`feature_title` text NOT NULL,
|
||||
`feature_description` text NOT NULL,
|
||||
PRIMARY KEY (`id_features_block`, `id_lang`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 ;
|
||||
@@ -23,17 +23,17 @@ if (!defined('_PS_VERSION_')) {
|
||||
}
|
||||
|
||||
require_once _PS_MODULE_DIR_.'hotelreservationsystem/define.php';
|
||||
require_once dirname(__FILE__).'/../wkhotelfeaturesblock/classes/WkHotelFeaturesBlockDb.php';
|
||||
require_once dirname(__FILE__).'/../wkhotelfeaturesblock/classes/WkHotelFeaturesData.php';
|
||||
|
||||
class WkHotelFeaturesBlock extends Module
|
||||
{
|
||||
const INSTALL_SQL_FILE = 'install.sql';
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'wkhotelfeaturesblock';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '2.0.5';
|
||||
$this->author = 'webkul';
|
||||
$this->version = '2.0.6';
|
||||
$this->author = 'Webkul';
|
||||
$this->bootstrap = true;
|
||||
parent::__construct();
|
||||
|
||||
@@ -121,22 +121,11 @@ class WkHotelFeaturesBlock extends Module
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
return false;
|
||||
} elseif (!$sql = Tools::file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
$objHotelFeaturesBlockDb = new WkHotelFeaturesBlockDb();
|
||||
if (!$objHotelFeaturesBlockDb->createTables()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql);
|
||||
$sql = preg_split("/;\s*[\r\n]+/", $sql);
|
||||
|
||||
foreach ($sql as $query) {
|
||||
if ($query) {
|
||||
if (!Db::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
$objFeaturesData = new WkHotelFeaturesData();
|
||||
if (!parent::install()
|
||||
|| !$this->registerModuleHooks()
|
||||
@@ -162,10 +151,11 @@ class WkHotelFeaturesBlock extends Module
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
$objHotelFeaturesBlockDb = new WkHotelFeaturesBlockDb();
|
||||
if (!parent::uninstall()
|
||||
|| !$this->deleteHotelAmenityImg()
|
||||
|| !$this->uninstallTab()
|
||||
|| !$this->deleteTables()
|
||||
|| !$objHotelFeaturesBlockDb->dropTables()
|
||||
|| !$this->deleteConfigKeys()
|
||||
) {
|
||||
return false;
|
||||
@@ -200,16 +190,7 @@ class WkHotelFeaturesBlock extends Module
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function deleteTables()
|
||||
{
|
||||
return Db::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'htl_features_block_data`,
|
||||
`'._DB_PREFIX_.'htl_features_block_data_lang`'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function uninstallTab()
|
||||
{
|
||||
$moduleTabs = Tab::getCollectionFromModule($this->name);
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
------------------------------
|
||||
# V1.1.7 to V1.1.7
|
||||
# V1.1.7 to V1.1.8
|
||||
------------------------------
|
||||
|
||||
## Improved/Changed Features:
|
||||
|
||||
[*] CO : Removed install.sql
|
||||
|
||||
------------------------------
|
||||
# V1.1.6 to V1.1.7
|
||||
------------------------------
|
||||
|
||||
## Improved/Changed Features:
|
||||
|
||||
59
modules/wkhotelroom/classes/WkHotelRoomDb.php
Normal file
59
modules/wkhotelroom/classes/WkHotelRoomDb.php
Normal file
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
class WkHotelRoomDb
|
||||
{
|
||||
public function createTables()
|
||||
{
|
||||
if ($sqls = $this->getModuleSqls()) {
|
||||
foreach ($sqls as $query) {
|
||||
if ($query) {
|
||||
if (!DB::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getModuleSqls()
|
||||
{
|
||||
return array(
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_room_block_data` (
|
||||
`id_room_block` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`active` tinyint(4) NOT NULL,
|
||||
`position` int(11) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_room_block`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;"
|
||||
);
|
||||
}
|
||||
|
||||
public function dropTables()
|
||||
{
|
||||
return DB::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'htl_room_block_data`;
|
||||
');
|
||||
}
|
||||
}
|
||||
@@ -19,4 +19,5 @@
|
||||
*/
|
||||
|
||||
require_once _PS_MODULE_DIR_.'/hotelreservationsystem/define.php';
|
||||
require_once 'classes/WkHotelRoomDb.php';
|
||||
require_once 'classes/WkHotelRoomDisplay.php';
|
||||
|
||||
@@ -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 <support@webkul.com>
|
||||
* @copyright 2010-2020 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_room_block_data` (
|
||||
`id_room_block` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`id_product` int(11) NOT NULL,
|
||||
`active` tinyint(4) NOT NULL,
|
||||
`position` int(11) NOT NULL,
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_room_block`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
@@ -21,18 +21,17 @@
|
||||
if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__).'/define.php';
|
||||
|
||||
class WkHotelRoom extends Module
|
||||
{
|
||||
const INSTALL_SQL_FILE = 'install.sql';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'wkhotelroom';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.1.7';
|
||||
$this->author = 'webkul';
|
||||
$this->version = '1.1.8';
|
||||
$this->author = 'Webkul';
|
||||
$this->bootstrap = true;
|
||||
parent::__construct();
|
||||
|
||||
@@ -179,21 +178,9 @@ class WkHotelRoom extends Module
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
$objHotelRoomDb = new WkHotelRoomDb();
|
||||
if (!$objHotelRoomDb->createTables()) {
|
||||
return false;
|
||||
} elseif (!$sql = Tools::file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql);
|
||||
$sql = preg_split("/;\s*[\r\n]+/", $sql);
|
||||
|
||||
foreach ($sql as $query) {
|
||||
if ($query) {
|
||||
if (!Db::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!parent::install()
|
||||
@@ -230,24 +217,17 @@ class WkHotelRoom extends Module
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
$objHotelRoomDb = new WkHotelRoomDb();
|
||||
if (!parent::uninstall()
|
||||
|| !$this->uninstallTab()
|
||||
|| !$this->deleteTables()
|
||||
|| !$objHotelRoomDb->dropTables()
|
||||
|| !$this->deleteConfigKeys()
|
||||
) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function deleteTables()
|
||||
{
|
||||
return Db::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'htl_room_block_data`'
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function deleteConfigKeys()
|
||||
{
|
||||
$configVars = array(
|
||||
|
||||
@@ -1,3 +1,10 @@
|
||||
# V1.1.5 to V1.1.6
|
||||
------------------------------
|
||||
|
||||
## Improved/Changed Features:
|
||||
|
||||
[*] CO : Removed install.sql
|
||||
|
||||
# V1.1.4 to V1.1.5
|
||||
------------------------------
|
||||
|
||||
|
||||
68
modules/wktestimonialblock/classes/WkTestimonialBlockDb.php
Normal file
68
modules/wktestimonialblock/classes/WkTestimonialBlockDb.php
Normal file
@@ -0,0 +1,68 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
class WkTestimonialBlockDb
|
||||
{
|
||||
public function createTables()
|
||||
{
|
||||
if ($sqls = $this->getModuleSqls()) {
|
||||
foreach ($sqls as $query) {
|
||||
if ($query) {
|
||||
if (!DB::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getModuleSqls()
|
||||
{
|
||||
return array(
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_testimonials_block_data` (
|
||||
`id_testimonial_block` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`designation` text NOT NULL,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
`position` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_testimonial_block`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8 AUTO_INCREMENT=1;",
|
||||
|
||||
"CREATE TABLE IF NOT EXISTS `"._DB_PREFIX_."htl_testimonials_block_data_lang` (
|
||||
`id_testimonial_block` int(11) NOT NULL,
|
||||
`id_lang` int(11) NOT NULL,
|
||||
`testimonial_content` text NOT NULL,
|
||||
PRIMARY KEY (`id_testimonial_block`, `id_lang`)
|
||||
) ENGINE="._MYSQL_ENGINE_." DEFAULT CHARSET=utf8;"
|
||||
);
|
||||
}
|
||||
|
||||
public function dropTables()
|
||||
{
|
||||
return DB::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'htl_testimonials_block_data`,
|
||||
`'._DB_PREFIX_.'htl_testimonials_block_data_lang`
|
||||
');
|
||||
}
|
||||
}
|
||||
@@ -1,36 +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 <support@webkul.com>
|
||||
* @copyright 2010-2020 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_testimonials_block_data` (
|
||||
`id_testimonial_block` int(11) NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(255) NOT NULL,
|
||||
`designation` text NOT NULL,
|
||||
`active` tinyint(1) NOT NULL,
|
||||
`position` int(10) unsigned NOT NULL DEFAULT '0',
|
||||
`date_add` datetime NOT NULL,
|
||||
`date_upd` datetime NOT NULL,
|
||||
PRIMARY KEY (`id_testimonial_block`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `PREFIX_htl_testimonials_block_data_lang` (
|
||||
`id_testimonial_block` int(11) NOT NULL,
|
||||
`id_lang` int(11) NOT NULL,
|
||||
`testimonial_content` text NOT NULL,
|
||||
PRIMARY KEY (`id_testimonial_block`, `id_lang`)
|
||||
) ENGINE=ENGINE_TYPE DEFAULT CHARSET=utf8 ;
|
||||
@@ -22,17 +22,17 @@ if (!defined('_PS_VERSION_')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__).'/../wktestimonialblock/classes/WkTestimonialBlockDb.php';
|
||||
require_once dirname(__FILE__).'/../wktestimonialblock/classes/WkHotelTestimonialData.php';
|
||||
require_once _PS_MODULE_DIR_.'hotelreservationsystem/define.php';
|
||||
|
||||
class WkTestimonialBlock extends Module
|
||||
{
|
||||
const INSTALL_SQL_FILE = 'install.sql';
|
||||
public function __construct()
|
||||
{
|
||||
$this->name = 'wktestimonialblock';
|
||||
$this->tab = 'front_office_features';
|
||||
$this->version = '1.1.5';
|
||||
$this->version = '1.1.6';
|
||||
$this->author = 'webkul';
|
||||
$this->need_instance = 0;
|
||||
|
||||
@@ -113,21 +113,11 @@ class WkTestimonialBlock extends Module
|
||||
|
||||
public function install()
|
||||
{
|
||||
if (!file_exists(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
return false;
|
||||
} elseif (!$sql = Tools::file_get_contents(dirname(__FILE__).'/'.self::INSTALL_SQL_FILE)) {
|
||||
$objTestimonialBlockDb = new WkTestimonialBlockDb();
|
||||
if (!$objTestimonialBlockDb->createTables()) {
|
||||
return false;
|
||||
}
|
||||
$sql = str_replace(array('PREFIX_', 'ENGINE_TYPE'), array(_DB_PREFIX_, _MYSQL_ENGINE_), $sql);
|
||||
$sql = preg_split("/;\s*[\r\n]+/", $sql);
|
||||
|
||||
foreach ($sql as $query) {
|
||||
if ($query) {
|
||||
if (!Db::getInstance()->execute(trim($query))) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
$objTestimonialData = new WkHotelTestimonialData();
|
||||
if (!parent::install()
|
||||
|| !$this->registerModuleHooks()
|
||||
@@ -192,15 +182,6 @@ class WkTestimonialBlock extends Module
|
||||
return true;
|
||||
}
|
||||
|
||||
public function deleteTables()
|
||||
{
|
||||
return Db::getInstance()->execute(
|
||||
'DROP TABLE IF EXISTS
|
||||
`'._DB_PREFIX_.'htl_testimonials_block_data`,
|
||||
`'._DB_PREFIX_.'htl_testimonials_block_data_lang`'
|
||||
);
|
||||
}
|
||||
|
||||
public function uninstallTab()
|
||||
{
|
||||
$moduleTabs = Tab::getCollectionFromModule($this->name);
|
||||
@@ -215,9 +196,10 @@ class WkTestimonialBlock extends Module
|
||||
|
||||
public function uninstall()
|
||||
{
|
||||
$objTestimonialBlockDb = new WkTestimonialBlockDb();
|
||||
if (!parent::uninstall()
|
||||
|| !$this->deleteTestimonialUserImage()
|
||||
|| !$this->deleteTables()
|
||||
|| !$objTestimonialBlockDb->dropTables()
|
||||
|| !$this->uninstallTab()
|
||||
|| !$this->deleteConfigKeys()
|
||||
) {
|
||||
|
||||
Reference in New Issue
Block a user