* Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2015 Regis Houssin * * 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 3 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, see . */ /** * \file htdocs/user/note.php * \ingroup usergroup * \brief Fiche de notes sur un utilisateur Dolibarr */ require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/usergroups.lib.php'; require_once DOL_DOCUMENT_ROOT.'/user/class/user.class.php'; $id = GETPOST('id','int'); $action = GETPOST('action'); $langs->load("companies"); $langs->load("members"); $langs->load("bills"); $langs->load("users"); $object = new User($db); $object->fetch($id); // If user is not user read and no permission to read other users, we stop if (($object->id != $user->id) && (! $user->rights->user->user->lire)) accessforbidden(); // Security check $socid=0; if ($user->societe_id > 0) $socid = $user->societe_id; $feature2 = (($socid && $user->rights->user->self->creer)?'':'user'); if ($user->id == $id) $feature2=''; // A user can always read its own card $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); /******************************************************************************/ /* Actions */ /******************************************************************************/ if ($action == 'update' && $user->rights->user->user->creer && ! $_POST["cancel"]) { $db->begin(); $res=$object->update_note(dol_html_entity_decode(GETPOST('note_private'), ENT_QUOTES)); if ($res < 0) { $mesg='
'.$adh->error.'
'; $db->rollback(); } else { $db->commit(); } } /******************************************************************************/ /* Affichage fiche */ /******************************************************************************/ llxHeader(); $form = new Form($db); if ($id) { $head = user_prepare_head($object); $title = $langs->trans("User"); dol_fiche_head($head, 'note', $title, 0, 'user'); if ($msg) print '
'.$msg.'
'; print "
"; print ''; print ''; // Reference print ''; print ''; print ''; // Lastname print ''; print ''; // Firstname print ''; // Login print ''; // Note print ''; print '"; print "
'.$langs->trans('Ref').''; print $form->showrefnav($object,'id','',$user->rights->user->user->lire || $user->admin); print '
'.$langs->trans("Lastname").''.$object->lastname.' 
'.$langs->trans("Firstname").''.$object->firstname.' 
'.$langs->trans("Login").''.$object->login.' 
'.$langs->trans("Note").''; if ($action == 'edit' && $user->rights->user->user->creer) { print ""; print "id."\">"; // Editeur wysiwyg require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php'; $doleditor=new DolEditor('note_private',$object->note,'',280,'dolibarr_notes','In',true,false,$conf->global->FCKEDITOR_ENABLE_SOCIETE,10,80); $doleditor->Create(); } else { print dol_htmlentitiesbr($object->note); } print "
"; dol_fiche_end(); if ($action == 'edit') { print '
'; print ''; print '     '; print ''; print '
'; } /* * Actions */ print '
'; if ($user->rights->user->user->creer && $action != 'edit') { print "id."&action=edit\">".$langs->trans('Modify').""; } print "
"; print "
\n"; } llxFooter(); $db->close();