-
diff --git a/htdocs/user/class/api_users.class.php b/htdocs/user/class/api_users.class.php
index 9549fbe2ef1..778823d3d7d 100644
--- a/htdocs/user/class/api_users.class.php
+++ b/htdocs/user/class/api_users.class.php
@@ -72,7 +72,7 @@ class Users extends DolibarrApi
$obj_ret = array();
if(! DolibarrApiAccess::$user->rights->user->user->lire) {
- throw new RestException(401, "You are not allowed to read list of users");
+ throw new RestException(401, "You are not allowed to read list of users");
}
// case of external user, $societe param is ignored and replaced by user's socid
@@ -226,10 +226,10 @@ class Users extends DolibarrApi
if ($field == 'statut') {
$result = $this->useraccount->setstatus($value);
if ($result < 0) {
- throw new RestException(500, 'Error when updating status of user: '.$this->useraccount->error);
+ throw new RestException(500, 'Error when updating status of user: '.$this->useraccount->error);
}
} else {
- $this->useraccount->$field = $value;
+ $this->useraccount->$field = $value;
}
}
diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php
index 79b285bc114..04a0f4c3883 100644
--- a/htdocs/user/clicktodial.php
+++ b/htdocs/user/clicktodial.php
@@ -110,7 +110,7 @@ if ($id > 0)
// Edit mode
if ($action == 'edit')
{
- print '
';
+ print '
';
if ($user->admin)
{
diff --git a/htdocs/user/hierarchy.php b/htdocs/user/hierarchy.php
index 8952b32f30b..a89fe447aa0 100644
--- a/htdocs/user/hierarchy.php
+++ b/htdocs/user/hierarchy.php
@@ -4,6 +4,7 @@
* Copyright (C) 2006-2015 Laurent Destailleur
* Copyright (C) 2007 Patrick Raguin
* Copyright (C) 2005-2012 Regis Houssin
+ * Copyright (C) 2019 Frédéric France
*
* 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
@@ -81,138 +82,138 @@ if (! is_array($user_arbo) && $user_arbo < 0)
}
else
{
-// Define fulltree array
-$fulltree=$user_arbo;
-//var_dump($fulltree);
-// Define data (format for treeview)
-$data=array();
-$data[] = array('rowid'=>0,'fk_menu'=>-1,'title'=>"racine",'mainmenu'=>'','leftmenu'=>'','fk_mainmenu'=>'','fk_leftmenu'=>'');
-foreach($fulltree as $key => $val)
-{
- $userstatic->id=$val['id'];
- $userstatic->ref=$val['label'];
- $userstatic->login=$val['login'];
- $userstatic->firstname=$val['firstname'];
- $userstatic->lastname=$val['lastname'];
- $userstatic->statut=$val['statut'];
- $userstatic->email=$val['email'];
- $userstatic->gender=$val['gender'];
- $userstatic->societe_id=$val['fk_soc'];
- $userstatic->admin=$val['admin'];
- $userstatic->entity=$val['entity'];
- $userstatic->photo=$val['photo'];
+ // Define fulltree array
+ $fulltree=$user_arbo;
+ //var_dump($fulltree);
+ // Define data (format for treeview)
+ $data=array();
+ $data[] = array('rowid'=>0,'fk_menu'=>-1,'title'=>"racine",'mainmenu'=>'','leftmenu'=>'','fk_mainmenu'=>'','fk_leftmenu'=>'');
+ foreach($fulltree as $key => $val)
+ {
+ $userstatic->id=$val['id'];
+ $userstatic->ref=$val['label'];
+ $userstatic->login=$val['login'];
+ $userstatic->firstname=$val['firstname'];
+ $userstatic->lastname=$val['lastname'];
+ $userstatic->statut=$val['statut'];
+ $userstatic->email=$val['email'];
+ $userstatic->gender=$val['gender'];
+ $userstatic->societe_id=$val['fk_soc'];
+ $userstatic->admin=$val['admin'];
+ $userstatic->entity=$val['entity'];
+ $userstatic->photo=$val['photo'];
- $entity=$val['entity'];
- $entitystring='';
+ $entity=$val['entity'];
+ $entitystring='';
- // TODO Set of entitystring should be done with a hook
- if (! empty($conf->multicompany->enabled) && is_object($mc))
- {
- if (empty($entity))
- {
- $entitystring=$langs->trans("AllEntities");
- }
- else
- {
- $mc->getInfo($entity);
- $entitystring=$mc->label;
- }
- }
+ // TODO Set of entitystring should be done with a hook
+ if (! empty($conf->multicompany->enabled) && is_object($mc))
+ {
+ if (empty($entity))
+ {
+ $entitystring=$langs->trans("AllEntities");
+ }
+ else
+ {
+ $mc->getInfo($entity);
+ $entitystring=$mc->label;
+ }
+ }
- $li=$userstatic->getNomUrl(-1, '', 0, 1);
- if (! empty($conf->multicompany->enabled) && $userstatic->admin && ! $userstatic->entity)
- {
- $li.=img_picto($langs->trans("SuperAdministrator"), 'redstar');
- }
- elseif ($userstatic->admin)
- {
- $li.=img_picto($langs->trans("Administrator"), 'star');
- }
- $li.=' ('.$val['login'].($entitystring?' - '.$entitystring:'').')';
+ $li=$userstatic->getNomUrl(-1, '', 0, 1);
+ if (! empty($conf->multicompany->enabled) && $userstatic->admin && ! $userstatic->entity)
+ {
+ $li.=img_picto($langs->trans("SuperAdministrator"), 'redstar');
+ }
+ elseif ($userstatic->admin)
+ {
+ $li.=img_picto($langs->trans("Administrator"), 'star');
+ }
+ $li.=' ('.$val['login'].($entitystring?' - '.$entitystring:'').')';
- $data[] = array(
- 'rowid'=>$val['rowid'],
- 'fk_menu'=>$val['fk_user'],
- 'statut'=>$val['statut'],
- 'entry'=>'