From 9011b03528eb47518b44b3e6d44b384a37cebe53 Mon Sep 17 00:00:00 2001 From: oscim Date: Wed, 26 Feb 2020 08:18:01 +0100 Subject: [PATCH 1/2] Update emailcollector.class.php add hook in loop action --- .../class/emailcollector.class.php | 34 +++++++++++++++++++ 1 file changed, 34 insertions(+) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 0c27f710135..0ae0122a887 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1793,6 +1793,40 @@ class EmailCollector extends CommonObject } $tickettocreate->ref = $defaultref; } + // Create event specific on hook + // this code action is hook..... for support this call + elseif (substr($operation['type'],0,4) == 'hook'){ + global $hookmanager; + + if(!is_object($hookmanager)) + $hookmanager->initHooks(array('emailcollectorcard')); + + $parameters = array( + 'connection'=> $connection, + 'imapemail'=>$imapemail, + 'overview'=>$overview, + + 'from' => $from , + 'fromtext' => $fromtext, + + 'actionparam'=> $operation['actionparam'], + + + + 'thirdpartyid' => $thirdpartyid , + 'objectid'=>@$objectid, + 'objectemail'=>@$objectemail, + + 'messagetext'=>$messagetext, + 'subject'=>$subject, + 'header'=>$header, + ) ; + $res = $hookmanager->executeHooks('doCollectOneCollector', $parameters, $this, $operation['type']); + + if($res < 0 ) + $this->error = $hookmanager->resPrint; + + } if ($errorforthisaction) { From ada99b01f95e027534810e36638db95f729c265b Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Wed, 26 Feb 2020 07:20:28 +0000 Subject: [PATCH 2/2] Fixing style errors. --- .../class/emailcollector.class.php | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/htdocs/emailcollector/class/emailcollector.class.php b/htdocs/emailcollector/class/emailcollector.class.php index 0ae0122a887..b6a295949a7 100644 --- a/htdocs/emailcollector/class/emailcollector.class.php +++ b/htdocs/emailcollector/class/emailcollector.class.php @@ -1794,39 +1794,38 @@ class EmailCollector extends CommonObject $tickettocreate->ref = $defaultref; } // Create event specific on hook - // this code action is hook..... for support this call - elseif (substr($operation['type'],0,4) == 'hook'){ - global $hookmanager; + // this code action is hook..... for support this call + elseif (substr($operation['type'], 0, 4) == 'hook'){ + global $hookmanager; - if(!is_object($hookmanager)) + if(!is_object($hookmanager)) $hookmanager->initHooks(array('emailcollectorcard')); - $parameters = array( + $parameters = array( 'connection'=> $connection, 'imapemail'=>$imapemail, - 'overview'=>$overview, - + 'overview'=>$overview, + 'from' => $from , 'fromtext' => $fromtext, - + 'actionparam'=> $operation['actionparam'], - - - + + + 'thirdpartyid' => $thirdpartyid , 'objectid'=>@$objectid, 'objectemail'=>@$objectemail, - + 'messagetext'=>$messagetext, 'subject'=>$subject, 'header'=>$header, ) ; - $res = $hookmanager->executeHooks('doCollectOneCollector', $parameters, $this, $operation['type']); - - if($res < 0 ) - $this->error = $hookmanager->resPrint; + $res = $hookmanager->executeHooks('doCollectOneCollector', $parameters, $this, $operation['type']); - } + if($res < 0 ) + $this->error = $hookmanager->resPrint; + } if ($errorforthisaction) {