2004-10-20 23:06:45 +02:00
|
|
|
|
<?php
|
2005-01-28 21:35:01 +01:00
|
|
|
|
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
|
|
|
|
* Copyright (C) 2004-2005 Laurent Destailleur <eldy@users.sourceforge.net>
|
2004-10-01 16:55:50 +02:00
|
|
|
|
*
|
|
|
|
|
|
* 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.
|
|
|
|
|
|
*
|
|
|
|
|
|
* $Id$
|
|
|
|
|
|
* $Source$
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
2005-01-28 21:35:01 +01:00
|
|
|
|
/**
|
2004-11-03 23:00:47 +01:00
|
|
|
|
\file htdocs/user/addon.php
|
|
|
|
|
|
\brief Onglet addon de la fiche utilisateur
|
|
|
|
|
|
\version $Revision$
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
2004-10-01 16:55:50 +02:00
|
|
|
|
require("./pre.inc.php");
|
|
|
|
|
|
require_once DOL_DOCUMENT_ROOT."/bookmark4u.class.php";
|
|
|
|
|
|
|
|
|
|
|
|
$langs->load("users");
|
|
|
|
|
|
|
|
|
|
|
|
$form = new Form($db);
|
|
|
|
|
|
|
|
|
|
|
|
if ($_GET["action"] == 'create_bk4u_login')
|
|
|
|
|
|
{
|
2005-08-11 20:48:08 +02:00
|
|
|
|
$edituser = new User($db, $_GET["id"]);
|
|
|
|
|
|
$edituser->fetch($_GET["id"]);
|
|
|
|
|
|
|
|
|
|
|
|
$bk4u = new Bookmark4u($db);
|
|
|
|
|
|
$bk4u->get_bk4u_uid($fuser);
|
|
|
|
|
|
$result=$bk4u->create_account_from_user($edituser);
|
|
|
|
|
|
|
|
|
|
|
|
if ($result > 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
Header("Location: addon.php?id=".$_GET["id"]);
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
|
|
|
|
|
dolibarr_print_error($db,$bk4u->error);
|
|
|
|
|
|
exit;
|
|
|
|
|
|
}
|
2004-10-01 16:55:50 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
llxHeader("","Addon Utilisateur");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ************************************************************************** */
|
|
|
|
|
|
/* */
|
|
|
|
|
|
/* */
|
|
|
|
|
|
/* ************************************************************************** */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if ($_GET["id"])
|
|
|
|
|
|
{
|
2005-08-11 20:48:08 +02:00
|
|
|
|
$fuser = new User($db, $_GET["id"]);
|
|
|
|
|
|
$fuser->fetch();
|
2004-10-01 16:55:50 +02:00
|
|
|
|
|
2005-08-11 20:48:08 +02:00
|
|
|
|
$bk4u = new Bookmark4u($db);
|
|
|
|
|
|
$bk4u->get_bk4u_uid($fuser);
|
2004-10-01 16:55:50 +02:00
|
|
|
|
|
|
|
|
|
|
|
2005-08-11 20:48:08 +02:00
|
|
|
|
/*
|
|
|
|
|
|
* Affichage onglets
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
$h = 0;
|
|
|
|
|
|
|
|
|
|
|
|
$head[$h][0] = DOL_URL_ROOT.'/user/fiche.php?id='.$fuser->id;
|
|
|
|
|
|
$head[$h][1] = $langs->trans("UserCard");
|
|
|
|
|
|
$h++;
|
2005-02-05 22:46:35 +01:00
|
|
|
|
|
2005-02-26 15:23:54 +01:00
|
|
|
|
$head[$h][0] = DOL_URL_ROOT.'/user/perms.php?id='.$fuser->id;
|
|
|
|
|
|
$head[$h][1] = $langs->trans("UserRights");
|
|
|
|
|
|
$h++;
|
2005-02-05 22:46:35 +01:00
|
|
|
|
|
2005-08-11 20:48:08 +02:00
|
|
|
|
$head[$h][0] = DOL_URL_ROOT.'/user/param_ihm.php?id='.$fuser->id;
|
|
|
|
|
|
$head[$h][1] = $langs->trans("UserGUISetup");
|
2005-02-26 15:23:54 +01:00
|
|
|
|
$h++;
|
2005-08-11 20:48:08 +02:00
|
|
|
|
|
|
|
|
|
|
if ($conf->bookmark4u->enabled)
|
|
|
|
|
|
{
|
|
|
|
|
|
$head[$h][0] = DOL_URL_ROOT.'/user/addon.php?id='.$fuser->id;
|
|
|
|
|
|
$head[$h][1] = $langs->trans("Bookmark4u");
|
|
|
|
|
|
$hselected=$h;
|
|
|
|
|
|
$h++;
|
2005-01-28 21:35:01 +01:00
|
|
|
|
}
|
2005-01-14 15:10:31 +01:00
|
|
|
|
|
2005-08-11 20:48:08 +02:00
|
|
|
|
if ($conf->clicktodial->enabled)
|
2005-01-14 15:10:31 +01:00
|
|
|
|
{
|
2005-08-11 20:48:08 +02:00
|
|
|
|
$head[$h][0] = DOL_URL_ROOT.'/user/clicktodial.php?id='.$fuser->id;
|
|
|
|
|
|
$head[$h][1] = $langs->trans("ClickToDial");
|
|
|
|
|
|
$h++;
|
2005-01-14 15:10:31 +01:00
|
|
|
|
}
|
|
|
|
|
|
|
2005-08-11 20:48:08 +02:00
|
|
|
|
dolibarr_fiche_head($head, $hselected, $langs->trans("User").": ".$fuser->fullname);
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* Fiche en mode visu
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
print '<table class="border" width="100%">';
|
|
|
|
|
|
|
|
|
|
|
|
print '<tr><td width="25%" valign="top">'.$langs->trans("Lastname").'</td>';
|
|
|
|
|
|
print '<td class="valeur">'.$fuser->nom.'</td></tr>';
|
|
|
|
|
|
print '<tr><td width="25%" valign="top">'.$langs->trans("Firstname").'</td>';
|
|
|
|
|
|
print '<td class="valeur">'.$fuser->prenom.'</td>';
|
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
|
|
|
|
|
|
|
print '<tr><td width="25%" valign="top">'.$langs->trans("Login").'</td>';
|
|
|
|
|
|
print '<td class="valeur">'.$fuser->login.'</td></tr>';
|
|
|
|
|
|
print '<tr><td width="25%" valign="top">'.$langs->trans("EMail").'</td>';
|
|
|
|
|
|
print '<td class="valeur"><a href="mailto:'.$fuser->email.'">'.$fuser->email.'</a></td>';
|
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print "<tr>".'<td width="25%" valign="top">'.$langs->trans("Login Boobkmark4u").'</td>';
|
|
|
|
|
|
print '<td class="valeur">';
|
|
|
|
|
|
|
|
|
|
|
|
if ($bk4u->uid == 0)
|
2004-10-01 16:55:50 +02:00
|
|
|
|
{
|
2005-08-11 20:48:08 +02:00
|
|
|
|
print $langs->trans("NoLogin");
|
2004-10-01 16:55:50 +02:00
|
|
|
|
}
|
2005-08-11 20:48:08 +02:00
|
|
|
|
else
|
2004-10-01 16:55:50 +02:00
|
|
|
|
{
|
2005-08-11 20:48:08 +02:00
|
|
|
|
$bk4u->get_bk4u_login();
|
|
|
|
|
|
print $bk4u->login;
|
2004-10-01 16:55:50 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
2005-08-11 20:48:08 +02:00
|
|
|
|
print '</td>';
|
|
|
|
|
|
print "</tr>\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print "</table>\n";
|
|
|
|
|
|
|
|
|
|
|
|
print "</div>\n";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
* Barre d'actions
|
|
|
|
|
|
*
|
|
|
|
|
|
*/
|
|
|
|
|
|
print '<div class="tabsAction">';
|
|
|
|
|
|
|
|
|
|
|
|
if ($user->admin)
|
2004-10-01 16:55:50 +02:00
|
|
|
|
{
|
2005-08-11 20:48:08 +02:00
|
|
|
|
print '<a class="tabAction" href="addon.php?id='.$fuser->id.'&action=create_bk4u_login">'.$langs->trans("Cr<EFBFBD>er login Bookmark4u").'</a>';
|
2004-10-01 16:55:50 +02:00
|
|
|
|
}
|
2005-08-11 20:48:08 +02:00
|
|
|
|
|
|
|
|
|
|
print "</div>\n";
|
|
|
|
|
|
print "<br>\n";
|
|
|
|
|
|
|
2004-10-01 16:55:50 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$db->close();
|
|
|
|
|
|
|
2005-08-11 20:48:08 +02:00
|
|
|
|
llxFooter('$Date$ - $Revision$');
|
2004-10-01 16:55:50 +02:00
|
|
|
|
?>
|