Merge branch 'develop' into gli-2941

This commit is contained in:
amit sharma
2026-08-24 16:30:37 +05:30
40 changed files with 510 additions and 380 deletions

View File

@@ -455,7 +455,7 @@ class AdminNormalProductsControllerCore extends AdminController
'tooltip_items' => $options,
));
$tooltip = $this->context->smarty->fetch('helpers/tooltip.tpl');
$tooltip = $this->context->smarty->fetch('controllers/normal_products/_price_calculation_method_options.tpl');
return count($options) . ' ' . $this->l('Selected') . ' ' . $tooltip;
}

View File

@@ -72,6 +72,7 @@ class AdminOrdersControllerCore extends AdminController
) FROM `'._DB_PREFIX_.'htl_booking_detail` hbd WHERE hbd.`id_order` = a.`id_order`) as total_guests,
(SELECT SUM(DATEDIFF(hbd.`date_to`, hbd.`date_from`)) FROM `'._DB_PREFIX_.'htl_booking_detail` hbd WHERE hbd.`id_order` = a.`id_order`) as los,
hbd.`id_room` AS id_room_information,
(SELECT GROUP_CONCAT(CONCAT(ps.period, \'~\', ps.cnt) ORDER BY ps.period SEPARATOR \'::\') FROM (SELECT CONCAT(hbd.`date_from`, \'|\', hbd.`date_to`) AS period, COUNT(*) AS cnt FROM `'._DB_PREFIX_.'htl_booking_detail` hbd WHERE hbd.`id_order` = a.`id_order` GROUP BY hbd.`date_from`, hbd.`date_to`) AS ps) AS stay_periods,
(SELECT COUNT(spod.`id_service_product_order_detail`) FROM `'._DB_PREFIX_.'service_product_order_detail` spod WHERE spod.`id_order` = a.`id_order` AND spod.`id_htl_booking_detail`=0) as num_products';
$this->_join = '
@@ -196,6 +197,15 @@ class AdminOrdersControllerCore extends AdminController
'type'=>'date',
'displayed' => false,
),
'stay_periods' => array(
'title' => $this->l('Stay Periods'),
'type' => 'text',
'callback' => 'formatStayPeriods',
'optional' => true,
'search' => false,
'displayed' => true,
'visible_default' => true,
),
'total_guests' => array(
'title' => $this->l('Guests'),
'type' => 'range',
@@ -212,7 +222,7 @@ class AdminOrdersControllerCore extends AdminController
'visible_default' => true
),
'los' => array(
'title' => $this->l('Stay period'),
'title' => $this->l('Stay duration'),
'align' => 'text-center',
'type' => 'range',
'havingFilter' => true,
@@ -359,6 +369,43 @@ class AdminOrdersControllerCore extends AdminController
return Tools::displayPrice($echo, (int)$idCurrency);
}
public function formatStayPeriods($value, $row)
{
if (empty($value)) {
return '--';
}
$stayPeriods = array();
foreach (explode('::', $value) as $stays) {
$countStays = explode('~', $stays);
$stayDates = explode('|', $countStays[0]);
if (count($stayDates) === 2) {
$stayPeriods[] = array(
'from' => Tools::displayDate(trim($stayDates[0])),
'to' => Tools::displayDate(trim($stayDates[1])),
'count' => isset($countStays[1]) ? (int)$countStays[1] : 1,
);
}
}
$datesDisplay = array();
foreach (array_slice($stayPeriods, 0, 1) as $stayPeriod) {
$datesDisplay[] = $stayPeriod['from'].' - '.$stayPeriod['to'];
}
$stayPeriodHtml = implode('<br>', $datesDisplay);
$uniqueStayPeriods = count($stayPeriods);
if ($uniqueStayPeriods > 1) {
$this->context->smarty->assign(array(
'stay_periods' => $stayPeriods,
'extra_stay_periods_count' => $uniqueStayPeriods - 1,
));
$stayPeriodHtml .= ' '.$this->createTemplate('_stay_periods_tooltip.tpl')->fetch();
}
return $stayPeriodHtml;
}
public function initPageHeaderToolbar()
{
if (empty($this->display)) {
@@ -1409,7 +1456,6 @@ class AdminOrdersControllerCore extends AdminController
$this->addJqueryUI('ui.datepicker');
$this->addJqueryUI('ui.tooltip', 'base', true);
$this->addJS(_PS_JS_DIR_.'vendor/d3.v3.min.js');
$this->addJqueryUI(array('ui.tooltip'), 'base', true);
@@ -4005,10 +4051,11 @@ class AdminOrdersControllerCore extends AdminController
$this->errors[] = $this->l('Please select a file to upload.');
} elseif ($objHotelBookingDocument->fileInfo['size'] > Tools::getMaxUploadSize()) {
$this->errors[] = $this->l('Uploaded file size is too large.');
} elseif(!(ImageManager::isRealImage($objHotelBookingDocument->fileInfo['tmp_name'])
|| $objHotelBookingDocument->fileInfo['mime'] == 'application/pdf')
) {
$this->errors[] = $this->l('Please upload an image or a PDF file only. Allowed image formats: .gif, .jpg, .jpeg and .png');
} else {
$objHotelBookingDocument->setFileType();
if (!$objHotelBookingDocument->file_type) {
$this->errors[] = $this->l('Please upload an image or a PDF file only. Allowed image formats: .gif, .jpg, .jpeg and .png');
}
}
} else {
$this->errors[] = Tools::displayError('You do not have permission to edit this order.');

View File

@@ -237,11 +237,11 @@ class ContactControllerCore extends FrontController
$this->addJS(_PS_JS_DIR_.'validate.js');
// GOOGLE MAP
if (($PS_API_KEY = Configuration::get('PS_API_KEY')) && ($PS_MAP_ID = Configuration::get('PS_MAP_ID')) && Configuration::get('WK_GOOGLE_ACTIVE_MAP')) {
if (($PS_API_KEY = Configuration::get('PS_API_KEY')) && Configuration::get('WK_GOOGLE_ACTIVE_MAP')) {
Media::addJsDef(
array(
'PS_STORES_ICON' => $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_STORES_ICON')),
'PS_MAP_ID' => $PS_MAP_ID,
'PS_MAP_ID' => Configuration::get('PS_MAP_ID'),
)
);
$this->addJS(

View File

@@ -639,7 +639,6 @@ class GuestTrackingControllerCore extends FrontController
if (Validate::isLoadedObject($objHotelBranchInformation)) {
if (($apiKey = Configuration::get('PS_API_KEY'))
&& Configuration::get('WK_GOOGLE_ACTIVE_MAP')
&& ($PS_MAP_ID = Configuration::get('PS_MAP_ID'))
) {
if (floatval($objHotelBranchInformation->latitude) != 0
&& floatval($objHotelBranchInformation->longitude) != 0
@@ -647,7 +646,7 @@ class GuestTrackingControllerCore extends FrontController
Media::addJsDef(array(
'PS_STORES_ICON' => $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_STORES_ICON')),
'initiateMap' => 1,
'PS_MAP_ID' => $PS_MAP_ID,
'PS_MAP_ID' => Configuration::get('PS_MAP_ID'),
));
$this->addJS(

View File

@@ -884,7 +884,6 @@ class OrderDetailControllerCore extends FrontController
if (Validate::isLoadedObject($objHotelBranchInformation)) {
if (($apiKey = Configuration::get('PS_API_KEY'))
&& Configuration::get('WK_GOOGLE_ACTIVE_MAP')
&& ($PS_MAP_ID = Configuration::get('PS_MAP_ID'))
) {
if (floatval($objHotelBranchInformation->latitude) != 0
&& floatval($objHotelBranchInformation->longitude) != 0
@@ -892,7 +891,7 @@ class OrderDetailControllerCore extends FrontController
Media::addJsDef(array(
'PS_STORES_ICON' => $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_STORES_ICON')),
'initiateMap' => 1,
'PS_MAP_ID' => $PS_MAP_ID,
'PS_MAP_ID' => Configuration::get('PS_MAP_ID'),
));
$this->addJS(
'https://maps.googleapis.com/maps/api/js?key='.$apiKey.'&libraries=places,marker&loading=async&callback=initMap&language='.

View File

@@ -111,7 +111,7 @@ class OurPropertiesControllerCore extends FrontController
$hotelsInfo = array_slice($hotelsInfo, $page * 10, 10);
}
if ($displayHotelMap && Configuration::get('PS_API_KEY') && Configuration::get('WK_GOOGLE_ACTIVE_MAP') && Configuration::get('PS_MAP_ID')) {
if ($displayHotelMap && Configuration::get('PS_API_KEY') && Configuration::get('WK_GOOGLE_ACTIVE_MAP')) {
if ($hotelLocations = $objHotelInfo->getMapFormatHotelsInfo(Configuration::get('WK_MAP_HOTEL_ACTIVE_ONLY'))) {
$hotelLocationArray = str_replace(array('\n', '\r'), '', json_encode($hotelLocations));
}
@@ -144,11 +144,11 @@ class OurPropertiesControllerCore extends FrontController
$this->addJS(_THEME_JS_DIR_.'our-properties.js');
$this->addCSS(_THEME_CSS_DIR_.'our-properties.css');
// GOOGLE MAP
if (($PS_API_KEY = Configuration::get('PS_API_KEY')) && ($PS_MAP_ID = Configuration::get('PS_MAP_ID')) && Configuration::get('WK_GOOGLE_ACTIVE_MAP')) {
if (($PS_API_KEY = Configuration::get('PS_API_KEY')) && Configuration::get('WK_GOOGLE_ACTIVE_MAP')) {
Media::addJsDef(
array(
'PS_STORES_ICON' => $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_STORES_ICON')),
'PS_MAP_ID' => $PS_MAP_ID
'PS_MAP_ID' => Configuration::get('PS_MAP_ID')
)
);

View File

@@ -67,9 +67,7 @@ class ProductControllerCore extends FrontController
$this->addJqueryPlugin('jqzoom');
}
if (($PS_API_KEY = Configuration::get('PS_API_KEY'))
&& ($PS_MAP_ID = Configuration::get('PS_MAP_ID'))
) {
if ($PS_API_KEY = Configuration::get('PS_API_KEY')) {
$objHotelRoomType = new HotelRoomType();
if ($roomTypeInfo = $objHotelRoomType->getRoomTypeInfoByIdProduct($this->product->id)) {
$objHotelBranchInformation = new HotelBranchInformation($roomTypeInfo['id_hotel']);
@@ -82,7 +80,7 @@ class ProductControllerCore extends FrontController
'longitude' => $objHotelBranchInformation->longitude,
),
'PS_STORES_ICON' => $this->context->link->getMediaLink(_PS_IMG_.Configuration::get('PS_STORES_ICON')),
'PS_MAP_ID' => $PS_MAP_ID
'PS_MAP_ID' => Configuration::get('PS_MAP_ID')
));
$this->addJS(