diff --git a/htdocs/adherent.class.php b/htdocs/adherent.class.php index bd7b8619cdb..fd1bff68a25 100644 --- a/htdocs/adherent.class.php +++ b/htdocs/adherent.class.php @@ -691,7 +691,8 @@ class Adherent $mdpass=md5($this->pass); $htpass=crypt($this->pass,initialiser_sel()); $query = "INSERT INTO spip_auteurs (nom, email, login, pass, htpass, alea_futur, statut) VALUES(\"".$this->prenom." ".$this->nom."\",\"".$this->email."\",\"".$this->login."\",\"$mdpass\",\"$htpass\",FLOOR(32000*RAND()),\"1comite\")"; - $mydb=new Db('mysql',MAIN_SPIP_SERVEUR,MAIN_SPIP_USER,MAIN_SPIP_PASS,MAIN_SPIP_DB); + // $mydb=new Db('mysql',MAIN_SPIP_SERVEUR,MAIN_SPIP_USER,MAIN_SPIP_PASS,MAIN_SPIP_DB); + $mydb=new DoliDb('mysql',MAIN_SPIP_SERVEUR,MAIN_SPIP_USER,MAIN_SPIP_PASS,MAIN_SPIP_DB); $result = $mydb->query($query); if ($result) @@ -721,7 +722,7 @@ class Adherent defined('MAIN_SPIP_DB') && MAIN_SPIP_DB != '' ){ $query = "DELETE FROM spip_auteurs WHERE login='".$this->login."'"; - $mydb=new Db('mysql',MAIN_SPIP_SERVEUR,MAIN_SPIP_USER,MAIN_SPIP_PASS,MAIN_SPIP_DB); + $mydb=new DoliDb('mysql',MAIN_SPIP_SERVEUR,MAIN_SPIP_USER,MAIN_SPIP_PASS,MAIN_SPIP_DB); $result = $mydb->query($query); if ($result) @@ -751,7 +752,7 @@ class Adherent defined('MAIN_SPIP_DB') && MAIN_SPIP_DB != '' ){ $query = "SELECT login FROM spip_auteurs WHERE login='".$this->login."'"; - $mydb=new Db('mysql',MAIN_SPIP_SERVEUR,MAIN_SPIP_USER,MAIN_SPIP_PASS,MAIN_SPIP_DB); + $mydb=new DoliDb('mysql',MAIN_SPIP_SERVEUR,MAIN_SPIP_USER,MAIN_SPIP_PASS,MAIN_SPIP_DB); $result = $mydb->query($query); if ($result) diff --git a/htdocs/adherents/cartes/PDF_card.class.php b/htdocs/adherents/cartes/PDF_card.class.php index bad1fe84884..9f139a28661 100755 --- a/htdocs/adherents/cartes/PDF_card.class.php +++ b/htdocs/adherents/cartes/PDF_card.class.php @@ -178,7 +178,8 @@ class PDF_card extends FPDF { 'height'=>54, 'font-size'=>10, 'logo1'=>'logo1.jpg', - 'logo2'=>'logo2.png') + 'logo2'=>'logo2.jpg', + 'fond'=>'fond.jpg') ); // convert units (in to mm, mm to in) @@ -264,12 +265,16 @@ class PDF_card extends FPDF { if ($this->_Avery_Name == "CARD") { $Tformat=$this->_Avery_Labels["CARD"]; $this->_Pointille($_PosX,$_PosY,$_PosX+$this->_Width,$_PosY+$this->_Height,1,25); + if($Tformat['fond'] != '' and file_exists($Tformat['fond'])){ + $this->image($Tformat['fond'],$_PosX,$_PosY,$this->_Width,$this->_Height); + } if($Tformat['logo1'] != '' and file_exists($Tformat['logo1'])){ $this->image($Tformat['logo1'],$_PosX+$this->_Width-21,$_PosY+1,20,20); } if($Tformat['logo2'] != '' and file_exists($Tformat['logo2'])){ $this->image($Tformat['logo2'],$_PosX+$this->_Width-21,$_PosY+25,20,20); } + //$this->image('logo1.jpg',$_PosX+$this->_Width-21,$_PosY+1,20); if ($header!=''){ $this->SetXY($_PosX, $_PosY+1); diff --git a/htdocs/adherents/cartes/carte.php b/htdocs/adherents/cartes/carte.php index 9d18e960261..d9e69425eb5 100755 --- a/htdocs/adherents/cartes/carte.php +++ b/htdocs/adherents/cartes/carte.php @@ -54,7 +54,7 @@ if (!isset($annee)){ $sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, ".$db->pdate("d.datefin")." as datefin, adresse,cp,ville,pays, t.libelle as type"; $sql .= " , d.email"; $sql .= " FROM llx_adherent as d, llx_adherent_type as t"; -$sql .= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1"; +$sql .= " WHERE d.fk_adherent_type = t.rowid AND d.statut = 1 AND datefin > now()"; $sql .= " ORDER BY d.rowid ASC "; $result = $db->query($sql); diff --git a/htdocs/adherents/pre.inc.php b/htdocs/adherents/pre.inc.php index 304f4a69950..48a5c7f22a9 100644 --- a/htdocs/adherents/pre.inc.php +++ b/htdocs/adherents/pre.inc.php @@ -38,7 +38,7 @@ function llxHeader($head = "") { $menu->add_submenu("liste.php?statut=-1","Adhésions à valider"); $menu->add_submenu("liste.php?statut=0","Adhésions résiliées"); - + $menu->add_submenu("cartes/carte.php","Cartes d'adhérents"); if ($user->admin) { $menu->add("fiche.php?action=create","Nouvel adhérent"); @@ -55,6 +55,7 @@ function llxHeader($head = "") { $menu->add("index.php","Configuration"); $menu->add_submenu("type.php","Type d'adhérent"); $menu->add_submenu("options.php","Champs optionnels"); + $menu->add_submenu("/admin/adherent.php","Constantes"); } left_menu($menu->liste); diff --git a/htdocs/admin/adherent.php b/htdocs/admin/adherent.php index d195f65837e..8dee779e8ea 100644 --- a/htdocs/admin/adherent.php +++ b/htdocs/admin/adherent.php @@ -36,6 +36,30 @@ $main_use_glasnost_auto = MAIN_USE_GLASNOST_AUTO; $main_use_spip = MAIN_USE_SPIP; $main_use_spip_auto = MAIN_USE_SPIP_AUTO; +$typeconst=array('yesno','texte','chaine'); +$var=True; + +if ($HTTP_POST_VARS["action"] == 'update' || $HTTP_POST_VARS["action"] == 'add') +{ + if (isset($HTTP_POST_VARS["consttype"]) && $HTTP_POST_VARS["consttype"] != ''){ + $sql = "REPLACE INTO llx_const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."', type='".$typeconst[$HTTP_POST_VARS["consttype"]]."',visible=0"; + }else{ + $sql = "REPLACE INTO llx_const SET name='".$_POST["constname"]."', value = '".$HTTP_POST_VARS["constvalue"]."',note='".$HTTP_POST_VARS["constnote"]."',visible=0"; + } + + if ($db->query($sql)) + { + Header("Location: adherent.php"); + } + + /* + $result = $db->query($sql); + if (!$result) + { + print $db->error(); + } + */ +} if ($action == 'set') { @@ -60,152 +84,196 @@ if ($action == 'unset') llxHeader(); /* - * PDF + * Interface de configuration de certaines variables de la partie adherent */ print_titre("Gestion des adhérents : Configurations de parametres"); +/* + * Mailman + */ print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print ''; -print "\n"; - - -print ''; - -print ''; + print '
Modules externes
NomInfoActivé 
MailmanSystème de mailing listes'; +print "
MailmanSystème de mailing listes"; print ''; -if ($main_use_mailman == 1) +if (defined("MAIN_USE_MAILMAN") && MAIN_USE_MAILMAN == 1) { print ''; -} -else -{ - print " "; -} - -print "\n"; - -if ($main_use_mailman == 0) -{ - print 'activer'; -} -else -{ + print "\n"; print 'désactiver'; -} -print '
GlasnostSystème de vote en ligne'; -print ''; - -if ($main_use_glasnost == 1) -{ - print ''; + print '
'; + // Edition des varibales globales rattache au theme Mailman + $constantes=array('MAIN_MAILMAN_LISTS', + 'MAIN_MAILMAN_UNSUB_URL', + 'MAIN_MAILMAN_URL' + ); + form_constantes($constantes); } else { print " "; + print "\n"; + print 'activer'; + print ''; + print ''; } -print "\n"; - -if ($main_use_glasnost == 0) -{ - print 'activer'; -} -else -{ - print 'désactiver'; -} -print ''; - - -print 'Glasnost AutoInscription automatique dans Glasnost'; +print "

\n"; +/* + * Spip + */ +$var=!$var; +print ''; +print "'; - - - - -print ''; - - -print ''; + print '
SpipSystème de publication en ligne"; print ''; -if (MAIN_USE_GLASNOST_AUTO == 1) +if (defined("MAIN_USE_SPIP") && MAIN_USE_SPIP == 1) { print ''; -} -else -{ - print " "; -} - -print "\n"; - -if (MAIN_USE_GLASNOST == 0) -{ - print 'activer'; -} -else -{ - print 'désactiver'; -} -print '
SpipSystème de publication'; -print ''; - -if ($main_use_spip == 1) -{ - print ''; -} -else -{ - print " "; -} - -print "\n"; - -if ($main_use_spip == 0) -{ - print 'activer'; -} -else -{ + print "\n"; print 'désactiver'; -} -print '
Spip AutoInscription automatique dans SPIP'; -print ''; - -if ($main_use_spip_auto == 1) -{ - print ''; + print '
'; + // Edition des varibales globales rattache au theme Mailman + $constantes=array('MAIN_USE_SPIP_AUTO', + 'MAIN_SPIP_SERVEUR', + 'MAIN_SPIP_DB', + 'MAIN_SPIP_USER', + 'MAIN_SPIP_PASS' + ); + form_constantes($constantes); } else { print " "; + print "\n"; + print 'activer'; + print ''; + print ''; } -print "\n"; +print "

\n"; +/* + * Glasnost + */ +$var=!$var; +print ''; +print "'; + print '
GlasnostSystème de vote en ligne"; +print ''; -if ($main_use_spip_auto == 0) +if (defined("MAIN_USE_GLASNOST") && MAIN_USE_GLASNOST == 1) { - print 'activer'; + print ''; + print "\n"; + print 'désactiver'; + print '
'; + // Edition des varibales globales rattache au theme Mailman + $constantes=array('MAIN_USE_GLASNOST_AUTO', + 'MAIN_GLASNOST_SERVEUR', + 'MAIN_GLASNOST_USER', + 'MAIN_GLASNOST_PASS' + ); + form_constantes($constantes); } else { - print 'désactiver'; + print " "; + print "\n"; + print 'activer'; + print ''; + print ''; } + +print "

\n"; +$var=!$var; +/* + * Edition des varibales globales non rattache a un theme specifique + */ +print ''; +print "'; - - - print '
Variables globalesVariables globales non rattachées a un thème"; print '
'; - - +$constantes=array('ADH_TEXT_NEW_ADH', + 'MAIN_MAIL_COTIS_SUBJECT', + 'MAIN_MAIL_COTIS', + 'MAIN_MAIL_EDIT_SUBJECT', + 'MAIN_MAIL_EDIT', + 'MAIN_MAIL_NEW_SUBJECT', + 'MAIN_MAIL_NEW', + 'MAIN_MAIL_RESIL_SUBJECT', + 'MAIN_MAIL_RESIL', + 'MAIN_MAIL_VALID_SUBJECT', + 'MAIN_MAIL_VALID', + 'MAIN_MAIL_FROM' + ); +form_constantes($constantes); $db->close(); llxFooter(); + +function form_constantes($tableau){ + // Variables globales + global $db,$bc; + $form = new Form($db); + print ''; + print ''; + print ''; + print ''; + print ''; + //print ''; + print ""; + print "\n"; + $var=True; + + foreach($tableau as $const){ + $sql = "SELECT rowid, name, value, type, note FROM llx_const WHERE name='$const'"; + $result = $db->query($sql); + if ($result && ($db->num_rows() == 1)) { + $obj = $db->fetch_object(0); + $var=!$var; + print ''; + print ''; + print ''; + print ''; + print ''; + + print "\n"; + + print '\n"; + + print ''; + $i++; + } + } + print '
DescriptionValeurTypeNoteAction
".stripslashes(nl2br($obj->note))."'; + if ($obj->type == 'yesno') + { + $form->selectyesnonum('constvalue',$obj->value); + 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 ''; + print '
'; + print 'Delete'; + print "
'; +} ?> diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index 9fae2f154ea..52c10611690 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -68,7 +68,11 @@ if ($user->admin) } } -$sql = "SELECT rowid, name, value, type, note FROM llx_const WHERE visible = 1 ORDER BY name ASC"; +if ($all==1){ + $sql = "SELECT rowid, name, value, type, note FROM llx_const ORDER BY name ASC"; +}else{ + $sql = "SELECT rowid, name, value, type, note FROM llx_const WHERE visible = 1 ORDER BY name ASC"; +} $result = $db->query($sql); if ($result) { diff --git a/htdocs/public/adherents/index.php b/htdocs/public/adherents/index.php index 4e3f4d4e0b5..114d7ffcfa2 100644 --- a/htdocs/public/adherents/index.php +++ b/htdocs/public/adherents/index.php @@ -23,7 +23,7 @@ require("./pre.inc.php"); llxHeader(); -$db = new Db(); +//$db = new Db(); print_titre("Gestion des adhesions a l'association"); diff --git a/htdocs/public/adherents/new.php b/htdocs/public/adherents/new.php index 5541a7dceb5..351facc13ca 100644 --- a/htdocs/public/adherents/new.php +++ b/htdocs/public/adherents/new.php @@ -27,7 +27,7 @@ require($GLOBALS["DOCUMENT_ROOT"]."/adherent_type.class.php"); require($GLOBALS["DOCUMENT_ROOT"]."/adherents/adherent_options.class.php"); -$db = new Db(); +//$db = new Db(); $adho = new AdherentOptions($db); $errmsg=''; $num=0; @@ -135,6 +135,10 @@ if ($errmsg != ''){ } print_titre("Nouvel adhérent"); +if (defined("ADH_TEXT_NEW_ADH") && ADH_TEXT_NEW_ADH !=''){ + print ADH_TEXT_NEW_ADH; + print "
\n"; +} print '