Fix: Hide supplier info if permission to read suppliers not on

This commit is contained in:
eldy 2011-10-10 00:03:26 +02:00
parent 02ebcdfed2
commit 11beb15d9a
6 changed files with 16 additions and 15 deletions

View File

@ -891,7 +891,7 @@ class Form
else else
{ {
$out.= '<select class="flat" name="'.$htmlname.'" disabled="disabled">'; $out.= '<select class="flat" name="'.$htmlname.'" disabled="disabled">';
$out.= '<option value="">'.$langs->trans("EmptyList").'</option>'; $out.= '<option value="">'.$langs->trans("None").'</option>';
} }
$out.= '</select>'; $out.= '</select>';
} }
@ -3648,7 +3648,7 @@ class Form
else else
{ {
$out.= '<select class="flat" name="'.$htmlname.'" disabled="disabled">'; $out.= '<select class="flat" name="'.$htmlname.'" disabled="disabled">';
$out.= '<option value="">'.$langs->trans("EmptyList").'</option>'; $out.= '<option value="">'.$langs->trans("None").'</option>';
} }
$out.= '</select>'; $out.= '</select>';
} }

View File

@ -40,9 +40,9 @@ $langs->load('companies');
$langs->load('commercial'); $langs->load('commercial');
// Security check // Security check
$socid = isset($_GET["socid"])?$_GET["socid"]:''; $socid = GETPOST("socid");
if ($user->societe_id) $socid=$user->societe_id; if ($user->societe_id) $socid=$user->societe_id;
$result = restrictedArea($user, 'societe',$socid,''); $result = restrictedArea($user, 'societe&fournisseur', $socid, '');
/* /*

View File

@ -58,7 +58,7 @@ function societe_prepare_head($object)
$head[$h][2] = 'customer'; $head[$h][2] = 'customer';
$h++; $h++;
} }
if (! empty($conf->fournisseur->enabled) && ($object->fournisseur || (isset($object->object) && $object->object->fournisseur))) if (! empty($conf->fournisseur->enabled) && ($object->fournisseur || (isset($object->object) && $object->object->fournisseur)) && ! empty($user->rights->fournisseur->lire))
{ {
$head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$object->id; $head[$h][0] = DOL_URL_ROOT.'/fourn/fiche.php?socid='.$object->id;
$head[$h][1] = $langs->trans("Supplier"); $head[$h][1] = $langs->trans("Supplier");

View File

@ -207,10 +207,10 @@ if ($_GET["id"] || $_GET["ref"])
{ {
if (! $graphfiles[$key]['file']) continue; if (! $graphfiles[$key]['file']) continue;
if ($graphfiles == 'propal' && ! $user->right->propale->lire) continue; if ($graphfiles == 'propal' && ! $user->rights->propale->lire) continue;
if ($graphfiles == 'order' && ! $user->right->commande->lire) continue; if ($graphfiles == 'order' && ! $user->rights->commande->lire) continue;
if ($graphfiles == 'invoices' && ! $user->right->facture->lire) continue; if ($graphfiles == 'invoices' && ! $user->rights->facture->lire) continue;
if ($graphfiles == 'invoices_suppliers' && ! $user->right->fournisseur->facture->lire) continue; if ($graphfiles == 'invoices_suppliers' && ! $user->rights->fournisseur->facture->lire) continue;
if ($i % 2 == 0) print '<tr>'; if ($i % 2 == 0) print '<tr>';

View File

@ -715,7 +715,7 @@ else
print '</td></tr>'; print '</td></tr>';
if ($conf->fournisseur->enabled) if ($conf->fournisseur->enabled && ! empty($user->rights->fournisseur->lire))
{ {
// Supplier // Supplier
print '<tr>'; print '<tr>';
@ -1146,7 +1146,7 @@ else
print '</td></tr>'; print '</td></tr>';
// Supplier // Supplier
if ($conf->fournisseur->enabled) if ($conf->fournisseur->enabled && ! empty($user->rights->fournisseur->lire))
{ {
print '<tr>'; print '<tr>';
print '<td><span class="fieldrequired">'.$langs->trans('Supplier').'</span></td><td>'; print '<td><span class="fieldrequired">'.$langs->trans('Supplier').'</span></td><td>';
@ -1465,7 +1465,7 @@ else
$rowspan=4; $rowspan=4;
if (! empty($conf->global->SOCIETE_USEPREFIX)) $rowspan++; if (! empty($conf->global->SOCIETE_USEPREFIX)) $rowspan++;
if ($object->client) $rowspan++; if ($object->client) $rowspan++;
if ($conf->fournisseur->enabled && $object->fournisseur) $rowspan++; if ($conf->fournisseur->enabled && $object->fournisseur && ! empty($user->rights->fournisseur->lire)) $rowspan++;
if ($conf->global->MAIN_MODULE_BARCODE) $rowspan++; if ($conf->global->MAIN_MODULE_BARCODE) $rowspan++;
if (empty($conf->global->SOCIETE_DISABLE_STATE)) $rowspan++; if (empty($conf->global->SOCIETE_DISABLE_STATE)) $rowspan++;
$showlogo=''; $showlogo='';
@ -1494,7 +1494,7 @@ else
print '</tr>'; print '</tr>';
} }
if ($conf->fournisseur->enabled && $object->fournisseur) if ($conf->fournisseur->enabled && $object->fournisseur && ! empty($user->rights->fournisseur->lire))
{ {
print '<tr><td>'; print '<tr><td>';
print $langs->trans('SupplierCode').'</td><td colspan="'.(2+($object->logo?0:1)).'">'; print $langs->trans('SupplierCode').'</td><td colspan="'.(2+($object->logo?0:1)).'">';

View File

@ -253,9 +253,10 @@ if ($action == 'create')
print '</textarea>'; print '</textarea>';
} }
print "</textarea></td></tr>\n"; print "</textarea></td></tr>\n";
print "<tr>".'<td align="center" colspan="2"><input class="button" value="'.$langs->trans("CreateGroup").'" type="submit"></td></tr>';
print "</table>\n"; print "</table>\n";
print '<center><br><input class="button" value="'.$langs->trans("CreateGroup").'" type="submit"></center>';
print "</form>"; print "</form>";
} }