[Legacy]_Add_global_history_viewed_DB_integration

This commit is contained in:
y.yerli 2023-12-13 18:50:06 +03:00 committed by Jack Anderson
parent 04312106de
commit 36790eb3f3

View file

@ -48,19 +48,13 @@ class TrackerManagerPort
* @param array $modules
* @return array
*/
public function getModule(array $modules): array
public function getModule(array $modules, int $history_max_viewed = 10): array
{
global $current_user;
$db = DBManagerFactory::getInstance();
$userId = $db->quote($current_user->id);
$tracker = BeanFactory::newBean('Trackers');
if (!empty($modules)) {
$history_max_viewed = 10;
} else {
$history_max_viewed = (!empty($GLOBALS['sugar_config']['history_max_viewed'])) ? $GLOBALS['sugar_config']['history_max_viewed'] : 50;
}
$table = $tracker->table_name;
if (!empty($modules)) {