Bureaucrats, emailconfirmed, Administrators
825
edits
| Line 63: | Line 63: | ||
</source> | </source> | ||
==After fetch method of this object :== | ==After fetch method of this object class:== | ||
<source lang="php"> | <source lang="php"> | ||
require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); | require_once(DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'); | ||
$extrafields=new ExtraFields($this->db); | $extrafields=new ExtraFields($this->db); | ||
| Line 76: | Line 75: | ||
$this->array_options['options_'.$key]=$label; | $this->array_options['options_'.$key]=$label; | ||
} | } | ||
</source> | |||
==After Update method of this object class :== | |||
<source lang="php"> | |||
// Actions on extra fields (by external module or standard code) | |||
// FIXME le hook fait double emploi avec le trigger !! | |||
$hookmanager->initHooks(array('thirdpartydao')); | |||
$parameters=array('socid'=>$this->id); | |||
$reshook=$hookmanager->executeHooks('insertExtraFields',$parameters,$this,$action); // Note that $action and $object may have been modified by some hooks | |||
if (empty($reshook)) | |||
{ | |||
if (empty($conf->global->MAIN_EXTRAFIELDS_DISABLED)) // For avoid conflicts if trigger used | |||
{ | |||
$result=$this->insertExtraFields(); | |||
if ($result < 0) | |||
{ | |||
$error++; | |||
} | |||
} | |||
} | |||
else if ($reshook < 0) $error++; | |||
</source> | </source> | ||