diff --git a/htdocs/adherents/admin/adherent.php b/htdocs/adherents/admin/adherent.php index add83e14922..c856b0df32f 100644 --- a/htdocs/adherents/admin/adherent.php +++ b/htdocs/adherents/admin/adherent.php @@ -1,7 +1,7 @@ * Copyright (C) 2003 Jean-Louis Bergamo - * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004-2012 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * Copyright (C) 2005-2011 Regis Houssin @@ -42,6 +42,10 @@ $type=array('yesno','texte','chaine'); $action = GETPOST("action"); +/* + * Actions + */ + // Action mise a jour ou ajout d'une constante if ($action == 'update' || $action == 'add') { @@ -198,84 +202,6 @@ print ''; print '
'; - -/* - * Mailman - */ -$var=!$var; -if ($conf->global->ADHERENT_USE_MAILMAN) -{ - $lien=img_picto($langs->trans("Active"),'tick').' '; - $lien.=''.$langs->trans("Disable").''; - // Edition des varibales globales - $constantes=array( - 'ADHERENT_MAILMAN_LISTS', - 'ADHERENT_MAILMAN_ADMINPW', - 'ADHERENT_MAILMAN_URL', - 'ADHERENT_MAILMAN_UNSUB_URL' - ); - print_fiche_titre("Mailman mailing list system",$lien,''); - - // JQuery activity - print ''; - - form_constantes($constantes); - - print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
'; - print '%LISTE%, %MAILMAN_ADMINPW%, %EMAIL%
'; - - print '
'; -} -else -{ - $lien=''.$langs->trans("Activate").''; - print_fiche_titre("Mailman mailing list system",$lien,''); - print "
\n"; -} - - -/* - * Spip - */ -$var=!$var; -if ($conf->global->ADHERENT_USE_SPIP) -{ - $lien=img_picto($langs->trans("Active"),'tick').' '; - $lien.=''.$langs->trans("Disable").''; - // Edition des varibales globales - $constantes=array( - 'ADHERENT_USE_SPIP_AUTO', - 'ADHERENT_SPIP_SERVEUR', - 'ADHERENT_SPIP_DB', - 'ADHERENT_SPIP_USER', - 'ADHERENT_SPIP_PASS' - ); - - print_fiche_titre("SPIP CMS",$lien,''); - form_constantes($constantes); - print '
'; -} -else -{ - $lien=''.$langs->trans("Activate").''; - print_fiche_titre("SPIP - CMS",$lien,''); - print "
\n"; -} - - /* * Edition info modele document */ @@ -342,140 +268,8 @@ print '
'; dol_fiche_end(); -$db->close(); llxFooter(); - -function form_constantes($tableau) -{ - global $db,$bc,$langs,$conf,$_Avery_Labels; - - $form = new Form($db); - - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print "\n"; - $var=true; - - $listofparam=array(); - foreach($tableau as $const) // Loop on each param - { - $sql = "SELECT "; - $sql.= "rowid"; - $sql.= ", ".$db->decrypt('name')." as name"; - $sql.= ", ".$db->decrypt('value')." as value"; - $sql.= ", type"; - $sql.= ", note"; - $sql.= " FROM ".MAIN_DB_PREFIX."const"; - $sql.= " WHERE ".$db->decrypt('name')." = '".$const."'"; - $sql.= " AND entity in (0, ".$conf->entity.")"; - $sql.= " ORDER BY name ASC, entity DESC"; - $result = $db->query($sql); - - dol_syslog("List params sql=".$sql); - if ($result) - { - $obj = $db->fetch_object($result); // Take first result of select - $var=!$var; - - print "\n".''; - - print ""; - - // Affiche nom constante - print '\n"; - - if ($const == 'ADHERENT_CARD_TYPE' || $const == 'ADHERENT_ETIQUETTE_TYPE') - { - print ''; - } - else - { - print ''; - } - print '"; - print "\n"; - print "\n"; - } - } - print '
'.$langs->trans("Description").''.$langs->trans("Value").'* '.$langs->trans("Action").'
'; - print ''; - print ''; - print ''; - print ''; - print ''; - - print $langs->trans("Desc".$const) != ("Desc".$const) ? $langs->trans("Desc".$const) : ($obj->note?$obj->note:$const); - - if ($const=='ADHERENT_MAILMAN_URL') - { - print '. '.$langs->trans("Example").': '.img_down().'
'; - //print 'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%MAILMAN_ADMINPW%&subscribees=%EMAIL%&send_welcome_msg_to_this_batch=1'; - print ''; - } - if ($const=='ADHERENT_MAILMAN_UNSUB_URL') - { - print '. '.$langs->trans("Example").': '.img_down().'
'; - print ''; - //print 'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members/remove?adminpw=%MAILMAN_ADMINPW%&unsubscribees=%EMAIL%'; - } - - - print "
'; - // List of possible labels (defined into $_Avery_Labels variable set into format_cards.lib.php) - require_once(DOL_DOCUMENT_ROOT.'/core/lib/format_cards.lib.php'); - $arrayoflabels=array(); - foreach(array_keys($_Avery_Labels) as $codecards) - { - $arrayoflabels[$codecards]=$_Avery_Labels[$codecards]['name']; - } - print $form->selectarray('constvalue',$arrayoflabels,($obj->value?$obj->value:'CARD'),1,0,0); - print ''; - print ''; - print ''; - //print 'aa'.$const; - if (in_array($const,array('ADHERENT_CARD_TEXT','ADHERENT_CARD_TEXT_RIGHT'))) - { - print '\n"; - print ''; - print ''; - } - else if (in_array($const,array('ADHERENT_AUTOREGISTER_MAIL','ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL'))) - { - require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"); - $doleditor=new DolEditor('constvalue'.$const,$obj->value,'',160,'dolibarr_notes','',false,false,$conf->fckeditor->enabled,5,60); - $doleditor->Create(); - - print ''; - print ''; - } - else if ($obj->type == 'yesno') - { - print $form->selectyesno('constvalue',$obj->value,1); - print ''; - print ''; - } - else - { - print ''; - print ''; - print ''; - } - print ''; - print '  '; - // print ''.img_delete().''; - print "
'; -} - +$db->close(); ?> \ No newline at end of file diff --git a/htdocs/adherents/admin/mailman.php b/htdocs/adherents/admin/mailman.php new file mode 100644 index 00000000000..81f1a2e32f9 --- /dev/null +++ b/htdocs/adherents/admin/mailman.php @@ -0,0 +1,175 @@ + + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2011 Juanjo Menent + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/adherents/admin/adherent.php + * \ingroup member + * \brief Page to setup the module Foundation + */ + +require("../../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/core/lib/mailmanspip.lib.php"); + +$langs->load("admin"); +$langs->load("members"); + +if (! $user->admin) accessforbidden(); + + +$type=array('yesno','texte','chaine'); + +$action = GETPOST("action"); + + +/* + * Actions + */ + +// Action mise a jour ou ajout d'une constante +if ($action == 'update' || $action == 'add') +{ + $constname=GETPOST("constname"); + $constvalue=GETPOST("constvalue"); + + if (($constname=='ADHERENT_CARD_TYPE' || $constname=='ADHERENT_ETIQUETTE_TYPE') && $constvalue == -1) $constvalue=''; + if ($constname=='ADHERENT_LOGIN_NOT_REQUIRED') // Invert choice + { + if ($constvalue) $constvalue=0; + else $constvalue=1; + } + + if (in_array($constname,array('ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL'))) $constvalue=$_POST["constvalue".$constname]; + $consttype=$_POST["consttype"]; + $constnote=GETPOST("constnote"); + $res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + $mesg = '
'.$langs->trans("SetupSaved").'
'; + } + else + { + $mesg = '
'.$langs->trans("Error").'
'; + } +} + +// Action activation d'un sous module du module adherent +if ($action == 'set') +{ + $result=dolibarr_set_const($db, $_GET["name"],$_GET["value"],'',0,'',$conf->entity); + if ($result < 0) + { + dol_print_error($db); + } +} + +// Action desactivation d'un sous module du module adherent +if ($action == 'unset') +{ + $result=dolibarr_del_const($db,$_GET["name"],$conf->entity); + if ($result < 0) + { + dol_print_error($db); + } +} + + + +/* + * View + */ + +$help_url=''; + +llxHeader('',$langs->trans("MailmanSpipSetup"),$help_url); + + +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans("MailmanSpipSetup"),$linkback,'setup'); + + +$head = mailmanspip_admin_prepare_head($adh); + +dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user'); + + +dol_htmloutput_mesg($mesg); + + +/* + * Mailman + */ +$var=!$var; +if ($conf->global->ADHERENT_USE_MAILMAN) +{ + $lien=img_picto($langs->trans("Active"),'tick').' '; + $lien.=''.$langs->trans("Disable").''; + // Edition des varibales globales + $constantes=array( + 'ADHERENT_MAILMAN_ADMINPW', + 'ADHERENT_MAILMAN_URL', + 'ADHERENT_MAILMAN_UNSUB_URL', + 'ADHERENT_MAILMAN_LISTS' + ); + + print_fiche_titre("Mailman mailing list system",$lien,''); + + // JQuery activity + print ''; + + form_constantes($constantes); + + print '*'.$langs->trans("FollowingConstantsWillBeSubstituted").'
'; + print '%LISTE%, %MAILMAN_ADMINPW%, %EMAIL%
'; + + print '
'; +} +else +{ + $lien=''.$langs->trans("Activate").''; + print_fiche_titre("Mailman mailing list system",$lien,''); + print "
\n"; +} + +dol_fiche_end(); + +llxFooter(); + +$db->close(); +?> \ No newline at end of file diff --git a/htdocs/adherents/admin/spip.php b/htdocs/adherents/admin/spip.php new file mode 100644 index 00000000000..6cbd8ee1344 --- /dev/null +++ b/htdocs/adherents/admin/spip.php @@ -0,0 +1,154 @@ + + * Copyright (C) 2003 Jean-Louis Bergamo + * Copyright (C) 2004-2011 Laurent Destailleur + * Copyright (C) 2004 Sebastien Di Cintio + * Copyright (C) 2004 Benoit Mortier + * Copyright (C) 2005-2011 Regis Houssin + * Copyright (C) 2011 Juanjo Menent + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \file htdocs/adherents/admin/adherent.php + * \ingroup member + * \brief Page to setup the module Foundation + */ + +require("../../main.inc.php"); +require_once(DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php"); +require_once(DOL_DOCUMENT_ROOT."/core/lib/mailmanspip.lib.php"); + +$langs->load("admin"); +$langs->load("members"); + +if (! $user->admin) accessforbidden(); + + +$type=array('yesno','texte','chaine'); + +$action = GETPOST("action"); + + +/* + * Actions + */ + +// Action mise a jour ou ajout d'une constante +if ($action == 'update' || $action == 'add') +{ + $constname=GETPOST("constname"); + $constvalue=GETPOST("constvalue"); + + if (($constname=='ADHERENT_CARD_TYPE' || $constname=='ADHERENT_ETIQUETTE_TYPE') && $constvalue == -1) $constvalue=''; + if ($constname=='ADHERENT_LOGIN_NOT_REQUIRED') // Invert choice + { + if ($constvalue) $constvalue=0; + else $constvalue=1; + } + + if (in_array($constname,array('ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL'))) $constvalue=$_POST["constvalue".$constname]; + $consttype=$_POST["consttype"]; + $constnote=GETPOST("constnote"); + $res=dolibarr_set_const($db,$constname,$constvalue,$type[$consttype],0,$constnote,$conf->entity); + + if (! $res > 0) $error++; + + if (! $error) + { + $mesg = '
'.$langs->trans("SetupSaved").'
'; + } + else + { + $mesg = '
'.$langs->trans("Error").'
'; + } +} + +// Action activation d'un sous module du module adherent +if ($action == 'set') +{ + $result=dolibarr_set_const($db, $_GET["name"],$_GET["value"],'',0,'',$conf->entity); + if ($result < 0) + { + dol_print_error($db); + } +} + +// Action desactivation d'un sous module du module adherent +if ($action == 'unset') +{ + $result=dolibarr_del_const($db,$_GET["name"],$conf->entity); + if ($result < 0) + { + dol_print_error($db); + } +} + + + +/* + * View + */ + +$help_url=''; + +llxHeader('',$langs->trans("MailmanSpipSetup"),$help_url); + + +$linkback=''.$langs->trans("BackToModuleList").''; +print_fiche_titre($langs->trans("MailmanSpipSetup"),$linkback,'setup'); + + +$head = mailmanspip_admin_prepare_head($adh); + +dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user'); + + +dol_htmloutput_mesg($mesg); + +/* + * Spip + */ +$var=!$var; +if ($conf->global->ADHERENT_USE_SPIP) +{ + $lien=img_picto($langs->trans("Active"),'tick').' '; + $lien.=''.$langs->trans("Disable").''; + // Edition des varibales globales + $constantes=array( + 'ADHERENT_SPIP_SERVEUR', + 'ADHERENT_SPIP_DB', + 'ADHERENT_SPIP_USER', + 'ADHERENT_SPIP_PASS' + ); + + print_fiche_titre("SPIP CMS",$lien,''); + form_constantes($constantes); + print '
'; +} +else +{ + $lien=''.$langs->trans("Activate").''; + print_fiche_titre("SPIP - CMS",$lien,''); + print "
\n"; +} + + +dol_fiche_end(); + +llxFooter(); + +$db->close(); +?> \ No newline at end of file diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 98f5a0072ae..3e3c075a5e4 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -1348,7 +1348,7 @@ class Adherent extends CommonObject } // spip - if ($conf->global->ADHERENT_USE_SPIP && $conf->global->ADHERENT_USE_SPIP_AUTO) + if ($conf->global->ADHERENT_USE_SPIP && $conf->mailmanspip->enabled) { $result=$this->add_to_spip(); if ($result < 0) @@ -1389,7 +1389,7 @@ class Adherent extends CommonObject } } - if ($conf->global->ADHERENT_USE_SPIP && $conf->global->ADHERENT_USE_SPIP_AUTO) + if ($conf->global->ADHERENT_USE_SPIP && $conf->mailmanspip->enabled) { $result=$this->del_to_spip(); if ($result < 0) diff --git a/htdocs/core/lib/admin.lib.php b/htdocs/core/lib/admin.lib.php index c735baee1de..5b129935061 100644 --- a/htdocs/core/lib/admin.lib.php +++ b/htdocs/core/lib/admin.lib.php @@ -981,4 +981,142 @@ function complete_dictionnary_with_modules(&$taborder,&$tabname,&$tablib,&$tabsq return 1; } + +/** + * Show array with constants to edit + * + * @param array $tableau Array of constants + * @return void + */ +function form_constantes($tableau) +{ + global $db,$bc,$langs,$conf,$_Avery_Labels; + + $form = new Form($db); + + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + $var=true; + + $listofparam=array(); + foreach($tableau as $const) // Loop on each param + { + $sql = "SELECT "; + $sql.= "rowid"; + $sql.= ", ".$db->decrypt('name')." as name"; + $sql.= ", ".$db->decrypt('value')." as value"; + $sql.= ", type"; + $sql.= ", note"; + $sql.= " FROM ".MAIN_DB_PREFIX."const"; + $sql.= " WHERE ".$db->decrypt('name')." = '".$const."'"; + $sql.= " AND entity in (0, ".$conf->entity.")"; + $sql.= " ORDER BY name ASC, entity DESC"; + $result = $db->query($sql); + + dol_syslog("List params sql=".$sql); + if ($result) + { + $obj = $db->fetch_object($result); // Take first result of select + $var=!$var; + + print "\n".''; + + print ""; + + // Affiche nom constante + print '\n"; + + if ($const == 'ADHERENT_CARD_TYPE' || $const == 'ADHERENT_ETIQUETTE_TYPE') + { + print ''; + } + else + { + print ''; + } + print '"; + print "\n"; + print "\n"; + } + } + print '
'.$langs->trans("Description").''.$langs->trans("Value").'* '.$langs->trans("Action").'
'; + print ''; + print ''; + print ''; + print ''; + print ''; + + print $langs->trans("Desc".$const) != ("Desc".$const) ? $langs->trans("Desc".$const) : ($obj->note?$obj->note:$const); + + if ($const=='ADHERENT_MAILMAN_URL') + { + print '. '.$langs->trans("Example").': '.img_down().'
'; + //print 'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%MAILMAN_ADMINPW%&subscribees=%EMAIL%&send_welcome_msg_to_this_batch=1'; + print ''; + } + if ($const=='ADHERENT_MAILMAN_UNSUB_URL') + { + print '. '.$langs->trans("Example").': '.img_down().'
'; + print ''; + //print 'http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members/remove?adminpw=%MAILMAN_ADMINPW%&unsubscribees=%EMAIL%'; + } + + + print "
'; + // List of possible labels (defined into $_Avery_Labels variable set into format_cards.lib.php) + require_once(DOL_DOCUMENT_ROOT.'/core/lib/format_cards.lib.php'); + $arrayoflabels=array(); + foreach(array_keys($_Avery_Labels) as $codecards) + { + $arrayoflabels[$codecards]=$_Avery_Labels[$codecards]['name']; + } + print $form->selectarray('constvalue',$arrayoflabels,($obj->value?$obj->value:'CARD'),1,0,0); + print ''; + print ''; + print ''; + //print 'aa'.$const; + if (in_array($const,array('ADHERENT_CARD_TEXT','ADHERENT_CARD_TEXT_RIGHT'))) + { + print '\n"; + print ''; + print ''; + } + else if (in_array($const,array('ADHERENT_AUTOREGISTER_MAIL','ADHERENT_MAIL_VALID','ADHERENT_MAIL_COTIS','ADHERENT_MAIL_RESIL'))) + { + require_once(DOL_DOCUMENT_ROOT."/core/class/doleditor.class.php"); + $doleditor=new DolEditor('constvalue'.$const,$obj->value,'',160,'dolibarr_notes','',false,false,$conf->fckeditor->enabled,5,60); + $doleditor->Create(); + + print ''; + print ''; + } + else if ($obj->type == 'yesno') + { + print $form->selectyesno('constvalue',$obj->value,1); + print ''; + print ''; + } + else + { + print ''; + print ''; + print ''; + } + print ''; + print '  '; + // print ''.img_delete().''; + print "
'; +} + ?> \ No newline at end of file diff --git a/htdocs/core/lib/mailmanspip.lib.php b/htdocs/core/lib/mailmanspip.lib.php new file mode 100644 index 00000000000..748fa005a06 --- /dev/null +++ b/htdocs/core/lib/mailmanspip.lib.php @@ -0,0 +1,50 @@ + + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + * or see http://www.gnu.org/ + */ + +/** + * \file htdocs/core/lib/member.lib.php + * \brief Ensemble de fonctions de base pour les adherents + */ + +/** + * Return array head with list of tabs to view object informations + * + * @param Object $object Member + * @return array head + */ +function mailmanspip_admin_prepare_head($object) +{ + global $langs, $conf, $user; + + $h = 0; + $head = array(); + + $head[$h][0] = DOL_URL_ROOT.'/adherents/admin/mailman.php'; + $head[$h][1] = $langs->trans("Mailman"); + $head[$h][2] = 'mailman'; + $h++; + + $head[$h][0] = DOL_URL_ROOT.'/adherents/admin/spip.php'; + $head[$h][1] = $langs->trans("Spip"); + $head[$h][2] = 'spip'; + $h++; + + return $head; +} + +?> \ No newline at end of file diff --git a/htdocs/core/lib/member.lib.php b/htdocs/core/lib/member.lib.php index a0f3cab5789..a278417689d 100644 --- a/htdocs/core/lib/member.lib.php +++ b/htdocs/core/lib/member.lib.php @@ -24,8 +24,8 @@ /** * Return array head with list of tabs to view object informations * - * @param object Member - * @return array head + * @param Object $object Member + * @return array head */ function member_prepare_head($object) { @@ -93,8 +93,9 @@ function member_prepare_head($object) /** * Return array head with list of tabs to view object informations - * @param object Member - * @return array head + * + * @param Object $object Member + * @return array head */ function member_admin_prepare_head($object) { diff --git a/htdocs/core/modules/modAdherent.class.php b/htdocs/core/modules/modAdherent.class.php index 99881fe4d0e..1d847f9cab9 100644 --- a/htdocs/core/modules/modAdherent.class.php +++ b/htdocs/core/modules/modAdherent.class.php @@ -65,7 +65,7 @@ class modAdherent extends DolibarrModules // Dependances //------------ $this->depends = array(); - $this->requiredby = array(); + $this->requiredby = array('modMailmanSpip'); $this->langfiles = array("members","companies"); // Constantes @@ -79,7 +79,6 @@ class modAdherent extends DolibarrModules $this->const[10] = array("ADHERENT_MAILMAN_UNSUB_URL","chaine","http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%MAILMAN_ADMINPW%&user=%EMAIL%","Url de désinscription aux listes mailman"); $this->const[11] = array("ADHERENT_MAILMAN_URL","chaine","http://lists.domain.com/cgi-bin/mailman/admin/%LISTE%/members?adminpw=%MAILMAN_ADMINPW%&send_welcome_msg_to_this_batch=1&subscribees=%EMAIL%","Url pour les inscriptions mailman"); $this->const[12] = array("ADHERENT_MAILMAN_LISTS","chaine","","Mailing-list to subscribe new members to"); - $this->const[16] = array("ADHERENT_USE_SPIP_AUTO","yesno","","Utilisation de SPIP automatiquement"); $this->const[17] = array("ADHERENT_SPIP_USER","chaine","","Utilisateur de connexion à la base spip"); $this->const[18] = array("ADHERENT_SPIP_PASS","chaine","","Mot de passe de connexion à la base spip"); $this->const[19] = array("ADHERENT_SPIP_SERVEUR","chaine","","serveur spip"); diff --git a/htdocs/core/modules/modMailmanSpip.class.php b/htdocs/core/modules/modMailmanSpip.class.php new file mode 100644 index 00000000000..651d8e6116d --- /dev/null +++ b/htdocs/core/modules/modMailmanSpip.class.php @@ -0,0 +1,110 @@ + + * Copyright (C) 2005-2012 Laurent Destailleur + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +/** + * \defgroup clicktodial Module clicktodial + * \brief Module pour gerer l'appel automatique + * \file htdocs/core/modules/modClickToDial.class.php + * \ingroup clicktodial + * \brief Fichier de description et activation du module de click to Dial + */ + +include_once(DOL_DOCUMENT_ROOT ."/core/modules/DolibarrModules.class.php"); + + +/** + * \class modMailmanSpip + * \brief Classe de description et activation du module de Click to Dial + */ + +class modMailmanSpip extends DolibarrModules +{ + + /** + * Constructor. Define names, constants, directories, boxes, permissions + * + * @param DoliDB $db Database handler + */ + function modMailmanSpip($db) + { + $this->db = $db; + $this->numero = 105; + + $this->family = "technic"; + // Module label (no space allowed), used if translation string 'ModuleXXXName' not found (where XXX is value of numeric property 'numero' of module) + $this->name = preg_replace('/^mod/i','',get_class($this)); + $this->description = "Mailman or Spip interface for member module"; + + $this->version = 'dolibarr'; // 'development' or 'experimental' or 'dolibarr' or version + + $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); + $this->special = 1; + $this->picto='technic'; + + // Data directories to create when module is enabled + $this->dirs = array(); + + // Dependencies + $this->depends = array('modAdherent'); + $this->requiredby = array(); + + // Config pages + $this->config_page_url = array('mailman.php@adherents'); + + // Constants + $this->const = array(); + + // Boxes + $this->boxes = array(); + + // Permissions + $this->rights = array(); + $this->rights_class = 'clicktodial'; + } + + /** + * Function called when module is enabled. + * The init function add constants, boxes, permissions and menus (defined in constructor) into Dolibarr database. + * It also creates data directories + * + * @param string $options Options when enabling module ('', 'noboxes') + * @return int 1 if OK, 0 if KO + */ + function init($options='') + { + global $conf; + + $sql = array(); + + return $this->_init($sql,$options); + } + + /** + * \brief Function called when module is disabled. + * Remove from database constants, boxes and permissions from Dolibarr database. + * Data directories are not deleted. + * \return int 1 if OK, 0 if KO + */ + function remove() + { + $sql = array(); + + return $this->_remove($sql); + } +} +?> diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index c1cb76b6c80..c19cfbb7712 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -1273,6 +1273,8 @@ BankOrderGlobal=General BankOrderGlobalDesc=General display order BankOrderES=Spanish BankOrderESDesc=Spanish display order +##### MailmanSpip ##### +MailmanSpipSetup=Mailman and Spip module Setup ##### Multicompany ##### MultiCompanySetup=Multi-company module setup ##### Suppliers ##### diff --git a/htdocs/langs/fr_FR/admin.lang b/htdocs/langs/fr_FR/admin.lang index 9ddbd77535b..1cb634c03e4 100644 --- a/htdocs/langs/fr_FR/admin.lang +++ b/htdocs/langs/fr_FR/admin.lang @@ -1281,6 +1281,8 @@ BankOrderGlobal=Général BankOrderGlobalDesc=Ordre d'affichage général BankOrderES=Espagnol BankOrderESDesc=Ordre d'affichage Espagnol +##### MailmanSpip ##### +MailmanSpipSetup=Configuration du module Mailman et Spip ##### Multicompany ##### MultiCompanySetup=Configuration du module Multi-société ##### Suppliers #####