mirror of
https://github.com/Dolibarr/dolibarr.git
synced 2026-02-08 00:52:01 +01:00
Fixed: [ bug #1653 ] Can't access task notes
This commit is contained in:
@@ -601,18 +601,22 @@ abstract class CommonObject
|
||||
/**
|
||||
* Load the third party of object, from id $this->socid or $this->fk_soc, into this->thirdparty
|
||||
*
|
||||
* @return int <0 if KO, >0 if OK
|
||||
* @param int $force_thirdparty_id Force thirdparty id
|
||||
* @return int <0 if KO, >0 if OK
|
||||
*/
|
||||
function fetch_thirdparty()
|
||||
function fetch_thirdparty($force_thirdparty_id=0)
|
||||
{
|
||||
global $conf;
|
||||
|
||||
if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty)) return 0;
|
||||
if (empty($this->socid) && empty($this->fk_soc) && empty($this->fk_thirdparty) && empty($force_thirdparty_id)) return 0;
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/societe/class/societe.class.php';
|
||||
|
||||
$idtofetch=isset($this->socid)?$this->socid:(isset($this->fk_soc)?$this->fk_soc:$this->fk_thirdparty);
|
||||
if ($force_thirdparty_id) $idtofetch=$force_thirdparty_id;
|
||||
|
||||
$thirdparty = new Societe($this->db);
|
||||
$result=$thirdparty->fetch(isset($this->socid)?$this->socid:(isset($this->fk_soc)?$this->fk_soc:$this->fk_thirdparty));
|
||||
$result=$thirdparty->fetch($idtofetch);
|
||||
$this->client = $thirdparty; // deprecated
|
||||
$this->thirdparty = $thirdparty;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user