hide purchase price unless the user has the appropriate rights

Conflicts:
	htdocs/product/liste.php
This commit is contained in:
Cédric Salvador 2013-09-03 11:36:56 +02:00
parent d7a14a15b3
commit d592e776fd

View File

@ -303,7 +303,9 @@ else
print_liste_field_titre($langs->trans("DateModification"), $_SERVER["PHP_SELF"], "p.tms",$param,"",'align="center"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("DateModification"), $_SERVER["PHP_SELF"], "p.tms",$param,"",'align="center"',$sortfield,$sortorder);
if (! empty($conf->service->enabled) && $type != 0) print_liste_field_titre($langs->trans("Duration"), $_SERVER["PHP_SELF"], "p.duration",$param,"",'align="center"',$sortfield,$sortorder); if (! empty($conf->service->enabled) && $type != 0) print_liste_field_titre($langs->trans("Duration"), $_SERVER["PHP_SELF"], "p.duration",$param,"",'align="center"',$sortfield,$sortorder);
if (empty($conf->global->PRODUIT_MULTIPRICES)) print_liste_field_titre($langs->trans("SellingPrice"), $_SERVER["PHP_SELF"], "p.price",$param,"",'align="right"',$sortfield,$sortorder); if (empty($conf->global->PRODUIT_MULTIPRICES)) print_liste_field_titre($langs->trans("SellingPrice"), $_SERVER["PHP_SELF"], "p.price",$param,"",'align="right"',$sortfield,$sortorder);
print '<td class="liste_titre" align="right">'.$langs->trans("BuyingPriceMinShort").'</td>'; if ($user->rights->produit->creer) {
print '<td class="liste_titre" align="right">'.$langs->trans("BuyingPriceMinShort").'</td>';
}
if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) print '<td class="liste_titre" align="right">'.$langs->trans("DesiredStock").'</td>'; if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) print '<td class="liste_titre" align="right">'.$langs->trans("DesiredStock").'</td>';
if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) print '<td class="liste_titre" align="right">'.$langs->trans("PhysicalStock").'</td>'; if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) print '<td class="liste_titre" align="right">'.$langs->trans("PhysicalStock").'</td>';
print_liste_field_titre($langs->trans("Sell"), $_SERVER["PHP_SELF"], "p.tosell",$param,"",'align="right"',$sortfield,$sortorder); print_liste_field_titre($langs->trans("Sell"), $_SERVER["PHP_SELF"], "p.tosell",$param,"",'align="right"',$sortfield,$sortorder);
@ -345,9 +347,11 @@ else
} }
// Minimum buying Price // Minimum buying Price
print '<td class="liste_titre">'; if ($user->rights->produit->creer) {
print '&nbsp;'; print '<td class="liste_titre">';
print '</td>'; print '&nbsp;';
print '</td>';
}
// Stock // Stock
if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1)
@ -442,21 +446,23 @@ else
} }
// Better buy price // Better buy price
print '<td align="right">'; if ($user->rights->produit->creer) {
if ($objp->minsellprice != '') print '<td align="right">';
{ if ($objp->minsellprice != '')
//print price($objp->minsellprice).' '.$langs->trans("HT"); {
if ($product_fourn->find_min_price_product_fournisseur($objp->rowid) > 0) //print price($objp->minsellprice).' '.$langs->trans("HT");
{ if ($product_fourn->find_min_price_product_fournisseur($objp->rowid) > 0)
if ($product_fourn->product_fourn_price_id > 0) {
{ if ($product_fourn->product_fourn_price_id > 0)
$htmltext=$product_fourn->display_price_product_fournisseur(); {
if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) print $form->textwithpicto(price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"),$htmltext); $htmltext=$product_fourn->display_price_product_fournisseur();
else print price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"); if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->lire) print $form->textwithpicto(price($product_fourn->fourn_unitprice).' '.$langs->trans("HT"),$htmltext);
} else print price($product_fourn->fourn_unitprice).' '.$langs->trans("HT");
} }
}
}
print '</td>';
} }
print '</td>';
// Show stock // Show stock
if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1) if (! empty($conf->stock->enabled) && $user->rights->stock->lire && $type != 1)