From 50b27239a7dcb80b882d7998701931280a404fcd Mon Sep 17 00:00:00 2001 From: ATM john Date: Tue, 15 Dec 2020 11:34:04 +0100 Subject: [PATCH] Fix missing hook for project overview control --- htdocs/projet/class/project.class.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index a0b6e38423b..335b06a0456 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -576,6 +576,9 @@ class Project extends CommonObject public function get_element_list($type, $tablename, $datefieldname = '', $dates = '', $datee = '', $projectkey = 'fk_projet') { // phpcs:enable + + global $hookmanager; + $elements = array(); if ($this->id <= 0) return $elements; @@ -630,6 +633,21 @@ class Project extends CommonObject if (empty($datefieldname)) return 'Error this object has no date field defined'; $sql .= " AND (".$datefieldname." <= '".$this->db->idate($datee)."' OR ".$datefieldname." IS NULL)"; } + + $hookmanager->initHooks(array('projectdao')); + $parameters = array( + 'sql'=>$sql, + 'type' => $type, + 'tablename' => $tablename, + 'datefieldname' => $datefieldname, + 'dates' => $dates, + 'datee' => $datee, + 'fk_projet' => $projectkey + ); + $reshook = $hookmanager->executeHooks('getElementList', $parameters, $object, $action); + if ($reshook > 0) $sql = $hookmanager->resPrint; + else $sql .= $hookmanager->resPrint; + if (!$sql) return -1; //print $sql;