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))
accessforbidden();
46 if ($user->socid > 0) $socid = $user->socid;
47 $feature2 = (($socid && $user->rights->user->self->creer) ?
'' :
'user');
49 $result =
restrictedArea($user,
'user', $id,
'user&user', $feature2);
52 $hookmanager->initHooks(array(
'usercard',
'usernote',
'globalcard'));
59 $parameters = array(
'id'=>$socid);
60 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
61 if ($reshook < 0)
setEventMessages($hookmanager->error, $hookmanager->errors,
'errors');
63 if (empty($reshook)) {
64 if ($action ==
'update' && $user->rights->user->user->creer && !$_POST[
"cancel"]) {
69 $mesg =
'<div class="error">'.$adh->error.
'</div>';
84 $form =
new Form($db);
90 $title = $langs->trans(
"User");
95 if ($user->rights->user->user->lire || $user->admin) {
96 $linkback =
'<a href="'.DOL_URL_ROOT.
'/user/list.php?restore_lastsearch_values=1">'.$langs->trans(
"BackToList").
'</a>';
99 dol_banner_tab($object,
'id', $linkback, $user->rights->user->user->lire || $user->admin);
101 print '<div class="underbanner clearboth"></div>';
103 print "<form method=\"post\" action=\"".$_SERVER[
'PHP_SELF'].
"\">";
104 print '<input type="hidden" name="token" value="'.newToken().
'">';
106 print '<div class="fichecenter">';
107 print '<table class="border centpercent tableforfield">';
110 print '<tr><td class="titlefield">'.$langs->trans(
"Login").
'</td><td class="valeur">'.$object->login.
' </td></tr>';
112 $editenabled = (($action ==
'edit') && !empty($user->rights->user->user->creer));
115 print '<tr><td class="tdtop">'.$langs->trans(
"Note").
'</td>';
116 print '<td class="'.($editenabled ?
'' :
'sensiblehtmlcontent').
'">';
119 print "<input type=\"hidden\" name=\"action\" value=\"update\">";
120 print "<input type=\"hidden\" name=\"id\" value=\"".$object->id.
"\">";
122 require_once DOL_DOCUMENT_ROOT.
'/core/class/doleditor.class.php';
123 $doleditor =
new DolEditor(
'note_private', $object->note_private,
'', 280,
'dolibarr_notes',
'In',
true,
false, $conf->global->FCKEDITOR_ENABLE_SOCIETE, ROWS_8,
'90%');
124 $doleditor->Create();
135 if ($action ==
'edit')
137 print '<div class="center">';
138 print '<input type="submit" class="button button-save" name="update" value="'.$langs->trans(
"Save").
'">';
139 print ' ';
140 print '<input type="submit" class="button button-cancel" name="cancel" value="'.$langs->trans(
"Cancel").
'">';
149 print '<div class="tabsAction">';
151 if ($user->rights->user->user->creer && $action !=
'edit')
153 print "<a class=\"butAction\" href=\"note.php?id=".$object->id.
"&action=edit\">".$langs->trans(
'Modify').
"</a>";
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
user_prepare_head($object)
Prepare array with list of tabs.
dol_html_entity_decode($a, $b, $c= 'UTF-8', $keepsomeentities=0)
Replace html_entity_decode functions to manage errors.
Class to manage Dolibarr users.
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.
restrictedArea($user, $features, $objectid=0, $tableandshare= '', $feature2= '', $dbt_keyfield= 'fk_soc', $dbt_select= 'rowid', $isdraft=0)
Check permissions of a user to show a page and an 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 ...
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles=1, $removeclassattribute=1, $cleanalsojavascript=0)
Clean a string to keep only desirable HTML tags.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Class to manage a WYSIWYG editor.
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.