Merge branch 'develop' into gli-3156
This commit is contained in:
@@ -47,7 +47,7 @@
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-lg-3 control-label">{l s='Total spent since registration:'}</label>
|
||||
<div class="col-lg-3"><p class="form-control-static">{displayWtPriceWithCurrency price=Tools::convertPrice($customer_stats.total_orders|floatval, $currency) currency=$currency}</p></div>
|
||||
<div class="col-lg-3"><p class="form-control-static">{displayWtPriceWithCurrency price=Tools::convertPrice($customer_stats.total_spent|floatval, $currency) currency=$currency}</p></div>
|
||||
</div>
|
||||
</div>
|
||||
{else}
|
||||
@@ -102,7 +102,7 @@
|
||||
<td>{dateFormat date=$room['date_from'] full=$is_full_date} - {dateFormat date=$room['date_to'] full=$is_full_date}</td>
|
||||
<td>
|
||||
<span>
|
||||
{if $stay['adults']}{$stay['adults']}{/if} {if $stay['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$stay['children']}}, {$stay['children']} {if $stay['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}
|
||||
{if $room['adults']}{$room['adults']}{/if} {if $room['adults'] > 1}{l s='Adults'}{else}{l s='Adult'}{/if}{if {$room['children']}}, {$room['children']} {if $room['children'] > 1}{l s='Children'}{else}{l s='Child'}{/if}{/if}
|
||||
</span>
|
||||
</td>
|
||||
<td>{displayWtPriceWithCurrency price=$room['feature_price_tax_excl'] currency=$currency}</td>
|
||||
@@ -131,7 +131,7 @@
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li role="presentation" class="active" ><a href="#room_type_service_product_desc_{$stay['id']}" aria-controls="services" role="tab" data-toggle="tab">{l s='Services'}</a></li>
|
||||
<li role="presentation" class="active" ><a href="#room_type_service_product_desc_{$room['id']}" aria-controls="services" role="tab" data-toggle="tab">{l s='Services'}</a></li>
|
||||
</ul>
|
||||
<div class="tab-content panel">
|
||||
{if isset($room['selected_services']) && $room['selected_services']}
|
||||
|
||||
@@ -255,7 +255,7 @@
|
||||
<label>
|
||||
<input type="checkbox" id="sp_standalone" name="selling_preference_type[]" value="{Product::SELLING_PREFERENCE_WITH_STANDALONE}"
|
||||
{if Product::isSellableAsStandalone($product->id) }checked="checked"{/if}>
|
||||
{l s='Sell With Standalone'}
|
||||
{l s='Sell as a Standalone'}
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1606,7 +1606,7 @@
|
||||
$('#deactiveDatesModal').attr('data-room-row-index', roomRowIndex);
|
||||
$('#deactiveDatesModal').attr('data-id-room', idRoom);
|
||||
if ($.trim(roomNum) != '') {
|
||||
roomNum = '( '+'{l s='%s No' sprintf=$htl_room_type['selling_object_plural_name']}'+' '+roomNum+')';
|
||||
roomNum = '( '+'{l s='%s No' sprintf=$htl_room_type['selling_object_name']}'+' '+roomNum+')';
|
||||
}
|
||||
|
||||
$('#deactiveDatesModal .disable_dates_room_num').html(roomNum);
|
||||
@@ -2005,7 +2005,7 @@
|
||||
$('#connected_room_title').html('');
|
||||
}
|
||||
} else {
|
||||
alert(response.message);
|
||||
showErrorMessage(response.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -2016,7 +2016,7 @@
|
||||
var connectedRoomId = $row.find('.connect-room').val();
|
||||
|
||||
if (!connectedRoomId) {
|
||||
alert(selectRoomText);
|
||||
showErrorMessage(selectRoomText);
|
||||
return;
|
||||
}
|
||||
$.ajax({
|
||||
@@ -2043,7 +2043,7 @@
|
||||
$icon.text(response.connected_count);
|
||||
}
|
||||
} else {
|
||||
alert(response.message);
|
||||
showErrorMessage(response.message);
|
||||
}
|
||||
},
|
||||
complete: function() {
|
||||
@@ -2132,7 +2132,7 @@
|
||||
$icon.text(response.connected_count);
|
||||
}
|
||||
} else {
|
||||
alert(response.message);
|
||||
showErrorMessage(response.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -28,7 +28,7 @@
|
||||
<input type="checkbox" name="{$node['input_name']}[]" value="{$node['value']}"{if isset($node['selected']) && $node['selected'] == true} checked="checked"{/if}{if isset($node['disabled']) && $node['disabled'] == true} disabled="disabled"{/if} {if isset($node['hidden']) && $node['hidden'] == true} hidden="hidden"{/if}/>
|
||||
{/if}
|
||||
<i class="icon-folder-close"></i>
|
||||
<label class="tree-toggler">{if isset($node['name'])}{$node['name']|escape:'html':'UTF-8'}{/if}{if isset($node['selected_childs']) && (int)$node['selected_childs'] > 0} {l s='(%s selected)' sprintf=$node['selected_childs']}{/if}</label>
|
||||
<label class="tree-toggler">{if isset($node['name'])}{$node['name']|escape:'html':'UTF-8':false}{/if}{if isset($node['selected_childs']) && (int)$node['selected_childs'] > 0} {l s='(%s selected)' sprintf=$node['selected_childs']}{/if}</label>
|
||||
</span>
|
||||
{if isset($node['badge'])}
|
||||
<span class="badge {if isset($node['badge']['class'])}{$node['badge']['class']}{/if}">{$node['badge']['title']}</span>
|
||||
|
||||
@@ -4066,7 +4066,7 @@ class CartCore extends ObjectModel
|
||||
) {
|
||||
if ($serviceProducts = $objServiceProductCartDetail->getServiceProductsInCart(
|
||||
$this->id,
|
||||
[Product::SELLING_PREFERENCE_HOTEL_STANDALONE, Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE],
|
||||
[Product::SELLING_PREFERENCE_WITH_HOTEL, Product::SELLING_PREFERENCE_WITH_HOTEL_AND_WITH_ROOM_TYPE],
|
||||
null,
|
||||
0,
|
||||
null,
|
||||
|
||||
@@ -619,7 +619,7 @@ abstract class PaymentModuleCore extends Module
|
||||
$serviceProducts = $objServiceProductCartDetail->getServiceProductsInCart(
|
||||
$order->id_cart,
|
||||
[],
|
||||
null,
|
||||
isset($product['id_hotel']) ? (int) $product['id_hotel'] : null,
|
||||
0,
|
||||
null,
|
||||
$product['id_product']
|
||||
|
||||
@@ -121,7 +121,7 @@ class HTMLTemplateOrderSlipCore extends HTMLTemplateInvoice
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$this->order->products = null;
|
||||
$this->order->products = array();
|
||||
}
|
||||
|
||||
unset($product); // remove reference
|
||||
|
||||
@@ -270,12 +270,12 @@ class AdminCartsControllerCore extends AdminController
|
||||
if (!($cart = $this->loadObject(true))) {
|
||||
return;
|
||||
}
|
||||
$this->context->cart = $cart;
|
||||
if ($this->tabAccess['kpi'] === 1) {
|
||||
$this->content .= $this->renderKpis();
|
||||
}
|
||||
$customer = new Customer($cart->id_customer);
|
||||
$currency = new Currency($cart->id_currency);
|
||||
$this->context->cart = $cart;
|
||||
$this->context->currency = $currency;
|
||||
$this->context->customer = $customer;
|
||||
$this->toolbar_title = sprintf($this->l('Cart #%06d'), $this->context->cart->id);
|
||||
@@ -1717,45 +1717,52 @@ class AdminCartsControllerCore extends AdminController
|
||||
$idCartBooking
|
||||
))) {
|
||||
$originalPrice = Product::getPriceStatic($idServiceProduct, false);
|
||||
$specificPriceInfo = SpecificPrice::getSpecificPrice(
|
||||
(int)$idServiceProduct,
|
||||
0,
|
||||
$objCart->id_currency,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
$objCart->id,
|
||||
0,
|
||||
$objHotelCartBookingData->id
|
||||
);
|
||||
// if price is different than the original service price then update the price
|
||||
if ($canEdit && $operator == 'up' && $originalPrice != $unitPrice) {
|
||||
if ($specificPriceInfo = SpecificPrice::getSpecificPrice(
|
||||
(int)$idServiceProduct,
|
||||
0,
|
||||
$objCart->id_currency,
|
||||
0,
|
||||
0,
|
||||
1,
|
||||
0,
|
||||
0,
|
||||
$objCart->id,
|
||||
0,
|
||||
$objHotelCartBookingData->id
|
||||
)) {
|
||||
$objSpecificPrice = new SpecificPrice($specificPriceInfo['id_specific_price']);
|
||||
} else {
|
||||
$objSpecificPrice = new SpecificPrice();
|
||||
}
|
||||
$objSpecificPrice->id_shop = 0;
|
||||
$objSpecificPrice->id_shop_group = 0;
|
||||
$objSpecificPrice->id_cart = $objCart->id;
|
||||
$objSpecificPrice->id_currency = $objCart->id_currency;
|
||||
$objSpecificPrice->id_country = 0;
|
||||
$objSpecificPrice->id_group = 0;
|
||||
$objSpecificPrice->id_customer = 0;
|
||||
$objSpecificPrice->id_product = $idServiceProduct;
|
||||
$objSpecificPrice->id_product_attribute = 0;
|
||||
$objSpecificPrice->price = $unitPrice;
|
||||
$objSpecificPrice->from_quantity = 1;
|
||||
$objSpecificPrice->reduction = 0;
|
||||
$objSpecificPrice->id_htl_cart_booking = $objHotelCartBookingData->id;
|
||||
$objSpecificPrice->reduction_type = 'amount';
|
||||
$objSpecificPrice->reduction_tax = 0;
|
||||
$objSpecificPrice->from = '0000-00-00 00:00:00';
|
||||
$objSpecificPrice->to = '0000-00-00 00:00:00';
|
||||
if($canEdit && $operator == 'up'){
|
||||
if ($originalPrice != $unitPrice) {
|
||||
if ($specificPriceInfo) {
|
||||
$objSpecificPrice = new SpecificPrice($specificPriceInfo['id_specific_price']);
|
||||
} else {
|
||||
$objSpecificPrice = new SpecificPrice();
|
||||
}
|
||||
$objSpecificPrice->id_shop = 0;
|
||||
$objSpecificPrice->id_shop_group = 0;
|
||||
$objSpecificPrice->id_cart = $objCart->id;
|
||||
$objSpecificPrice->id_currency = $objCart->id_currency;
|
||||
$objSpecificPrice->id_country = 0;
|
||||
$objSpecificPrice->id_group = 0;
|
||||
$objSpecificPrice->id_customer = 0;
|
||||
$objSpecificPrice->id_product = $idServiceProduct;
|
||||
$objSpecificPrice->id_product_attribute = 0;
|
||||
$objSpecificPrice->price = $unitPrice;
|
||||
$objSpecificPrice->from_quantity = 1;
|
||||
$objSpecificPrice->reduction = 0;
|
||||
$objSpecificPrice->id_htl_cart_booking = $objHotelCartBookingData->id;
|
||||
$objSpecificPrice->reduction_type = 'amount';
|
||||
$objSpecificPrice->reduction_tax = 0;
|
||||
$objSpecificPrice->from = '0000-00-00 00:00:00';
|
||||
$objSpecificPrice->to = '0000-00-00 00:00:00';
|
||||
|
||||
$result &= $objSpecificPrice->save();
|
||||
$result &= $objSpecificPrice->save();
|
||||
} elseif ($specificPriceInfo) {
|
||||
$objSpecificPrice = new SpecificPrice($specificPriceInfo['id_specific_price']);
|
||||
$result &= $objSpecificPrice->delete();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -5720,6 +5720,19 @@ class AdminProductsControllerCore extends AdminController
|
||||
$idHotel = (int) $objRoom->id_hotel;
|
||||
|
||||
if ($mode === 'add') {
|
||||
if (!Validate::isLoadedObject($objRoom)) {
|
||||
die(json_encode(['success' => false, 'message' => $this->l('Invalid room selected.')]));
|
||||
}
|
||||
|
||||
$objConnectedRoom = new HotelRoomInformation($connectedRoomId);
|
||||
if (
|
||||
$connectedRoomId === $roomId
|
||||
|| !Validate::isLoadedObject($objConnectedRoom)
|
||||
|| (int) $objConnectedRoom->id_hotel !== $idHotel
|
||||
) {
|
||||
die(json_encode(['success' => false, 'message' => $this->l('Invalid room selected for connection.')]));
|
||||
}
|
||||
|
||||
$connection = new HotelConnectedRoom();
|
||||
$connection->id_room = $roomId;
|
||||
$connection->id_room_connected = $connectedRoomId;
|
||||
|
||||
@@ -232,6 +232,9 @@ class ServiceProductCartDetail extends ObjectModel
|
||||
$context = Context::getContext();
|
||||
foreach ($serviceProducts as $product) {
|
||||
$objProduct = new Product($product['id_product'], false, $language->id);
|
||||
if (!Validate::isLoadedObject($objProduct)) {
|
||||
continue;
|
||||
}
|
||||
if (!$objProduct->booking_product) {
|
||||
$quantity = $product['quantity'] ? (int) $product['quantity'] : 1;
|
||||
|
||||
|
||||
@@ -57,6 +57,17 @@ class AdminHotelPropertyTypesController extends ModuleAdminController
|
||||
$this->addRowAction('edit');
|
||||
$this->addRowAction('delete');
|
||||
$this->bulk_actions = array(
|
||||
'enableSelection' => array(
|
||||
'text' => $this->l('Enable selected'),
|
||||
'icon' => 'icon-power-off text-success',
|
||||
),
|
||||
'disableSelection' => array(
|
||||
'text' => $this->l('Disable selected'),
|
||||
'icon' => 'icon-power-off text-danger',
|
||||
),
|
||||
'divider' => array(
|
||||
'text' => 'divider',
|
||||
),
|
||||
'delete' => array(
|
||||
'text' => $this->l('Delete selected'),
|
||||
'confirm' => $this->l('Delete selected items?'),
|
||||
@@ -157,6 +168,13 @@ class AdminHotelPropertyTypesController extends ModuleAdminController
|
||||
|
||||
$this->display = $idPropertyType ? 'edit' : 'add';
|
||||
|
||||
if (!$this->errors && !Tools::getValue('active') && $idPropertyType) {
|
||||
$objPropertyType = new HotelPropertyType((int) $idPropertyType);
|
||||
if (Validate::isLoadedObject($objPropertyType) && $objPropertyType->active && $objPropertyType->isUsed()) {
|
||||
$this->errors[] = $this->l('You cannot disable this property type because it is currently assigned to one or more properties.');
|
||||
}
|
||||
}
|
||||
|
||||
if (!$this->errors) {
|
||||
parent::postProcess();
|
||||
}
|
||||
@@ -165,6 +183,34 @@ class AdminHotelPropertyTypesController extends ModuleAdminController
|
||||
}
|
||||
}
|
||||
|
||||
public function processStatus()
|
||||
{
|
||||
$object = $this->loadObject();
|
||||
if (Validate::isLoadedObject($object) && $object->active && $object->isUsed()) {
|
||||
$this->errors[] = $this->l('You cannot disable this property type because it is currently assigned to one or more properties.');
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return parent::processStatus();
|
||||
}
|
||||
|
||||
protected function processBulkDisableSelection()
|
||||
{
|
||||
if (is_array($this->boxes) && !empty($this->boxes)) {
|
||||
foreach ($this->boxes as $idPropertyType) {
|
||||
$object = new HotelPropertyType((int) $idPropertyType);
|
||||
if (Validate::isLoadedObject($object) && $object->isUsed()) {
|
||||
$this->errors[] = $this->l('You cannot disable this property type because it is currently assigned to one or more properties.');
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return parent::processBulkDisableSelection();
|
||||
}
|
||||
|
||||
public function processDelete()
|
||||
{
|
||||
$object = $this->loadObject();
|
||||
|
||||
@@ -120,8 +120,8 @@
|
||||
@keyframes wkZoomIn { from { opacity:0; transform:scale(0.88); } to { opacity:1; transform:scale(1); } }
|
||||
@keyframes wkBlurOut { from { opacity:1; filter:blur(0); } to { opacity:0; filter:blur(10px); } }
|
||||
@keyframes wkBlurIn { from { opacity:0; filter:blur(10px); } to { opacity:1; filter:blur(0); } }
|
||||
@keyframes wkSlideOut { from { opacity:1; transform:translateX(0); } to { opacity:0; transform:translateX(-60px); } }
|
||||
@keyframes wkSlideIn { from { opacity:0; transform:translateX(60px); } to { opacity:1; transform:translateX(0); } }
|
||||
@keyframes wkSlideOut { from { transform:translateX(0); } to { transform:translateX(-100%); } }
|
||||
@keyframes wkSlideIn { from { transform:translateX(100%); } to { transform:translateX(0); } }
|
||||
|
||||
/* Description slide animation on slide change */
|
||||
.js-header-description {
|
||||
|
||||
@@ -228,12 +228,6 @@
|
||||
</div> {l s='Buy Standalone.'}
|
||||
</label>
|
||||
</div>
|
||||
<label class="control-label">{l s='Select Property'}</label>
|
||||
<select class="chosen input-hotel" name="id_hotel" id="service_id_hotel">
|
||||
{foreach $associated_hotels as $hotel}
|
||||
<option value="{$hotel.id_hotel}" {if isset($service_id_hotel) && $service_id_hotel == $hotel['id_hotel']}selected{elseif $hotel@first}selected{/if}>{$hotel.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
{/if}
|
||||
{/block}
|
||||
@@ -241,7 +235,7 @@
|
||||
<div id="hotel_selection_block" {if isset($buying_option) && $buying_option == '2'}style="display: none;"{/if}>
|
||||
{if isset($associated_hotels) && $associated_hotels}
|
||||
<div class="form-group">
|
||||
<label class="control-label">{l s='Select Hotel'}</label>
|
||||
<label class="control-label">{l s='Select Property'}</label>
|
||||
<select class="chosen input-hotel" name="id_hotel" id="service_id_hotel">
|
||||
{foreach $associated_hotels as $hotel}
|
||||
<option value="{$hotel.id_hotel}" {if isset($service_id_hotel) && $service_id_hotel == $hotel['id_hotel']}selected{elseif $hotel@first}selected{/if}>{$hotel.name}</option>
|
||||
|
||||
@@ -120,7 +120,7 @@
|
||||
<div class="row">
|
||||
<div class="{if isset($nationality_mandatory) && $nationality_mandatory}required {/if}form-group col-sm-6">
|
||||
<label for="id_nationality">{l s='Nationality'}{if isset($nationality_mandatory) && $nationality_mandatory} <sup>*</sup>{/if}</label>
|
||||
<select name="id_nationality" id="id_nationality" class="form-control">
|
||||
<select name="id_nationality" id="id_nationality" >
|
||||
<option value="">-</option>
|
||||
{foreach from=$nationality_countries item=c}
|
||||
<option value="{$c.id_country}"{if isset($smarty.post.id_nationality) && $smarty.post.id_nationality == $c.id_country || (isset($guestInformations) && isset($guestInformations.id_nationality) && $guestInformations.id_nationality == $c.id_country)} selected="selected"{/if}>{$c.name|escape:'html':'UTF-8'}</option>
|
||||
|
||||
Reference in New Issue
Block a user