30 require
'../main.inc.php';
31 require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
32 require_once DOL_DOCUMENT_ROOT.
'/core/lib/mailmanspip.lib.php';
33 require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
36 $langs->loadLangs(array(
"admin",
"members",
"mailmanspip"));
41 $type = array(
'yesno',
'texte',
'chaine');
43 $action =
GETPOST(
'action',
'aZ09');
44 $testsubscribeemail =
GETPOST(
"testsubscribeemail");
45 $testunsubscribeemail =
GETPOST(
"testunsubscribeemail");
52 if ($action ==
'update' || $action ==
'add')
54 foreach ($_POST[
'constname'] as $key => $val)
56 $constname = $_POST[
"constname"][$key];
57 $constvalue = $_POST[
"constvalue"][$key];
58 $consttype = $_POST[
"consttype"][$key];
59 $constnote = $_POST[
"constnote"][$key];
60 $res =
dolibarr_set_const($db, $constname, $constvalue, $type[$consttype], 0, $constnote, $conf->entity);
62 if (!($res > 0)) $error++;
76 $result =
dolibarr_set_const($db, $_GET[
"name"], $_GET[
"value"],
'', 0,
'', $conf->entity);
84 if ($action ==
'unset')
93 if (($action ==
'testsubscribe' || $action ==
'testunsubscribe') && !empty($conf->global->ADHERENT_USE_MAILMAN))
95 $email =
GETPOST($action.
'email');
98 $langs->load(
"errors");
101 include_once DOL_DOCUMENT_ROOT.
'/mailmanspip/class/mailmanspip.class.php';
104 $object =
new stdClass();
105 $object->email = $email;
106 $object->pass = $email;
110 if ($action ==
'testsubscribe')
112 $result = $mailmanspip->add_to_mailman($object);
121 if ($action ==
'testunsubscribe')
123 $result = $mailmanspip->del_to_mailman($object);
142 llxHeader(
'', $langs->trans(
"MailmanSpipSetup"), $help_url);
145 $linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
148 $head = mailmanspip_admin_prepare_head();
150 if (!empty($conf->global->ADHERENT_USE_MAILMAN))
152 print '<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
153 print '<input type="hidden" name="token" value="'.newToken().
'">';
154 print '<input type="hidden" name="action" value="update">';
159 $link =
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=unset&token='.
newToken().
'&value=0&name=ADHERENT_USE_MAILMAN">';
161 $link .=
img_picto($langs->trans(
"Activated"),
'switch_on');
165 'ADHERENT_MAILMAN_ADMINPW',
166 'ADHERENT_MAILMAN_URL',
167 'ADHERENT_MAILMAN_UNSUB_URL',
168 'ADHERENT_MAILMAN_LISTS'
176 print
'<script type="text/javascript">
180 jQuery(document).ready(function(){
181 jQuery("#exampleclick1").click(function(event){
182 if (i1 == 0) { jQuery("#example1").show(); i1=1; }
183 else if (i1 == 1) { jQuery("#example1").hide(); i1=0; }
185 jQuery("#exampleclick2").click(function(){
186 if (i2 == 0) { jQuery("#example2").show(); i2=1; }
187 else if (i2 == 1) { jQuery("#example2").hide(); i2=0; }
189 jQuery("#exampleclick3").click(function(){
190 if (i3 == 0) { jQuery("#example3").show(); i3=1; }
191 else if (i3 == 1) { jQuery("#example3").hide(); i3=0; }
198 print
'*'.$langs->trans(
"FollowingConstantsWillBeSubstituted").
'<br>';
199 print
'%LISTE%, %MAILMAN_ADMINPW%, %EMAIL% <br>';
203 print
'<div class="center"><input type="submit" class="button" value="'.$langs->trans(
"Update").
'" name="update"></div>';
209 $link =
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=set&token='.
newToken().
'&value=1&name=ADHERENT_USE_MAILMAN">';
211 $link .=
img_picto($langs->trans(
"Disabled"),
'switch_off');
219 if (!empty($conf->global->ADHERENT_USE_MAILMAN))
221 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'">';
222 print
'<input type="hidden" name="token" value="'.newToken().
'">';
223 print
'<input type="hidden" name="action" value="testsubscribe">';
225 print $langs->trans(
"TestSubscribe").
'<br>';
226 print $langs->trans(
"EMail").
' <input type="email" class="flat" name="testsubscribeemail" value="'.
GETPOST(
'testsubscribeemail').
'"> <input class="button" type="submit" value="'.$langs->trans(
"Test").
'"><br>';
230 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'">';
231 print
'<input type="hidden" name="token" value="'.newToken().
'">';
232 print
'<input type="hidden" name="action" value="testunsubscribe">';
234 print $langs->trans(
"TestUnSubscribe").
'<br>';
235 print $langs->trans(
"EMail").
' <input type="email" class="flat" name="testunsubscribeemail" value="'.
GETPOST(
'testunsubscribeemail').
'"> <input class="button" type="submit" value="'.$langs->trans(
"Test").
'"><br>';
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dolibarr_set_const($db, $name, $value, $type= 'chaine', $visible=0, $note= '', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
dolibarr_del_const($db, $name, $entity=1)
Effacement d'une constante dans la base de donnees.
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
form_constantes($tableau, $strictw3c=0, $helptext= '')
Show array with constants to edit.
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Class to manage mailman and spip.
isValidEmail($address, $acceptsupervisorkey=0)
Return true if email syntax is ok.