62 if (empty($conf->mailmanspip) || empty($conf->mailmanspip->enabled)) {
66 require_once DOL_DOCUMENT_ROOT.
"/mailmanspip/class/mailmanspip.class.php";
67 require_once DOL_DOCUMENT_ROOT.
"/user/class/usergroup.class.php";
69 if ($action ==
'CATEGORY_LINK') {
70 dol_syslog(
"Trigger '".$this->
name.
"' for action '$action' launched by ".__FILE__.
". id=".$object->id);
73 if (is_object($object->context[
'linkto']) && method_exists($object->context[
'linkto'],
'add_to_abo') && $object->context[
'linkto']->add_to_abo() < 0) {
74 $this->error = $object->context[
'linkto']->error;
75 $this->errors = $object->context[
'linkto']->errors;
82 } elseif ($action ==
'CATEGORY_UNLINK') {
83 dol_syslog(
"Trigger '".$this->
name.
"' for action '$action' launched by ".__FILE__.
". id=".$object->id);
86 if (is_object($object->context[
'unlinkoff']) && method_exists($object->context[
'unlinkoff'],
'del_to_abo') && $object->context[
'unlinkoff']->del_to_abo() < 0) {
87 $this->error = $object->context[
'unlinkoff']->error;
88 $this->errors = $object->context[
'unlinkoff']->errors;
95 } elseif ($action ==
'MEMBER_VALIDATE') {
97 dol_syslog(
"Trigger '".$this->
name.
"' for action '$action' launched by ".__FILE__.
". id=".$object->id);
100 if ($object->add_to_abo() < 0) {
101 $this->errors = $object->errors;
102 if (!empty($object->error)) {
103 $this->errors[] = $object->error;
111 } elseif ($action ==
'MEMBER_MODIFY') {
112 dol_syslog(
"Trigger '".$this->
name.
"' for action '$action' launched by ".__FILE__.
". id=".$object->id);
116 if (($object->oldcopy->email != $object->email) || ($object->oldcopy->typeid != $object->typeid)) {
117 if (is_object($object->oldcopy) && (($object->oldcopy->email != $object->email) || ($object->oldcopy->typeid != $object->typeid))) {
118 if ($object->oldcopy->del_to_abo() < 0) {
119 $this->errors = $object->oldcopy->errors;
120 if (!empty($object->oldcopy->error)) {
121 $this->errors[] = $object->oldcopy->error;
129 if ($object->add_to_abo() < 0) {
130 $this->errors = $object->errors;
131 if (!empty($object->error)) {
132 $this->errors[] = $object->error;
141 } elseif ($action ==
'MEMBER_RESILIATE' || $action ==
'MEMBER_DELETE') {
142 dol_syslog(
"Trigger '".$this->
name.
"' for action '$action' launched by ".__FILE__.
". id=".$object->id);
146 if ($object->del_to_abo() < 0) {
147 $this->errors = $object->errors;
148 if (!empty($object->error)) {
149 $this->errors[] = $object->error;