Fixed: fix review changes

This commit is contained in:
amit sharma
2026-09-03 14:43:40 +05:30
parent 51f4f14129
commit 7fc4ecc91f
5 changed files with 19 additions and 14 deletions

View File

@@ -2348,13 +2348,13 @@
<optgroup label="{$booking_source.business_source_name}">
{assign var="prev_business_source" value=$booking_source.business_source_name}
{/if}
<option value="{$booking_source.id_source}" {if isset($smarty.post.id_booking_source) && $booking_source.id_source == $smarty.post.id_booking_source}selected="selected"{/if}>
<option value="{$booking_source.id_source}" {if (isset($smarty.post.id_booking_source) && $booking_source.id_source == $smarty.post.id_booking_source) || (!isset($smarty.post.id_booking_source) && $booking_source.code == 'WALKIN')}selected="selected"{/if}>
{$booking_source.name}
</option>
{/foreach}
{if $booking_sources}</optgroup>{/if}
</select>
<p class="help-block">{l s='Leave unselected to use the default Walk-in source.'}</p>
<p class="help-block">{l s='Walk-in is selected by default. Change it if this booking came from a different source.'}</p>
</div>
</div>
<div class="form-group" {if $order_total <= 0}style="display: none;"{/if}>

View File

@@ -150,7 +150,7 @@ class SourceCore extends ObjectModel
}
return Db::getInstance()->executeS('
SELECT a.`id_source`, a.`id_business_source`, al.`name`, bsl.`name` AS `business_source_name`
SELECT a.`id_source`, a.`id_business_source`, a.`code`, al.`name`, bsl.`name` AS `business_source_name`
FROM `'._DB_PREFIX_.'source` a
LEFT JOIN `'._DB_PREFIX_.'source_lang` al ON (al.`id_source` = a.`id_source` AND al.`id_lang` = '.(int)$idLang.')
LEFT JOIN `'._DB_PREFIX_.'business_source_lang` bsl ON (bsl.`id_business_source` = a.`id_business_source` AND bsl.`id_lang` = '.(int)$idLang.')

View File

@@ -44,7 +44,7 @@ class HelperKpiRowCore extends Helper
if (isset($this->context->cookie->$cookieKey)) {
$kpi->visible = (bool) $this->context->cookie->$cookieKey;
} else {
$kpi->visible = true;
$kpi->visible = isset($kpi->visible) ? (bool) $kpi->visible : true;
}
$countVisible = $kpi->visible ? ++$countVisible : $countVisible;

View File

@@ -288,7 +288,6 @@ class AdminOrdersControllerCore extends AdminController
'filter_key' => 'a!source',
'list' => $this->all_order_sources,
'optional' => true,
'visible_default' => true
),
'booking_source_name' => array(
'title' => $this->l('Booking Source'),
@@ -393,14 +392,7 @@ class AdminOrdersControllerCore extends AdminController
return '--';
}
$html = Tools::safeOutput($echo);
if (isset($row['booking_source_code']) && $row['booking_source_code'] === 'DIRECT_WEBSITE') {
$title = $this->l('Visit website', 'AdminOrders', true);
$html .= ' <a href="'.Context::getContext()->link->getBaseLink().'" target="_blank" title="'.$title.'" onclick="event.stopPropagation();"><i class="icon-external-link"></i></a>';
}
return $html;
return Tools::safeOutput($echo);
}
public function formatStayPeriods($value, $row)
@@ -3026,12 +3018,25 @@ class AdminOrdersControllerCore extends AdminController
$helper->id = 'box-order-source';
$helper->icon = 'icon-globe';
$helper->color = 'color1';
$helper->visible = false;
$helper->title = $this->l('Order Source');
$helper->tooltip = $this->l('Order source shows from which source the order was placed.');
$helper->subtitle = $orderHistory[0]['id_employee'] ? $this->l('Back office') : $this->l('Front office');
$helper->value = $objOrder->source;
$this->kpis[] = $helper;
$objBookingSource = new Source((int)$objOrder->id_source, $this->context->language->id);
if (Validate::isLoadedObject($objBookingSource)) {
$helper = new HelperKpi();
$helper->id = 'box-booking-source';
$helper->icon = 'icon-tag';
$helper->color = 'color2';
$helper->title = $this->l('Booking Source');
$helper->tooltip = $this->l('Booking source shows the source from which this booking originated, e.g. Walk-in, Website, OTA.');
$helper->value = $objBookingSource->name;
$this->kpis[] = $helper;
}
$objCustomerThread = new CustomerThread();
$idCustomerThread = $objCustomerThread->getIdCustomerThreadByIdOrder($objOrder->id);
$helper = new HelperKpi();

View File

@@ -176,7 +176,7 @@ class AdminSourcesControllerCore extends AdminController
'class' => 'fixed-width-xs'
),
'name' => array(
'title' => $this->l('Name'),
'title' => $this->l('Booking Source'),
'width' => 'auto',
'filter_key' => 'b!name'
),