64 if (empty($conf->mailmanspip) || empty($conf->mailmanspip->enabled)) {
68 require_once DOL_DOCUMENT_ROOT.
"/mailmanspip/class/mailmanspip.class.php";
69 require_once DOL_DOCUMENT_ROOT.
"/user/class/usergroup.class.php";
71 if ($action ==
'CATEGORY_LINK') {
72 dol_syslog(
"Trigger '".$this->
name.
"' for action '$action' launched by ".__FILE__.
". id=".$object->id);
75 if (is_object($object->context[
'linkto']) && method_exists($object->context[
'linkto'],
'add_to_abo') && $object->context[
'linkto']->add_to_abo() < 0) {
76 $this->error = $object->context[
'linkto']->error;
77 $this->errors = $object->context[
'linkto']->errors;
84 } elseif ($action ==
'CATEGORY_UNLINK') {
85 dol_syslog(
"Trigger '".$this->
name.
"' for action '$action' launched by ".__FILE__.
". id=".$object->id);
88 if (is_object($object->context[
'unlinkoff']) && method_exists($object->context[
'unlinkoff'],
'del_to_abo') && $object->context[
'unlinkoff']->del_to_abo() < 0) {
89 $this->error = $object->context[
'unlinkoff']->error;
90 $this->errors = $object->context[
'unlinkoff']->errors;
97 } elseif ($action ==
'MEMBER_VALIDATE') {
99 dol_syslog(
"Trigger '".$this->
name.
"' for action '$action' launched by ".__FILE__.
". id=".$object->id);
102 if ($object->add_to_abo() < 0) {
103 $this->errors = $object->errors;
104 if (!empty($object->error)) {
105 $this->errors[] = $object->error;
113 } elseif ($action ==
'MEMBER_MODIFY') {
114 dol_syslog(
"Trigger '".$this->
name.
"' for action '$action' launched by ".__FILE__.
". id=".$object->id);
118 if (($object->oldcopy->email != $object->email) || ($object->oldcopy->typeid != $object->typeid)) {
119 if (is_object($object->oldcopy) && (($object->oldcopy->email != $object->email) || ($object->oldcopy->typeid != $object->typeid))) {
121 $tmpmember =
new Adherent($this->db);
122 $tmpmember->fetch($object->oldcopy->id);
123 if ($tmpmember->del_to_abo() < 0) {
124 $this->errors = $tmpmember->errors;
125 if (!empty($tmpmember->error)) {
126 $this->errors[] = $tmpmember->error;
134 if ($object->add_to_abo() < 0) {
135 $this->errors = $object->errors;
136 if (!empty($object->error)) {
137 $this->errors[] = $object->error;
146 } elseif ($action ==
'MEMBER_RESILIATE' || $action ==
'MEMBER_DELETE') {
147 dol_syslog(
"Trigger '".$this->
name.
"' for action '$action' launched by ".__FILE__.
". id=".$object->id);
151 if ($object->del_to_abo() < 0) {
152 $this->errors = $object->errors;
153 if (!empty($object->error)) {
154 $this->errors[] = $object->error;