Go to the documentation of this file.
26 require
'../main.inc.php';
27 require_once DOL_DOCUMENT_ROOT.
'/core/lib/usergroups.lib.php';
28 require_once DOL_DOCUMENT_ROOT.
'/user/class/user.class.php';
31 $action =
GETPOST(
'action',
'aZ09');
32 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'usernote';
35 $langs->loadLangs(array(
'companies',
'members',
'bills',
'users'));
37 $object =
new User($db);
38 $object->fetch($id,
'',
'', 1);
42 if (($object->id != $user->id) && (!$user->rights->user->user->lire)) {
48 if ($user->socid > 0) {
49 $socid = $user->socid;
51 $feature2 = (($socid && $user->rights->user->self->creer) ?
'' :
'user');
53 $result =
restrictedArea($user,
'user', $id,
'user&user', $feature2);
56 $hookmanager->initHooks(array(
'usercard',
'usernote',
'globalcard'));
63 $parameters = array(
'id'=>$socid);
64 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
69 if (empty($reshook)) {
70 if ($action ==
'update' && $user->rights->user->user->creer && !
GETPOST(
"cancel")) {
75 $mesg =
'<div class="error">'.$adh->error.
'</div>';
95 $title = $langs->trans(
"User");
100 if ($user->rights->user->user->lire || $user->admin) {
101 $linkback =
'<a href="'.DOL_URL_ROOT.
'/user/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
104 $morehtmlref =
'<a href="'.DOL_URL_ROOT.
'/user/vcard.php?id='.$object->id.
'" class="refid">';
105 $morehtmlref .=
img_picto($langs->trans(
"Download").
' '.$langs->trans(
"VCard"),
'vcard.png',
'class="valignmiddle marginleftonly paddingrightonly"');
106 $morehtmlref .=
'</a>';
108 dol_banner_tab($object,
'id', $linkback, $user->rights->user->user->lire || $user->admin,
'rowid',
'ref', $morehtmlref);
110 print
'<div class="underbanner clearboth"></div>';
112 print
'<form method="POST" action="'.$_SERVER[
'PHP_SELF'].
'">';
113 print
'<input type="hidden" name="token" value="'.newToken().
'">';
115 print
'<div class="fichecenter">';
116 print
'<table class="border centpercent tableforfield">';
119 print
'<tr><td class="titlefield">'.$langs->trans(
"Login").
'</td>';
120 if (!empty($object->ldap_sid) && $object->statut == 0) {
121 print
'<td class="error">';
122 print $langs->trans(
"LoginAccountDisableInDolibarr");
127 if (property_exists($object,
'admin')) {
128 if (!empty($conf->multicompany->enabled) && !empty($object->admin) && empty($object->entity)) {
129 $addadmin .=
img_picto($langs->trans(
"SuperAdministratorDesc"),
"redstar",
'class="paddingleft"');
130 } elseif (!empty($object->admin)) {
131 $addadmin .=
img_picto($langs->trans(
"AdministratorDesc"),
"star",
'class="paddingleft"');
139 $editenabled = (($action ==
'edit') && !empty($user->rights->user->user->creer));
142 print
'<tr><td class="tdtop">'.$langs->trans(
"Note").
'</td>';
143 print
'<td class="'.($editenabled ?
'' :
'sensiblehtmlcontent').
'">';
145 print
"<input type=\"hidden\" name=\"action\" value=\"update\">";
146 print
"<input type=\"hidden\" name=\"id\" value=\"".$object->id.
"\">";
148 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
149 $doleditor =
new DolEditor(
'note_private', $object->note_private,
'', 280,
'dolibarr_notes',
'In',
true,
false,
getDolGlobalInt(
'FCKEDITOR_ENABLE_SOCIETE'), ROWS_8,
'90%');
150 $doleditor->Create();
161 if ($action ==
'edit') {
162 print
$form->buttonsSaveCancel();
170 print
'<div class="tabsAction">';
172 if ($user->rights->user->user->creer && $action !=
'edit') {
173 print
'<a class="butAction" href="note.php?id='.$object->id.
'&action=edit&token='.
newToken().
'">'.$langs->trans(
'Modify').
"</a>";
restrictedArea($user, $features, $objectid=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.
user_prepare_head(User $object)
Prepare array with list of tabs.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
dol_banner_tab($object, $paramid, $morehtml='', $shownav=1, $fieldid='rowid', $fieldref='ref', $morehtmlref='', $moreparam='', $nodbprefix=0, $morehtmlleft='', $morehtmlstatus='', $onlybanner=0, $morehtmlright='')
Show tab footer of a card.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
showValueWithClipboardCPButton($valuetocopy, $showonlyonhover=1, $texttoshow='')
Create a button to copy $valuetocopy in the clipboard (for copy and paste feature).
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Class to manage Dolibarr users.
dol_html_entity_decode($a, $b, $c='UTF-8', $keepsomeentities=0)
Replace html_entity_decode functions to manage errors.
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles=1, $removeclassattribute=1, $cleanalsojavascript=0, $allowiframe=0)
Clean a string to keep only desirable HTML tags.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage a WYSIWYG editor.