Merge branch 'develop' into hourly
This commit is contained in:
@@ -852,11 +852,19 @@ class HotelBranchInformation extends ObjectModel
|
||||
$idProfile = Context::getContext()->employee->id_profile;
|
||||
}
|
||||
|
||||
$accessedIds = self::getProfileAccessedHotels($idProfile, 1, 1);
|
||||
if (!$idsHotel) {
|
||||
$idsHotel = self::getProfileAccessedHotels($idProfile, 1, 1);
|
||||
$idsHotel = $accessedIds;
|
||||
} else {
|
||||
$idsHotel = array($idsHotel);
|
||||
if (!is_array($idsHotel)) {
|
||||
$idsHotel = array($idsHotel);
|
||||
}
|
||||
// check if passed hotel id's are available for current employee
|
||||
$idsHotel = array_filter($idsHotel, function ($idHotel) use($accessedIds) {
|
||||
return in_array($idHotel, $accessedIds);
|
||||
});
|
||||
}
|
||||
|
||||
$restriction = ' AND ';
|
||||
if (count($idsHotel)) {
|
||||
if ($alias) {
|
||||
@@ -866,7 +874,7 @@ class HotelBranchInformation extends ObjectModel
|
||||
$identifier = "`$identifier`";
|
||||
$restriction .= $alias.$identifier.' IN ('.implode(', ', $idsHotel).') ';
|
||||
} else {
|
||||
$restriction .= 1;
|
||||
$restriction .= 0;
|
||||
}
|
||||
|
||||
return $restriction;
|
||||
|
||||
@@ -430,6 +430,9 @@ class HotelCartBookingData extends ObjectModel
|
||||
}
|
||||
}
|
||||
}
|
||||
// after room is removed from cart, check if any of the appled cart rules are not being used
|
||||
CartRule::autoRemoveFromCart(Context::getContext());
|
||||
CartRule::autoAddToCart(Context::getContext());
|
||||
|
||||
// return number of rooms deleted
|
||||
return true;
|
||||
@@ -1912,6 +1915,15 @@ class HotelCartBookingData extends ObjectModel
|
||||
}
|
||||
}
|
||||
|
||||
public function save($null_values = false, $auto_date = true)
|
||||
{
|
||||
$return = parent::save($null_values = false, $auto_date = true);
|
||||
// after updating cart data, check if any of the appled cart rules are not being used
|
||||
CartRule::autoRemoveFromCart(Context::getContext());
|
||||
CartRule::autoAddToCart(Context::getContext());
|
||||
return $return;
|
||||
}
|
||||
|
||||
public function update($null_values = false)
|
||||
{
|
||||
if (!$this->extra_demands) {
|
||||
|
||||
@@ -171,6 +171,36 @@ class AdminAddHotelController extends ModuleAdminController
|
||||
}
|
||||
}
|
||||
$smartyVars['order_restrict_date_info'] = $restrictDateInfo;
|
||||
$objHotelFeatures = new HotelFeatures();
|
||||
$hotelFeatures = $this->object->getFeaturesOfHotelByHotelId($this->object->id);
|
||||
if ($features = $objHotelFeatures->HotelBranchSelectedFeaturesArray($hotelFeatures)) {
|
||||
foreach ($features as $idFeature => $feature) {
|
||||
$features[$idFeature]['value'] = $idFeature;
|
||||
$features[$idFeature]['input_name'] = 'id_feature_parents';
|
||||
if (isset($feature['children']) && $feature['children']) {
|
||||
$selectedChildFeatures = 0;
|
||||
foreach ($feature['children'] as $childKey => $childFeature) {
|
||||
$features[$idFeature]['children'][$childKey]['value'] = $childFeature['id'];
|
||||
$features[$idFeature]['children'][$childKey]['input_name'] = 'id_features';
|
||||
if (isset($childFeature['selected']) && $childFeature['selected']) {
|
||||
$selectedChildFeatures++;
|
||||
}
|
||||
}
|
||||
|
||||
if ($selectedChildFeatures == count($feature['children'])) {
|
||||
$features[$idFeature]['selected'] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$tree = new HelperTree('hotel-features-tree', $features);
|
||||
$tree->setShowCollapseExpandButton(true)
|
||||
->setUseCheckBox(true)
|
||||
->setAutoSelectChildren(true)
|
||||
->setUseBulkActions(true);
|
||||
$treeContent = $tree->render();
|
||||
$smartyVars['hotel_feature_tree'] = $treeContent;
|
||||
}
|
||||
} else {
|
||||
$idCountry = Tools::getValue('hotel_country');
|
||||
}
|
||||
@@ -226,6 +256,7 @@ class AdminAddHotelController extends ModuleAdminController
|
||||
$longitude = Tools::getValue('loclongitude');
|
||||
$map_formated_address = Tools::getValue('locformatedAddr');
|
||||
$map_input_text = Tools::getValue('googleInputField');
|
||||
$hotelFeatures = Tools::getValue('id_features', array());
|
||||
|
||||
// check if field is atleast in default language. Not available in default prestashop
|
||||
$defaultLangId = Configuration::get('PS_LANG_DEFAULT');
|
||||
@@ -640,6 +671,12 @@ class AdminAddHotelController extends ModuleAdminController
|
||||
$objHotelOrderRestrictDate->preparation_time = $preparationTime;
|
||||
}
|
||||
$objHotelOrderRestrictDate->save();
|
||||
|
||||
$objHotelFeatures = new HotelBranchFeatures();
|
||||
$objHotelFeatures->deleteBranchFeaturesByHotelId($idHotel);
|
||||
if (!$objHotelFeatures->assignFeaturesToHotel($idHotel, $hotelFeatures)) {
|
||||
$this->errors[] = $this->l('Some problem occurred while assigning features to the hotel.');
|
||||
}
|
||||
}
|
||||
|
||||
if (Tools::isSubmit('submitAdd'.$this->table.'AndStay')) {
|
||||
|
||||
@@ -1,229 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
||||
class AdminAssignHotelFeaturesController extends ModuleAdminController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$this->bootstrap = true;
|
||||
$this->table = 'htl_branch_features';
|
||||
$this->className = 'HotelBranchFeatures';
|
||||
$this->identifier = 'id';
|
||||
$this->context = Context::getContext();
|
||||
|
||||
// START send access query information to the admin controller
|
||||
$this->access_select = ' SELECT a.`id` FROM '._DB_PREFIX_.'htl_branch_features a';
|
||||
$this->access_join = ' INNER JOIN '._DB_PREFIX_.'htl_branch_info hbi ON (hbi.id = a.id_hotel)';
|
||||
if ($acsHtls = HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1, 1)) {
|
||||
$this->access_where = ' WHERE hbi.id IN ('.implode(',', $acsHtls).')';
|
||||
}
|
||||
|
||||
parent::__construct();
|
||||
|
||||
$this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'htl_branch_info` hi ON (hi.`id` = a.`id_hotel`)';
|
||||
$this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'htl_branch_info_lang` hil
|
||||
ON (hi.`id` = hil.`id` AND hil.id_lang = '.(int)$this->context->language->id.')';
|
||||
$this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'address` addr ON (addr.`id_hotel` = hi.`id`)';
|
||||
$this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'state` s ON (s.`id_state` = addr.`id_state`)';
|
||||
$this->_join .= 'LEFT JOIN `'._DB_PREFIX_.'country_lang` cl ON (cl.`id_country` = addr.`id_country`
|
||||
AND cl.`id_lang` = '.(int)$this->context->language->id.')';
|
||||
|
||||
$this->_select .= 'addr.`city` as htl_city, hi.`id` as htl_id, hil.`hotel_name` as htl_name,
|
||||
s.`name` as `state_name`, cl.`name`';
|
||||
$this->_group = 'GROUP BY a.`id_hotel`';
|
||||
|
||||
$this->fields_list = array(
|
||||
'htl_id' => array(
|
||||
'title' => $this->l('Hotel ID'),
|
||||
'align' => 'center',
|
||||
'filter_key' => 'hi!id',
|
||||
),
|
||||
'htl_name' => array(
|
||||
'title' => $this->l('Hotel Name'),
|
||||
'align' => 'center',
|
||||
'filter_key' => 'hil!hotel_name',
|
||||
),
|
||||
'htl_city' => array(
|
||||
'title' => $this->l('City'),
|
||||
'align' => 'center',
|
||||
'filter_key' => 'addr!city',
|
||||
),
|
||||
|
||||
'state_name' => array(
|
||||
'title' => $this->l('State'),
|
||||
'align' => 'center',
|
||||
'filter_key' => 's!name',
|
||||
),
|
||||
'name' => array(
|
||||
'title' => $this->l('Country'),
|
||||
'align' => 'center',
|
||||
'filter_key' => 'cl!name',
|
||||
),
|
||||
'date_add' => array(
|
||||
'title' => $this->l('Date Added'),
|
||||
'align' => 'center',
|
||||
'type' => 'datetime',
|
||||
'filter_key' => 'a!date_add',
|
||||
)
|
||||
);
|
||||
|
||||
$this->bulk_actions = array(
|
||||
'delete' => array(
|
||||
'text' => $this->l('Delete selected'),
|
||||
'icon' => 'icon-trash',
|
||||
'confirm' => $this->l('Delete selected items?')
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
public function initToolbar()
|
||||
{
|
||||
parent::initToolbar();
|
||||
|
||||
$this->page_header_toolbar_btn['new_feature'] = array(
|
||||
'href' => $this->context->link->getAdminLink('AdminHotelFeatures'),
|
||||
'desc' => $this->l('Hotel Features'),
|
||||
'imgclass' => 'back'
|
||||
);
|
||||
|
||||
$this->page_header_toolbar_btn['assignfeatures'] = array(
|
||||
'href' => self::$currentIndex.'&add'.$this->table.'&token='.$this->token,
|
||||
'desc' => $this->l('Assign Features'),
|
||||
'imgclass' => 'new'
|
||||
);
|
||||
}
|
||||
|
||||
public function renderList()
|
||||
{
|
||||
$this->addRowAction('edit');
|
||||
$this->addRowAction('delete');
|
||||
|
||||
return parent::renderList();
|
||||
}
|
||||
|
||||
public function renderForm()
|
||||
{
|
||||
$smartyVars = array();
|
||||
if ($this->display == 'add') {
|
||||
$objHotelFeatures = new HotelFeatures();
|
||||
$featuresList = $objHotelFeatures->HotelAllCommonFeaturesArray();
|
||||
$objBranchInfo = new HotelBranchInformation();
|
||||
$unassignedFtrsHotels = $objBranchInfo->getUnassignedFeaturesHotelIds();
|
||||
// filter hotels as per accessed hotels
|
||||
$unassignedFtrsHotels = HotelBranchInformation::filterDataByHotelAccess(
|
||||
$unassignedFtrsHotels,
|
||||
$this->context->employee->id_profile,
|
||||
1
|
||||
);
|
||||
|
||||
$smartyVars['hotels'] = $unassignedFtrsHotels;
|
||||
$smartyVars['features_list'] = $featuresList;
|
||||
} elseif ($this->display == 'edit') {
|
||||
$id = Tools::getValue('id');
|
||||
$objBranchFeatures = new HotelBranchFeatures($id);
|
||||
$smartyVars['edit'] = 1;
|
||||
$objHotelFeatures = new HotelFeatures();
|
||||
$objBranchInfo = new HotelBranchInformation();
|
||||
|
||||
$features_hotel = $objBranchInfo->getFeaturesOfHotelByHotelId($objBranchFeatures->id_hotel);
|
||||
$featuresList = $objHotelFeatures->HotelBranchSelectedFeaturesArray($features_hotel);
|
||||
|
||||
$hotels = $objBranchInfo->hotelsNameAndId();
|
||||
$smartyVars['hotel_id'] = $objBranchFeatures->id_hotel;
|
||||
$smartyVars['hotels'] = $hotels;
|
||||
$smartyVars['features_list'] = $featuresList;
|
||||
}
|
||||
|
||||
$this->context->smarty->assign($smartyVars);
|
||||
|
||||
$this->fields_form = array(
|
||||
'submit' => array(
|
||||
'title' => $this->l('Save')
|
||||
)
|
||||
);
|
||||
return parent::renderForm();
|
||||
}
|
||||
|
||||
public function processSave()
|
||||
{
|
||||
if ($editId = Tools::getValue('edit_hotel_id')) {
|
||||
$objBranchFeatures = new HotelBranchFeatures();
|
||||
$objBranchFeatures->deleteBranchFeaturesByHotelId($editId);
|
||||
}
|
||||
if (!$hotelFeatures = Tools::getValue('hotel_fac')) {
|
||||
$this->errors[] = $this->l('Please select at least one feature to assign to a hotel.');
|
||||
}
|
||||
if (!$idHotel = Tools::getValue('id_hotel')) {
|
||||
$this->errors[] = $this->l('Please select a hotel first.');
|
||||
}
|
||||
if (!count($this->errors)) {
|
||||
$objHotelFeatures = new HotelBranchFeatures();
|
||||
if (!$objHotelFeatures->assignFeaturesToHotel($idHotel, $hotelFeatures)) {
|
||||
$this->errors[] = $this->l('Some problem occure while assigning Features to the hotel.');
|
||||
}
|
||||
if (empty($this->errors)) {
|
||||
if (Tools::isSubmit('submitAdd'.$this->table.'AndStay')) {
|
||||
Tools::redirectAdmin(
|
||||
self::$currentIndex.'&id='.(int)$idHotel.'&update'.$this->table.'&conf=3&token='.$this->token
|
||||
);
|
||||
} else {
|
||||
Tools::redirectAdmin(self::$currentIndex.'&conf=4&token='.$this->token);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->display = 'add';
|
||||
}
|
||||
}
|
||||
|
||||
public function processDelete()
|
||||
{
|
||||
if (Validate::isLoadedObject($object = $this->loadObject())) {
|
||||
$object = $this->loadObject();
|
||||
if ($object->id) {
|
||||
$objBranchFeatures = new HotelBranchFeatures();
|
||||
$objBranchFeatures->deleteBranchFeaturesByHotelId($object->id_hotel);
|
||||
}
|
||||
} else {
|
||||
$this->errors[] = $this->l('An error occurred while deleting the object.').'<b>'.$this->table.'</b> '.
|
||||
$this->l('(cannot load object)');
|
||||
}
|
||||
parent::processDelete();
|
||||
}
|
||||
|
||||
protected function processBulkDelete()
|
||||
{
|
||||
if (is_array($this->boxes) && !empty($this->boxes)) {
|
||||
foreach ($this->boxes as $key => $value) {
|
||||
$objBranchFeatures = new HotelBranchFeatures($value);
|
||||
$objBranchFeatures->deleteBranchFeaturesByHotelId($objBranchFeatures->id_hotel);
|
||||
}
|
||||
parent::processBulkDelete();
|
||||
} else {
|
||||
$this->errors[] = $this->l('You must select at least one element to delete.');
|
||||
}
|
||||
}
|
||||
|
||||
public function setMedia()
|
||||
{
|
||||
parent::setMedia();
|
||||
$this->addJs(_MODULE_DIR_.'hotelreservationsystem/views/js/HotelReservationAdmin.js');
|
||||
$this->addCSS(_MODULE_DIR_.'hotelreservationsystem/views/css/HotelReservationAdmin.css');
|
||||
}
|
||||
}
|
||||
@@ -41,11 +41,6 @@ class AdminHotelFeaturesController extends ModuleAdminController
|
||||
'desc' => $this->l('Add new Features'),
|
||||
'imgclass' => 'new'
|
||||
);
|
||||
|
||||
$this->page_header_toolbar_btn['new'] = array(
|
||||
'href' => $this->context->link->getAdminLink('AdminAssignHotelFeatures'),
|
||||
'desc' => $this->l('Assign Features To Hotel'),
|
||||
);
|
||||
}
|
||||
|
||||
public function renderView()
|
||||
|
||||
@@ -577,7 +577,6 @@ class HotelReservationSystem extends Module
|
||||
$this->installTab('AdminHotelGeneralSettings', 'Hotel General Configuration', 'AdminHotelConfigurationSetting', false);
|
||||
$this->installTab('AdminHotelFeaturePricesSettings', 'Advanced Price Rules', 'AdminHotelConfigurationSetting', false);
|
||||
$this->installTab('AdminRoomTypeGlobalDemand', 'Additional Demand Configuration', 'AdminHotelConfigurationSetting', false);
|
||||
$this->installTab('AdminAssignHotelFeatures', 'Assign Hotel Features', false, false);
|
||||
$this->installTab('AdminBookingDocument', 'Booking Documents', false, false);
|
||||
|
||||
return true;
|
||||
|
||||
@@ -83,6 +83,12 @@
|
||||
{l s='Refund Policies' mod='hotelreservationsystem'}
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#hotel-features" data-toggle="tab">
|
||||
<i class="icon-list-alt"></i>
|
||||
{l s='Features' mod='hotelreservationsystem'}
|
||||
</a>
|
||||
</li>
|
||||
{hook h='displayAdminAddHotelFormTab' id_hotel=$hook_arg_id_hotel}
|
||||
</ul>
|
||||
<div class="tab-content panel collapse in">
|
||||
@@ -488,6 +494,29 @@
|
||||
|
||||
{hook h='displayAdminAddHotelFormRefundPoliciesTabAfter' id_hotel=$hook_arg_id_hotel}
|
||||
</div>
|
||||
<div class="tab-pane" id="hotel-features">
|
||||
{hook h='displayAdminAddHotelFormFeaturesTabBefore' id_hotel=$hook_arg_id_hotel}
|
||||
{if isset($hotel_feature_tree)}
|
||||
<div class="form-group">
|
||||
<label for="hotel_feature" class="control-label col-sm-3">
|
||||
<span title="" data-toggle="tooltip" class="label-tooltip" data-original-title='{l s='Select features for this hotel.' mod='hotelreservationsystem'}'>{l s='Select feature' mod='hotelreservationsystem'}</span>
|
||||
</label>
|
||||
<div class="col-xs-7 hotel_features_tree">
|
||||
{$hotel_feature_tree}
|
||||
</div>
|
||||
</div>
|
||||
{elseif isset($hotel_info.id) && $hotel_info.id}
|
||||
<div class="alert alert-warning">
|
||||
{l s='No features created yet.' mod='hotelreservationsystem'} {l s='You can create features by visiting ' mod='hotelreservationsystem'} <a target="_blank" href="{$link->getAdminLink('AdminHotelFeatures')}">{l s='manage hotel features.' mod='hotelreservationsystem'}</a>
|
||||
</div>
|
||||
{else}
|
||||
<div class="alert alert-warning">
|
||||
{l s='Please save hotel information before assigning hotel features.' mod='hotelreservationsystem'}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
{hook h='displayAdminAddHotelFormFeaturesTabAfter' id_hotel=$hook_arg_id_hotel}
|
||||
</div>
|
||||
{hook h='displayAdminAddHotelFormTabContent' id_hotel=$hook_arg_id_hotel}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -224,7 +224,7 @@
|
||||
</td>
|
||||
<td>
|
||||
{if $rm_dtl_v['booking_type'] == HotelBookingDetail::ALLOTMENT_AUTO}
|
||||
<button type="button" class="btn btn-primary room_reallocate_swap" id="reallocate_room_{$rm_dtl_v['id_htl_booking']}" data-room_type_name="{$rm_dtl_v['room_type_name']}" data-id_htl_booking="{$rm_dtl_v['id_htl_booking']}" data-id_order="{$rm_dtl_v['id_order']}" data-room_num='{$booked_v['room_num']}' data-currency_sign='{$rm_dtl_v['currency_sign']}' data-id_room_type='{$booked_v['id_product']}' data-cust_name='{$rm_dtl_v['alloted_cust_name']}' data-cust_email='{$rm_dtl_v['alloted_cust_email']}' data-avail_rm_swap='{$rm_dtl_v['avail_rooms_to_swap']|@json_encode}' data-avail_realloc_room_types='{$rm_dtl_v['avail_room_types_to_realloc']|@json_encode}'>
|
||||
<button type="button" class="btn btn-primary room_reallocate_swap" id="reallocate_room_{$rm_dtl_v['id_htl_booking']}" data-room_type_name="{$rm_dtl_v['room_type_name']}" data-id_htl_booking="{$rm_dtl_v['id_htl_booking']}" data-id_order="{$rm_dtl_v['id_order']}" data-room_num='{$booked_v['room_num']}' data-currency_sign='{$rm_dtl_v['currency_sign']}' data-id_room_type='{$booked_v['id_product']}' data-cust_name='{$rm_dtl_v['alloted_cust_name']}' data-cust_email='{$rm_dtl_v['alloted_cust_email']}' data-avail_rm_swap='{$rm_dtl_v['avail_rooms_to_swap']|@json_encode}' data-avail_realloc_room_types='{$rm_dtl_v['avail_room_types_to_realloc']|@json_encode}' data-allotment_type_label='{if $rm_dtl_v['booking_type'] == $ALLOTMENT_MANUAL}{l s='Manual'}{else}{l s='Auto'}{/if}' data-comment='{$rm_dtl_v.comment}'>
|
||||
{l s='Reallocate Room' mod='hotelreservationsystem'}
|
||||
</button>
|
||||
{else}
|
||||
|
||||
@@ -208,6 +208,7 @@ class AdminAboutHotelBlockSettingController extends ModuleAdminController
|
||||
$this->l('Maximum image size: %1s'),
|
||||
Tools::formatBytes(Tools::getMaxUploadSize())
|
||||
),
|
||||
'desc' => $this->l('Recommended resolution: 720 x 360 pixels.'),
|
||||
),
|
||||
array(
|
||||
'type' => 'switch',
|
||||
@@ -272,12 +273,11 @@ class AdminAboutHotelBlockSettingController extends ModuleAdminController
|
||||
} while ((bool)Tools::file_get_contents(
|
||||
$this->context->link->getMediaLink(_MODULE_DIR_.$this->module->name.'/views/img/hotel_interior/'.$tmp_name.'.jpg')
|
||||
));
|
||||
$imageSize = ImageType::getByName(ImageType::getFormatedName('large'));
|
||||
ImageManager::resize(
|
||||
$file['tmp_name'],
|
||||
_PS_MODULE_DIR_.$this->module->name.'/views/img/hotel_interior/'.$tmp_name.'.jpg',
|
||||
$imageSize['width'],
|
||||
$imageSize['height']
|
||||
720,
|
||||
360
|
||||
);
|
||||
|
||||
$objHtlInteriorImg->name = $tmp_name;
|
||||
|
||||
@@ -201,6 +201,7 @@ class AdminFeaturesModuleSettingController extends ModuleAdminController
|
||||
$this->l('Maximum image size: %1s'),
|
||||
Tools::formatBytes(Tools::getMaxUploadSize())
|
||||
),
|
||||
'desc' => $this->l('Recommended resolution: 720 x 540 pixels.'),
|
||||
),
|
||||
array(
|
||||
'type' => 'switch',
|
||||
@@ -319,12 +320,11 @@ class AdminFeaturesModuleSettingController extends ModuleAdminController
|
||||
if (file_exists($imgPath)) {
|
||||
unlink($imgPath);
|
||||
}
|
||||
$imageSize = ImageType::getByName(ImageType::getFormatedName('large'));
|
||||
ImageManager::resize(
|
||||
$file['tmp_name'],
|
||||
$imgPath,
|
||||
$imageSize['width'],
|
||||
$imageSize['height']
|
||||
720,
|
||||
540
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,18 +17,53 @@
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
.hotelRoomDescContainer{
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background-color: rgba(255, 255, 255, 0.85);
|
||||
margin-left: 15px;
|
||||
margin-right: 15px;
|
||||
padding: 20px;
|
||||
z-index: 10;
|
||||
.htlRoomTypeDescTextContainer {
|
||||
overflow: hidden;
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 3;
|
||||
-webkit-box-orient: vertical;
|
||||
}
|
||||
.htlRoomTypeDescReadmore, .htlRoomTypeDescReadless{
|
||||
cursor: pointer;
|
||||
font-weight: 400;
|
||||
display: none;
|
||||
}
|
||||
.htlRoomTypeDescExtras {
|
||||
display: none;
|
||||
}
|
||||
@media (min-width: 530px) {
|
||||
.hotelRoomDescContainer{
|
||||
position: absolute;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
background-color: rgba(255, 255, 255, 0.8);
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
padding: 20px;
|
||||
z-index: 10;
|
||||
}
|
||||
.htlRoomTypePriceText{
|
||||
float :right;
|
||||
}
|
||||
}
|
||||
@media (max-width: 530px) {
|
||||
.hotelRoomDescContainer{
|
||||
padding: 10px;
|
||||
}
|
||||
.wk_roomType_price_type{
|
||||
font-size: 16px;
|
||||
font-weight: 400;
|
||||
}
|
||||
.htlRoomTypeNameText {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.room_type_old_price {
|
||||
width: 100%;
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
.htlRoomTypeNameText, .htlRoomTypePriceText {
|
||||
font-size: 18px;
|
||||
color: #222222;
|
||||
@@ -37,17 +72,19 @@
|
||||
}
|
||||
.htlRoomTypeDescText{
|
||||
font-size: 16px;
|
||||
word-break: break-word;
|
||||
color: #555555;
|
||||
font-weight: 300;
|
||||
line-height: 21px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
.htlRoomTypeBookNow {
|
||||
font-size: 15px!important;
|
||||
color: #333333!important;
|
||||
font-weight: 400!important;
|
||||
background: transparent!important;
|
||||
border: 1px solid #333333!important;
|
||||
padding: 10px 30px!important;
|
||||
a.htlRoomTypeBookNow {
|
||||
font-size: 15px;
|
||||
color: #333333;
|
||||
font-weight: 400;
|
||||
background: transparent;
|
||||
border: 1px solid #333333;
|
||||
padding: 10px 30px;
|
||||
text-transform: capitalize;
|
||||
}
|
||||
|
||||
@@ -55,10 +92,6 @@
|
||||
border: 1px solid #333333;
|
||||
}
|
||||
|
||||
.htlRoomTypeDescText {
|
||||
padding-bottom: 9px;
|
||||
}
|
||||
|
||||
.room_type_old_price {
|
||||
text-decoration: line-through;
|
||||
color:#555555;
|
||||
|
||||
78
modules/wkhotelroom/views/js/WkHotelRoomBlockFront.js
Normal file
78
modules/wkhotelroom/views/js/WkHotelRoomBlockFront.js
Normal file
@@ -0,0 +1,78 @@
|
||||
/**
|
||||
* Since 2010 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 Since 2010 Webkul IN
|
||||
* @license https://store.webkul.com/license.html
|
||||
*/
|
||||
|
||||
$(document).ready(function() {
|
||||
applyChangesToDescription();
|
||||
$(window).on('resize', function() {
|
||||
resetDescriptionChanges();
|
||||
applyChangesToDescription();
|
||||
});
|
||||
|
||||
$(document).on('click', '.htlRoomTypeDescReadmore', function(e) {
|
||||
e.preventDefault();
|
||||
var target = (e.target).closest(".htlRoomTypeDescText");
|
||||
$(target).removeClass('htlRoomTypeDescTextContainer');
|
||||
$(target).html($(e.target).closest(".hotelRoomDescContainer").find('.htlRoomTypeDescOriginal').html());
|
||||
$(target).append($('.htlRoomTypeDescExtras').html());
|
||||
$(target).find('.htlRoomTypeDescReadless').show().css('display', 'inline-block');
|
||||
});
|
||||
|
||||
$(document).on('click', '.htlRoomTypeDescReadless', function(e) {
|
||||
e.preventDefault();
|
||||
var target = (e.target).closest(".htlRoomTypeDescText");
|
||||
$(target).addClass('htlRoomTypeDescTextContainer');
|
||||
initToggleOptions($(target));
|
||||
});
|
||||
});
|
||||
|
||||
function resetDescriptionChanges() {
|
||||
$(document).find('.htlRoomTypeDescText').each(function() {
|
||||
$(this).addClass('htlRoomTypeDescTextContainer');
|
||||
$(this).html($(this).parent().find('.htlRoomTypeDescOriginal').html());
|
||||
});
|
||||
}
|
||||
|
||||
function applyChangesToDescription() {
|
||||
$(document).find('.htlRoomTypeDescText').each(function() {
|
||||
// checking if the display:overFlow has been applied to the description. using 14px since font size is 14px.
|
||||
if ($(this).prop('scrollHeight') - $(this).prop('clientHeight') > 14) {
|
||||
initToggleOptions($(this)[0]);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function initToggleOptions(target) {
|
||||
truncatedText = truncateText(target);
|
||||
$(target).text(truncatedText);
|
||||
$(target).append($('.htlRoomTypeDescExtras').html());
|
||||
$(target).find('.htlRoomTypeDescReadmore').first().show().css('display', 'inline-block');
|
||||
}
|
||||
|
||||
function truncateText(target) {
|
||||
var lineHeight = parseInt($(target).css('line-height'), 10);
|
||||
var containerHeight = lineHeight * 3;
|
||||
|
||||
text = $(target).text();
|
||||
while ($(target).prop('scrollHeight') > containerHeight) {
|
||||
text = text.slice(0, -10);
|
||||
$(target).text(text + ' ... ' + $('.htlRoomTypeDescReadmore').first().text());
|
||||
}
|
||||
|
||||
return text;
|
||||
}
|
||||
@@ -45,22 +45,24 @@
|
||||
<div class="row margin-lr-0">
|
||||
<p class="htlRoomTypeNameText pull-left">{$roomDisplay.name|escape:'htmlall':'UTF-8'}</p>
|
||||
{if $roomDisplay.show_price && !isset($restricted_country_mode) && !$PS_CATALOG_MODE}
|
||||
<p class="htlRoomTypePriceText pull-right">
|
||||
<p class="htlRoomTypePriceText">
|
||||
{if $roomDisplay.feature_price_diff >= 0}
|
||||
<span class="wk_roomType_price {if $roomDisplay.feature_price_diff>0}room_type_old_price{/if}">{convertPrice price = $roomDisplay.price_without_reduction}</span>
|
||||
{/if}
|
||||
{if $roomDisplay.feature_price_diff}
|
||||
<span class="wk_roomType_price">{convertPrice price = $roomDisplay.feature_price}</span>
|
||||
{/if}
|
||||
/ {l s='Per Night' mod='wkhotelroom'}
|
||||
<span class="wk_roomType_price_type">
|
||||
/ {l s='Per Night' mod='wkhotelroom'}
|
||||
</span>
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="row margin-lr-0 htlRoomTypeDescText">
|
||||
{$roomDisplay.description}
|
||||
</div>
|
||||
<div class="row margin-lr-0 htlRoomTypeDescText htlRoomTypeDescTextContainer">{$roomDisplay.description|escape:'html':'UTF-8'}</div>
|
||||
<div class="row htlRoomTypeDescOriginal" hidden>{$roomDisplay.description|escape:'html':'UTF-8'}</div>
|
||||
<div class="htlRoomTypeDescExtras"><span class='htlRoomTypeDescReadmore'>...{l s='Read More.' mod='wkhotelroom'}</span><span class='htlRoomTypeDescReadless'>...{l s='Read Less.' mod='wkhotelroom'}</span></div>
|
||||
<div class="row margin-lr-0">
|
||||
<a class="btn btn-default button htlRoomTypeBookNow" href="{$link->getProductLink($roomDisplay.id_product)|escape:'html':'UTF-8'}"><span>{if !isset($restricted_country_mode) && !$PS_CATALOG_MODE}{l s='book now' mod='wkhotelroom'}{else}{l s='View' mod='wkhotelroom'}{/if}</span></a>
|
||||
<a class="btn htlRoomTypeBookNow" href="{$link->getProductLink($roomDisplay.id_product)|escape:'html':'UTF-8'}"><span>{if !isset($restricted_country_mode) && !$PS_CATALOG_MODE}{l s='book now' mod='wkhotelroom'}{else}{l s='View' mod='wkhotelroom'}{/if}</span></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -115,6 +115,7 @@ class WkHotelRoom extends Module
|
||||
)
|
||||
);
|
||||
|
||||
$this->context->controller->addJs($this->_path.'/views/js/WkHotelRoomBlockFront.js');
|
||||
$this->context->controller->addCSS($this->_path.'/views/css/WkHotelRoomBlockFront.css');
|
||||
|
||||
return $this->display(__FILE__, 'hotelRoomDisplayBlock.tpl');
|
||||
|
||||
@@ -185,6 +185,7 @@ class AdminTestimonialsModuleSettingController extends ModuleAdminController
|
||||
'display_image' => true,
|
||||
'image' => $imgExist ? $image : false,
|
||||
'hint' => $this->l('Upload an image of the person to whom this testimonial belongs.'),
|
||||
'desc' => $this->l('Recommended resolution: 98 x 98 pixels.'),
|
||||
),
|
||||
array(
|
||||
'type' => 'switch',
|
||||
|
||||
Reference in New Issue
Block a user