Merge pull request #10807 from altatof/ste

change add_commercial function signature
This commit is contained in:
Laurent Destailleur 2019-03-15 19:26:12 +01:00 committed by GitHub
commit c72cd7e750
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -1,4 +1,4 @@
/*
!.gitignore
!README.md
!index.html
!index.html

View File

@ -1939,11 +1939,11 @@ class Societe extends CommonObject
*
* @param User $user Object user
* @param int $commid Id of user
* @return void
* @return int <0 if KO, >0 if OK
*/
public function add_commercial(User $user, $commid)
{
// phpcs:enable
// phpcs:enable
$error=0;
@ -1961,14 +1961,18 @@ class Societe extends CommonObject
if (! $this->db->query($sql) )
{
dol_syslog(get_class($this)."::add_commercial Erreur");
return -2;
}
else {
$this->context=array('commercial_modified'=>$commid);
$result=$this->call_trigger('COMPANY_LINK_SALE_REPRESENTATIVE', $user);
if ($result < 0) $error++;
if ($result < 0) return $result;
return 1;
}
}
return -1;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps