diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 3b9c2d448da..1e8f6dadc18 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1,10 +1,10 @@ - * Copyright (C) 2002-2003 Jean-Louis Bergamo - * Copyright (C) 2004-2011 Laurent Destailleur - * Copyright (C) 2004 Sebastien Di Cintio - * Copyright (C) 2004 Benoit Mortier - * Copyright (C) 2009 Regis Houssin +/* Copyright (C) 2002-2003 Rodolphe Quiedeville + * Copyright (C) 2002-2003 Jean-Louis Bergamo + * Copyright (C) 2004-2012 Laurent Destailleur + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2009-2012 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -318,7 +318,7 @@ class Adherent extends CommonObject $this->ref=$id; // Update minor fields - $result=$this->update($user,1,1); // nosync is 1 to avoid update data of user + $result=$this->update($user,1,1,0,0,'add'); // nosync is 1 to avoid update data of user if ($result < 0) { $this->db->rollback(); @@ -390,9 +390,10 @@ class Adherent extends CommonObject * @param int $nosyncuser 0=Synchronize linked user (standard info), 1=Do not synchronize linked user * @param int $nosyncuserpass 0=Synchronize linked user (password), 1=Do not synchronize linked user * @param int $nosyncthirdparty 0=Synchronize linked thirdparty (standard info), 1=Do not synchronize linked thirdparty + * @param string $action Current action for hookmanager * @return int <0 if KO, >0 if OK */ - function update($user,$notrigger=0,$nosyncuser=0,$nosyncuserpass=0,$nosyncthirdparty=0) + function update($user,$notrigger=0,$nosyncuser=0,$nosyncuserpass=0,$nosyncthirdparty=0,$action='update') { global $conf, $langs; diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php index d9e7ecda956..0f9758cd427 100644 --- a/htdocs/contact/class/contact.class.php +++ b/htdocs/contact/class/contact.class.php @@ -148,7 +148,7 @@ class Contact extends CommonObject if (! $error) { - $result=$this->update($this->id, $user, 1); + $result=$this->update($this->id, $user, 1, 'add'); if ($result < 0) { $error++; @@ -203,10 +203,11 @@ class Contact extends CommonObject * * @param int $id Id of contact/address to update * @param User $user Objet user making change - * @param int $notrigger 0=no, 1=yesi + * @param int $notrigger 0=no, 1=yes + * @param string $action Current action for hookmanager * @return int <0 if KO, >0 if OK */ - function update($id, $user=0, $notrigger=0) + function update($id, $user=0, $notrigger=0, $action='update') { global $conf, $langs; diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index ba412053ccf..698e4794678 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -326,7 +326,7 @@ class Product extends CommonObject $result = $this->_log_price($user); if ($result > 0) { - if ($this->update($id, $user, true) > 0) + if ($this->update($id, $user, true, 'add') > 0) { // FIXME: not use here /* @@ -404,9 +404,10 @@ class Product extends CommonObject * @param int $id Id of product * @param User $user Object user making update * @param int $notrigger Disable triggers + * @param string $action Current action for hookmanager * @return int 1 if OK, -1 if ref already exists, -2 if other error */ - function update($id, $user, $notrigger=false) + function update($id, $user, $notrigger=false, $action='update') { global $langs, $conf;