32require
'../main.inc.php';
33require_once DOL_DOCUMENT_ROOT.
'/core/lib/admin.lib.php';
34require_once DOL_DOCUMENT_ROOT.
'/core/lib/mailmanspip.lib.php';
35require_once DOL_DOCUMENT_ROOT.
'/categories/class/categorie.class.php';
38$langs->loadLangs(array(
"admin",
"members",
"mailmanspip"));
46$action =
GETPOST(
'action',
'aZ09');
47$testsubscribeemail =
GETPOST(
"testsubscribeemail");
48$testunsubscribeemail =
GETPOST(
"testunsubscribeemail");
58if ($action ==
'update' || $action ==
'add') {
59 $tmparray =
GETPOST(
'constname',
'array');
60 $tmpvalue =
GETPOST(
'constvalue',
'array');
61 $tmpnote =
GETPOST(
'constnote',
'array');
62 if (is_array($tmparray)) {
63 foreach ($tmparray as $key => $val) {
64 $constname = $tmparray[$key];
65 $constvalue = $tmpvalue[$key];
66 $constnote = $tmpnote[$key];
67 $res =
dolibarr_set_const($db, $constname, $constvalue,
'chaine', 0, $constnote, $conf->entity);
83if ($action ==
'set') {
91if ($action ==
'unset') {
98if (($action ==
'testsubscribe' || $action ==
'testunsubscribe') &&
getDolGlobalString(
'ADHERENT_USE_MAILMAN')) {
99 $email =
GETPOST($action.
'email');
101 $langs->load(
"errors");
104 include_once DOL_DOCUMENT_ROOT.
'/mailmanspip/class/mailmanspip.class.php';
113 if ($action ==
'testsubscribe') {
114 $result = $mailmanspip->add_to_mailman(
$object);
122 if ($action ==
'testunsubscribe') {
123 $result = $mailmanspip->del_to_mailman(
$object);
141llxHeader(
'', $langs->trans(
"MailmanSpipSetup"), $help_url,
'', 0, 0,
'',
'',
'',
'mod-admin page-mailman');
144$linkback =
'<a href="'.DOL_URL_ROOT.
'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToModuleList").
'</a>';
145print
load_fiche_titre($langs->trans(
"MailmanSpipSetup"), $linkback,
'title_setup');
147$head = mailmanspip_admin_prepare_head();
150 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">';
151 print
'<input type="hidden" name="token" value="'.newToken().
'">';
152 print
'<input type="hidden" name="action" value="update">';
157 $link =
'<a class="reposition" href="'.$_SERVER[
"PHP_SELF"].
'?action=unset&token='.
newToken().
'&value=0&name=ADHERENT_USE_MAILMAN">';
159 $link .=
img_picto($langs->trans(
"Activated"),
'switch_on');
163 'ADHERENT_MAILMAN_ADMIN_PASSWORD',
164 'ADHERENT_MAILMAN_URL',
165 'ADHERENT_MAILMAN_UNSUB_URL',
166 'ADHERENT_MAILMAN_LISTS'
174 print
'<script type="text/javascript">
178 jQuery(document).ready(function(){
179 jQuery("#exampleclick1").click(function(event){
180 if (i1 == 0) { jQuery("#example1").show(); i1=1; }
181 else if (i1 == 1) { jQuery("#example1").hide(); i1=0; }
183 jQuery("#exampleclick2").click(function(){
184 if (i2 == 0) { jQuery("#example2").show(); i2=1; }
185 else if (i2 == 1) { jQuery("#example2").hide(); i2=0; }
187 jQuery("#exampleclick3").click(function(){
188 if (i3 == 0) { jQuery("#example3").show(); i3=1; }
189 else if (i3 == 1) { jQuery("#example3").hide(); i3=0; }
196 print
'*'.$langs->trans(
"FollowingConstantsWillBeSubstituted").
'<br>';
197 print
'%LISTE%, %MAILMAN_ADMINPW%, %EMAIL% <br>';
201 print
'<div class="center"><input type="submit" class="button" value="'.$langs->trans(
"Update").
'" name="update"></div>';
207 $link =
'<a href="'.$_SERVER[
"PHP_SELF"].
'?action=set&token='.
newToken().
'&value=1&name=ADHERENT_USE_MAILMAN">';
209 $link .=
img_picto($langs->trans(
"Disabled"),
'switch_off');
218 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'">';
219 print
'<input type="hidden" name="token" value="'.newToken().
'">';
220 print
'<input type="hidden" name="action" value="testsubscribe">';
222 print $langs->trans(
"TestSubscribe").
'<br>';
223 print $langs->trans(
"EMail").
' <input type="email" class="flat" name="testsubscribeemail" value="'.
GETPOST(
'testsubscribeemail').
'"> <input type="submit" class="button" value="'.$langs->trans(
"Test").
'"><br>';
227 print
'<form action="'.$_SERVER[
"PHP_SELF"].
'">';
228 print
'<input type="hidden" name="token" value="'.newToken().
'">';
229 print
'<input type="hidden" name="action" value="testunsubscribe">';
231 print $langs->trans(
"TestUnSubscribe").
'<br>';
232 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($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
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.
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 a 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.