Added: option for modules to manipulate KPI data

This commit is contained in:
Shreesh Arora
2024-06-03 19:52:39 +05:30
parent d97c22d7af
commit d390dd5fdf
11 changed files with 151 additions and 159 deletions

View File

@@ -320,6 +320,9 @@ class AdminControllerCore extends Controller
/** @var string */
protected $display;
/** @var array */
public $kpis = array();
/** @var bool */
protected $_includeContainer = true;
@@ -2647,6 +2650,23 @@ class AdminControllerCore extends Controller
public function renderKpis()
{
Hook::exec('action'.$this->controller_name.'KPIListingModifier', array(
'kpis' => &$this->kpis,
));
foreach ($this->kpis as $key => &$kpi) {
$kpi->exclude_id_hotels[] = 3;
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);
}
}
$helper = new HelperKpiRow();
$helper->kpis = $this->kpis;
return $helper->generate();
}
/**