Skip to content

Commit

Permalink
Merge pull request #12420 from fappels/debug_11
Browse files Browse the repository at this point in the history
Cleanup interface_90_modSociete_ContactRoles
  • Loading branch information
eldy committed Nov 13, 2019
2 parents ede05e0 + 9efcdc7 commit 78b6246
Showing 1 changed file with 4 additions and 5 deletions.
Expand Up @@ -21,9 +21,9 @@
*/

/**
* \file htdocs/core/triggers/interface_50_modAgenda_ActionsAuto.class.php
* \file htdocs/core/triggers/interface_90_modSociete_ContactRoles.class.php
* \ingroup agenda
* \brief Trigger file for agenda module
* \brief Trigger file for company - contactroles
*/

require_once DOL_DOCUMENT_ROOT.'/core/triggers/dolibarrtriggers.class.php';
Expand All @@ -35,7 +35,7 @@
class InterfaceContactRoles extends DolibarrTriggers
{
public $family = 'agenda';
public $description = "Triggers of this module add actions in agenda according to setup made in agenda setup.";
public $description = "Triggers of this module auto link contact to company.";

/**
* Version of the trigger
Expand Down Expand Up @@ -73,7 +73,6 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf
$socid=(property_exists($object, 'socid')?$object->socid:$object->fk_soc);

if (! empty($socid) && $socid > 0) {
global $db, $langs;
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
$contactdefault = new Contact($this->db);
$contactdefault->socid=$socid;
Expand All @@ -83,7 +82,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf
if ($object->id > 0)
{
$class = get_class($object);
$cloneFrom = new $class($db);
$cloneFrom = new $class($this->db);
$r = $cloneFrom->fetch($object->id);

if (!empty($cloneFrom->id)) $TContactAlreadyLinked = array_merge($cloneFrom->liste_contact(-1, 'external'), $cloneFrom->liste_contact(-1, 'internal'));
Expand Down

0 comments on commit 78b6246

Please sign in to comment.