diff --git a/htdocs/core/lib/usergroups.lib.php b/htdocs/core/lib/usergroups.lib.php
index 8936cf98623..3b3cde1d66a 100644
--- a/htdocs/core/lib/usergroups.lib.php
+++ b/htdocs/core/lib/usergroups.lib.php
@@ -59,6 +59,11 @@ function user_prepare_head($object)
$h++;
}
+ $head[$h][0] = DOL_URL_ROOT.'/user/param_ihm.php?id='.$object->id;
+ $head[$h][1] = $langs->trans("UserGUISetup");
+ $head[$h][2] = 'guisetup';
+ $h++;
+
if ($canreadperms)
{
$head[$h][0] = DOL_URL_ROOT.'/user/perms.php?id='.$object->id;
@@ -67,15 +72,27 @@ function user_prepare_head($object)
$h++;
}
- $head[$h][0] = DOL_URL_ROOT.'/user/param_ihm.php?id='.$object->id;
- $head[$h][1] = $langs->trans("UserGUISetup");
- $head[$h][2] = 'guisetup';
- $h++;
-
if (! empty($conf->agenda->enabled))
{
+ if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
+ $MAXAGENDA=$conf->global->AGENDA_EXT_NB;
+
+ $i=1;
+ $nbagenda = 0;
+ while ($i <= $MAXAGENDA)
+ {
+ $key=$i;
+ $name='AGENDA_EXT_NAME_'.$object->id.'_'.$key;
+ $src='AGENDA_EXT_SRC_'.$object->id.'_'.$key;
+ $offsettz='AGENDA_EXT_OFFSETTZ_'.$object->id.'_'.$key;
+ $color='AGENDA_EXT_COLOR_'.$object->id.'_'.$key;
+ $i++;
+
+ if (! empty($object->conf->$name)) $nbagenda++;
+ }
+
$head[$h][0] = DOL_URL_ROOT.'/user/agenda_extsites.php?id='.$object->id;
- $head[$h][1] = $langs->trans("ExtSites");
+ $head[$h][1] = $langs->trans("ExtSites").($nbagenda ? ' '.$nbagenda.'' : '');
$head[$h][2] = 'extsites';
$h++;
}
diff --git a/htdocs/holiday/list.php b/htdocs/holiday/list.php
index f91616d0b9a..d35fa9293c3 100644
--- a/htdocs/holiday/list.php
+++ b/htdocs/holiday/list.php
@@ -202,7 +202,7 @@ $user_id = $user->id;
if ($id > 0)
{
// Charge utilisateur edite
- $fuser->fetch($id);
+ $fuser->fetch($id, '', '', 1);
$fuser->getrights();
$user_id = $fuser->id;
}
diff --git a/htdocs/user/agenda_extsites.php b/htdocs/user/agenda_extsites.php
index d8aba34a934..e789a8277f3 100644
--- a/htdocs/user/agenda_extsites.php
+++ b/htdocs/user/agenda_extsites.php
@@ -42,7 +42,7 @@ $actiontest=GETPOST('test','alpha');
$actionsave=GETPOST('save','alpha');
if (empty($conf->global->AGENDA_EXT_NB)) $conf->global->AGENDA_EXT_NB=5;
-$MAXAGENDA=empty($conf->global->AGENDA_EXT_NB)?5:$conf->global->AGENDA_EXT_NB;
+$MAXAGENDA=$conf->global->AGENDA_EXT_NB;
// List of available colors
$colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5');
@@ -50,7 +50,8 @@ $colorlist=array('BECEDD','DDBECE','BFDDBE','F598B4','F68654','CBF654','A4A4A5')
// Security check
$id = GETPOST('id','int');
$object = new User($db);
-$object->fetch($id);
+$object->fetch($id, '', '', 1);
+$object->getrights();
// Security check
$socid=0;
@@ -81,12 +82,12 @@ if (empty($reshook)) {
if ($actionsave) {
$db->begin();
- $i = 1;
$errorsaved = 0;
$error = 0;
$tabparam = array();
// Save agendas
+ $i = 1;
while ($i <= $MAXAGENDA) {
$name = trim(GETPOST('AGENDA_EXT_NAME_'.$id.'_'.$i, 'alpha'));
$src = trim(GETPOST('AGENDA_EXT_SRC_'.$id.'_'.$i, 'alpha'));
@@ -110,7 +111,7 @@ if (empty($reshook)) {
$tabparam['AGENDA_EXT_COLOR_'.$id.'_'.$i]=$color;
$tabparam['AGENDA_EXT_ENABLED_'.$id.'_'.$i]=$enabled;
- $i ++;
+ $i++;
}
if (!$error) {
@@ -167,7 +168,6 @@ print "
\n";
$selectedvalue=$conf->global->AGENDA_DISABLE_EXT;
if ($selectedvalue==1) $selectedvalue=0; else $selectedvalue=1;
-$var=true;
print '
| '.$langs->trans("Color").' | '; print ""; $i=1; -$var=true; while ($i <= $MAXAGENDA) { $key=$i; @@ -189,7 +188,7 @@ while ($i <= $MAXAGENDA) $offsettz='AGENDA_EXT_OFFSETTZ_'.$id.'_'.$key; $color='AGENDA_EXT_COLOR_'.$id.'_'.$key; - + print '
| '.$langs->trans("AgendaExtNb",$key)." | "; diff --git a/htdocs/user/bank.php b/htdocs/user/bank.php index c9551cdbc23..9f36bc91e31 100644 --- a/htdocs/user/bank.php +++ b/htdocs/user/bank.php @@ -50,7 +50,8 @@ $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); $object = new User($db); if ($id > 0 || ! empty($ref)) { - $result = $object->fetch($id, $ref); + $result = $object->fetch($id, $ref, '', 1); + $object->getrights(); } /* diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 3255dc676cf..675f5748842 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1140,7 +1140,7 @@ else if ($id > 0) { - $object->fetch($id); + $object->fetch($id, '', '', 1); if ($res < 0) { dol_print_error($db,$object->error); exit; } $res=$object->fetch_optionals($object->id,$extralabels); diff --git a/htdocs/user/clicktodial.php b/htdocs/user/clicktodial.php index 5299f348431..1500a3be55c 100644 --- a/htdocs/user/clicktodial.php +++ b/htdocs/user/clicktodial.php @@ -83,7 +83,8 @@ llxHeader("","ClickToDial"); if ($id > 0) { $object = new User($db); - $object->fetch($id); + $object->fetch($id, '', '', 1); + $object->getrights(); $object->fetch_clicktodial(); diff --git a/htdocs/user/document.php b/htdocs/user/document.php index a8d5000e809..8b055979992 100644 --- a/htdocs/user/document.php +++ b/htdocs/user/document.php @@ -86,7 +86,7 @@ if (! $sortfield) $sortfield="name"; $object = new User($db); if ($id > 0 || ! empty($ref)) { - $result = $object->fetch($id, $ref); + $result = $object->fetch($id, $ref, '', 1); $object->getrights(); $entitytouseforuserdir = $object->entity; if (empty($entitytouseforuserdir)) $entitytouseforuserdir=1; diff --git a/htdocs/user/info.php b/htdocs/user/info.php index 86bff7147ff..d20624063f2 100644 --- a/htdocs/user/info.php +++ b/htdocs/user/info.php @@ -34,7 +34,7 @@ $id = GETPOST('id','int'); $object = new User($db); if ($id > 0 || ! empty($ref)) { - $result = $object->fetch($id, $ref); + $result = $object->fetch($id, $ref, '', 1); $object->getrights(); } diff --git a/htdocs/user/ldap.php b/htdocs/user/ldap.php index 0f0cc6b4ed7..252ed9f82b4 100644 --- a/htdocs/user/ldap.php +++ b/htdocs/user/ldap.php @@ -42,7 +42,7 @@ if ($user->id == $id) $feature2=''; // A user can always read its own card $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); $object = new User($db); -$object->fetch($id); +$object->fetch($id, '', '', 1); $object->getrights(); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array diff --git a/htdocs/user/note.php b/htdocs/user/note.php index ca9f821d14c..2844676a465 100644 --- a/htdocs/user/note.php +++ b/htdocs/user/note.php @@ -36,7 +36,7 @@ $langs->load("bills"); $langs->load("users"); $object = new User($db); -$object->fetch($id); +$object->fetch($id, '', '', 1); $object->getrights(); // If user is not user read and no permission to read other users, we stop @@ -53,9 +53,9 @@ $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); $hookmanager->initHooks(array('usercard','globalcard')); -/******************************************************************************/ -/* Actions */ -/******************************************************************************/ +/* + * Actions + */ $parameters=array('id'=>$socid); $reshook=$hookmanager->executeHooks('doActions',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks @@ -76,9 +76,9 @@ if (empty($reshook)) { } -/******************************************************************************/ -/* Affichage fiche */ -/******************************************************************************/ +/* + * View + */ llxHeader(); diff --git a/htdocs/user/notify/card.php b/htdocs/user/notify/card.php index 4f47578f543..2b7c31d75df 100644 --- a/htdocs/user/notify/card.php +++ b/htdocs/user/notify/card.php @@ -122,7 +122,8 @@ if ($action == 'delete') $form = new Form($db); $object = new User($db); -$result=$object->fetch($id); +$result=$object->fetch($id, '', '', 1); +$object->getrights(); $title=$langs->trans("ThirdParty").' - '.$langs->trans("Notification"); if (! empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name.' - '.$langs->trans("Notification"); diff --git a/htdocs/user/perms.php b/htdocs/user/perms.php index e84cfe09ca8..b40c79f783e 100644 --- a/htdocs/user/perms.php +++ b/htdocs/user/perms.php @@ -68,7 +68,7 @@ $result = restrictedArea($user, 'user', $id, 'user&user', $feature2); if ($user->id <> $id && ! $canreaduser) accessforbidden(); $object = new User($db); -$object->fetch($id); +$object->fetch($id, '', '', 1); $object->getrights(); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array