Merge pull request #5028 from marcosgdf/fr-4524
NEW Renamed ActionComm::add function to ActionComm::create
This commit is contained in:
commit
4b401a03c8
@ -318,7 +318,7 @@ if ($action == 'add')
|
||||
$db->begin();
|
||||
|
||||
// On cree l'action
|
||||
$idaction=$object->add($user);
|
||||
$idaction=$object->create($user);
|
||||
|
||||
if ($idaction > 0)
|
||||
{
|
||||
|
||||
@ -173,7 +173,7 @@ class ActionComm extends CommonObject
|
||||
*
|
||||
* @param DoliDB $db Database handler
|
||||
*/
|
||||
function __construct($db)
|
||||
public function __construct(DoliDB $db)
|
||||
{
|
||||
$this->db = $db;
|
||||
|
||||
@ -189,7 +189,7 @@ class ActionComm extends CommonObject
|
||||
* @param int $notrigger 1 = disable triggers, 0 = enable triggers
|
||||
* @return int Id of created event, < 0 if KO
|
||||
*/
|
||||
function add($user,$notrigger=0)
|
||||
public function create(User $user, $notrigger = 0)
|
||||
{
|
||||
global $langs,$conf,$hookmanager;
|
||||
|
||||
@ -395,6 +395,20 @@ class ActionComm extends CommonObject
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Add an action/event into database.
|
||||
* $this->type_id OR $this->type_code must be set.
|
||||
*
|
||||
* @param User $user Object user making action
|
||||
* @param int $notrigger 1 = disable triggers, 0 = enable triggers
|
||||
* @return int Id of created event, < 0 if KO
|
||||
* @deprecated Use create instead
|
||||
*/
|
||||
public function add(User $user, $notrigger = 0)
|
||||
{
|
||||
$this->create($user, $notrigger);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load an object from its id and create a new one in database
|
||||
*
|
||||
@ -436,7 +450,7 @@ class ActionComm extends CommonObject
|
||||
}
|
||||
|
||||
// Create clone
|
||||
$result=$this->add($fuser);
|
||||
$result=$this->create($fuser);
|
||||
if ($result < 0) $error++;
|
||||
|
||||
if (! $error)
|
||||
|
||||
@ -803,7 +803,7 @@ class InterfaceActionsAuto extends DolibarrTriggers
|
||||
$actioncomm->fk_element = $object->id;
|
||||
$actioncomm->elementtype = $object->element;
|
||||
|
||||
$ret=$actioncomm->add($user); // User creating action
|
||||
$ret=$actioncomm->create($user); // User creating action
|
||||
|
||||
unset($object->actionmsg); unset($object->actionmsg2); unset($object->actiontypecode); // When several action are called on same object, we must be sure to not reuse value of first action.
|
||||
|
||||
|
||||
@ -459,7 +459,7 @@ function createActionComm($authentication,$actioncomm)
|
||||
|
||||
$db->begin();
|
||||
|
||||
$result=$newobject->add($fuser);
|
||||
$result=$newobject->create($fuser);
|
||||
if ($result <= 0)
|
||||
{
|
||||
$error++;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user