* Copyright (C) 2002-2003 Jean-Louis Bergamo * Copyright (C) 2004-2008 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, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /** \file htdocs/adherents/fiche.php \ingroup adherent \brief Page d'ajout, edition, suppression d'une fiche adherent \version $Id$ */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/member.lib.php"); require_once(DOL_DOCUMENT_ROOT."/lib/company.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"); $langs->load("companies"); $langs->load("bills"); $langs->load("members"); $langs->load("users"); // Defini si peux creer un utilisateur ou gerer groupe sur un utilisateur $canadduser=$user->rights->adherent->creer; // Defini si peux lire/modifier info user ou mot de passe if ($_GET["rowid"]) { $caneditfield=$user->rights->adherent->creer; $caneditpassword=$user->rights->adherent->creer; } if (! $user->rights->adherent->lire) { accessforbidden(); } $adh = new Adherent($db); $adho = new AdherentOptions($db); $errmsg=''; $action=isset($_GET["action"])?$_GET["action"]:$_POST["action"]; $rowid=isset($_GET["rowid"])?$_GET["rowid"]:$_POST["rowid"]; $typeid=isset($_GET["typeid"])?$_GET["typeid"]:$_POST["typeid"]; /* * Actions */ // Creation utilisateur depuis adherent if ($user->rights->user->user->creer) { if ($_GET["action"] == 'create_user') { // Recuperation contact actuel $adh = new Adherent($db); $result = $adh->fetch($_GET["rowid"]); if ($result > 0) { // Creation user $nuser = new User($db); $result=$nuser->create_from_member($adh); if ($result < 0) { $msg=$nuser->error; } } else { $msg=$adh->error; } } } if ($_POST["action"] == 'confirm_sendinfo' && $_POST["confirm"] == 'yes') { $adh->id = $rowid; $adh->fetch($rowid); if ($adh->email) { $result=$adh->send_an_email("Voici le contenu de votre fiche\n\n%INFOS%\n\n","Contenu de votre fiche adherent"); } } if ($_REQUEST["action"] == 'update' && ! $_POST["cancel"]) { $result=$adh->fetch($_POST["rowid"]); // If change (allowed on all members) or (allowed on myself and i am edited memeber) if ($user->rights->adherent->creer || ($user->rights->adherent->self->creer && $adh->user_id == $user->id)) { $datenaiss=''; if (isset($_POST["naissday"]) && $_POST["naissday"] && isset($_POST["naissmonth"]) && $_POST["naissmonth"] && isset($_POST["naissyear"]) && $_POST["naissyear"]) { $datenaiss=dolibarr_mktime(12, 0, 0, $_POST["naissmonth"], $_POST["naissday"], $_POST["naissyear"]); } //print $_POST["naissmonth"].", ".$_POST["naissday"].", ".$_POST["naissyear"]." ".$datenaiss." ".adodb_strftime('%Y-%m-%d %H:%M:%S',$datenaiss); // Charge objet actuel if ($result > 0) { // Modifie valeures $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->typeid = $_POST["type"]; $adh->note = $_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)) { //escape values from POST, at least with addslashes, to avoid obvious SQL injections //(array_options is directly input in the DB in adherent.class.php::update()) $adh->array_options[$key]=addslashes($_POST[$key]); } } $result=$adh->update($user,0); if ($result >= 0 && ! sizeof($adh->errors)) { if (isset($_FILES['photo']['tmp_name']) && trim($_FILES['photo']['tmp_name'])) { // If photo is provided if (! is_dir($conf->adherent->dir_output)) { create_exdir($conf->adherent->dir_output); } if (is_dir($conf->adherent->dir_output)) { $newfile=$conf->adherent->dir_output . "/" . $adh->id . ".jpg"; if (! dol_move_uploaded_file($_FILES['photo']['tmp_name'],$newfile,1) > 0) { $message .= '
'.$langs->trans("ErrorFailedToSaveFile").'
'; } } } $_GET["rowid"]=$adh->id; $_REQUEST["action"]=''; } else { if ($adh->error) { $errmsg=$adh->error; } else { foreach($adh->errors as $error) { if ($errmsg) $errmsg.='
'; $errmsg.=$error; } } $action=''; } } } } if ($user->rights->adherent->creer && $_POST["action"] == 'add') { $datenaiss=''; if (isset($_POST["naissday"]) && $_POST["naissday"] && isset($_POST["naissmonth"]) && $_POST["naissmonth"] && isset($_POST["naissyear"]) && $_POST["naissyear"]) { $datenaiss=dolibarr_mktime(12, 0, 0, $_POST["naissmonth"], $_POST["naissday"], $_POST["naissyear"]); } $datecotisation=''; if (isset($_POST["reday"]) && isset($_POST["remonth"]) && isset($_POST["reyear"])) { $datecotisation=dolibarr_mktime(12, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); } $type=$_POST["type"]; $nom=$_POST["nom"]; $prenom=$_POST["prenom"]; $societe=$_POST["societe"]; $adresse=$_POST["adresse"]; $cp=$_POST["cp"]; $ville=$_POST["ville"]; $pays_id=$_POST["pays_id"]; $phone=$_POST["phone"]; $phone_perso=$_POST["phone_perso"]; $phone_mobile=$_POST["phone_mobile"]; $email=$_POST["member_email"]; $login=$_POST["member_login"]; $pass=$_POST["password"]; $photo=$_POST["photo"]; $comment=$_POST["comment"]; $morphy=$_POST["morphy"]; $cotisation=$_POST["cotisation"]; $adh->prenom = $prenom; $adh->nom = $nom; $adh->societe = $societe; $adh->adresse = $adresse; $adh->cp = $cp; $adh->ville = $ville; $adh->pays_id = $pays_id; $adh->phone = $phone; $adh->phone_perso = $phone_perso; $adh->phone_mobile= $phone_mobile; $adh->email = $email; $adh->login = $login; $adh->pass = $pass; $adh->naiss = $datenaiss; $adh->photo = $photo; $adh->typeid = $type; $adh->note = $comment; $adh->morphy = $morphy; foreach($_POST as $key => $value){ if (ereg("^options_",$key)){ //escape values from POST, at least with addslashes, to avoid obvious SQL injections //(array_options is directly input in the DB in adherent.class.php::update()) $adh->array_options[$key]=addslashes($_POST[$key]); } } // Test validite des parametres if(!isset($type) || $type==''){ $error++; $errmsg .= $langs->trans("ErrorMemberTypeNotDefined")."
\n"; } // Test si le login existe deja if(!isset($login) || $login==''){ $error++; $errmsg .= $langs->trans("ErrorFieldRequired",$langs->trans("Login"))."
\n"; } else { $sql = "SELECT login FROM ".MAIN_DB_PREFIX."adherent WHERE login='".$login."'"; $result = $db->query($sql); if ($result) { $num = $db->num_rows($result); } if ($num) { $error++; $errmsg .= $langs->trans("ErrorLoginAlreadyExists",$login)."
\n"; } } if (!isset($nom) || $nom=='') { $error++; $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Lastname"))."
\n"; } if ($morphy != 'mor' && (!isset($prenom) || $prenom=='')) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Firstname"))."
\n"; } if ($conf->global->ADHERENT_MAIL_REQUIRED && ! ValidEMail($email)) { $error++; $errmsg .= $langs->trans("ErrorBadEMail",$email)."
\n"; } if (!isset($pass) || $pass == '' ) { $error++; $errmsg .= $langs->trans("ErrorFieldRequired",$langs->transnoentities("Password"))."
\n"; } $public=0; if (isset($public)) $public=1; if (! $error) { $db->begin(); // Email a peu pres correct et le login n'existe pas $result=$adh->create($user); if ($result > 0) { if ($cotisation > 0) { $crowid=$adh->cotisation($datecotisation, $cotisation); // insertion dans la gestion banquaire si configure pour if ($global->conf->ADHERENT_BANK_USE) { $dateop=time(); $amount=$cotisation; $acct=new Account($db,$_POST["accountid"]); $insertid=$acct->addline($dateop, $_POST["operation"], $_POST["label"], $amount, $_POST["num_chq"], '', $user); if ($insertid == '') { dolibarr_print_error($db); } else { // met a jour la table cotisation $sql ="UPDATE ".MAIN_DB_PREFIX."cotisation"; $sql.=" SET fk_bank=$insertid WHERE rowid=$crowid "; $result = $db->query($sql); if ($result) { //Header("Location: fiche.php"); } else { dolibarr_print_error($db); } } } } $db->commit(); Header("Location: liste.php?statut=-1"); exit; } else { $db->rollback(); if ($adh->error) $errmsg=$adh->error; else $errmsg=$adh->errors[0]; $action = 'create'; } } else { $action = 'create'; } } if ($user->rights->adherent->supprimer && $_POST["action"] == 'confirm_delete' && $_POST["confirm"] == 'yes') { $result=$adh->fetch($rowid); $result=$adh->delete($rowid); if ($result > 0) { Header("Location: liste.php"); exit; } else { $mesg=$adh->error; } } if ($user->rights->adherent->creer && $_POST["action"] == 'confirm_valid' && $_POST["confirm"] == 'yes') { $result=$adh->fetch($rowid); $result=$adh->validate($user); $adht = new AdherentType($db); $adht->fetch($adh->typeid); if ($result >= 0 && ! sizeof($adh->errors)) { // Envoi mail validation (selon param du type adherent sinon generique) if ($adh->email && $_POST["send_mail"]) { if (isset($adht->mail_valid) && $adht->mail_valid) { $result=$adh->send_an_email($adht->mail_valid,$conf->global->ADHERENT_MAIL_VALID_SUBJECT,array(),array(),array(),"","",0,2); } else { $result=$adh->send_an_email($conf->global->ADHERENT_MAIL_VALID,$conf->global->ADHERENT_MAIL_VALID_SUBJECT,array(),array(),array(),"","",0,2); } if ($result < 0) { $errmsg.=$adh->error; } } // Rajoute l'utilisateur dans les divers abonnements (mailman, spip, etc...) if ($adh->add_to_abo($adht) < 0) { // error $errmsg.="Echec du rajout de l'utilisateur aux abonnements mailman: ".$adh->error."
\n"; } } else { // \TODO Mettre fonction qui fabrique errmsg depuis this->error||this->errors if ($adh->error) { $errmsg=$adh->error; } else { foreach($adh->errors as $error) { if ($errmsg) $errmsg.='
'; $errmsg.=$error; } } $action=''; } } if ($user->rights->adherent->supprimer && $_POST["action"] == 'confirm_resign' && $_POST["confirm"] == 'yes') { $result=$adh->fetch($rowid); $result=$adh->resiliate($user); $adht = new AdherentType($db); $adht->fetch($adh->typeid); if ($result >= 0 && ! sizeof($adh->errors)) { if ($adh->email && $_POST["send_mail"]) { $result=$adh->send_an_email($conf->global->ADHERENT_MAIL_RESIL,$conf->global->ADHERENT_MAIL_RESIL_SUBJECT,array(),array(),array(),"","",0,-1); } if ($result < 0) { $errmsg.=$adh->error; } // supprime l'utilisateur des divers abonnements .. if (! $adh->del_to_abo($adht)) { // error $errmsg.="Echec de la suppression de l'utilisateur aux abonnements mailman: ".$adh->error."
\n"; } } else { // \TODO Mettre fonction qui fabrique errmsg depuis this->error||this->errors if ($adh->error) { $errmsg=$adh->error; } else { foreach($adh->errors as $error) { if ($errmsg) $errmsg.='
'; $errmsg.=$error; } } $action=''; } } if ($user->rights->adherent->supprimer && $_POST["action"] == 'confirm_del_spip' && $_POST["confirm"] == 'yes') { $result=$adh->fetch($rowid); if ($result >= 0 && ! sizeof($adh->errors)) { if(!$adh->del_to_spip()){ $errmsg.="Echec de la suppression de l'utilisateur dans spip: ".$adh->error."
\n"; } } } if ($user->rights->adherent->creer && $_POST["action"] == 'confirm_add_spip' && $_POST["confirm"] == 'yes') { $result=$adh->fetch($rowid); if ($result >= 0 && ! sizeof($adh->errors)) { if (!$adh->add_to_spip()) { $errmsg.="Echec du rajout de l'utilisateur dans spip: ".$adh->error."
\n"; } } } /* * */ llxHeader(); if ($errmsg) { print '
'.$errmsg.'
'; print "\n"; } // fetch optionals attributes and labels $adho->fetch_optionals(); if ($action == 'edit') { /******************************************** * * Fiche en mode edition * ********************************************/ $adho = new AdherentOptions($db); $adh = new Adherent($db); $adh->id = $rowid; $adh->fetch($rowid); // fetch optionals value $adh->fetch_optionals($rowid); // fetch optionals attributes and labels $adho->fetch_optionals(); $adht = new AdherentType($db); $adht->fetch($adh->typeid); /* * Affichage onglets */ $head = member_prepare_head($adh); dolibarr_fiche_head($head, 'general', $langs->trans("Member")); print '
'; print ""; print ""; print "statut."\">"; $htmls = new Form($db); print ''; // Ref print ''; // Nom print ''; // Photo $rowspan=16; $rowspan+=sizeof($adho->attribute_label); print ''; print ''; // Prenom print ''; print ''; // Login print ''; // Password print ''; // Type print '"; // Physique-Moral $morphys["phy"] = $langs->trans("Physical"); $morphys["mor"] = $langs->trans("Morale"); print ""; // Societe print ''; // Adresse print ''; // Cp print ''; // Pays print ''; // Tel print ''; // Tel perso print ''; // Tel mobile print ''; // EMail print ''; // Date naissance print "\n"; // Profil public print "\n"; // Attributs supplementaires foreach($adho->attribute_label as $key=>$value) { print "\n"; } print ''; print '
'.$langs->trans("Ref").''.$adh->id.' 
'.$langs->trans("Lastname").'*'; if (file_exists($conf->adherent->dir_output."/".$adh->id.".jpg")) { print ''; } else { print ''; } if ($caneditfield) { print '

'; print '
'.$langs->trans("PhotoFile").'
'; print ''; print '
'; } print '
'.$langs->trans("Firstname").'*
'.$langs->trans("Login").'*
'.$langs->trans("Password").'*
'.$langs->trans("Type").'*'; if ($user->rights->adherent->creer) // If $user->rights->adherent->self->creer, we do not allow. { $htmls->select_array("type", $adht->liste_array(), $adh->typeid); } else { print $adht->getNomUrl(1); print ''; } print "
".$langs->trans("Person")."*"; $htmls->select_array("morphy", $morphys, $adh->morphy); print "
'.$langs->trans("Company").'
'.$langs->trans("Address").''; print '
'.$langs->trans("Zip").'/'.$langs->trans("Town").'
'.$langs->trans("Country").''; $htmls->select_pays($adh->pays_code?$adh->pays_code:$mysoc->pays_code,'pays'); print '
'.$langs->trans("PhonePro").'
'.$langs->trans("PhonePerso").'
'.$langs->trans("PhoneMobile").'
'.$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'*':'').'
".$langs->trans("Birthday")."\n"; $htmls->select_date(($adh->naiss ? $adh->naiss : -1),'naiss','','',1,'update'); print "
".$langs->trans("Public")."\n"; print $htmls->selectyesno("public",$adh->public,1); print "
$valuearray_options["options_$key"]."\">
'; print ''; print '       '; print ''; print '
'; print '
'; print ''; } if ($action == 'create') { /* ************************************************************************** */ /* */ /* Fiche creation */ /* */ /* ************************************************************************** */ $htmls = new Form($db); $adht = new AdherentType($db); print_titre($langs->trans("NewMember")); print '
'; print ''; print ''; // Nom print ''; print ''; // Prenom print ''; print ''; // Login print ''; // Mot de passe $generated_password=''; if ($conf->global->USER_PASSWORD_GENERATED) { $nomclass="modGeneratePass".ucfirst($conf->global->USER_PASSWORD_GENERATED); $nomfichier=$nomclass.".class.php"; //print DOL_DOCUMENT_ROOT."/includes/modules/security/generate/".$nomclass; require_once(DOL_DOCUMENT_ROOT."/includes/modules/security/generate/".$nomfichier); $genhandler=new $nomclass($db,$conf,$langs,$user); $generated_password=$genhandler->getNewGeneratedPassword(); } print ''; // Type print '\n"; // Moral-Physique $morphys["phy"] = "Physique"; $morphys["mor"] = "Morale"; print "\n"; print ''; // Adresse print ''; // CP / Ville print ''; // Pays print ''; // Tel pro print ''; // Tel perso print ''; // Tel mobile print ''; // EMail print ''; // Date naissance print "\n"; // Attribut optionnels foreach($adho->attribute_label as $key=>$value) { print "\n"; } // Profil public print "\n"; print "
'.$langs->trans("Lastname").'*
'.$langs->trans("Firstname").'*
'.$langs->trans("Login").'*
'.$langs->trans("Password").'*'; print ''; print '
'.$langs->trans("MemberType").'*'; $listetype=$adht->liste_array(); if (sizeof($listetype)) { $htmls->select_array("type", $listetype, $typeid); } else { print ''.$langs->trans("NoTypeDefinedGoToSetup").''; } print "
".$langs->trans("Person")."*\n"; $htmls->select_array("morphy", $morphys, $adh->morphy); print "
'.$langs->trans("Company").'
'.$langs->trans("Address").''; print '
'.$langs->trans("Zip").' / '.$langs->trans("Town").'
'.$langs->trans("Country").''; $htmls->select_pays($adh->pays_id ? $adh->pays_id : $mysoc->pays_id,'pays_id'); print '
'.$langs->trans("PhonePro").'
'.$langs->trans("PhonePerso").'
'.$langs->trans("PhoneMobile").'
'.$langs->trans("EMail").($conf->global->ADHERENT_MAIL_REQUIRED?'*':'').'
".$langs->trans("Birthday")."\n"; $htmls->select_date(($adh->naiss ? $adh->naiss : -1),'naiss','','',1,'add'); print "
$value
".$langs->trans("Public")."\n"; print $htmls->selectyesno("public",$adh->public,1); print "
\n"; print '
'; print '
'; print "
\n"; } if ($rowid && $action != 'edit') { /* ************************************************************************** */ /* */ /* Mode affichage */ /* */ /* ************************************************************************** */ $adh = new Adherent($db); $adh->id = $rowid; $adh->fetch($rowid); $adh->fetch_optionals($rowid); $adht = new AdherentType($db); $adht->fetch($adh->typeid); $html = new Form($db); /* * Affichage onglets */ $head = member_prepare_head($adh); dolibarr_fiche_head($head, 'general', $langs->trans("Member")); if ($msg) print '
'.$msg.'
'; // Confirmation de la suppression de l'adherent if ($action == 'delete') { $html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("DeleteMember"),$langs->trans("ConfirmDeleteMember"),"confirm_delete"); print '
'; } // Confirmation de la validation if ($action == 'valid') { // Cree un tableau formulaire $formquestion=array(); if ($adh->email) $formquestion[0]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $langs->trans("SendAnEMailToMember",$adh->email), 'value' => 'true'); $html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("ValidateMember"),$langs->trans("ConfirmValidateMember"),"confirm_valid",$formquestion); print '
'; } // Confirmation de l'envoi fiche par mail if ($action == 'sendinfo') { $html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("SendCardByMail"),$langs->trans("ConfirmSendCardByMail"),"confirm_sendinfo"); print '
'; } // Confirmation de la Resiliation if ($action == 'resign') { // Cree un tableau formulaire $formquestion=array(); if ($adh->email) $formquestion[0]=array('type' => 'checkbox', 'name' => 'send_mail', 'label' => $langs->trans("SendAnEMailToMember",$adh->email), 'value' => 'false'); $html->form_confirm("fiche.php?rowid=$rowid",$langs->trans("ResiliateMember"),$langs->trans("ConfirmResiliateMember"),"confirm_resign",$formquestion); print '
'; } /* * Confirmation de l'ajout dans spip */ if ($action == 'add_spip') { $html->form_confirm("fiche.php?rowid=$rowid","Ajouter dans spip","Etes-vous sur de vouloir ajouter cet adherent dans spip ? (serveur : ".ADHERENT_SPIP_SERVEUR.")","confirm_add_spip"); print '
'; } /* * Confirmation de la suppression dans spip */ if ($action == 'del_spip') { $html->form_confirm("fiche.php?rowid=$rowid","Supprimer dans spip","Etes-vous sur de vouloir effacer cet adherent dans spip ? (serveur : ".ADHERENT_SPIP_SERVEUR.")","confirm_del_spip"); print '
'; } print '
'; print ''; // Ref print ''; print ''; // Nom print ''; print ''; // Prenom print ''; // Login print ''; $rowspan=16+sizeof($adho->attribute_label); print ''; print ''; // Password print ''; // Type print '\n"; // Morphy print ''; // Tiers print ''; // Adresse print ''; // CP / Ville print ''; // Pays print ''; // Tel pro. print ''; // Tel perso print ''; // Tel mobile print ''; // EMail print ''; // Date naissance print ''; // Public print ''; // Status print ''; // Login Dolibarr print ''; // Autres attributs foreach($adho->attribute_label as $key=>$value) { print "\n"; } print "
'.$langs->trans("Ref").''; print $html->showrefnav($adh,'rowid'); print '
'.$langs->trans("Lastname").''.$adh->nom.' 
'.$langs->trans("Firstname").''.$adh->prenom.' 
'.$langs->trans("Login").''.$adh->login.' '; if (file_exists($conf->adherent->dir_output."/".$adh->id.".jpg")) { print ''; } else { print ''; } print '
'.$langs->trans("Password").''.eregi_replace('.','*',$adh->pass).'
'.$langs->trans("Type").''.$adht->getNomUrl(1)."
'.$langs->trans("Person").''.$adh->getmorphylib().'
'.$langs->trans("Company").''.$adh->societe.' 
'.$langs->trans("Address").''.nl2br($adh->adresse).' 
'.$langs->trans("Zip").' / '.$langs->trans("Town").''.$adh->cp.' '.$adh->ville.' 
'.$langs->trans("Country").''.getCountryLabel($adh->pays_id).'
'.$langs->trans("PhonePro").''.$adh->phone.'
'.$langs->trans("PhonePerso").''.$adh->phone_perso.'
'.$langs->trans("PhoneMobile").''.$adh->phone_mobile.'
'.$langs->trans("EMail").''.$adh->email.' 
'.$langs->trans("Birthday").''.dolibarr_print_date($adh->naiss,'day').' 
'.$langs->trans("Public").''.yn($adh->public).'
'.$langs->trans("Status").''.$adh->getLibStatut(4).'
'.$langs->trans("DolibarrLogin").''; if ($adh->user_id) { $dolibarr_user=new User($db); $dolibarr_user->id=$adh->user_id; $result=$dolibarr_user->fetch(); print $dolibarr_user->getLoginUrl(1); } else print $langs->trans("NoDolibarrAccess"); print '
$value".$adh->array_options["options_$key"]." 
\n"; print '
'; print "\n"; /* * Barre d'actions * */ print '
'; // Modify if ($user->rights->adherent->creer || ($user->rights->adherent->self->creer && $adh->user_id == $user->id)) { print "".$langs->trans("Modify").""; } else { print "".$langs->trans("Modify").""; } // Valider if ($adh->statut == -1) { if ($user->rights->adherent->creer) { print "".$langs->trans("Validate")."\n"; } else { print "".$langs->trans("Validate").""; } } // Reactiver if ($adh->statut == 0) { if ($user->rights->adherent->creer) { print "".$langs->trans("Reenable")."\n"; } else { print "".$langs->trans("Reenable").""; } } // Envoi fiche par mail if ($adh->statut >= 1 && $adh->email) { if ($user->rights->adherent->creer) { print "id&action=sendinfo\">".$langs->trans("SendCardByMail")."\n"; } else { print "".$langs->trans("SendCardByMail").""; } } // Resilier if ($adh->statut >= 1) { if ($user->rights->adherent->supprimer) { print "".$langs->trans("Resiliate")."\n"; } else { print "".$langs->trans("Resiliate").""; } } // Create user if (! $user->societe_id && ! $adh->user_id) { if ($user->rights->user->user->creer) { print ''.$langs->trans("CreateDolibarrLogin").''; } else { print "".$langs->trans("CreateDolibarrLogin").""; } } // Supprimer if ($user->rights->adherent->supprimer) { print "id&action=delete\">".$langs->trans("Delete")."\n"; } else { print "".$langs->trans("Delete").""; } // Action SPIP if ($conf->global->ADHERENT_USE_SPIP) { $isinspip=$adh->is_in_spip(); if ($isinspip == 1) { print "id&action=del_spip\">Suppression dans Spip\n"; } if ($isinspip == 0) { print "id&action=add_spip\">Ajout dans Spip\n"; } if ($isinspip == -1) { print '
Failed to connect to SPIP: '.$adh->error.''; } } print '
'; print "
\n"; /* * Bandeau des cotisations * */ print ''; print ''; print ''; print '
'; print ''; print '
'; } $db->close(); llxFooter('$Date$ - $Revision$'); ?>