31require
'../main.inc.php';
32require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/mailmanspip.lib.php';
34require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
37$langs->loadLangs(array(
"admin",
"members",
"mailmanspip"));
44$type = array(
'yesno',
'texte',
'chaine');
46$action =
GETPOST(
'action',
'aZ09');
47$testsubscribeemail =
GETPOST(
"testsubscribeemail");
48$testunsubscribeemail =
GETPOST(
"testunsubscribeemail");
58if ($action ==
'update' || $action ==
'add') {
59 $tmparray =
GETPOST(
'constname',
'array');
60 if (is_array($tmparray)) {
61 foreach ($tmparray as $key => $val) {
62 $constname = $tmparray[$key];
63 $constvalue = $tmparray[$key];
64 $consttype = $tmparray[$key];
65 $constnote = $tmparray[$key];
66 $res =
dolibarr_set_const($db, $constname, $constvalue, $type[$consttype], 0, $constnote, $conf->entity);
82if ($action ==
'set') {
90if ($action ==
'unset') {
97if (($action ==
'testsubscribe' || $action ==
'testunsubscribe') &&
getDolGlobalString(
'ADHERENT_USE_MAILMAN')) {
98 $email =
GETPOST($action.
'email');
100 $langs->load(
"errors");
103 include_once DOL_DOCUMENT_ROOT.
'/mailmanspip/class/mailmanspip.class.php';
112 if ($action ==
'testsubscribe') {
113 $result = $mailmanspip->add_to_mailman(
$object);
121 if ($action ==
'testunsubscribe') {
122 $result = $mailmanspip->del_to_mailman(
$object);
140llxHeader(
'', $langs->trans(
"MailmanSpipSetup"), $help_url,
'', 0, 0,
'',
'',
'',
'mod-admin page-mailman');
143$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
144print
load_fiche_titre($langs->trans(
"MailmanSpipSetup"), $linkback,
'title_setup');
146$head = mailmanspip_admin_prepare_head();
149 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
150 print
'<input type="hidden" name="token" value="'.newToken().
'">';
151 print
'<input type="hidden" name="action" value="update">';
156 $link =
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=unset&token='.
newToken().
'&value=0&name=ADHERENT_USE_MAILMAN">';
158 $link .=
img_picto($langs->trans(
"Activated"),
'switch_on');
162 'ADHERENT_MAILMAN_ADMIN_PASSWORD',
163 'ADHERENT_MAILMAN_URL',
164 'ADHERENT_MAILMAN_UNSUB_URL',
165 'ADHERENT_MAILMAN_LISTS'
173 print
'<script type="text/javascript">
177 jQuery(document).ready(function(){
178 jQuery("#exampleclick1").click(function(event){
179 if (i1 == 0) { jQuery("#example1").show(); i1=1; }
180 else if (i1 == 1) { jQuery("#example1").hide(); i1=0; }
182 jQuery("#exampleclick2").click(function(){
183 if (i2 == 0) { jQuery("#example2").show(); i2=1; }
184 else if (i2 == 1) { jQuery("#example2").hide(); i2=0; }
186 jQuery("#exampleclick3").click(function(){
187 if (i3 == 0) { jQuery("#example3").show(); i3=1; }
188 else if (i3 == 1) { jQuery("#example3").hide(); i3=0; }
195 print
'*'.$langs->trans(
"FollowingConstantsWillBeSubstituted").
'<br>';
196 print
'%LISTE%, %MAILMAN_ADMINPW%, %EMAIL% <br>';
200 print
'<div class="center"><input type="submit" class="button" value="'.$langs->trans(
"Update").
'" name="update"></div>';
206 $link =
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=set&token='.
newToken().
'&value=1&name=ADHERENT_USE_MAILMAN">';
208 $link .=
img_picto($langs->trans(
"Disabled"),
'switch_off');
217 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'">';
218 print
'<input type="hidden" name="token" value="'.newToken().
'">';
219 print
'<input type="hidden" name="action" value="testsubscribe">';
221 print $langs->trans(
"TestSubscribe").
'<br>';
222 print $langs->trans(
"EMail").
' <input type="email" class="flat" name="testsubscribeemail" value="'.
GETPOST(
'testsubscribeemail').
'"> <input type="submit" class="button" value="'.$langs->trans(
"Test").
'"><br>';
226 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'">';
227 print
'<input type="hidden" name="token" value="'.newToken().
'">';
228 print
'<input type="hidden" name="action" value="testunsubscribe">';
230 print $langs->trans(
"TestUnSubscribe").
'<br>';
231 print $langs->trans(
"EMail").
' <input type="email" class="flat" name="testunsubscribeemail" value="'.
GETPOST(
'testunsubscribeemail').
'"> <input type="submit" class="button" value="'.$langs->trans(
"Test").
'"><br>';
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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).
form_constantes($tableau, $strictw3c=2, $helptext='', $text='Value')
Show array with constants to edit.
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage mailman and spip.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0)
Show tabs of a record.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
isValidEmail($address, $acceptsupervisorkey=0, $acceptuserkey=0)
Return true if email syntax is ok.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.