Modif pour la création des accés clients
This commit is contained in:
parent
bcfbc1a8dc
commit
f19a153c20
@ -27,6 +27,21 @@ require (DOL_DOCUMENT_ROOT."/lib/vcard/vcard.class.php");
|
|||||||
|
|
||||||
$error = array();
|
$error = array();
|
||||||
|
|
||||||
|
|
||||||
|
if ($_GET["action"] == 'create_user' && $user->admin)
|
||||||
|
{
|
||||||
|
// Recuperation contact actuel
|
||||||
|
$contact = new Contact($db);
|
||||||
|
$result = $contact->fetch($_GET["id"]);
|
||||||
|
|
||||||
|
// Creation user
|
||||||
|
$nuser = new User($db);
|
||||||
|
$nuser->nom = $contact->nom;
|
||||||
|
$nuser->prenom = $contact->prenom;
|
||||||
|
$nuser->create_from_contact($contact);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
if ($_POST["action"] == 'add')
|
if ($_POST["action"] == 'add')
|
||||||
{
|
{
|
||||||
if (! $_POST["name"] && ! $_POST["firstname"]) {
|
if (! $_POST["name"] && ! $_POST["firstname"]) {
|
||||||
@ -103,16 +118,6 @@ if ($_POST["action"] == 'update')
|
|||||||
if ($contact->error) { array_push($error,$contact->error); }
|
if ($contact->error) { array_push($error,$contact->error); }
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_GET["action"] == 'create_user')
|
|
||||||
{
|
|
||||||
$nuser = new User($db);
|
|
||||||
$contact = new Contact($db);
|
|
||||||
$nuser->nom = $contact->nom;
|
|
||||||
$nuser->prenom = $contact->prenom;
|
|
||||||
$result = $contact->fetch($contactid);
|
|
||||||
$nuser->create_from_contact($contact);
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
@ -297,6 +302,9 @@ else
|
|||||||
if ($contact->jabberid)
|
if ($contact->jabberid)
|
||||||
print 'Jabber : '.$contact->jabberid ."<br>";
|
print 'Jabber : '.$contact->jabberid ."<br>";
|
||||||
|
|
||||||
|
if($contact->user_id)
|
||||||
|
print 'Utilisateur avec accés : <a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$contact->user_id.'">Fiche utilisateur</a><br>';
|
||||||
|
|
||||||
print '</td><td valign="top">';
|
print '</td><td valign="top">';
|
||||||
|
|
||||||
if ($contact->phone_pro)
|
if ($contact->phone_pro)
|
||||||
@ -327,9 +335,15 @@ else
|
|||||||
{
|
{
|
||||||
print '<div class="tabsAction">';
|
print '<div class="tabsAction">';
|
||||||
|
|
||||||
print '<a class="tabAction" href="fiche.php?id='.$_GET["id"].'&action=edit">Editer</a>';
|
print '<a class="tabAction" href="fiche.php?id='.$contact->id.'&action=edit">Editer</a>';
|
||||||
|
|
||||||
print '<a class="tabAction" href="fiche.php?id='.$_GET["id"].'&action=deleteWARNING">Supprimer</a>';
|
print '<a class="tabAction" href="fiche.php?id='.$contact->id.'&action=deleteWARNING">Supprimer</a>';
|
||||||
|
|
||||||
|
|
||||||
|
if ($contact->user_id == 0 && $user->admin)
|
||||||
|
{
|
||||||
|
print '<a class="tabAction" href="fiche.php?id='.$contact->id.'&action=create_user">Créer un compte</a>';
|
||||||
|
}
|
||||||
|
|
||||||
print "</div>";
|
print "</div>";
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user