Skip to content

Commit

Permalink
Comment
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Aug 24, 2013
1 parent 8c90ad8 commit 70f7321
Showing 1 changed file with 9 additions and 8 deletions.
Expand Up @@ -141,7 +141,7 @@ function run_trigger($action,$object,$user,$langs,$conf)
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);

// We add subscription if new email or new type (new type may means more mailing-list to subscribe)
// We add subscription if we change category (new category may means more mailing-list to subscribe)
if ($object->linkto->add_to_abo() < 0)
{
$this->error=$object->linkto->error;
Expand All @@ -152,13 +152,14 @@ function run_trigger($action,$object,$user,$langs,$conf)
{
$return=1;
}

return $return;
}
elseif ($action == 'CATEGORY_UNLINK')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);


// We remove subscription if we change category (lessw category may means less mailing-list to subscribe)
if ($object->unlinkoff->del_to_abo() < 0)
{
$this->error=$object->unlinkoff->error;
Expand All @@ -169,18 +170,18 @@ function run_trigger($action,$object,$user,$langs,$conf)
{
$return=1;
}

return $return;
}

// Members
elseif ($action == 'MEMBER_VALIDATE' || $action == 'MEMBER_MODIFY')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);

$return=0;
// Add user into some linked tools (mailman, spip, etc...)
if (($object->oldcopy->email != $object->email) || ($object->oldcopy->typeid != $object->typeid)) // TODO Do del/add also if type change
if (($object->oldcopy->email != $object->email) || ($object->oldcopy->typeid != $object->typeid)) // TODO Do del/add also if type change
{
if ($object->oldcopy->email != $object->email) // If email has changed we delete mailman subscription for old email
{
Expand All @@ -207,7 +208,7 @@ function run_trigger($action,$object,$user,$langs,$conf)
$return=1;
}
}

return $return;
}
elseif ($action == 'MEMBER_NEW_PASSWORD')
Expand All @@ -217,7 +218,7 @@ function run_trigger($action,$object,$user,$langs,$conf)
elseif ($action == 'MEMBER_RESILIATE' || $action == 'MEMBER_DELETE')
{
dol_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);

$return=0;
// Remove from external tools (mailman, spip, etc...)
if ($object->del_to_abo() < 0)
Expand Down

0 comments on commit 70f7321

Please sign in to comment.