* Copyright (C) 2004-2005 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. * * $Id$ * $Source$ */ /** \file htdocs/user/addon.php \brief Onglet addon de la fiche utilisateur \version $Revision$ */ 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') { $edituser = new User($db, $_GET["id"]); $edituser->fetch($_GET["id"]); $bk4u = new Bookmark4u($db); $bk4u->get_bk4u_uid($fuser); $bk4u->create_account_from_user($edituser); Header("Location: addon.php?id=".$_GET["id"]); } llxHeader("","Addon Utilisateur"); /* ************************************************************************** */ /* */ /* */ /* ************************************************************************** */ if ($_GET["id"]) { $fuser = new User($db, $_GET["id"]); $fuser->fetch(); $bk4u = new Bookmark4u($db); $bk4u->get_bk4u_uid($fuser); /* * Affichage onglets */ $h = 0; $head[$h][0] = DOL_URL_ROOT.'/user/fiche.php?id='.$fuser->id; $head[$h][1] = $langs->trans("UserCard"); $h++; if ($user->admin) { $head[$h][0] = DOL_URL_ROOT.'/user/perms.php?id='.$fuser->id; $head[$h][1] = $langs->trans("UserRights"); $h++; } 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++; } if ($conf->clicktodial->enabled) { $head[$h][0] = DOL_URL_ROOT.'/user/clicktodial.php?id='.$fuser->id; $head[$h][1] = $langs->trans("ClickToDial"); $h++; } dolibarr_fiche_head($head, $hselected, $langs->trans("User").": ".$fuser->fullname); /* * Fiche en mode visu */ print ''; print "".''; print ''; print ''; print ''; print "\n"; print "".''; print ''; print ''; print ''; print "\n"; print "".''; print ''; print ''; print ''; print "\n"; print "
'.$langs->trans("Lastname").''.$fuser->nom.''.$langs->trans("Firstname").''.$fuser->prenom.'
'.$langs->trans("Login").''.$fuser->login.''.$langs->trans("EMail").''.$fuser->email.'
'.$langs->trans("Login Boobkmark4u").''; if ($bk4u->uid == 0) { print "Pas de login"; } else { $bk4u->get_bk4u_login(); print $bk4u->login; } print '  
\n"; print "
\n"; print "\n"; /* * Barre d'actions * */ print '
'; if ($user->admin) { print ''.$langs->trans("Créer login Bookmark4u").''; } print "
\n"; print "
\n"; } $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); ?>