Fix: possibility to have more hooks in the same page
New: add left search block hook and extra left block hook
This commit is contained in:
parent
e2efc8abcc
commit
8e25cb1ae5
@ -93,9 +93,9 @@ if (is_array($conf->hooks_modules) && !empty($conf->hooks_modules))
|
||||
/******************************************************************************/
|
||||
|
||||
// Hook of thirdparty module
|
||||
if (! empty($object->hooks))
|
||||
if (! empty($object->hooks['objectcard']))
|
||||
{
|
||||
foreach($object->hooks as $module)
|
||||
foreach($object->hooks['objectcard'] as $module)
|
||||
{
|
||||
$module->doActions($object);
|
||||
$mesg = $module->error;
|
||||
@ -1082,9 +1082,9 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
|
||||
// Hook of thirdparty module
|
||||
if (empty($formconfirm) && ! empty($object->hooks))
|
||||
if (empty($formconfirm) && ! empty($object->hooks['objectcard']))
|
||||
{
|
||||
foreach($object->hooks as $module)
|
||||
foreach($object->hooks['objectcard'] as $module)
|
||||
{
|
||||
if (empty($formconfirm)) $formconfirm = $module->formconfirm($action,$object,$lineid);
|
||||
}
|
||||
@ -1491,9 +1491,9 @@ if ($id > 0 || ! empty($ref))
|
||||
}
|
||||
|
||||
// Hook of thirdparty module
|
||||
if (! empty($object->hooks))
|
||||
if (! empty($object->hooks['objectcard']))
|
||||
{
|
||||
foreach($object->hooks as $module)
|
||||
foreach($object->hooks['objectcard'] as $module)
|
||||
{
|
||||
$var=!$var;
|
||||
$module->formAddObject($object);
|
||||
@ -1643,7 +1643,7 @@ if ($id > 0 || ! empty($ref))
|
||||
|
||||
$var=true;
|
||||
|
||||
$somethingshown=$formfile->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'',0,'',$soc->default_lang,$object->hooks);
|
||||
$somethingshown=$formfile->show_documents('propal',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'',0,'',$soc->default_lang,$object->hooks['objectcard']);
|
||||
|
||||
|
||||
/*
|
||||
|
||||
@ -906,9 +906,9 @@ class Propal extends CommonObject
|
||||
if (! $error)
|
||||
{
|
||||
// Hook of thirdparty module
|
||||
if (! empty($object->hooks))
|
||||
if (! empty($object->hooks['objectcard']))
|
||||
{
|
||||
foreach($object->hooks as $module)
|
||||
foreach($object->hooks['objectcard'] as $module)
|
||||
{
|
||||
$result = $module->createfrom($objFrom,$result,$object->element);
|
||||
if ($result < 0) $error++;
|
||||
|
||||
@ -808,9 +808,9 @@ class Commande extends CommonObject
|
||||
if (! $error)
|
||||
{
|
||||
// Hook of thirdparty module
|
||||
if (! empty($object->hooks))
|
||||
if (! empty($object->hooks['objectcard']))
|
||||
{
|
||||
foreach($object->hooks as $module)
|
||||
foreach($object->hooks['objectcard'] as $module)
|
||||
{
|
||||
$result = $module->createfrom($objFrom,$result,$object->element);
|
||||
if ($result < 0) $error++;
|
||||
@ -902,9 +902,9 @@ class Commande extends CommonObject
|
||||
if ($ret > 0)
|
||||
{
|
||||
// Hooks
|
||||
if (! empty($object->hooks))
|
||||
if (! empty($object->hooks['objectcard']))
|
||||
{
|
||||
foreach($object->hooks as $module)
|
||||
foreach($object->hooks['objectcard'] as $module)
|
||||
{
|
||||
$result = $module->createfrom($object,$ret,$this->element);
|
||||
if ($result < 0) $error++;
|
||||
|
||||
@ -78,9 +78,9 @@ if (is_array($conf->hooks_modules) && !empty($conf->hooks_modules))
|
||||
/******************************************************************************/
|
||||
|
||||
// Hook of thirdparty module
|
||||
if (! empty($object->hooks))
|
||||
if (! empty($object->hooks['objectcard']))
|
||||
{
|
||||
foreach($object->hooks as $module)
|
||||
foreach($object->hooks['objectcard'] as $module)
|
||||
{
|
||||
$module->doActions($object);
|
||||
$mesg = $module->error;
|
||||
@ -305,9 +305,9 @@ if ($action == 'add' && $user->rights->commande->creer)
|
||||
}
|
||||
|
||||
// Hooks
|
||||
if (! empty($object->hooks))
|
||||
if (! empty($object->hooks['objectcard']))
|
||||
{
|
||||
foreach($object->hooks as $module)
|
||||
foreach($object->hooks['objectcard'] as $module)
|
||||
{
|
||||
$res = $module->createfrom($srcobject,$object_id,$object->element);
|
||||
if ($res < 0) $error++;
|
||||
@ -1516,9 +1516,9 @@ else
|
||||
}
|
||||
|
||||
// Hook of thirdparty module
|
||||
if (empty($formconfirm) && ! empty($object->hooks))
|
||||
if (empty($formconfirm) && ! empty($object->hooks['objectcard']))
|
||||
{
|
||||
foreach($object->hooks as $module)
|
||||
foreach($object->hooks['objectcard'] as $module)
|
||||
{
|
||||
if (empty($formconfirm)) $formconfirm = $module->formconfirm($action,$object,$lineid);
|
||||
}
|
||||
@ -1874,9 +1874,9 @@ else
|
||||
}
|
||||
|
||||
// Hook of thirdparty module
|
||||
if (! empty($object->hooks))
|
||||
if (! empty($object->hooks['objectcard']))
|
||||
{
|
||||
foreach($object->hooks as $module)
|
||||
foreach($object->hooks['objectcard'] as $module)
|
||||
{
|
||||
$var=!$var;
|
||||
$module->formAddObject($object);
|
||||
@ -2017,7 +2017,7 @@ else
|
||||
$genallowed=$user->rights->commande->creer;
|
||||
$delallowed=$user->rights->commande->supprimer;
|
||||
|
||||
$somethingshown=$formfile->show_documents('commande',$comref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang,$object->hooks);
|
||||
$somethingshown=$formfile->show_documents('commande',$comref,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang,$object->hooks['objectcard']);
|
||||
|
||||
/*
|
||||
* Linked object block
|
||||
|
||||
@ -86,9 +86,9 @@ if (is_array($conf->hooks_modules) && !empty($conf->hooks_modules))
|
||||
/******************************************************************************/
|
||||
|
||||
// Hook of thirdparty module
|
||||
if (! empty($object->hooks))
|
||||
if (! empty($object->hooks['objectcard']))
|
||||
{
|
||||
foreach($object->hooks as $module)
|
||||
foreach($object->hooks['objectcard'] as $module)
|
||||
{
|
||||
$module->doActions($object);
|
||||
$mesg = $module->error;
|
||||
@ -768,9 +768,9 @@ if ($action == 'add' && $user->rights->facture->creer)
|
||||
}
|
||||
|
||||
// Hooks
|
||||
if (! empty($object->hooks))
|
||||
if (! empty($object->hooks['objectcard']))
|
||||
{
|
||||
foreach($object->hooks as $module)
|
||||
foreach($object->hooks['objectcard'] as $module)
|
||||
{
|
||||
$res = $module->createfrom($srcobject,$id,$object->element);
|
||||
if ($res < 0) $error++;
|
||||
@ -2026,9 +2026,9 @@ else
|
||||
}
|
||||
|
||||
// Hook of thirdparty module
|
||||
if (empty($formconfirm) && ! empty($object->hooks))
|
||||
if (empty($formconfirm) && ! empty($object->hooks['objectcard']))
|
||||
{
|
||||
foreach($object->hooks as $module)
|
||||
foreach($object->hooks['objectcard'] as $module)
|
||||
{
|
||||
if (empty($formconfirm)) $formconfirm = $module->formconfirm($action,$object,$lineid);
|
||||
}
|
||||
@ -2555,9 +2555,9 @@ else
|
||||
}
|
||||
|
||||
// Hook of thirdparty module
|
||||
if (! empty($object->hooks))
|
||||
if (! empty($object->hooks['objectcard']))
|
||||
{
|
||||
foreach($object->hooks as $module)
|
||||
foreach($object->hooks['objectcard'] as $module)
|
||||
{
|
||||
$var=!$var;
|
||||
$module->formAddObject($object);
|
||||
@ -2798,7 +2798,7 @@ else
|
||||
$delallowed=$user->rights->facture->supprimer;
|
||||
|
||||
print '<br>';
|
||||
$somethingshown=$formfile->show_documents('facture',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang,$object->hooks);
|
||||
$somethingshown=$formfile->show_documents('facture',$filename,$filedir,$urlsource,$genallowed,$delallowed,$object->modelpdf,1,0,0,28,0,'','','',$soc->default_lang,$object->hooks['objectcard']);
|
||||
|
||||
/*
|
||||
* Linked object block
|
||||
|
||||
@ -572,9 +572,9 @@ class Facture extends CommonObject
|
||||
if (! $error)
|
||||
{
|
||||
// Hook of thirdparty module
|
||||
if (! empty($object->hooks))
|
||||
if (! empty($object->hooks['objectcard']))
|
||||
{
|
||||
foreach($object->hooks as $module)
|
||||
foreach($object->hooks['objectcard'] as $module)
|
||||
{
|
||||
$result = $module->createfrom($objFrom,$result,$object->element);
|
||||
if ($result < 0) $error++;
|
||||
|
||||
@ -1404,37 +1404,41 @@ class CommonObject
|
||||
* Instantiate hooks of thirdparty module
|
||||
* @param $type Type of hook
|
||||
*/
|
||||
function callHooks($type='objectcard')
|
||||
function callHooks($arraytype)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if (! is_array($arraytype)) $arraytype=array($arraytype);
|
||||
|
||||
foreach($conf->hooks_modules as $module => $hooks)
|
||||
{
|
||||
if ($conf->$module->enabled && in_array($type,$hooks))
|
||||
if ($conf->$module->enabled)
|
||||
{
|
||||
$path = '/'.$module.'/class/';
|
||||
$actionfile = 'actions_'.$module.'.class.php';
|
||||
$daofile = 'dao_'.$module.'.class.php';
|
||||
$pathroot = '';
|
||||
|
||||
// Include actions class (controller)
|
||||
dol_include_once($path.$actionfile);
|
||||
|
||||
// Include dataservice class (model)
|
||||
dol_include_once($path.$daofile);
|
||||
|
||||
// Instantiate actions class (controller)
|
||||
$controlclassname = 'Actions'.ucfirst($module);
|
||||
$objModule = new $controlclassname($this->db);
|
||||
$this->hooks[$objModule->module_number] = $objModule;
|
||||
|
||||
// Instantiate dataservice class (model)
|
||||
$modelclassname = 'Dao'.ucfirst($module);
|
||||
$this->hooks[$objModule->module_number]->object = new $modelclassname($this->db);
|
||||
|
||||
// We comment this because library must be included into file that need it,
|
||||
// so include should be done into actions_ and/or dao file
|
||||
// dol_include_once('/'.$module.'/lib/'.$module.'.lib.php');
|
||||
foreach($arraytype as $type)
|
||||
{
|
||||
if (in_array($type,$hooks))
|
||||
{
|
||||
$path = '/'.$module.'/class/';
|
||||
$actionfile = 'actions_'.$module.'.class.php';
|
||||
$daofile = 'dao_'.$module.'.class.php';
|
||||
$pathroot = '';
|
||||
|
||||
// Include actions class (controller)
|
||||
dol_include_once($path.$actionfile);
|
||||
|
||||
// Include dataservice class (model)
|
||||
dol_include_once($path.$daofile);
|
||||
|
||||
// Instantiate actions class (controller)
|
||||
$controlclassname = 'Actions'.ucfirst($module);
|
||||
$objModule = new $controlclassname($this->db);
|
||||
$this->hooks[$type][$objModule->module_number] = $objModule;
|
||||
|
||||
// Instantiate dataservice class (model)
|
||||
$modelclassname = 'Dao'.ucfirst($module);
|
||||
$this->hooks[$type][$objModule->module_number]->object = new $modelclassname($this->db);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1597,7 +1601,7 @@ class CommonObject
|
||||
|
||||
if (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line))
|
||||
{
|
||||
if (empty($line->fk_parent_line)) $this->hooks[$line->special_code]->printObjectLine($action,$this,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected);
|
||||
if (empty($line->fk_parent_line)) $this->hooks['objectcard'][$line->special_code]->printObjectLine($action,$this,$line,$var,$num,$i,$dateSelector,$seller,$buyer,$selected);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1715,7 +1719,7 @@ class CommonObject
|
||||
|
||||
if (($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line))
|
||||
{
|
||||
if (empty($line->fk_parent_line)) $object->hooks[$line->special_code]->printOriginObjectLine($this,$line,$var,$i);
|
||||
if (empty($line->fk_parent_line)) $object->hooks['objectcard'][$line->special_code]->printOriginObjectLine($this,$line,$var,$i);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@ -48,8 +48,8 @@
|
||||
echo $html->select_type_of_lines(isset($_POST["type"])?$_POST["type"]:-1,'type',1);
|
||||
if (($conf->product->enabled && $conf->service->enabled) || (empty($conf->product->enabled) && empty($conf->service->enabled))) echo '<br>';
|
||||
|
||||
if (! empty($object->hooks)) {
|
||||
foreach($object->hooks as $module) {
|
||||
if (! empty($object->hooks['objectcard'])) {
|
||||
foreach($object->hooks['objectcard'] as $module) {
|
||||
$module->formCreateProductOptions($object);
|
||||
}
|
||||
echo '<br>';
|
||||
|
||||
@ -60,8 +60,8 @@
|
||||
|
||||
if (! $conf->global->PRODUIT_USE_SEARCH_TO_SELECT) echo '<br>';
|
||||
|
||||
if (! empty($object->hooks)) {
|
||||
foreach($object->hooks as $module) {
|
||||
if (! empty($object->hooks['objectcard'])) {
|
||||
foreach($object->hooks['objectcard'] as $module) {
|
||||
$module->formCreateProductOptions($object);
|
||||
}
|
||||
echo '<br>';
|
||||
|
||||
@ -653,11 +653,11 @@ function pdf_writelinedesc(&$pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hide
|
||||
{
|
||||
global $db, $conf, $langs;
|
||||
|
||||
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['objectcard']) && ( ($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);
|
||||
return $object->hooks[$special_code]->pdf_writelinedesc($pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hideref,$hidedesc,$issupplierline);
|
||||
return $object->hooks['objectcard'][$special_code]->pdf_writelinedesc($pdf,$object,$i,$outputlangs,$w,$h,$posx,$posy,$hideref,$hidedesc,$issupplierline);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -810,7 +810,7 @@ function pdf_getlinedesc($object,$i,$outputlangs,$hideref=0,$hidedesc=0,$issuppl
|
||||
*/
|
||||
function pdf_getlinenum($object,$i,$outputlangs)
|
||||
{
|
||||
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['objectcard']) && ( ($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);
|
||||
@ -831,7 +831,7 @@ function pdf_getlinenum($object,$i,$outputlangs)
|
||||
*/
|
||||
function pdf_getlineref($object,$i,$outputlangs)
|
||||
{
|
||||
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['objectcard']) && ( ($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);
|
||||
@ -851,7 +851,7 @@ function pdf_getlineref($object,$i,$outputlangs)
|
||||
*/
|
||||
function pdf_getlineref_supplier($object,$i,$outputlangs)
|
||||
{
|
||||
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['objectcard']) && ( ($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);
|
||||
@ -875,11 +875,11 @@ function pdf_getlineref_supplier($object,$i,$outputlangs)
|
||||
*/
|
||||
function pdf_getlinevatrate($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['objectcard']) && ( ($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);
|
||||
return $object->hooks[$special_code]->pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails);
|
||||
return $object->hooks['objectcard'][$special_code]->pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -899,11 +899,11 @@ function pdf_getlinevatrate($object,$i,$outputlangs,$hidedetails=0)
|
||||
*/
|
||||
function pdf_getlineupexcltax($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['objectcard']) && ( ($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);
|
||||
return $object->hooks[$special_code]->pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails);
|
||||
return $object->hooks['objectcard'][$special_code]->pdf_getlineupexcltax($object,$i,$outputlangs,$hidedetails);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -925,11 +925,11 @@ function pdf_getlineqty($object,$i,$outputlangs,$hidedetails=0)
|
||||
{
|
||||
if ($object->lines[$i]->special_code != 3)
|
||||
{
|
||||
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['objectcard']) && (( $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);
|
||||
return $object->hooks[$special_code]->pdf_getlineqty($object,$i,$outputlangs,$hidedetails);
|
||||
return $object->hooks['objectcard'][$special_code]->pdf_getlineqty($object,$i,$outputlangs,$hidedetails);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -952,11 +952,11 @@ function pdf_getlineqty_asked($object,$i,$outputlangs,$hidedetails=0)
|
||||
{
|
||||
if ($object->lines[$i]->special_code != 3)
|
||||
{
|
||||
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['objectcard']) && (( $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);
|
||||
return $object->hooks[$special_code]->pdf_getlineqty_asked($object,$i,$outputlangs,$hidedetails);
|
||||
return $object->hooks['objectcard'][$special_code]->pdf_getlineqty_asked($object,$i,$outputlangs,$hidedetails);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -979,11 +979,11 @@ function pdf_getlineqty_shipped($object,$i,$outputlangs,$hidedetails=0)
|
||||
{
|
||||
if ($object->lines[$i]->special_code != 3)
|
||||
{
|
||||
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['objectcard']) && (( $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);
|
||||
return $object->hooks[$special_code]->pdf_getlineqty_shipped($object,$i,$outputlangs,$hidedetails);
|
||||
return $object->hooks['objectcard'][$special_code]->pdf_getlineqty_shipped($object,$i,$outputlangs,$hidedetails);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1006,11 +1006,11 @@ function pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails=0)
|
||||
{
|
||||
if ($object->lines[$i]->special_code != 3)
|
||||
{
|
||||
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['objectcard']) && (( $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);
|
||||
return $object->hooks[$special_code]->pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails);
|
||||
return $object->hooks['objectcard'][$special_code]->pdf_getlineqty_keeptoship($object,$i,$outputlangs,$hidedetails);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1035,11 +1035,11 @@ function pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails=0)
|
||||
|
||||
if ($object->lines[$i]->special_code != 3)
|
||||
{
|
||||
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['objectcard']) && ( ($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);
|
||||
return $object->hooks[$special_code]->pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails);
|
||||
return $object->hooks['objectcard'][$special_code]->pdf_getlineremisepercent($object,$i,$outputlangs,$hidedetails);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1066,11 +1066,11 @@ function pdf_getlinetotalexcltax($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['objectcard']) && ( ($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);
|
||||
return $object->hooks[$special_code]->pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails);
|
||||
return $object->hooks['objectcard'][$special_code]->pdf_getlinetotalexcltax($object,$i,$outputlangs,$hidedetails);
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -1099,7 +1099,7 @@ function pdf_getTotalQty($object,$type='',$outputlangs)
|
||||
{
|
||||
$total += $object->lines[$i]->qty;
|
||||
}
|
||||
else if ($type==9 && ! empty($object->hooks) && ( ($object->lines[$i]->product_type == 9 && ! empty($object->lines[$i]->special_code) ) || ! empty($object->lines[$i]->fk_parent_line) ) )
|
||||
else if ($type==9 && ! empty($object->hooks['objectcard']) && ( ($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);
|
||||
|
||||
@ -1331,7 +1331,14 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
|
||||
else print '<td class="vmenu" valign="top">';
|
||||
|
||||
print "\n";
|
||||
|
||||
|
||||
// Instantiate hooks of thirdparty module
|
||||
if (is_array($conf->hooks_modules) && !empty($conf->hooks_modules))
|
||||
{
|
||||
require_once(DOL_DOCUMENT_ROOT.'/core/class/commonobject.class.php');
|
||||
$object = new CommonObject($db);
|
||||
$object->callHooks(array('searchform','leftblock'));
|
||||
}
|
||||
|
||||
// Define $searchform
|
||||
if ($conf->societe->enabled && $conf->global->MAIN_SEARCHFORM_SOCIETE && $user->rights->societe->lire)
|
||||
@ -1362,6 +1369,15 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
|
||||
$searchform.=printSearchForm(DOL_URL_ROOT.'/adherents/liste.php', DOL_URL_ROOT.'/adherents/liste.php',
|
||||
img_object('','user').' '.$langs->trans("Members"), 'member', 'sall');
|
||||
}
|
||||
|
||||
// Search form hook of thirdparty module
|
||||
if (! empty($object->hooks['searchform']))
|
||||
{
|
||||
foreach($object->hooks['searchform'] as $module)
|
||||
{
|
||||
$searchform.=$module->printSearchForm();
|
||||
}
|
||||
}
|
||||
|
||||
// Define $bookmarks
|
||||
if ($conf->bookmark->enabled && $user->rights->bookmark->lire)
|
||||
@ -1372,8 +1388,6 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
|
||||
$bookmarks=printBookmarksList($db, $langs);
|
||||
}
|
||||
|
||||
|
||||
|
||||
$left_menu=isset($conf->browser->phone)?$conf->smart_menu:$conf->top_menu;
|
||||
if (GETPOST('menu')) $left_menu=GETPOST('menu'); // menu=eldy_backoffice.php
|
||||
|
||||
@ -1467,6 +1481,16 @@ function left_menu($menu_array_before, $helppagename='', $moresearchform='', $me
|
||||
print '<div class="help"><a class="help" target="_blank" href="'.$bugbaseurl.'">'.$langs->trans("FindBug").'</a></div>';
|
||||
}
|
||||
print "\n";
|
||||
|
||||
// Left block hook of thirdparty module
|
||||
if (! empty($object->hooks['leftblock']))
|
||||
{
|
||||
foreach($object->hooks['leftblock'] as $module)
|
||||
{
|
||||
$module->printLeftBlock();
|
||||
}
|
||||
}
|
||||
|
||||
print "</div>\n";
|
||||
print "<!-- End left vertical menu -->\n";
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user