2
0
forked from Wavyzz/dolibarr

Fix: hide tab "agenda" if "agenda" module is disable

This commit is contained in:
Regis Houssin
2010-10-29 15:55:15 +00:00
parent cd71917531
commit f286ae9d61
2 changed files with 11 additions and 15 deletions

View File

@@ -65,20 +65,13 @@ function societe_prepare_head($objsoc)
$head[$h][2] = 'supplier'; $head[$h][2] = 'supplier';
$h++; $h++;
} }
/*if ($conf->facture->enabled || $conf->compta->enabled || $conf->accounting->enabled) if ($conf->agenda->enabled)
{ {
$langs->load("compta"); $head[$h][0] = DOL_URL_ROOT.'/societe/agenda.php?socid='.$objsoc->id;
$head[$h][0] = DOL_URL_ROOT.'/compta/fiche.php?socid='.$objsoc->id; $head[$h][1] = $langs->trans("Agenda");
$head[$h][1] = $langs->trans("Accountancy"); $head[$h][2] = 'agenda';
$head[$h][2] = 'compta'; $h++;
$h++; }
}*/
$head[$h][0] = DOL_URL_ROOT.'/societe/agenda.php?socid='.$objsoc->id;
$head[$h][1] = $langs->trans("Agenda");
$head[$h][2] = 'agenda';
$h++;
//show categorie tab //show categorie tab
if ($conf->categorie->enabled) if ($conf->categorie->enabled)
{ {
@@ -103,7 +96,6 @@ function societe_prepare_head($objsoc)
$head[$h][2] = 'document'; $head[$h][2] = 'document';
$h++; $h++;
} }
if ($conf->notification->enabled && $user->societe_id == 0) if ($conf->notification->enabled && $user->societe_id == 0)
{ {
$head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$objsoc->id; $head[$h][0] = DOL_URL_ROOT.'/societe/notify/fiche.php?socid='.$objsoc->id;
@@ -111,7 +103,6 @@ function societe_prepare_head($objsoc)
$head[$h][2] = 'notify'; $head[$h][2] = 'notify';
$h++; $h++;
} }
if ($user->societe_id == 0) if ($user->societe_id == 0)
{ {
$head[$h][0] = DOL_URL_ROOT.'/societe/info.php?socid='.$objsoc->id; $head[$h][0] = DOL_URL_ROOT.'/societe/info.php?socid='.$objsoc->id;

View File

@@ -33,6 +33,10 @@ if (! $user->rights->user->user->lire && !$user->admin)
$langs->load("users"); $langs->load("users");
// Security check (for external users)
$socid=0;
if ($user->societe_id > 0) $socid = $user->societe_id;
/* /*
* View * View
@@ -89,6 +93,7 @@ $sql.= " s.nom, s.canvas";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_societe = s.rowid"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_societe = s.rowid";
$sql.= " WHERE u.entity IN (0,".$conf->entity.")"; $sql.= " WHERE u.entity IN (0,".$conf->entity.")";
if (!empty($socid)) $sql.= " AND u.fk_societe = ".$socid;
$sql.= $db->order("u.datec","DESC"); $sql.= $db->order("u.datec","DESC");
$sql.= $db->plimit($max); $sql.= $db->plimit($max);