Beispiel #1
0
        if (!empty($backtopage) && !$error) {
            header("Location: " . $backtopage);
            exit;
        }
    }
    // SPIP Management
    if ($user->rights->adherent->supprimer && $action == 'confirm_del_spip' && $confirm == 'yes') {
        if (!count($object->errors)) {
            if (!$mailmanspip->del_to_spip($object)) {
                setEventMessages($langs->trans('DeleteIntoSpipError') . ': ' . $mailmanspip->error, null, 'errors');
            }
        }
    }
    if ($user->rights->adherent->creer && $action == 'confirm_add_spip' && $confirm == 'yes') {
        if (!count($object->errors)) {
            if (!$mailmanspip->add_to_spip($object)) {
                setEventMessages($langs->trans('AddIntoSpipError') . ': ' . $mailmanspip->error, null, 'errors');
            }
        }
    }
}
/*
 * View
 */
$form = new Form($db);
$formcompany = new FormCompany($db);
$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros';
llxHeader('', $langs->trans("Member"), $help_url);
$countrynotdefined = $langs->trans("ErrorSetACountryFirst") . ' (' . $langs->trans("SeeAbove") . ')';
if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
    // -----------------------------------------
 /**
  *  Function to add member into external tools mailing-list, spip, etc.
  *
  *  @return		int		<0 if KO, >0 if OK
  */
 function add_to_abo()
 {
     global $conf, $langs;
     include_once DOL_DOCUMENT_ROOT . '/mailmanspip/class/mailmanspip.class.php';
     $mailmanspip = new MailmanSpip($this->db);
     $err = 0;
     // mailman
     if (!empty($conf->global->ADHERENT_USE_MAILMAN)) {
         $result = $mailmanspip->add_to_mailman($this);
         if ($result < 0) {
             if (!empty($mailmanspip->error)) {
                 $this->errors[] = $mailmanspip->error;
             }
             $err += 1;
         }
         foreach ($mailmanspip->mladded_ko as $tmplist => $tmpemail) {
             $langs->load("errors");
             $this->errors[] = $langs->trans("ErrorFailedToAddToMailmanList", $tmpemail, $tmplist);
         }
         foreach ($mailmanspip->mladded_ok as $tmplist => $tmpemail) {
             $langs->load("mailmanspip");
             $this->mesgs[] = $langs->trans("SuccessToAddToMailmanList", $tmpemail, $tmplist);
         }
     }
     // spip
     if ($conf->global->ADHERENT_USE_SPIP && !empty($conf->mailmanspip->enabled)) {
         $result = $mailmanspip->add_to_spip($this);
         if ($result < 0) {
             $this->errors[] = $mailmanspip->error;
             $err += 1;
         }
     }
     if ($err) {
         return -$err;
     } else {
         return 1;
     }
 }
Beispiel #3
0
 /**
  *  Fonction qui ajoute l'adherent au abonnements automatiques mailing-list, spip, etc.
  *  TODO Move this into member creation trigger (trigger of mailmanspip module)
  *
  *  @return		int		<0 if KO, >0 if OK
  */
 function add_to_abo()
 {
     global $conf;
     include_once DOL_DOCUMENT_ROOT . '/mailmanspip/class/mailmanspip.class.php';
     $mailmanspip = new MailmanSpip($db);
     $err = 0;
     // mailman
     if (!empty($conf->global->ADHERENT_USE_MAILMAN)) {
         $result = $mailmanspip->add_to_mailman($this);
         if ($result < 0) {
             $err += 1;
         }
     }
     // spip
     if ($conf->global->ADHERENT_USE_SPIP && $conf->mailmanspip->enabled) {
         $result = $mailmanspip->add_to_spip($this);
         if ($result < 0) {
             $err += 1;
         }
     }
     if ($err) {
         // error
         return -$err;
     } else {
         return 1;
     }
 }