diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php
index df8f513f46e..8babc2a2ddd 100644
--- a/htdocs/commande/fiche.php
+++ b/htdocs/commande/fiche.php
@@ -25,7 +25,7 @@
* \file htdocs/commande/fiche.php
* \ingroup commande
* \brief Page to show customer order
- * \version $Id: fiche.php,v 1.533 2011/08/10 22:47:34 eldy Exp $
+ * \version $Id: fiche.php,v 1.534 2011/08/11 15:14:51 hregis Exp $
*/
require("../main.inc.php");
@@ -1392,7 +1392,7 @@ if ($action == 'create' && $user->rights->commande->creer)
print '
';
- $objectsrc->printOriginLinesList();
+ $objectsrc->printOriginLinesList($hookmanager);
print '
';
}
@@ -2070,5 +2070,5 @@ else
$db->close();
-llxFooter('$Date: 2011/08/10 22:47:34 $ - $Revision: 1.533 $');
+llxFooter('$Date: 2011/08/11 15:14:51 $ - $Revision: 1.534 $');
?>
diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php
index ac7695e965b..be1791c2464 100644
--- a/htdocs/compta/facture.php
+++ b/htdocs/compta/facture.php
@@ -25,7 +25,7 @@
* \file htdocs/compta/facture.php
* \ingroup facture
* \brief Page to create/see an invoice
- * \version $Id: facture.php,v 1.854 2011/08/10 22:47:34 eldy Exp $
+ * \version $Id: facture.php,v 1.855 2011/08/11 15:14:50 hregis Exp $
*/
require('../main.inc.php');
@@ -782,7 +782,7 @@ if ($action == 'add' && $user->rights->facture->creer)
}
// Hooks
- $parameters=array('srcobject'=>$srcobject);
+ $parameters=array('objFrom'=>$srcobject);
$reshook=$hookmanager->executeHooks('createfrom',$parameters,$object,$action); // Note that $action and $object may have been modified by hook
if ($reshook < 0) $error++;
}
@@ -1835,7 +1835,7 @@ if ($action == 'create')
print '';
- $objectsrc->printOriginLinesList($object);
+ $objectsrc->printOriginLinesList($hookmanager);
print '
';
}
@@ -3185,5 +3185,5 @@ else
$db->close();
-llxFooter('$Date: 2011/08/10 22:47:34 $ - $Revision: 1.854 $');
+llxFooter('$Date: 2011/08/11 15:14:50 $ - $Revision: 1.855 $');
?>
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 26168ccf132..3e6d3cb15ef 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -27,7 +27,7 @@
* \file htdocs/compta/facture/class/facture.class.php
* \ingroup facture
* \brief Fichier de la classe des factures clients
- * \version $Id: facture.class.php,v 1.126 2011/08/10 22:47:33 eldy Exp $
+ * \version $Id: facture.class.php,v 1.127 2011/08/11 15:14:50 hregis Exp $
*/
require_once(DOL_DOCUMENT_ROOT ."/core/class/commonobject.class.php");
@@ -661,8 +661,8 @@ class Facture extends CommonObject
// Hook of thirdparty module
if (is_object($hookmanager))
{
- $parameters=array('objFrom'=>$objFrom);
- $reshook=$hookmanager->executeHooks('createfrom',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks
+ $parameters=array('objFrom'=>$object);
+ $reshook=$hookmanager->executeHooks('createfrom',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
if ($reshook < 0) $error++;
}
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index aebbc059ce5..e29058ef019 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -21,7 +21,7 @@
* \file htdocs/core/class/commonobject.class.php
* \ingroup core
* \brief File of parent class of all other business classes (invoices, contracts, proposals, orders, ...)
- * \version $Id: commonobject.class.php,v 1.154 2011/08/10 22:47:34 eldy Exp $
+ * \version $Id: commonobject.class.php,v 1.155 2011/08/11 15:14:51 hregis Exp $
*/
@@ -1800,7 +1800,7 @@ class CommonObject
* If lines are into a template, title must also be into a template
* But for the moment we don't know if it's possible as we keep a method available on overloaded objects.
*/
- function printOriginLinesList()
+ function printOriginLinesList($hookmanager=false)
{
global $langs;
@@ -1820,14 +1820,12 @@ class CommonObject
{
$var=!$var;
- if (! empty($this->hooks) && ( ($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line) ) )
+ if (is_object($hookmanager) && ( ($line->product_type == 9 && ! empty($line->special_code)) || ! empty($line->fk_parent_line) ) )
{
if (empty($line->fk_parent_line))
{
- foreach($this->hooks as $hook)
- {
- if (method_exists($hook['modules'][$line->special_code],'printOriginObjectLine')) $hook['modules'][$line->special_code]->printOriginObjectLine($this,$line,$var,$i);
- }
+ $parameters=array('line'=>$line,'var'=>$var,'i'=>$i);
+ $reshook=$hookmanager->executeHooks('printOriginObjectLine',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks
}
}
else