Modif: on cache les onglets "note", "notifications" et "info" de la fiche société pour
 un utilisateur externe.
This commit is contained in:
Regis Houssin 2006-07-30 18:03:59 +00:00
parent 1edb516b88
commit e854700da5
3 changed files with 24 additions and 12 deletions

View File

@ -81,7 +81,7 @@ if ($_GET["action"] == 'attribute_prefix')
$societe->attribute_prefix($db, $_GET["socid"]); $societe->attribute_prefix($db, $_GET["socid"]);
} }
// conditions de règlement // conditions de règlement
if ($_POST["action"] == 'setconditions') if ($_POST["action"] == 'setconditions' && (!$user->societe_id > 0))
{ {
$societe = new Societe($db, $_GET["socid"]); $societe = new Societe($db, $_GET["socid"]);
@ -92,7 +92,7 @@ if ($_POST["action"] == 'setconditions')
if (! $result) dolibarr_print_error($result); if (! $result) dolibarr_print_error($result);
} }
// mode de règlement // mode de règlement
if ($_POST["action"] == 'setmode') if ($_POST["action"] == 'setmode' && (!$user->societe_id > 0))
{ {
$societe = new Societe($db, $_GET["socid"]); $societe = new Societe($db, $_GET["socid"]);
$societe->mode_reglement=$_POST['mode_reglement_id']; $societe->mode_reglement=$_POST['mode_reglement_id'];
@ -102,7 +102,7 @@ if ($_POST["action"] == 'setmode')
if (! $result) dolibarr_print_error($result); if (! $result) dolibarr_print_error($result);
} }
// assujétissement à la TVA // assujétissement à la TVA
if ($_POST["action"] == 'setassujtva') if ($_POST["action"] == 'setassujtva' && (!$user->societe_id > 0))
{ {
$societe = new Societe($db, $_GET["socid"]); $societe = new Societe($db, $_GET["socid"]);
$societe->tva_assuj=$_POST['assujtva_value']; $societe->tva_assuj=$_POST['assujtva_value'];

View File

@ -178,7 +178,10 @@ if ($socid > 0)
print '<table width="100%" class="nobordernopadding"><tr><td nowrap>'; print '<table width="100%" class="nobordernopadding"><tr><td nowrap>';
print $langs->trans("CustomerRelativeDiscountShort"); print $langs->trans("CustomerRelativeDiscountShort");
print '<td><td align="right">'; print '<td><td align="right">';
print '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$societe->id.'">'.img_edit($langs->trans("Modify")).'</a>'; if (!$user->societe_id > 0)
{
print '<a href="'.DOL_URL_ROOT.'/comm/remise.php?id='.$societe->id.'">'.img_edit($langs->trans("Modify")).'</a>';
}
print '</td></tr></table>'; print '</td></tr></table>';
print '</td><td colspan="3">'.($societe->remise_client?$societe->remise_client.'%':$langs->trans("DiscountNone")).'</td>'; print '</td><td colspan="3">'.($societe->remise_client?$societe->remise_client.'%':$langs->trans("DiscountNone")).'</td>';
print '</tr>'; print '</tr>';
@ -189,7 +192,10 @@ if ($socid > 0)
print '<tr><td nowrap>'; print '<tr><td nowrap>';
print $langs->trans("CustomerAbsoluteDiscountShort"); print $langs->trans("CustomerAbsoluteDiscountShort");
print '<td><td align="right">'; print '<td><td align="right">';
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$societe->id.'">'.img_edit($langs->trans("Modify")).'</a>'; if (!$user->societe_id > 0)
{
print '<a href="'.DOL_URL_ROOT.'/comm/remx.php?id='.$societe->id.'">'.img_edit($langs->trans("Modify")).'</a>';
}
print '</td></tr></table>'; print '</td></tr></table>';
print '</td>'; print '</td>';
print '<td colspan="3">'; print '<td colspan="3">';

View File

@ -71,10 +71,13 @@ function societe_prepare_head($objsoc)
$h++; $h++;
} }
$head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$objsoc->id; if ($user->societe_id == 0)
$head[$h][1] = $langs->trans("Note"); {
$head[$h][2] = 'note'; $head[$h][0] = DOL_URL_ROOT.'/socnote.php?socid='.$objsoc->id;
$h++; $head[$h][1] = $langs->trans("Note");
$head[$h][2] = 'note';
$h++;
}
if ($user->societe_id == 0) if ($user->societe_id == 0)
{ {
@ -84,18 +87,21 @@ function societe_prepare_head($objsoc)
$h++; $h++;
} }
if (! $conf->global->SOCIETE_DISABLE_NOTIFICATIONS) if (! $conf->global->SOCIETE_DISABLE_NOTIFICATIONS && $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;
$head[$h][1] = $langs->trans("Notifications"); $head[$h][1] = $langs->trans("Notifications");
$head[$h][2] = 'notify'; $head[$h][2] = 'notify';
$h++; $h++;
} }
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;
$head[$h][1] = $langs->trans("Info"); $head[$h][1] = $langs->trans("Info");
$head[$h][2] = 'info'; $head[$h][2] = 'info';
$h++; $h++;
}
if ($conf->bookmark->enabled && $user->rights->bookmark->creer) if ($conf->bookmark->enabled && $user->rights->bookmark->creer)
{ {