Use return code on activateAll and closeAll
This commit is contained in:
parent
f963afa505
commit
cf175b0777
@ -252,7 +252,7 @@ class Contrat extends CommonObject
|
|||||||
*
|
*
|
||||||
* @param User $user Object User making action
|
* @param User $user Object User making action
|
||||||
* @param int|string $date_start Date start (now if empty)
|
* @param int|string $date_start Date start (now if empty)
|
||||||
* @return void
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function activateAll($user, $date_start='')
|
function activateAll($user, $date_start='')
|
||||||
{
|
{
|
||||||
@ -287,11 +287,13 @@ class Contrat extends CommonObject
|
|||||||
if ($ok)
|
if ($ok)
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($this->db,'Error in activateAll function');
|
dol_print_error($this->db,'Error in activateAll function');
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -299,7 +301,7 @@ class Contrat extends CommonObject
|
|||||||
* Close all lines of a contract
|
* Close all lines of a contract
|
||||||
*
|
*
|
||||||
* @param User $user Object User making action
|
* @param User $user Object User making action
|
||||||
* @return void
|
* @return int <0 if KO, >0 if OK
|
||||||
*/
|
*/
|
||||||
function closeAll($user)
|
function closeAll($user)
|
||||||
{
|
{
|
||||||
@ -335,11 +337,13 @@ class Contrat extends CommonObject
|
|||||||
if ($ok)
|
if ($ok)
|
||||||
{
|
{
|
||||||
$this->db->commit();
|
$this->db->commit();
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
dol_print_error($this->db,'Error in closeAll function');
|
dol_print_error($this->db,'Error in closeAll function');
|
||||||
$this->db->rollback();
|
$this->db->rollback();
|
||||||
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user