* Copyright (C) 2003 Jean-Louis Bergamo * Copyright (C) 2004-2008 Laurent Destailleur * Copyright (C) 2004 Sebastien Di Cintio * Copyright (C) 2004 Benoit Mortier * * 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, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** \file htdocs/admin/adherent.php \ingroup adherent \brief Page d'administration/configuration du module Adherent \version $Id$ */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/admin.lib.php"); $langs->load("admin"); $langs->load("members"); if (!$user->admin) accessforbidden(); $typeconst=array('yesno','texte','chaine'); // Action mise a jour ou ajout d'une constante if ($_POST["action"] == 'update' || $_POST["action"] == 'add') { $result=dolibarr_set_const($db, $_POST["constname"],$_POST["constvalue"],$typeconst[$_POST["consttype"]],0,isset($_POST["constnote"])?$_POST["constnote"]:''); if ($result < 0) { print $db->error(); } } // Action activation d'un sous module du module adherent if ($_GET["action"] == 'set') { $result=dolibarr_set_const($db, $_GET["name"],$_GET["value"]); if ($result < 0) { print $db->error(); } } // Action desactivation d'un sous module du module adherent if ($_GET["action"] == 'unset') { $result=dolibarr_del_const($db,$_GET["name"]); if ($result < 0) { print $db->error(); } } llxHeader(); /* * Interface de configuration de certaines variables de la partie adherent */ $var=True; $linkback=''.$langs->trans("BackToModuleList").''; print_fiche_titre($langs->trans("MembersSetup"),$linkback,'setup'); print "
"; print_fiche_titre($langs->trans("MemberMainOptions")); print ''; print ''; print ''; print ''; print ''; print "\n"; $var=true; $form = new Form($db); // Mail obligatoire $var=!$var; print ''; print ''; print ''; print ''; print "\n"; print ''; // Insertion cotisations dans compte financier $var=!$var; print ''; print ''; print ''; print ''; print "'; if ($conf->banque->enabled) { print ''; } else { print ''; } print "\n"; print ''; print '
'.$langs->trans("Description").''.$langs->trans("Value").''.$langs->trans("Action").'
".$langs->trans("AdherentMailRequired").''; print $form->selectyesno('constvalue',$conf->global->ADHERENT_MAIL_REQUIRED,1); print ''; print ''; print "
".$langs->trans("AddSubscriptionIntoAccount").''; print $form->selectyesno('constvalue',$conf->global->ADHERENT_BANK_USE,1); print ''; print ''; print ''; print $langs->trans("WarningModuleNotActive",$langs->transnoentities("Module85Name")).' '.img_warning("",""); print '
'; print '
'; /* * Mailman */ if ($conf->global->MAIN_FEATURES_LEVEL >= 1) { $var=!$var; if ($conf->global->ADHERENT_USE_MAILMAN) { $lien=img_tick().' '; $lien.=''.$langs->trans("Disable").''; // Edition des varibales globales rattache au theme Mailman $constantes=array('ADHERENT_MAILMAN_LISTS', 'ADHERENT_MAILMAN_LISTS_COTISANT', 'ADHERENT_MAILMAN_ADMINPW', 'ADHERENT_MAILMAN_SERVER', 'ADHERENT_MAILMAN_UNSUB_URL', 'ADHERENT_MAILMAN_URL' ); print_fiche_titre("Mailman - Systeme de mailing listes",$lien); form_constantes($constantes); } else { $lien=''.$langs->trans("Activate").''; print_fiche_titre("Mailman - Systeme de mailing listes",$lien); } print "
\n"; } /* * Spip */ if ($conf->global->MAIN_FEATURES_LEVEL >= 1) { $var=!$var; if ($conf->global->ADHERENT_USE_SPIP) { $lien=img_tick().' '; $lien.=''.$langs->trans("Disable").''; // Edition des varibales globales rattache au theme Mailman $constantes=array('ADHERENT_USE_SPIP_AUTO', 'ADHERENT_SPIP_SERVEUR', 'ADHERENT_SPIP_DB', 'ADHERENT_SPIP_USER', 'ADHERENT_SPIP_PASS' ); print_fiche_titre("SPIP - Systeme de publication en ligne",$lien); form_constantes($constantes); } else { $lien=''.$langs->trans("Activate").''; print_fiche_titre("SPIP - Systeme de publication en ligne",$lien); } print "
\n"; } /* * Edition des varibales globales non rattache a un theme specifique */ $constantes=array( 'ADHERENT_MAIL_VALID_SUBJECT', 'ADHERENT_MAIL_VALID', 'ADHERENT_MAIL_COTIS_SUBJECT', 'ADHERENT_MAIL_COTIS', 'ADHERENT_MAIL_RESIL_SUBJECT', 'ADHERENT_MAIL_RESIL', 'ADHERENT_MAIL_FROM', 'ADHERENT_CARD_HEADER_TEXT', 'ADHERENT_CARD_TEXT', 'ADHERENT_CARD_FOOTER_TEXT', 'ADHERENT_ETIQUETTE_TYPE' ); print_fiche_titre("Autres variables globales"); print $langs->trans("FollowingConstantsWillBeSubstituted").'
'; print '%DOL_MAIN_URL_ROOT%, %ID%, %PRENOM%, %NOM%, %LOGIN%, %PASSWORD%,'; print '%SOCIETE%, %ADRESSE%, %CP%, %VILLE%, %PAYS%, %EMAIL%, %NAISS%, %PHOTO%, %TYPE%,'; //print '%INFOS%'; Deprecated print '
'; form_constantes($constantes); $db->close(); print '
'; llxFooter('$Date$ - $Revision$'); function form_constantes($tableau) { // Variables globales global $db,$bc,$langs; $form = new Form($db); print ''; print ''; print ''; print ''; print ''; print ''; print "\n"; $var=true; foreach($tableau as $const){ $sql = "SELECT rowid, name, value, type, note FROM ".MAIN_DB_PREFIX."const WHERE name='$const'"; $result = $db->query($sql); if ($result && ($db->num_rows() == 1)) { $obj = $db->fetch_object($result); $var=!$var; print ''; print ''; print ''; print ''; print ''; print ""; // Affiche nom constante print '\n"; if ($obj->name == 'ADHERENT_ETIQUETTE_TYPE') { print ''; } print '\n"; print ''; $i++; } } print '
'.$langs->trans("Description").''.$langs->trans("Value").''.$langs->trans("Type").''.$langs->trans("Action").'
'; print $langs->trans("Desc".$obj->name) != ("Desc".$obj->name) ? $langs->trans("Desc".$obj->name) : $obj->note; print "'; // List of possible labels. Values must exists in // file htdocs/adherents/PDF_Card.class.php require_once(DOL_DOCUMENT_ROOT.'/adherents/cartes/PDF_card.class.php'); $pdfcard=new PDF_card('5160',1,1,'mm'); $arrayoflabels=array_keys($pdfcard->_Avery_Labels); $form->select_array('constvalue',$arrayoflabels,$obj->value); print ''; $form->select_array('consttype',array('yesno','texte','chaine'),1); } else { print ''; if ($obj->type == 'yesno') { print $form->selectyesno('constvalue',$obj->value,1); print ''; $form->select_array('consttype',array('yesno','texte','chaine'),0); } elseif ($obj->type == 'texte') { print '\n"; print ''; $form->select_array('consttype',array('yesno','texte','chaine'),1); } else { print ''; print ''; $form->select_array('consttype',array('yesno','texte','chaine'),2); } print ''; print '  '; // print ''.img_delete().''; print "
'; } ?>