New: Amliorations diverses dans le module adhrent

This commit is contained in:
Laurent Destailleur 2006-11-26 18:24:53 +00:00
parent 0ad1c28898
commit b3175036a8
15 changed files with 418 additions and 248 deletions

View File

@ -337,10 +337,17 @@ class Adherent
$this->error = $langs->trans("ErrorBadEMail",$this->email);
return -1;
}
if (! $this->datec) $this->datec=time();
$this->db->begin();
// Insertion membre
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent (datec,login)";
$sql.= " VALUES (now(),'".$this->login."')";
$sql = "INSERT INTO ".MAIN_DB_PREFIX."adherent";
$sql.= " (datec,login)";
$sql.= " VALUES (";
$sql.= " '".$this->db->idate($this->datec)."',";
$sql.= " '".addslashes($this->login)."'";
$sql.= ")";
dolibarr_syslog("Adherent.class::create sql=".$sql);
$result = $this->db->query($sql);
@ -353,7 +360,12 @@ class Adherent
// Mise a jour
$result=$this->update($user,1);
if ($result < 0)
{
$this->db->rollback();
return -1;
}
// Appel des triggers
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
$interface=new Interfaces($this->db);
@ -361,17 +373,30 @@ class Adherent
if ($result < 0) $error++;
// Fin appel triggers
if ($error)
{
$this->error=$interface->error;
$this->db->rollback();
return -1;
}
else
{
$this->db->commit();
}
return $this->id;
}
else
{
dolibarr_print_error($this->db,'Failed to get last insert id');
$this->error='Failed to get last insert id';
$this->db->rollback();
return -1;
}
}
else
{
$this->error=$this->db->error();
$this->db->rollback();
return -1;
}
}
@ -379,6 +404,7 @@ class Adherent
/**
\brief Fonction qui met à jour l'adhérent
\param user Utilisateur qui réalise la mise a jour
\param notrigger 1=désactive le trigger UPDATE (quand appelé par creation)
\return int <0 si KO, >0 si OK
*/
@ -386,7 +412,7 @@ class Adherent
{
global $conf,$langs;
dolibarr_syslog("Adherent.class::update $notrigger");
dolibarr_syslog("Adherent.class::update user=".$user." notrigger=".$notrigger);
// Verification parametres
if ($conf->global->ADHERENT_MAIL_REQUIRED && ! ValidEMail($this->email))
@ -398,28 +424,29 @@ class Adherent
$this->db->begin();
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
$sql .= " prenom = '".$this->prenom ."'";
$sql .= ",nom='" .$this->nom."'";
$sql .= ",login='" .$this->login."'";
$sql .= ",pass='" .$this->pass."'";
$sql .= ",societe='".$this->societe."'";
$sql .= " prenom = ".($this->prenom?"'".addslashes($this->prenom)."'":"null");
$sql .= ",nom=" .($this->nom?"'".addslashes($this->nom)."'":"null");
$sql .= ",login=" .($this->login?"'".addslashes($this->login)."'":"null");
$sql .= ",pass=" .($this->pass?"'".addslashes($this->pass)."'":"null");
$sql .= ",societe=" .($this->societe?"'".addslashes($this->societe)."'":"null");
$sql .= ",adresse=" .($this->adresse?"'".addslashes($this->adresse)."'":"null");
$sql .= ",cp='" .$this->cp."'";
$sql .= ",ville='" .$this->ville."'";
$sql .= ",pays='" .$this->pays_id."'";
$sql .= ",email='" .$this->email."'";
$sql .= ",cp=" .($this->cp?"'".addslashes($this->cp)."'":"null");
$sql .= ",ville=" .($this->ville?"'".addslashes($this->ville)."'":"null");
$sql .= ",pays=" ."'".$this->pays_id."'";
$sql .= ",email=" ."'".$this->email."'";
$sql .= ",phone=" .($this->phone?"'".addslashes($this->phone)."'":"null");
$sql .= ",phone_perso=" .($this->phone_perso?"'".addslashes($this->phone_perso)."'":"null");
$sql .= ",phone_mobile=" .($this->phone_mobile?"'".addslashes($this->phone_mobile)."'":"null");
$sql .= ",note=" .($this->commentaire?"'".addslashes($this->commentaire)."'":"null");
$sql .= ",photo=" .($this->photo?"'".$this->photo."'":"null");
$sql .= ",public='" .$this->public."'";
$sql .= ",public=" ."'".$this->public."'";
$sql .= ",statut=" .$this->statut;
$sql .= ",fk_adherent_type=".$this->typeid;
$sql .= ",morphy='" .$this->morphy."'";
$sql .= ",morphy=" ."'".$this->morphy."'";
$sql .= ",naiss=" .($this->naiss?"'".$this->db->idate($this->naiss)."'":"null");
if ($this->datefin) $sql .= ",datefin='".$this->db->idate($this->datefin)."'"; // Ne doit etre vidé que par effacement cotisation
if ($this->datefin) $sql .= ",datefin='".$this->db->idate($this->datefin)."'"; // Ne doit etre modifié que par effacement cotisation
if ($this->datevalid) $sql .= ",datevalid='".$this->db->idate($this->datevalid)."'"; // Ne doit etre modifié que par validation adherent
$sql .= " WHERE rowid = ".$this->id;
@ -723,11 +750,11 @@ class Adherent
\param montant Montant cotisation
\param account_id Id compte bancaire
\param operation Type operation (si Id compte bancaire fourni)
\param operation Label operation (si Id compte bancaire fourni)
\param label Label operation (si Id compte bancaire fourni)
\param num_chq Numero cheque (si Id compte bancaire fourni)
\return int rowid de l'entrée ajoutée, <0 si erreur
*/
function cotisation($date, $montant, $accountid, $operation, $label, $num_chq)
function cotisation($date, $montant, $accountid=0, $operation='', $label='', $num_chq='')
{
global $conf,$langs,$user;
@ -800,6 +827,7 @@ class Adherent
include_once(DOL_DOCUMENT_ROOT . "/interfaces.class.php");
$interface=new Interfaces($this->db);
$result=$interface->run_triggers('MEMBER_SUBSCRIPTION',$this,$user,$langs,$conf);
if ($result < 0) $error++;
// Fin appel triggers
$this->db->commit();
@ -1765,5 +1793,61 @@ class Adherent
return $info;
}
/**
* \brief Charge les informations d'ordre info dans l'objet adherent
* \param id Id du membre a charger
*/
function info($id)
{
$sql = 'SELECT a.rowid, '.$this->db->pdate('a.datec').' as datec,';
$sql.= ' '.$this->db->pdate('a.datevalid').' as datev,';
$sql.= ' '.$this->db->pdate('a.tms').' as datem,';
$sql.= ' a.fk_user_author, a.fk_user_valid, a.fk_user_mod';
$sql.= ' FROM '.MAIN_DB_PREFIX.'adherent as a';
$sql.= ' WHERE a.rowid = '.$id;
$result=$this->db->query($sql);
if ($result)
{
if ($this->db->num_rows($result))
{
$obj = $this->db->fetch_object($result);
$this->id = $obj->rowid;
if ($obj->fk_user_author)
{
$cuser = new User($this->db, $obj->fk_user_author);
$cuser->fetch();
$this->user_creation = $cuser;
}
if ($obj->fk_user_valid)
{
$vuser = new User($this->db, $obj->fk_user_valid);
$vuser->fetch();
$this->user_validation = $vuser;
}
if ($obj->fk_user_mod)
{
$muser = new User($this->db, $obj->fk_user_mod);
$muser->fetch();
$this->user_modification = $mluser;
}
$this->date_creation = $obj->datec;
$this->date_validation = $obj->datev;
$this->date_modification = $obj->datem;
}
$this->db->free($result);
}
else
{
dolibarr_print_error($this->db);
}
}
}
?>

View File

@ -435,6 +435,27 @@ class Cotisation
}
}
/**
* \brief Renvoie nom clicable (avec eventuellement le picto)
* \param withpicto 0=Pas de picto, 1=Inclut le picto dans le lien, 2=Picto seul
* \return string Chaine avec URL
*/
function getNomUrl($withpicto=0)
{
global $langs;
$result='';
// $lien = '<a href="'.DOL_URL_ROOT.'/adherents/cotisations.php?rowid='.$this->id.'">';
// $lienfin='</a>';
$picto='payment';
$label=$langs->trans("ShowSubscription");
if ($withpicto) $result.=($lien.img_object($label,$picto).$lienfin);
if ($withpicto && $withpicto != 2) $result.=' ';
$result.=$lien.$this->ref.$lienfin;
return $result;
}
}
?>

View File

@ -29,6 +29,8 @@
*/
require("./pre.inc.php");
require_once(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php");
require_once(DOL_DOCUMENT_ROOT."/adherents/cotisation.class.php");
require_once(DOL_DOCUMENT_ROOT."/compta/bank/account.class.php");
$sortorder=$_GET["sortorder"];
@ -109,10 +111,6 @@ if ($_POST["action"] == '2bank' && $_POST["rowid"] !='')
llxHeader();
$params="&amp;select_date=".$select_date;
print_barre_liste($langs->trans("ListOfSubscriptions"), $page, "cotisations.php", $params, $sortfield, $sortorder,'',$num);
// Liste des cotisations
$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, b.fk_account,";
$sql.= " c.cotisation, ".$db->pdate("c.dateadh")." as dateadh, c.fk_bank as bank, c.rowid as crowid,";
@ -120,11 +118,12 @@ $sql.= " b.fk_account";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."cotisation as c";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."bank as b ON c.fk_bank=b.rowid";
$sql.= " WHERE d.rowid = c.fk_adherent";
if(isset($date_select) && $date_select != '')
if (isset($date_select) && $date_select != '')
{
$sql .= " AND dateadh LIKE '$date_select%'";
$sql.= " AND dateadh LIKE '$date_select%'";
}
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset);
$sql.= " ORDER BY $sortfield $sortorder";
$sql.= $db->plimit($conf->liste_limit+1, $offset);
$result = $db->query($sql);
if ($result)
@ -132,10 +131,15 @@ if ($result)
$num = $db->num_rows($result);
$i = 0;
$param.="&amp;statut=$statut&amp;date_select=$date_select";
print_barre_liste($langs->trans("ListOfSubscriptions"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',$num);
print '<table class="noborder" width="100%">';
$param="&page=$page&statut=$statut&amp;date_select=$date_select";
print '<tr class="liste_titre">';
print_liste_field_titre($langs->trans("Ref"),"cotisations.php","c.rowid",$param,"","",$sortfield);
print_liste_field_titre($langs->trans("Date"),"cotisations.php","c.dateadh",$param,"","",$sortfield);
print_liste_field_titre($langs->trans("Name"),"cotisations.php","d.nom",$param,"","",$sortfield);
print_liste_field_titre($langs->trans("Amount"),"cotisations.php","c.cotisation",$param,"","align=\"right\"",$sortfield);
@ -147,15 +151,24 @@ if ($result)
$var=true;
$total=0;
while ($i < $num)
while ($i < $num && $i < $conf->liste_limit)
{
$objp = $db->fetch_object($result);
$total+=price($objp->cotisation);
$cotisation=new Cotisation($db);
$cotisation->ref=$objp->crowid;
$cotisation->id=$objp->crowid;
$adherent=new Adherent($db);
$adherent->ref=trim($objp->prenom.' '.$objp->nom);
$adherent->id=$objp->rowid;
$var=!$var;
print "<tr $bc[$var]>";
print "<td>".dolibarr_print_date($objp->dateadh)."</td>\n";
print "<td><a href=\"fiche.php?rowid=$objp->rowid&action=edit\">".img_object($langs->trans("ShowMember"),"user").' '.stripslashes($objp->prenom)." ".stripslashes($objp->nom)."</a></td>\n";
print '<td>'.$cotisation->getNomUrl(1).'</td>';
print '<td>'.dolibarr_print_date($objp->dateadh)."</td>\n";
print '<td>'.$adherent->getNomUrl(1).'</td>';
print '<td align="right">'.price($objp->cotisation).'</td>';
if ($conf->global->ADHERENT_BANK_USE)
{
@ -190,6 +203,7 @@ if ($result)
print '<tr class="liste_total">';
print "<td>".$langs->trans("Total")."</td>\n";
print "<td align=\"right\">&nbsp;</td>\n";
print "<td align=\"right\">&nbsp;</td>\n";
print "<td align=\"right\">".price($total)."</td>\n";
if ($conf->global->ADHERENT_BANK_USE)
{

View File

@ -33,6 +33,7 @@ require_once(DOL_DOCUMENT_ROOT."/lib/member.lib.php");
require_once(DOL_DOCUMENT_ROOT."/adherents/adherent.class.php");
require_once(DOL_DOCUMENT_ROOT."/adherents/adherent_type.class.php");
require_once(DOL_DOCUMENT_ROOT."/adherents/adherent_options.class.php");
require_once(DOL_DOCUMENT_ROOT."/adherents/cotisation.class.php");
require_once(DOL_DOCUMENT_ROOT."/compta/bank/account.class.php");
require_once(DOL_DOCUMENT_ROOT."/includes/xmlrpc/xmlrpc.php");
@ -117,71 +118,63 @@ if ($_POST["action"] == 'cotisation')
}
}
if ($_REQUEST["action"] == 'update')
if ($_REQUEST["action"] == 'update' && ! $_POST["cancel"])
{
if ($_POST["bouton"] == $langs->trans("Save"))
$datenaiss='';
if (isset($_POST["naissday"]) && $_POST["naissday"]
&& isset($_POST["naissmonth"])
&& isset($_POST["naissyear"]) && $_POST["naissyear"])
{
$datenaiss='';
if (isset($_POST["naissday"]) && $_POST["naissday"]
&& isset($_POST["naissmonth"])
&& isset($_POST["naissyear"]) && $_POST["naissyear"])
$datenaiss=@mktime(12, 0 , 0, $_POST["naissmonth"], $_POST["naissday"], $_POST["naissyear"]);
}
$adh->id = $_POST["rowid"];
$adh->prenom = $_POST["prenom"];
$adh->nom = $_POST["nom"];
$adh->fullname = trim($adh->prenom.' '.$adh->nom);
$adh->login = $_POST["login"];
$adh->pass = $_POST["pass"];
$adh->societe = $_POST["societe"];
$adh->adresse = $_POST["adresse"];
$adh->cp = $_POST["cp"];
$adh->ville = $_POST["ville"];
$adh->pays_id = $_POST["pays"];
$adh->phone = $_POST["phone"];
$adh->phone_perso = $_POST["phone_perso"];
$adh->phone_mobile= $_POST["phone_mobile"];
$adh->email = $_POST["email"];
$adh->naiss = $datenaiss;
$adh->date = $datenaiss; // A virer
$adh->photo = $_POST["photo"];
$adh->typeid = $_POST["type"];
$adh->commentaire = $_POST["comment"];
$adh->morphy = $_POST["morphy"];
$adh->amount = $_POST["amount"];
// recuperation du statut et public
$adh->statut = $_POST["statut"];
$adh->public = $_POST["public"];
foreach($_POST as $key => $value)
{
if (ereg("^options_",$key))
{
$datenaiss=@mktime(12, 0 , 0, $_POST["naissmonth"], $_POST["naissday"], $_POST["naissyear"]);
}
$adh->id = $_POST["rowid"];
$adh->prenom = $_POST["prenom"];
$adh->nom = $_POST["nom"];
$adh->fullname = trim($adh->prenom.' '.$adh->nom);
$adh->login = $_POST["login"];
$adh->pass = $_POST["pass"];
$adh->societe = $_POST["societe"];
$adh->adresse = $_POST["adresse"];
$adh->cp = $_POST["cp"];
$adh->ville = $_POST["ville"];
$adh->pays_id = $_POST["pays"];
$adh->phone = $_POST["phone"];
$adh->phone_perso = $_POST["phone_perso"];
$adh->phone_mobile= $_POST["phone_mobile"];
$adh->email = $_POST["email"];
$adh->naiss = $datenaiss;
$adh->date = $datenaiss; // A virer
$adh->photo = $_POST["photo"];
$adh->typeid = $_POST["type"];
$adh->commentaire = $_POST["comment"];
$adh->morphy = $_POST["morphy"];
$adh->amount = $_POST["amount"];
// recuperation du statut et public
$adh->statut = $_POST["statut"];
$adh->public = $_POST["public"];
foreach($_POST as $key => $value)
{
if (ereg("^options_",$key))
{
$adh->array_options[$key]=$_POST[$key];
}
}
if ($adh->update($user,0) >= 0)
{
Header("Location: fiche.php?rowid=".$adh->id);
exit;
}
else
{
$errmsg=$adh->error;
$action='';
$adh->array_options[$key]=$_POST[$key];
}
}
if ($adh->update($user,0) >= 0)
{
Header("Location: fiche.php?rowid=".$adh->id);
exit;
}
else
{
Header("Location: fiche.php?rowid=".$rowid);
exit;
$errmsg=$adh->error;
$action='';
}
}
@ -482,17 +475,12 @@ if ($action == 'edit')
$adht = new AdherentType($db);
/*
* Affichage onglets
*/
$h = 0;
$head[$h][0] = DOL_URL_ROOT.'/adherents/fiche.php?rowid='.$rowid;
$head[$h][1] = $langs->trans("Card");
$hselected=$h;
$h++;
dolibarr_fiche_head($head, $hselected, $langs->trans("MemberCard"));
/*
* Affichage onglets
*/
$head = member_prepare_head($adh);
dolibarr_fiche_head($head, 'general', $langs->trans("Member").": ".$adh->fullname);
print '<form name="update" action="'.$_SERVER["PHP_SELF"].'" method="post">';
@ -501,7 +489,6 @@ if ($action == 'edit')
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
print "<input type=\"hidden\" name=\"rowid\" value=\"$rowid\">";
print "<input type=\"hidden\" name=\"statut\" value=\"".$adh->statut."\">";
print "<input type=\"hidden\" name=\"public\" value=\"".$adh->public."\">";
$htmls = new Form($db);
@ -510,13 +497,14 @@ if ($action == 'edit')
// Nom
print '<tr><td>'.$langs->trans("Name").'</td><td><input type="text" name="nom" size="40" value="'.$adh->nom.'"></td>';
// Notes
print '<td valign="top" width="50%">'.$langs->trans("Notes").'</td></tr>';
// Prenom
print '<tr><td width="15%">'.$langs->trans("Firstname").'</td><td width="35%"><input type="text" name="prenom" size="40" value="'.$adh->prenom.'"></td>';
$rowspan=16;
print '<td rowspan="'.$rowspan.'" valign="top">';
print '<textarea name="comment" wrap="soft" cols="40" rows="15">'.$adh->commentaire.'</textarea></td></tr>';
print '<textarea name="comment" wrap="soft" cols="70" rows="16">'.$adh->commentaire.'</textarea></td></tr>';
// Login
print '<tr><td>'.$langs->trans("Login").'</td><td><input type="text" name="login" size="40" value="'.$adh->login.'"></td></tr>';
@ -574,10 +562,18 @@ if ($action == 'edit')
{
print "<tr><td>$value</td><td><input type=\"text\" name=\"options_$key\" size=\"40\" value=\"".$adh->array_options["options_$key"]."\"></td></tr>\n";
}
print '<tr><td colspan="2" align="center">';
print '<input type="submit" class="button" name="bouton" value="'.$langs->trans("Save").'">&nbsp;';
print '<input type="submit" class="button" value="'.$langs->trans("Cancel").'">';
// Profil public
print "<tr><td>".$langs->trans("Public")."</td><td>\n";
$htmls->select_YesNo($adh->public);
print "</td></tr>\n";
print '<tr><td colspan="3" align="center">';
print '<input type="submit" class="button" name="submit" value="'.$langs->trans("Save").'">';
print ' &nbsp; &nbsp; &nbsp; ';
print '<input type="submit" class="button" name="cancel" value="'.$langs->trans("Cancel").'">';
print '</td></tr>';
print '</table>';
print '</form>';
@ -857,7 +853,7 @@ if ($rowid && $action != 'edit')
print '<tr><td>'.$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'*':'').'</td><td class="valeur">'.$adh->email.'&nbsp;</td></tr>';
// Date naissance
print '<tr><td>'.$langs->trans("Birthday").'</td><td class="valeur">'.$adh->naiss.'&nbsp;</td></tr>';
print '<tr><td>'.$langs->trans("Birthday").'</td><td class="valeur">'.dolibarr_print_date($adh->naiss,'day').'&nbsp;</td></tr>';
// URL
print '<tr><td>URL Photo</td><td class="valeur">'.$adh->photo.'&nbsp;</td></tr>';
@ -897,7 +893,7 @@ if ($rowid && $action != 'edit')
// Réactiver
if ($adh->statut == 0)
{
print "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=valid\">".$langs->trans("Restore")."</a>\n";
print "<a class=\"butAction\" href=\"fiche.php?rowid=$rowid&action=valid\">".$langs->trans("Reenable")."</a>\n";
}
// Envoi fiche par mail
@ -972,9 +968,10 @@ if ($rowid && $action != 'edit')
* Liste des cotisations
*
*/
$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, c.cotisation, ".$db->pdate("c.dateadh")." as dateadh";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."cotisation as c";
$sql .= " WHERE d.rowid = c.fk_adherent AND d.rowid=$rowid";
$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe,";
$sql.= " c.rowid as crowid, c.cotisation, ".$db->pdate("c.dateadh")." as dateadh";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."cotisation as c";
$sql.= " WHERE d.rowid = c.fk_adherent AND d.rowid=".$rowid;
$result = $db->query($sql);
if ($result)
@ -985,6 +982,7 @@ if ($rowid && $action != 'edit')
print "<table class=\"noborder\" width=\"100%\">\n";
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Ref").'</td>';
print '<td>'.$langs->trans("DateSubscription").'</td>';
print "<td align=\"right\">".$langs->trans("Amount")."</td>\n";
print "</tr>\n";
@ -995,6 +993,10 @@ if ($rowid && $action != 'edit')
$objp = $db->fetch_object($result);
$var=!$var;
print "<tr $bc[$var]>";
$cotisation=new Cotisation($db);
$cotisation->ref=$objp->crowid;
$cotisation->id=$objp->crowid;
print '<td>'.$cotisation->getNomUrl(1).'</td>';
print "<td>".dolibarr_print_date($objp->dateadh)."</td>\n";
print '<td align="right">'.price($objp->cotisation).'</td>';
print "</tr>";

View File

@ -1,6 +1,7 @@
<?php
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2003 Jean-Louis Bergamo <jlb@j1b.org>
* Copyright (C) 2006 Laurent Destailleur <eldy@users.sourceforge.net>
*
* 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
@ -18,10 +19,10 @@
*
* $Id$
* $Source$
*
*/
/*! \file htdocs/adherents/htpasswd.php
/**
\file htdocs/adherents/htpasswd.php
\ingroup adherent
\brief Page d'export htpasswd du fichier des adherents
\author Rodolphe Quiedeville
@ -34,7 +35,6 @@ llxHeader();
if ($sortorder == "") { $sortorder="ASC"; }
if ($sortfield == "") { $sortfield="d.login"; }
if (! isset($statut))
{
$statut = 1 ;
@ -45,40 +45,44 @@ if (! isset($cotis))
// par defaut les adherents doivent etre a jour de cotisation
$cotis=1;
}
$sql = "SELECT d.login, d.pass, ".$db->pdate("d.datefin")." as datefin";
$sql .= " FROM ".MAIN_DB_PREFIX."adherent as d ";
$sql .= " WHERE d.statut = $statut ";
if ($cotis==1){
$sql .= " AND datefin > now() ";
}
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset);
$result = $db->query($sql);
if ($result)
if ($cotis==1)
{
$num = $db->num_rows();
$i = 0;
print "<BR><DIV class=\"titre\">Export au format htpasswd des login des adhérents</DIV><BR>\n";
//print_barre_liste("Export au format htpasswd des login des adhérents", $page, "htpasswd.php", "");
print "<HR>\n";
while ($i < $num)
{
$objp = $db->fetch_object($result);
$htpass=crypt($objp->pass,makesalt());
print $objp->login.":".$htpass."<BR>\n";
$i++;
}
print "<HR>\n";
$sql .= " AND datefin > now() ";
}
$sql.= " ORDER BY $sortfield $sortorder";
//$sql.=$db->plimit($conf->liste_limit, $offset);
$resql = $db->query($sql);
if ($resql)
{
$num = $db->num_rows($resql);
$i = 0;
print_barre_liste($langs->trans("HTPasswordExport"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder,'',0);
print "<hr>\n";
while ($i < $num)
{
$objp = $db->fetch_object($result);
$htpass=crypt($objp->pass,makesalt());
print $objp->login.":".$htpass."<br>\n";
$i++;
}
print "<hr>\n";
}
else
{
print $sql;
print $db->error();
dolibarr_print_error($db);
}
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
llxFooter('$Date$ - $Revision$');
?>

View File

@ -266,7 +266,7 @@ print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Year").'</td>';
print '<td align="right">'.$langs->trans("Subscriptions").'</td>';
print '<td align="right">'.$langs->trans("Number").'</td>';
print '<td align="right">'.$langs->trans("Average").'</td>';
print '<td align="right">'.$langs->trans("AmountAverage").'</td>';
print "</tr>\n";
$var=true;

View File

@ -57,8 +57,10 @@ $offset = $conf->liste_limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, ".$db->pdate("d.datefin")." as datefin,";
$sql.= " d.email, d.fk_adherent_type as type_id, t.libelle as type, d.morphy, d.statut, t.cotisation";
$sql = "SELECT d.rowid, d.prenom, d.nom, d.societe, ";
$sql.= " ".$db->pdate("d.datefin")." as datefin,";
$sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
$sql.= " t.libelle as type, t.cotisation";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as d, ".MAIN_DB_PREFIX."adherent_type as t";
$sql.= " WHERE d.fk_adherent_type = t.rowid ";
if ($sall)
@ -172,29 +174,32 @@ if ($result)
print "</td>";
// Date fin cotisation
print "<td>";
if ($objp->cotisation == 'yes')
if ($objp->datefin)
{
if ($objp->datefin)
print '<td align="center">';
if ($objp->datefin < time() && $objp->statut > 0)
{
if ($objp->datefin < time() && $objp->statut > 0)
{
print dolibarr_print_date($objp->datefin)." - ".$langs->trans("SubscriptionLate")." ".img_warning()."</td>\n";
}
else
{
print dolibarr_print_date($objp->datefin)."</td>\n";
}
print dolibarr_print_date($objp->datefin)." - ".$langs->trans("SubscriptionLate")." ".img_warning();
}
else {
print $langs->trans("SubscriptionNotReceived");
if ($objp->statut > 0) print " ".img_warning();
print "</td>\n";
else
{
print dolibarr_print_date($objp->datefin);
}
print '</td>';
}
else
{
print "&nbsp;</td>";
print '<td align="left">';
if ($objp->cotisation == 'yes')
{
print $langs->trans("SubscriptionNotReceived");
if ($objp->statut > 0) print " ".img_warning();
}
else
{
print '&nbsp;';
}
print '</td>';
}
// Actions

View File

@ -635,10 +635,10 @@ class MenuLeft {
$newmenu->add_submenu(DOL_URL_ROOT."/compta/bank/index.php?leftmenu=accountancy",$langs->trans("Banks"),0,$user->rights->adherent->lire);
$newmenu->add(DOL_URL_ROOT."/adherents/index.php?leftmenu=export&mainmenu=members",$langs->trans("Exports"),0,$user->rights->adherent->export);
if ($leftmenu=="export") $newmenu->add_submenu(DOL_URL_ROOT."/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->rights->adherent->export);
if ($conf->export->enabled && $leftmenu=="export") $newmenu->add_submenu(DOL_URL_ROOT."/exports/index.php?leftmenu=export",$langs->trans("Datas"),1,$user->rights->adherent->export);
if ($leftmenu=="export") $newmenu->add_submenu(DOL_URL_ROOT."/adherents/htpasswd.php?leftmenu=export",$langs->trans("Filehtpasswd"),1,$user->rights->adherent->export);
if ($leftmenu=="export") $newmenu->add_submenu(DOL_URL_ROOT."/adherents/cartes/carte.php?leftmenu=export",$langs->trans("MembersCards"),1,$user->rights->adherent->export);
if ($leftmenu=="export") $newmenu->add_submenu(DOL_URL_ROOT."/adherents/cartes/etiquette.php?leftmenu=export","Etiquettes d'adhérents",1,$user->rights->adherent->export);
if ($leftmenu=="export") $newmenu->add_submenu(DOL_URL_ROOT."/adherents/cartes/carte.php?leftmenu=export",$langs->trans("MembersCards"),1,$user->rights->adherent->export,'_new');
if ($leftmenu=="export") $newmenu->add_submenu(DOL_URL_ROOT."/adherents/cartes/etiquette.php?leftmenu=export","Etiquettes d'adhérents",1,$user->rights->adherent->export,'_new');
$newmenu->add(DOL_URL_ROOT."/public/adherents/index.php?leftmenu=member_public",$langs->trans("MemberPublicLinks"));
/*
@ -686,7 +686,8 @@ class MenuLeft {
for ($i = 0 ; $i < sizeof($this->menu_array) ; $i++)
{
$alt++;
if ($this->menu_array[$i]['level']==0) {
if ($this->menu_array[$i]['level']==0)
{
if (($alt%2==0))
{
print '<div class="blockvmenuimpair">'."\n";
@ -697,32 +698,44 @@ class MenuLeft {
}
}
if ($this->menu_array[$i]['level']==0) {
if ($this->menu_array[$i]['enabled'])
print '<a class="vmenu" href="'.$this->menu_array[$i]['url'].'">'.$this->menu_array[$i]['titre'].'</a><br>';
else
print '<font class="vmenudisabled">'.$this->menu_array[$i]['titre'].'</font><br>';
}
if ($this->menu_array[$i]['level']==1) {
if ($this->menu_array[$i]['enabled'])
print '<a class="vsmenu" href="'.$this->menu_array[$i]['url'].'">'.$this->menu_array[$i]['titre'].'</a><br>';
else
print '<font class="vsmenudisabled">'.$this->menu_array[$i]['titre'].'</font><br>';
}
if ($this->menu_array[$i]['level']==2) {
if ($this->menu_array[$i]['enabled'])
print '&nbsp; &nbsp; <a class="vsmenu" href="'.$this->menu_array[$i]['url'].'">'.$this->menu_array[$i]['titre'].'</a><br>';
else
print '&nbsp; &nbsp; <font class="vsmenudisabled">'.$this->menu_array[$i]['titre'].'</font><br>';
}
if ($this->menu_array[$i]['level']==3) {
if ($this->menu_array[$i]['enabled'])
print '&nbsp; &nbsp; &nbsp; &nbsp; <a class="vsmenu" href="'.$this->menu_array[$i]['url'].'">'.$this->menu_array[$i]['titre'].'</a><br>';
else
print '&nbsp; &nbsp; &nbsp; &nbsp; <font class="vsmenudisabled">'.$this->menu_array[$i]['titre'].'</font><br>';
}
// Place tabulation
$tabul=($this->menu_array[$i]['level'] - 1);
if ($tabul > 0)
{
for ($j=0; $j < $tabul; $j++)
{
print '&nbsp; &nbsp; ';
}
}
if ($i == (sizeof($this->menu_array)-1) || $this->menu_array[$i+1]['level']==0) {
// Menu niveau 0
if ($this->menu_array[$i]['level'] == 0)
{
if ($this->menu_array[$i]['enabled'])
{
print '<a class="vmenu" href="'.$this->menu_array[$i]['url'].'"'.($this->menu_array[$i]['target']?' target="'.$this->menu_array[$i]['target'].'"':'').'>'.$this->menu_array[$i]['titre'].'</a><br>';
}
else
{
print '<font class="vmenudisabled">'.$this->menu_array[$i]['titre'].'</font><br>';
}
}
// Menu niveau > 0
if ($this->menu_array[$i]['level'] > 0)
{
if ($this->menu_array[$i]['enabled'])
{
print '<a class="vsmenu" href="'.$this->menu_array[$i]['url'].'"'.($this->menu_array[$i]['target']?' target="'.$this->menu_array[$i]['target'].'"':'').'>'.$this->menu_array[$i]['titre'].'</a><br>';
}
else
{
print '<font class="vsmenudisabled">'.$this->menu_array[$i]['titre'].'</font><br>';
}
}
if ($i == (sizeof($this->menu_array)-1) || $this->menu_array[$i+1]['level']==0)
{
print "</div>\n";
}
}

View File

@ -154,151 +154,151 @@ class InterfaceDemo
// Products
elseif ($action == 'PRODUCT_CREATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'PRODUCT_MODIFY')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'PRODUCT_DELETE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
// Customer orders
elseif ($action == 'ORDER_CREATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'ORDER_VALIDATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'ORDER_DELETE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
// Supplier orders
elseif ($action == 'ORDER_SUPPLIER_CREATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'ORDER_SUPPLIER_VALIDATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
// Proposals
elseif ($action == 'PROPAL_CREATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'PROPAL_MODIFY')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'PROPAL_VALIDATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'PROPAL_CLOSE_SIGNED')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'PROPAL_CLOSE_REFUSED')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
// Contracts
elseif ($action == 'CONTRACT_CREATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'CONTRACT_MODIFY')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'CONTRACT_ACTIVATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'CONTRACT_CANCEL')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'CONTRACT_CLOSE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'CONTRACT_DELETE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
// Bills
elseif ($action == 'BILL_CREATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'BILL_MODIFY')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'BILL_VALIDATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'BILL_CANCEL')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'BILL_DELETE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
// Payments
elseif ($action == 'PAYMENT_CUSTOMER_CREATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'PAYMENT_SUPPLIER_CREATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
// Interventions
elseif ($action == 'FICHEINTER_VALIDATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
// Members
elseif ($action == 'MEMBER_CREATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'MEMBER_VALIDATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'MEMBER_SUBSCRIPTION')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'MEMBER_MODIFY')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'MEMBER_RESILIATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
elseif ($action == 'MEMBER_DELETE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched");
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
}
return 0;

View File

@ -113,7 +113,7 @@ class InterfaceLdap
$info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info);
$ldap->add($dn,$info,$user);
return $ldap->add($dn,$info,$user);
}
}
elseif ($action == 'USER_MODIFY')
@ -127,7 +127,7 @@ class InterfaceLdap
$info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info);
$ldap->update($dn,$info,$user);
return $ldap->update($dn,$info,$user);
}
}
elseif ($action == 'USER_NEW_PASSWORD')
@ -149,7 +149,7 @@ class InterfaceLdap
$info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info);
$ldap->delete($dn,$info,$user);
return $ldap->delete($dn,$info,$user);
}
}
@ -164,7 +164,7 @@ class InterfaceLdap
$info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info);
$ldap->add($dn,$info,$user);
return $ldap->add($dn,$info,$user);
}
}
elseif ($action == 'GROUP_MODIFY')
@ -177,7 +177,7 @@ class InterfaceLdap
$info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info);
$ldap->update($dn,$info,$user);
return $ldap->update($dn,$info,$user);
}
}
elseif ($action == 'GROUP_DELETE')
@ -190,7 +190,7 @@ class InterfaceLdap
$info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info);
$ldap->delete($dn,$info,$user);
return $ldap->delete($dn,$info,$user);
}
}
@ -206,7 +206,7 @@ class InterfaceLdap
$info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info);
$ldap->add($dn,$info,$user);
return $ldap->add($dn,$info,$user);
}
}
elseif ($action == 'CONTACT_MODIFY')
@ -220,7 +220,7 @@ class InterfaceLdap
$info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info);
$ldap->update($dn,$info,$user);
return $ldap->update($dn,$info,$user);
}
}
elseif ($action == 'CONTACT_DELETE')
@ -234,7 +234,7 @@ class InterfaceLdap
$info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info);
$ldap->delete($dn,$info,$user);
return $ldap->delete($dn,$info,$user);
}
}
@ -246,19 +246,26 @@ class InterfaceLdap
{
$ldap=new Ldap();
$ldap->connect_bind();
$info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info);
$ldap->add($dn,$info,$user);
return $ldap->add($dn,$info,$user);
}
}
elseif ($action == 'MEMBER_VALIDATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE)
{
}
}
elseif ($action == 'MEMBER_SUBSCRIPTION')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE)
{
}
}
elseif ($action == 'MEMBER_MODIFY')
{
@ -271,12 +278,15 @@ class InterfaceLdap
$info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info);
$ldap->update($dn,$info,$user);
return $ldap->update($dn,$info,$user);
}
}
elseif ($action == 'MEMBER_RESILIATE')
{
dolibarr_syslog("Trigger '".$this->name."' for action '$action' launched by ".__FILE__.". id=".$object->id);
if ($conf->ldap->enabled && $conf->global->LDAP_MEMBER_ACTIVE)
{
}
}
elseif ($action == 'MEMBER_DELETE')
{
@ -289,7 +299,7 @@ class InterfaceLdap
$info=$object->_load_ldap_info();
$dn=$object->_load_ldap_dn($info);
$ldap->delete($dn,$info,$user);
return $ldap->delete($dn,$info,$user);
}
}

View File

@ -478,7 +478,9 @@ function dolibarr_print_ca($ca)
*/
function dolibarr_time_plus_duree($time,$duration_value,$duration_unit)
{
$deltastring="+$duration_value";
if ($duration_value == 0) return $time;
if ($duration_value > 0) $deltastring="+".abs($duration_value);
if ($duration_value < 0) $deltastring="-".abs($duration_value);
if ($duration_unit == 'd') { $deltastring.=" day"; }
if ($duration_unit == 'm') { $deltastring.=" month"; }
if ($duration_unit == 'y') { $deltastring.=" year"; }

View File

@ -50,6 +50,11 @@ function member_prepare_head($member)
$h++;
}
$head[$h][0] = DOL_URL_ROOT.'/adherents/info.php?id='.$member->id;
$head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info';
$h++;
return $head;
}

View File

@ -635,7 +635,7 @@ function llxFooter($foot='',$limitIEbug=1)
global $conf, $dolibarr_auto_user, $micro_start_time;
print "\n</div>\n".'<!-- end div class="fiche" -->'."\n";
print "\n</div>\n".'<!-- end div class="vmenuplusfiche" -->';
print "\n</div>\n".'<!-- end div class="vmenuplusfiche" -->'."\n";
if (isset($_SERVER['DOL_TUNING']))
{

View File

@ -18,7 +18,6 @@
*
* $Id$
* $Source$
*
*/
/**
@ -60,14 +59,16 @@ class Menu {
* \param titre Libelle menu à afficher
* \param level Niveau du menu à ajouter
* \param enabled Menu actif ou non
* \param target Target lien
*/
function add($url, $titre, $level=0, $enabled=1)
function add($url, $titre, $level=0, $enabled=1, $target='')
{
$i = sizeof($this->liste);
$this->liste[$i]['url'] = $url;
$this->liste[$i]['titre'] = $titre;
$this->liste[$i]['level'] = $level;
$this->liste[$i]['enabled'] = $enabled;
$this->liste[$i]['target'] = $target;
}
/**
@ -76,11 +77,12 @@ class Menu {
* \param titre Libelle menu à afficher
* \param level Niveau du menu à ajouter
* \param enabled Menu actif ou non
* \param target Target lien
*/
function add_submenu($url, $titre, $level=1, $enabled=1)
function add_submenu($url, $titre, $level=1, $enabled=1, $target='')
{
$i = sizeof($this->liste) - 1;
$this->add($url, $titre, $level, $enabled);
$this->add($url, $titre, $level, $enabled, $target);
}
}

View File

@ -54,10 +54,11 @@ require_once(DOL_DOCUMENT_ROOT."/adherents/cotisation.class.php");
$error=0;
print "***** $script_file ($version) *****\n";
if ($argv[2]) $conf->global->LDAP_SERVER_HOST=$argv[2];
if ($argv[2]) $conf->global->LDAP_SERVER_HOST=$argv[2];
if ($argv[2]) $conf->global->LDAP_SERVER_HOST=$argv[2];
print "***** $script_file ($version) *****\n";
print 'DN='.$conf->global->LDAP_MEMBER_DN."\n";
print 'Filter=('.$conf->global->LDAP_KEY_MEMBERS.'=*)'."\n";
/*
if (! $conf->global->LDAP_MEMBER_ACTIVE)
@ -100,15 +101,19 @@ else
exit;
}
$ldap = new Ldap();
$result = $ldap->connect_bind();
if ($result >= 0)
{
$justthese=array();
print 'DN='.$conf->global->LDAP_MEMBER_DN."\n";
print 'Filter=('.$conf->global->LDAP_KEY_MEMBERS.'=*)'."\n";
// On désactive la synchro Dolibarr vers LDAP
$conf->global->LDAP_MEMBER_ACTIVE=0;
$ldaprecords = $ldap->search($conf->global->LDAP_MEMBER_DN, '('.$conf->global->LDAP_KEY_MEMBERS.'=*)');
if (is_array($ldaprecords))
{
@ -142,22 +147,24 @@ if ($result >= 0)
$member->commentaire=$ldapuser[$conf->global->LDAP_FIELD_DESCRIPTION][0];
$member->morphy='phy';
//$member->photo;
$member->photo='';
$member->public=1;
$member->statut=-1; // Par defaut, statut brouillon
$member->naiss=dolibarr_mktime($ldapuser[$conf->global->LDAP_FIELD_BIRTHDATE][0]);
// Cas particulier (on ne rentre jamais dans ce if)
if (isset($ldapuser["prnxstatus"][0]))
{
$member->datec=dolibarr_mktime($ldapuser["prnxfirtscontribution"][0]);
$member->datevalid=dolibarr_mktime($ldapuser["prnxfirtscontribution"][0]);
if ($ldapuser["prnxstatus"][0]==1)
{
$member->statut=1;
$member->datev=time();
}
else
{
$member->statut=0;
}
}
$member->naiss=dolibarr_mktime($ldapuser[$conf->global->LDAP_FIELD_BIRTHDATE][0]);
// Propriete type membre
$member->typeid=$typeid;
@ -187,13 +194,14 @@ if ($result >= 0)
$datelast=dolibarr_mktime($ldapuser["prnxlastcontribution"][0]);
if ($datefirst)
{
$crowid=$member->cotisation($datefirst, 0, 0, $operation, $label, $num_chq);
$crowid=$member->cotisation($datefirst, 0, 0);
}
if ($datelast)
{
// Cree derniere cotisation et met a jour datefin dans adherent
$price=price2num($ldapuser["prnxlastcontributionprice"][0]);
$crowid=$member->cotisation(dolibarr_time_plus_duree($datelast,-1,'y'), $price, 0, $operation, $label, $num_chq);
//print "xx".$datelast."-".dolibarr_time_plus_duree($datelast,-1,'y')."\n";
$crowid=$member->cotisation(dolibarr_time_plus_duree($datelast,-1,'y'), $price, 0);
}
//----------------------------