Fix: hook object more simple
This commit is contained in:
parent
2117cf7a6a
commit
ca468c2f84
@ -98,7 +98,7 @@ class HookManager
|
||||
{
|
||||
$controlclassname = 'Actions'.ucfirst($module);
|
||||
$actionInstance = new $controlclassname($this->db);
|
||||
$this->hooks[$context]['modules'][$module] = $actionInstance;
|
||||
$this->hooks[$context][$module] = $actionInstance;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -129,11 +129,11 @@ class HookManager
|
||||
|
||||
// Loop on each hook
|
||||
$resaction=0; $resprint='';
|
||||
foreach($this->hooks as $hook)
|
||||
foreach($this->hooks as $modules)
|
||||
{
|
||||
if (! empty($hook['modules']))
|
||||
if (! empty($modules))
|
||||
{
|
||||
foreach($hook['modules'] as $module => $actioninstance)
|
||||
foreach($modules as $actioninstance)
|
||||
{
|
||||
$var=!$var;
|
||||
|
||||
|
||||
@ -1005,13 +1005,13 @@ function pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails=0,$hookmanage
|
||||
*/
|
||||
function pdf_getlineupwithtax($object,$i,$outputlangs,$hidedetails=0)
|
||||
{
|
||||
if (! empty($object->hooks) && ( ($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code) ) || ! empty($object->lines[$i]->fk_parent_line) ) )
|
||||
if (! empty($object->hooks) && (($object->lines[$i]->product_type == 9 && !empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line)))
|
||||
{
|
||||
$special_code = $object->lines[$i]->special_code;
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
foreach($object->hooks as $hook)
|
||||
foreach($object->hooks as $modules)
|
||||
{
|
||||
if (method_exists($hook['modules'][$special_code],'pdf_getlineupwithtax')) return $hook['modules'][$special_code]->pdf_getlineupwithtax($object,$i,$outputlangs,$hidedetails);
|
||||
if (method_exists($modules[$special_code],'pdf_getlineupwithtax')) return $modules[$special_code]->pdf_getlineupwithtax($object,$i,$outputlangs,$hidedetails);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1222,13 +1222,13 @@ function pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails=0)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (! empty($object->hooks) && ( ($object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code) ) || ! empty($object->lines[$i]->fk_parent_line) ) )
|
||||
if (! empty($object->hooks) && (($object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code)) || ! empty($object->lines[$i]->fk_parent_line)))
|
||||
{
|
||||
$special_code = $object->lines[$i]->special_code;
|
||||
if (! empty($object->lines[$i]->fk_parent_line)) $special_code = $object->getSpecialCode($object->lines[$i]->fk_parent_line);
|
||||
foreach($object->hooks as $hook)
|
||||
foreach($object->hooks as $modules)
|
||||
{
|
||||
if (method_exists($hook['modules'][$special_code],'pdf_getlinetotalwithtax')) return $hook['modules'][$special_code]->pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails);
|
||||
if (method_exists($modules[$special_code],'pdf_getlinetotalwithtax')) return $modules[$special_code]->pdf_getlinetotalwithtax($object,$i,$outputlangs,$hidedetails);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user