rajout d'un champt dans les type d'adherent pour savoir s'ils ont le droit de vote ou (utile pour cdg)
rajout de la possibilite de creer des comptes dans spip pour les adherents.
This commit is contained in:
parent
f88e0fcc52
commit
7f4a2607cf
@ -582,7 +582,7 @@ class Adherent
|
||||
* (mailing-list, spip, glasnost etc etc ..)
|
||||
*
|
||||
*/
|
||||
Function add_to_abo()
|
||||
Function add_to_abo($adht)
|
||||
{
|
||||
$err=0;
|
||||
// mailman
|
||||
@ -592,12 +592,24 @@ class Adherent
|
||||
$err+=1;
|
||||
}
|
||||
}
|
||||
if (defined("MAIN_USE_GLASNOST") && MAIN_USE_GLASNOST ==1)
|
||||
if ($adht->vote == 'yes' &&
|
||||
defined("MAIN_USE_GLASNOST") && MAIN_USE_GLASNOST ==1 &&
|
||||
defined("MAIN_USE_GLASNOST_AUTO") && MAIN_USE_GLASNOST_AUTO ==1
|
||||
)
|
||||
{
|
||||
if(!$this->add_to_glasnost()){
|
||||
$err+=1;
|
||||
}
|
||||
}
|
||||
if (
|
||||
defined("MAIN_USE_SPIP") && MAIN_USE_SPIP ==1 &&
|
||||
defined("MAIN_USE_SPIP_AUTO") && MAIN_USE_SPIP_AUTO ==1
|
||||
)
|
||||
{
|
||||
if(!$this->add_to_spip()){
|
||||
$err+=1;
|
||||
}
|
||||
}
|
||||
if ($err>0){
|
||||
// error
|
||||
return 0;
|
||||
@ -611,7 +623,7 @@ class Adherent
|
||||
* (mailing-list, spip, glasnost etc etc ..)
|
||||
*
|
||||
*/
|
||||
Function del_to_abo()
|
||||
Function del_to_abo($adht)
|
||||
{
|
||||
$err=0;
|
||||
// mailman
|
||||
@ -621,12 +633,24 @@ class Adherent
|
||||
$err+=1;
|
||||
}
|
||||
}
|
||||
if (defined("MAIN_USE_GLASNOST") && MAIN_USE_GLASNOST ==1)
|
||||
if ($adht->vote == 'yes' &&
|
||||
defined("MAIN_USE_GLASNOST") && MAIN_USE_GLASNOST ==1 &&
|
||||
defined("MAIN_USE_GLASNOST_AUTO") && MAIN_USE_GLASNOST_AUTO ==1
|
||||
)
|
||||
{
|
||||
if(!$this->del_to_glasnost()){
|
||||
$err+=1;
|
||||
}
|
||||
}
|
||||
if (
|
||||
defined("MAIN_USE_SPIP") && MAIN_USE_SPIP ==1 &&
|
||||
defined("MAIN_USE_SPIP_AUTO") && MAIN_USE_SPIP_AUTO ==1
|
||||
)
|
||||
{
|
||||
if(!$this->del_to_spip()){
|
||||
$err+=1;
|
||||
}
|
||||
}
|
||||
if ($err>0){
|
||||
// error
|
||||
return 0;
|
||||
@ -635,6 +659,66 @@ class Adherent
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* Ajoute cet utilisateur comme redacteur dans spip
|
||||
*
|
||||
*/
|
||||
Function add_to_spip()
|
||||
{
|
||||
if (defined("MAIN_USE_SPIP") && MAIN_USE_SPIP ==1 &&
|
||||
defined('MAIN_SPIP_SERVEUR') && MAIN_SPIP_SERVEUR != '' &&
|
||||
defined('MAIN_SPIP_USER') && MAIN_SPIP_USER != '' &&
|
||||
defined('MAIN_SPIP_PASS') && MAIN_SPIP_PASS != '' &&
|
||||
defined('MAIN_SPIP_DB') && MAIN_SPIP_DB != ''
|
||||
){
|
||||
$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->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);
|
||||
$result = $mydb->query($query);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errorstr=$mydb->error();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* supprime cet utilisateur dans spip
|
||||
*
|
||||
*/
|
||||
Function del_to_spip()
|
||||
{
|
||||
if (defined("MAIN_USE_SPIP") && MAIN_USE_SPIP ==1 &&
|
||||
defined('MAIN_SPIP_SERVEUR') && MAIN_SPIP_SERVEUR != '' &&
|
||||
defined('MAIN_SPIP_USER') && MAIN_SPIP_USER != '' &&
|
||||
defined('MAIN_SPIP_PASS') && MAIN_SPIP_PASS != '' &&
|
||||
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);
|
||||
$result = $mydb->query($query);
|
||||
|
||||
if ($result)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errorstr=$mydb->error();
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Rajoute cet utilisateur au serveur glasnost
|
||||
*
|
||||
@ -661,6 +745,7 @@ class Adherent
|
||||
$userid=$response[0];
|
||||
$usertoken=$response[1];
|
||||
}else{
|
||||
$this->errorstr=$response['faultString'];
|
||||
return 0;
|
||||
}
|
||||
|
||||
@ -689,10 +774,12 @@ class Adherent
|
||||
if ($success){
|
||||
$personid=$response[0];
|
||||
}else{
|
||||
$this->errorstr=$response['faultString'];
|
||||
return 0;
|
||||
}
|
||||
return 1;
|
||||
}else{
|
||||
$this->errorstr="Constantes de connection non definies";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -744,6 +831,7 @@ class Adherent
|
||||
if ($success){
|
||||
$personid=$response['id'];
|
||||
}else{
|
||||
$this->errorstr=$response['faultString'];
|
||||
return 0;
|
||||
}
|
||||
if (defined('MAIN_GLASNOST_DEFAULT_GROUPID') && MAIN_GLASNOST_DEFAULT_GROUPID != ''){
|
||||
@ -766,6 +854,7 @@ class Adherent
|
||||
if ($success){
|
||||
$groupids=$response['membersSet'];
|
||||
}else{
|
||||
$this->errorstr=$response['faultString'];
|
||||
return 0;
|
||||
}
|
||||
// TODO faire la verification que le user n'est pas dans ce
|
||||
@ -791,9 +880,11 @@ class Adherent
|
||||
if ($success){
|
||||
return 1;
|
||||
}else{
|
||||
$this->errorstr=$response['faultString'];
|
||||
return 0;
|
||||
}
|
||||
}else{
|
||||
$this->errorstr="Constantes de connection non definies";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -847,6 +938,7 @@ class Adherent
|
||||
}
|
||||
return 1;
|
||||
}else{
|
||||
$this->errorstr="Constantes de connection non definies";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -897,6 +989,7 @@ class Adherent
|
||||
}
|
||||
return 1;
|
||||
}else{
|
||||
$this->errorstr="Constantes de connection non definies";
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,6 +29,7 @@ class AdherentType
|
||||
var $errorstr;
|
||||
var $mail_valid; // mail envoye lors de la validation
|
||||
var $commentaire; // commentaire
|
||||
var $vote; // droit de vote ?
|
||||
/*
|
||||
*
|
||||
*
|
||||
@ -97,6 +98,7 @@ class AdherentType
|
||||
$sql .= ",statut=".$this->statut;
|
||||
$sql .= ",cotisation='".$this->cotisation."'";
|
||||
$sql .= ",note='".$this->commentaire."'";
|
||||
$sql .= ",vote='".$this->vote."'";
|
||||
$sql .= ",mail_valid='".$this->mail_valid."'";
|
||||
|
||||
$sql .= " WHERE rowid = $this->id";
|
||||
@ -166,6 +168,7 @@ class AdherentType
|
||||
$this->cotisation = $obj->cotisation;
|
||||
$this->mail_valid = $obj->mail_valid;
|
||||
$this->commentaire = $obj->note;
|
||||
$this->vote = $obj->vote;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@ -106,21 +106,12 @@ if ($HTTP_POST_VARS["action"] == 'confirm_valid' && $HTTP_POST_VARS["confirm"] =
|
||||
$adh->send_an_email($adh->email,$conf->adherent->email_valid,$conf->adherent->email_valid_subject);
|
||||
}
|
||||
// rajoute l'utilisateur dans les divers abonnements ..
|
||||
if (!$adh->add_to_abo())
|
||||
if (!$adh->add_to_abo($adht))
|
||||
{
|
||||
// error
|
||||
$errmsg="echec du rajout de l'utilisateur aux mailing-lists";
|
||||
$errmsg.="echec du rajout de l'utilisateur aux abonnements: ".$adh->errostr."<BR>\n";
|
||||
}
|
||||
|
||||
/*
|
||||
if ($conf->adherent->use_mailman == 1)
|
||||
{
|
||||
foreach ($conf->adherent->mailman_lists as $key)
|
||||
{
|
||||
$adh->add_to_mailman($adh->email,$key,$conf->adherent->mailman_dir);
|
||||
}
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
if ($HTTP_POST_VARS["action"] == 'confirm_resign' && $HTTP_POST_VARS["confirm"] == yes)
|
||||
@ -129,13 +120,16 @@ if ($HTTP_POST_VARS["action"] == 'confirm_resign' && $HTTP_POST_VARS["confirm"]
|
||||
$adh->resiliate($user->id);
|
||||
$adh->fetch($rowid);
|
||||
|
||||
$adht = new AdherentType($db);
|
||||
$adht->fetch($adh->typeid);
|
||||
|
||||
$adh->send_an_email($adh->email,$conf->adherent->email_resil,$conf->adherent->email_resil_subject);
|
||||
|
||||
// supprime l'utilisateur des divers abonnements ..
|
||||
if (!$adh->del_to_abo())
|
||||
if (!$adh->del_to_abo($adht))
|
||||
{
|
||||
// error
|
||||
$errmsg="echec du rajout de l'utilisateur aux mailing-lists";
|
||||
$errmsg.="echec de la suppression de l'utilisateur aux abonnements: ".$adh->errostr."<BR>\n";
|
||||
}
|
||||
}
|
||||
|
||||
@ -145,10 +139,16 @@ if ($HTTP_POST_VARS["action"] == 'confirm_add_glasnost' && $HTTP_POST_VARS["conf
|
||||
{
|
||||
$adh = new Adherent($db, $rowid);
|
||||
$adh->fetch($rowid);
|
||||
define("XMLRPC_DEBUG", 1);
|
||||
$adh->add_to_glasnost();
|
||||
if(defined('MAIN_DEBUG') && MAIN_DEBUG == 1){
|
||||
XMLRPC_debug_print();
|
||||
$adht = new AdherentType($db);
|
||||
$adht->fetch($adh->typeid);
|
||||
if ($adht->vote == 'yes'){
|
||||
define("XMLRPC_DEBUG", 1);
|
||||
if (!$adh->add_to_glasnost()){
|
||||
$errmsg.="Echec du rajout de l'utilisateur dans glasnost: ".$adh->errostr."<BR>\n";
|
||||
}
|
||||
if(defined('MAIN_DEBUG') && MAIN_DEBUG == 1){
|
||||
XMLRPC_debug_print();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -156,12 +156,38 @@ if ($HTTP_POST_VARS["action"] == 'confirm_del_glasnost' && $HTTP_POST_VARS["conf
|
||||
{
|
||||
$adh = new Adherent($db, $rowid);
|
||||
$adh->fetch($rowid);
|
||||
define("XMLRPC_DEBUG", 1);
|
||||
$adh->del_to_glasnost();
|
||||
if(defined('MAIN_DEBUG') && MAIN_DEBUG == 1){
|
||||
XMLRPC_debug_print();
|
||||
$adht = new AdherentType($db);
|
||||
$adht->fetch($adh->typeid);
|
||||
if ($adht->vote == 'yes'){
|
||||
define("XMLRPC_DEBUG", 1);
|
||||
if(!$adh->del_to_glasnost()){
|
||||
$errmsg.="Echec de la suppression de l'utilisateur dans glasnost: ".$adh->errostr."<BR>\n";
|
||||
}
|
||||
if(defined('MAIN_DEBUG') && MAIN_DEBUG == 1){
|
||||
XMLRPC_debug_print();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($HTTP_POST_VARS["action"] == 'confirm_del_spip' && $HTTP_POST_VARS["confirm"] == yes)
|
||||
{
|
||||
$adh = new Adherent($db, $rowid);
|
||||
$adh->fetch($rowid);
|
||||
if(!$adh->del_to_spip()){
|
||||
$errmsg.="Echec de la suppression de l'utilisateur dans spip: ".$adh->errostr."<BR>\n";
|
||||
}
|
||||
}
|
||||
|
||||
if ($HTTP_POST_VARS["action"] == 'confirm_add_spip' && $HTTP_POST_VARS["confirm"] == yes)
|
||||
{
|
||||
$adh = new Adherent($db, $rowid);
|
||||
$adh->fetch($rowid);
|
||||
if (!$adh->add_to_spip()){
|
||||
$errmsg.="Echec du rajout de l'utilisateur dans spip: ".$adh->errostr."<BR>\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* ************************************************************************** */
|
||||
/* */
|
||||
/* Création d'une fiche */
|
||||
@ -180,25 +206,6 @@ if ($errmsg != ''){
|
||||
$adho->fetch_optionals();
|
||||
if ($action == 'create') {
|
||||
|
||||
/*
|
||||
$sql = "SELECT s.nom,s.idp, f.amount, f.total, f.facnumber";
|
||||
$sql .= " FROM societe as s, llx_facture as f WHERE f.fk_soc = s.idp";
|
||||
$sql .= " AND f.rowid = $facid";
|
||||
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows();
|
||||
if ($num) {
|
||||
$obj = $db->fetch_object( 0);
|
||||
|
||||
$total = $obj->total;
|
||||
}
|
||||
}
|
||||
*/
|
||||
// $adho = new AdherentOptions($db);
|
||||
|
||||
//$myattr=$adho->fetch_name_optionals();
|
||||
|
||||
print_titre("Nouvel adhérent");
|
||||
print "<form action=\"$PHP_SELF\" method=\"post\">\n";
|
||||
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
|
||||
@ -276,6 +283,8 @@ if ($rowid > 0)
|
||||
$adh->fetch($rowid);
|
||||
$adh->fetch_optionals($rowid);
|
||||
//$myattr=$adh->fetch_name_optionals();
|
||||
$adht = new AdherentType($db);
|
||||
$adht->fetch($adh->typeid);
|
||||
|
||||
print_titre("Edition de la fiche adhérent");
|
||||
|
||||
@ -370,7 +379,7 @@ if ($rowid > 0)
|
||||
|
||||
print '<tr><td colspan="3">Valider un adhérent</td></tr>';
|
||||
|
||||
print '<tr><td class="valid">Etes-vous sur de vouloir ajouter cet adhérent dans glasnost ?</td><td class="valid">';
|
||||
print '<tr><td class="valid">Etes-vous sur de vouloir ajouter cet adhérent dans glasnost ? (serveur : '.MAIN_GLASNOST_SERVEUR.')</td><td class="valid">';
|
||||
$htmls = new Form($db);
|
||||
|
||||
$htmls->selectyesno("confirm","no");
|
||||
@ -395,7 +404,57 @@ if ($rowid > 0)
|
||||
|
||||
print '<tr><td colspan="3">Valider un adhérent</td></tr>';
|
||||
|
||||
print '<tr><td class="delete">Etes-vous sur de vouloir effacer cet adhérent de glasnost ?</td><td class="delete">';
|
||||
print '<tr><td class="delete">Etes-vous sur de vouloir effacer cet adhérent de glasnost ? (serveur : '.MAIN_GLASNOST_SERVEUR.')</td><td class="delete">';
|
||||
$htmls = new Form($db);
|
||||
|
||||
$htmls->selectyesno("confirm","no");
|
||||
|
||||
print "</td>\n";
|
||||
print '<td class="delete" align="center"><input type="submit" value="Confirmer"</td></tr>';
|
||||
print '</table>';
|
||||
print "</form>\n";
|
||||
}
|
||||
|
||||
/*
|
||||
* Confirmation de l'ajout dans spip
|
||||
*
|
||||
*/
|
||||
|
||||
if ($action == 'add_spip')
|
||||
{
|
||||
|
||||
print '<form method="post" action="'.$PHP_SELF.'?rowid='.$rowid.'">';
|
||||
print '<input type="hidden" name="action" value="confirm_add_spip">';
|
||||
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
|
||||
|
||||
print '<tr><td colspan="3">Valider un adhérent</td></tr>';
|
||||
|
||||
print '<tr><td class="valid">Etes-vous sur de vouloir ajouter cet adhérent dans spip ? (serveur : '.MAIN_SPIP_SERVEUR.')</td><td class="valid">';
|
||||
$htmls = new Form($db);
|
||||
|
||||
$htmls->selectyesno("confirm","no");
|
||||
|
||||
print "</td>\n";
|
||||
print '<td class="valid" align="center"><input type="submit" value="Confirmer"</td></tr>';
|
||||
print '</table>';
|
||||
print "</form>\n";
|
||||
}
|
||||
|
||||
/*
|
||||
* Confirmation de la suppression dans spip
|
||||
*
|
||||
*/
|
||||
|
||||
if ($action == 'del_spip')
|
||||
{
|
||||
|
||||
print '<form method="post" action="'.$PHP_SELF.'?rowid='.$rowid.'">';
|
||||
print '<input type="hidden" name="action" value="confirm_del_spip">';
|
||||
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
|
||||
|
||||
print '<tr><td colspan="3">Valider un adhérent</td></tr>';
|
||||
|
||||
print '<tr><td class="delete">Etes-vous sur de vouloir effacer cet adhérent de glasnost ? (serveur : '.MAIN_SPIP_SERVEUR.')</td><td class="delete">';
|
||||
$htmls = new Form($db);
|
||||
|
||||
$htmls->selectyesno("confirm","no");
|
||||
@ -409,18 +468,21 @@ if ($rowid > 0)
|
||||
print "<form action=\"$PHP_SELF\" method=\"post\">\n";
|
||||
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
|
||||
|
||||
print "<tr><td>Type</td><td class=\"valeur\">$adh->type</td>\n";
|
||||
print '<tr><td>Numero</td><td class="valeur">'.$adh->id.' </td>';
|
||||
print '<td valign="top" width="50%">Commentaires</tr>';
|
||||
|
||||
print '<tr><td>Personne</td><td class="valeur">'.$adh->morphy.' </td>';
|
||||
print "<tr><td>Type</td><td class=\"valeur\">$adh->type</td>\n";
|
||||
|
||||
print '<td rowspan="13" valign="top" width="50%">';
|
||||
print nl2br($adh->commentaire).' </td></tr>';
|
||||
|
||||
print '<tr><td>Personne</td><td class="valeur">'.$adh->morphy.' </td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr><td width="15%">Prénom</td><td class="valeur" width="35%">'.$adh->prenom.' </td></tr>';
|
||||
|
||||
print '<tr><td>Nom</td><td class="valeur">'.$adh->nom.' </td></tr>';
|
||||
|
||||
print '<tr><td>Nom</td><td class="valeur">'.$adh->nom.' </td></tr>';
|
||||
|
||||
print '<tr><td>Société</td><td class="valeur">'.$adh->societe.' </td></tr>';
|
||||
print '<tr><td>Adresse</td><td class="valeur">'.nl2br($adh->adresse).' </td></tr>';
|
||||
@ -457,7 +519,7 @@ if ($rowid > 0)
|
||||
* Case 1
|
||||
*/
|
||||
|
||||
print '<td align="center" width="15%" class=\"bouton\">[<a href="edit.php?rowid='.$adh->id.'">Editer</a>]</td>';
|
||||
print '<td align="center" width="25%" class=\"bouton\">[<a href="edit.php?rowid='.$adh->id.'">Editer</a>]</td>';
|
||||
|
||||
/*
|
||||
* Case 2
|
||||
@ -465,46 +527,80 @@ if ($rowid > 0)
|
||||
|
||||
if ($adh->statut < 1)
|
||||
{
|
||||
print "<td align=\"center\" width=\"15%\" class=\"bouton\">[<a href=\"$PHP_SELF?rowid=$rowid&action=valid\">Valider l'adhésion</a>]</td>\n";
|
||||
print "<td align=\"center\" width=\"25%\" class=\"bouton\">[<a href=\"$PHP_SELF?rowid=$rowid&action=valid\">Valider l'adhésion</a>]</td>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\" width=\"15%\" class=\"bouton\">-</td>\n";
|
||||
print "<td align=\"center\" width=\"25%\" class=\"bouton\">-</td>\n";
|
||||
}
|
||||
/*
|
||||
* Case 3
|
||||
*/
|
||||
if ($adh->statut == 1)
|
||||
{
|
||||
print "<td align=\"center\" width=\"15%\" class=\"bouton\">[<a href=\"$PHP_SELF?rowid=$rowid&action=resign\">Résilier l'adhésion</a>]</td>\n";
|
||||
print "<td align=\"center\" width=\"25%\" class=\"bouton\">[<a href=\"$PHP_SELF?rowid=$rowid&action=resign\">Résilier l'adhésion</a>]</td>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "<td align=\"center\" width=\"15%\" class=\"bouton\">-</td>\n";
|
||||
print "<td align=\"center\" width=\"25%\" class=\"bouton\">-</td>\n";
|
||||
}
|
||||
|
||||
/*
|
||||
* Case 4
|
||||
*/
|
||||
|
||||
print "<td align=\"center\" width=\"15%\" class=\"bouton\">[<a href=\"$PHP_SELF?rowid=$adh->id&action=delete\">Supprimer</a>]</td>\n";
|
||||
print "<td align=\"center\" width=\"25%\" class=\"bouton\">[<a href=\"$PHP_SELF?rowid=$adh->id&action=delete\">Supprimer</a>]</td>\n";
|
||||
|
||||
print "</tr><tr class=\"barreBouton\">\n";
|
||||
|
||||
if (defined("MAIN_USE_GLASNOST") && MAIN_USE_GLASNOST ==1){
|
||||
if ($adht->vote == 'yes' && defined("MAIN_USE_GLASNOST") && MAIN_USE_GLASNOST ==1){
|
||||
define("XMLRPC_DEBUG", 1);
|
||||
/*
|
||||
* Case 5
|
||||
* Case 1
|
||||
*/
|
||||
print "<td align=\"center\" width=\"20%\" class=\"bouton\">[<a href=\"$PHP_SELF?rowid=$adh->id&action=add_glasnost\">Ajout dans Glasnost</a>]</td>\n";
|
||||
print "<td align=\"center\" width=\"25%\" class=\"bouton\">[<a href=\"$PHP_SELF?rowid=$adh->id&action=add_glasnost\">Ajout dans Glasnost</a>]</td>\n";
|
||||
|
||||
|
||||
/*
|
||||
* Case 6
|
||||
* Case 2
|
||||
*/
|
||||
|
||||
print "<td align=\"center\" width=\"20%\" class=\"bouton\">[<a href=\"$PHP_SELF?rowid=$adh->id&action=del_glasnost\">Suppression dans Glasnost</a>]</td>\n";
|
||||
print "<td align=\"center\" width=\"25%\" class=\"bouton\">[<a href=\"$PHP_SELF?rowid=$adh->id&action=del_glasnost\">Suppression dans Glasnost</a>]</td>\n";
|
||||
}else{
|
||||
/*
|
||||
* Case 1
|
||||
*/
|
||||
print "<td align=\"center\" width=\"25%\" class=\"bouton\">-</td>\n";
|
||||
|
||||
/*
|
||||
* Case 2
|
||||
*/
|
||||
print "<td align=\"center\" width=\"25%\" class=\"bouton\">-</td>\n";
|
||||
}
|
||||
|
||||
if (defined("MAIN_USE_SPIP") && MAIN_USE_SPIP ==1){
|
||||
/*
|
||||
* Case 3
|
||||
*/
|
||||
print "<td align=\"center\" width=\"20%\" class=\"bouton\">[<a href=\"$PHP_SELF?rowid=$adh->id&action=add_spip\">Ajout dans Spip</a>]</td>\n";
|
||||
|
||||
|
||||
/*
|
||||
* Case 4
|
||||
*/
|
||||
|
||||
print "<td align=\"center\" width=\"20%\" class=\"bouton\">[<a href=\"$PHP_SELF?rowid=$adh->id&action=del_spip\">Suppression dans Spip</a>]</td>\n";
|
||||
}else{
|
||||
/*
|
||||
* Case 3
|
||||
*/
|
||||
print "<td align=\"center\" width=\"25%\" class=\"bouton\">-</td>\n";
|
||||
|
||||
/*
|
||||
* Case 4
|
||||
*/
|
||||
print "<td align=\"center\" width=\"25%\" class=\"bouton\">-</td>\n";
|
||||
}
|
||||
|
||||
print "</tr></table></form><p>\n";
|
||||
}
|
||||
|
||||
@ -39,6 +39,7 @@ if ($HTTP_POST_VARS["action"] == 'add' && $user->admin)
|
||||
$adht->cotisation = $HTTP_POST_VARS["cotisation"];
|
||||
$adht->commentaire = $HTTP_POST_VARS["comment"];
|
||||
$adht->mail_valid = $HTTP_POST_VARS["mail_valid"];
|
||||
$adht->vote = $HTTP_POST_VARS["vote"];
|
||||
|
||||
if ($adht->create($user->id) )
|
||||
{
|
||||
@ -55,6 +56,7 @@ if ($HTTP_POST_VARS["action"] == 'update' && $user->admin)
|
||||
$adht->cotisation = $HTTP_POST_VARS["cotisation"];
|
||||
$adht->commentaire = $HTTP_POST_VARS["comment"];
|
||||
$adht->mail_valid = $HTTP_POST_VARS["mail_valid"];
|
||||
$adht->vote = $HTTP_POST_VARS["vote"];
|
||||
|
||||
if ($adht->update($user->id) )
|
||||
{
|
||||
@ -87,7 +89,7 @@ print_titre("Configuration");
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
$sql = "SELECT d.rowid, d.libelle, d.cotisation";
|
||||
$sql = "SELECT d.rowid, d.libelle, d.cotisation, d.vote";
|
||||
$sql .= " FROM llx_adherent_type as d";
|
||||
|
||||
$result = $db->query($sql);
|
||||
@ -100,7 +102,7 @@ if ($result)
|
||||
|
||||
print '<TR class="liste_titre">';
|
||||
print "<td>Id</td>";
|
||||
print "<td>Libellé</td><td>Cotisation ?</td><td> </td>";
|
||||
print "<td>Libellé</td><td>Cotisation ?</td><td>Vote ?</td><td> </td>";
|
||||
print "</TR>\n";
|
||||
|
||||
$var=True;
|
||||
@ -112,6 +114,7 @@ if ($result)
|
||||
print "<TD>".$objp->rowid."</td>\n";
|
||||
print '<TD>'.$objp->libelle.'</TD>';
|
||||
print '<TD>'.$objp->cotisation.'</TD>';
|
||||
print '<TD>'.$objp->vote.'</TD>';
|
||||
print '<TD><a href="type.php?action=edit&rowid='.$objp->rowid.'">Editer</TD>';
|
||||
print "</tr>";
|
||||
$i++;
|
||||
@ -125,30 +128,30 @@ else
|
||||
}
|
||||
|
||||
|
||||
print "<p><TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\"><tr>";
|
||||
print "<p><TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\"><tr class=\"barreBouton\">";
|
||||
|
||||
/*
|
||||
* Case 1
|
||||
*/
|
||||
|
||||
print '<td align="center" width="25%">[<a href="type.php?action=create">Nouveau Type</a>]</td>';
|
||||
print '<td align="center" width="25%" class=\"bouton\">[<a href="type.php?action=create">Nouveau Type</a>]</td>';
|
||||
|
||||
/*
|
||||
* Case 2
|
||||
*/
|
||||
|
||||
print "<td align=\"center\" width=\"25%\">-</td>";
|
||||
print "<td align=\"center\" width=\"25%\" class=\"bouton\">-</td>";
|
||||
|
||||
/*
|
||||
* Case 3
|
||||
*/
|
||||
print "<td align=\"center\" width=\"25%\">-</td>";
|
||||
print "<td align=\"center\" width=\"25%\" class=\"bouton\">-</td>";
|
||||
|
||||
/*
|
||||
* Case 4
|
||||
*/
|
||||
|
||||
print "<td align=\"center\" width=\"25%\">-</td>";
|
||||
print "<td align=\"center\" width=\"25%\" class=\"bouton\">-</td>";
|
||||
|
||||
print "</tr></table></form><p>";
|
||||
|
||||
@ -193,6 +196,11 @@ if ($action == 'create') {
|
||||
print '<select name="cotisation"><option value="yes">oui</option>';
|
||||
print '<option value="no">non</option></select>';
|
||||
|
||||
print '<tr><td>Droit de vote</td><td>';
|
||||
|
||||
print '<select name="vote"><option value="yes">oui</option>';
|
||||
print '<option value="no">non</option></select>';
|
||||
|
||||
print '<tr><td valign="top">Commentaires :</td><td>';
|
||||
print "<textarea name=\"comment\" wrap=\"soft\" cols=\"60\" rows=\"3\"></textarea></td></tr>";
|
||||
|
||||
@ -223,8 +231,10 @@ if ($rowid > 0 && $action == 'edit')
|
||||
|
||||
print '<tr><td>Libellé</td><td class="valeur">'.$adht->libelle.' </td></tr>';
|
||||
print '<tr><td>Soumis à cotisation</td><td class="valeur">'.$adht->cotisation.' </td></tr>';
|
||||
print '<tr><td valign="top">Commentaires</td>';
|
||||
|
||||
print '<tr><td>Droit de vote</td><td class="valeur">'.$adht->vote.' </td></tr>';
|
||||
|
||||
print '<tr><td valign="top">Commentaires</td>';
|
||||
print '<td valign="top" width="75%" class="valeur">';
|
||||
print nl2br($adht->commentaire).' </td></tr>';
|
||||
|
||||
@ -253,7 +263,12 @@ if ($rowid > 0 && $action == 'edit')
|
||||
$htmls = new Form($db);
|
||||
|
||||
$htmls->selectyesno("cotisation",$adht->cotisation);
|
||||
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td>Droit de vote</td><td>';
|
||||
$htmls->selectyesno("vote",$adht->vote);
|
||||
print '</tr>';
|
||||
|
||||
print '<tr><td valign="top">Commentaires :</td><td>';
|
||||
print "<textarea name=\"comment\" wrap=\"soft\" cols=\"60\" rows=\"3\">".$adht->commentaire."</textarea></td></tr>";
|
||||
|
||||
|
||||
@ -671,4 +671,42 @@ function logfile($str,$log="/var/log/dolibarr/dolibarr.log")
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Fonctions reprise sur spip
|
||||
* http://www.uzine.net/spip/
|
||||
*/
|
||||
function creer_pass_aleatoire($longueur = 8, $sel = "") {
|
||||
$seed = (double) (microtime() + 1) * time();
|
||||
srand($seed);
|
||||
|
||||
for ($i = 0; $i < $longueur; $i++) {
|
||||
if (!$s) {
|
||||
if (!$s) $s = rand();
|
||||
$s = substr(md5(uniqid($s).$sel), 0, 16);
|
||||
}
|
||||
$r = unpack("Cr", pack("H2", $s.$s));
|
||||
$x = $r['r'] & 63;
|
||||
if ($x < 10) $x = chr($x + 48);
|
||||
else if ($x < 36) $x = chr($x + 55);
|
||||
else if ($x < 62) $x = chr($x + 61);
|
||||
else if ($x == 63) $x = '/';
|
||||
else $x = '.';
|
||||
$pass .= $x;
|
||||
$s = substr($s, 2);
|
||||
}
|
||||
return $pass;
|
||||
}
|
||||
|
||||
/*
|
||||
* Fonctions reprise sur spip
|
||||
* http://www.uzine.net/spip/
|
||||
*/
|
||||
|
||||
function initialiser_sel() {
|
||||
global $htsalt;
|
||||
|
||||
$htsalt = '$1$'.creer_pass_aleatoire();
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@ -62,6 +62,13 @@ INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_USE_GLASNOST','0',
|
||||
INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_GLASNOST_SERVEUR','glasnost.j1b.org','chaine','serveur glasnost');
|
||||
INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_GLASNOST_USER','user','chaine','Administrateur glasnost');
|
||||
INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_GLASNOST_PASS','password','chaine','password de l\'administrateur');
|
||||
INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_USE_GLASNOST_AUTO','1','yesno','inscription automatique a glasnost ?');
|
||||
INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_USE_SPIP','1','yesno','Utilisation de SPIP ?');
|
||||
INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_USE_SPIP_AUTO','1','yesno','Utilisation de SPIP automatiquement');
|
||||
INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_SPIP_USER','user','chaine','user spip');
|
||||
INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_SPIP_PASS','pass','chaine','Pass de connection');
|
||||
INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_SPIP_SERVEUR','localhost','chaine','serveur spip');
|
||||
INSERT INTO llx_const (name, value, type, note) VALUES ('MAIN_SPIP_DB','spip','chaine','db spip');
|
||||
|
||||
--
|
||||
-- Constantes
|
||||
|
||||
@ -29,6 +29,7 @@ create table llx_adherent_type
|
||||
statut smallint NOT NULL DEFAULT 0,
|
||||
libelle varchar(50),
|
||||
cotisation enum('yes','no') NOT NULL DEFAULT 'yes',
|
||||
vote enum('yes','no') NOT NULL DEFAULT 'yes',
|
||||
note text,
|
||||
mail_valid text -- mail envoye a la validation
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user