fixed kip panel visible on all admin pages

This commit is contained in:
Shreesh Arora
2024-08-23 15:48:57 +05:30
parent fa3d470455
commit b3dfa98e6c
2 changed files with 54 additions and 52 deletions

View File

@@ -2689,18 +2689,20 @@ class AdminControllerCore extends Controller
'kpis' => &$this->kpis,
));
foreach ($this->kpis as $key => &$kpi) {
if (count($kpi->exclude_id_hotels)) {
if (empty($kpi->id_hotels)) {
$kpi->id_hotels = HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1, 1);
if (count($this->kpis)) {
foreach ($this->kpis as $key => &$kpi) {
if (count($kpi->exclude_id_hotels)) {
if (empty($kpi->id_hotels)) {
$kpi->id_hotels = HotelBranchInformation::getProfileAccessedHotels($this->context->employee->id_profile, 1, 1);
}
$kpi->id_hotels = array_diff($kpi->id_hotels, $kpi->exclude_id_hotels);
}
$kpi->id_hotels = array_diff($kpi->id_hotels, $kpi->exclude_id_hotels);
}
}
$helper = new HelperKpiRow();
$helper->kpis = $this->kpis;
return $helper->generate();
$helper = new HelperKpiRow();
$helper->kpis = $this->kpis;
return $helper->generate();
}
}
/**