From 5f4ab188cf94eadece2172d154b1401d3bf6f2df Mon Sep 17 00:00:00 2001 From: Quentin VIAL-GOUTEYRON Date: Tue, 17 Aug 2021 09:33:50 +0200 Subject: [PATCH 1/2] NEW hook after rank update --- htdocs/core/class/commonobject.class.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 50d86d17488..2853031b698 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3022,6 +3022,7 @@ abstract class CommonObject */ public function updateRangOfLine($rowid, $rang) { + global $hookmanager; $fieldposition = 'rang'; // @todo Rename 'rang' into 'position' if (in_array($this->table_element_line, array('bom_bomline', 'ecm_files', 'emailcollector_emailcollectoraction'))) { $fieldposition = 'position'; @@ -3034,6 +3035,9 @@ abstract class CommonObject if (!$this->db->query($sql)) { dol_print_error($this->db); } + $parameters=array('rowid'=>$rowid, 'rang'=>$rang, 'fieldposition' => $fieldposition); + $action=''; + $reshook = $hookmanager->executeHooks('afterRankUpdate', $parameters, $this, $action); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps From 7986f4881c6fca92f30873725c180d7ca84d8d7b Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Tue, 17 Aug 2021 16:12:45 +0200 Subject: [PATCH 2/2] Update commonobject.class.php --- htdocs/core/class/commonobject.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 2853031b698..1a2015acac0 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -3037,7 +3037,7 @@ abstract class CommonObject } $parameters=array('rowid'=>$rowid, 'rang'=>$rang, 'fieldposition' => $fieldposition); $action=''; - $reshook = $hookmanager->executeHooks('afterRankUpdate', $parameters, $this, $action); + $reshook = $hookmanager->executeHooks('afterRankOfLineUpdate', $parameters, $this, $action); } // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps