diff --git a/htdocs/bom/tpl/linkedobjectblock.tpl.php b/htdocs/bom/tpl/linkedobjectblock.tpl.php
index 1765e9a84c1..d00340a1322 100644
--- a/htdocs/bom/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/bom/tpl/linkedobjectblock.tpl.php
@@ -64,7 +64,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
print '';
echo '
'.dol_print_date($objectlink->date_creation, 'day').' | ';
echo '';
- if ($user->rights->commande->lire) {
+ if ($user->hasRight('commande', 'lire')) {
$total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht);
}
diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php
index c332848434a..1c72f0ef4ff 100644
--- a/htdocs/commande/class/commande.class.php
+++ b/htdocs/commande/class/commande.class.php
@@ -2463,7 +2463,7 @@ class Commande extends CommonOrder
{
$remise = trim($remise) ?trim($remise) : 0;
- if ($user->rights->commande->creer) {
+ if ($user->hasRight('commande', 'creer')) {
$error = 0;
$this->db->begin();
diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php
index a6a1fde3851..323ef0aefa6 100644
--- a/htdocs/commande/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php
@@ -55,7 +55,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
echo ' | '.$objectlink->ref_client.' | ';
echo ''.dol_print_date($objectlink->date, 'day').' | ';
echo '';
- if ($user->rights->commande->lire) {
+ if ($user->hasRight('commande', 'lire')) {
$total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht);
}
diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php
index 4c8e50624c2..1653bd06c08 100644
--- a/htdocs/contrat/card.php
+++ b/htdocs/contrat/card.php
@@ -2123,7 +2123,7 @@ if ($action == 'create') {
if (isModEnabled('commande') && $object->statut > 0 && $object->nbofservicesclosed < $nbofservices) {
$langs->load("orders");
- if ($user->rights->commande->creer) {
+ if ($user->hasRight('commande', 'creer')) {
print dolGetButtonAction($langs->trans('CreateOrder'), '', 'default', DOL_URL_ROOT.'/commande/card.php?action=create&token='.newToken().'&origin='.$object->element.'&originid='.$object->id.'&socid='.$object->thirdparty->id, '', true, $params);
} else {
$params['attr']['title'] = $langs->trans("NotEnoughPermissions");
diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php
index f5764c8a575..f0534728aad 100644
--- a/htdocs/core/boxes/box_commandes.php
+++ b/htdocs/core/boxes/box_commandes.php
@@ -85,7 +85,7 @@ class box_commandes extends ModeleBoxes
$this->info_box_head = array('text' => $langs->trans("BoxTitleLast".(!empty($conf->global->MAIN_LASTBOX_ON_OBJECT_DATE) ? "" : "Modified")."CustomerOrders", $max));
- if ($user->rights->commande->lire) {
+ if ($user->hasRight('commande', 'lire')) {
$sql = "SELECT s.rowid as socid, s.nom as name, s.name_alias";
$sql .= ", s.code_client, s.code_compta, s.client";
$sql .= ", s.logo, s.email, s.entity";
diff --git a/htdocs/core/boxes/box_graph_orders_permonth.php b/htdocs/core/boxes/box_graph_orders_permonth.php
index 0d8f41bc6ea..47b10fa5749 100644
--- a/htdocs/core/boxes/box_graph_orders_permonth.php
+++ b/htdocs/core/boxes/box_graph_orders_permonth.php
@@ -103,7 +103,7 @@ class box_graph_orders_permonth extends ModeleBoxes
$prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user
}
- if ($user->rights->commande->lire) {
+ if ($user->hasRight('commande', 'lire')) {
$langs->load("orders");
$param_year = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php
index c61249877a3..325559882d8 100644
--- a/htdocs/expedition/shipment.php
+++ b/htdocs/expedition/shipment.php
@@ -517,7 +517,7 @@ if ($id > 0 || !empty($ref)) {
print '| ';
print $langs->trans('IncotermLabel');
print ' | | ';
- if ($user->rights->commande->creer) {
+ if ($user->hasRight('commande', 'creer')) {
print ''.img_edit().'';
} else {
print ' ';
diff --git a/htdocs/fichinter/document.php b/htdocs/fichinter/document.php
index 3b4721d63a0..52d1019d755 100644
--- a/htdocs/fichinter/document.php
+++ b/htdocs/fichinter/document.php
@@ -127,7 +127,7 @@ if ($object->id) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
- if ($user->rights->commande->creer) {
+ if ($user->hasRight('commande', 'creer')) {
if ($action != 'classify') {
//$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
diff --git a/htdocs/fichinter/info.php b/htdocs/fichinter/info.php
index da1af1d613b..77e31705790 100644
--- a/htdocs/fichinter/info.php
+++ b/htdocs/fichinter/info.php
@@ -82,7 +82,7 @@ $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
- if ($user->rights->commande->creer) {
+ if ($user->hasRight('commande', 'creer')) {
if ($action != 'classify') {
//$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
diff --git a/htdocs/fichinter/note.php b/htdocs/fichinter/note.php
index 93bd60e519b..f80f08a44bc 100644
--- a/htdocs/fichinter/note.php
+++ b/htdocs/fichinter/note.php
@@ -92,7 +92,7 @@ if ($id > 0 || !empty($ref)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
- if ($user->rights->commande->creer) {
+ if ($user->hasRight('commande', 'creer')) {
if ($action != 'classify') {
//$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php
index 1df4f70c063..d5854fdc702 100644
--- a/htdocs/product/stats/commande.php
+++ b/htdocs/product/stats/commande.php
@@ -136,7 +136,7 @@ if ($id > 0 || !empty($ref)) {
print dol_get_fiche_end();
- if ($user->rights->commande->lire) {
+ if ($user->hasRight('commande', 'lire')) {
$sql = "SELECT DISTINCT s.nom as name, s.rowid as socid, s.code_client, c.rowid, d.total_ht as total_ht, c.ref,";
$sql .= " c.ref_client,";
$sql .= " c.date_commande, c.fk_statut as statut, c.facture, c.rowid as commandeid, d.rowid, d.qty";
diff --git a/htdocs/resource/element_resource.php b/htdocs/resource/element_resource.php
index f69b82727f0..d1631d94d94 100644
--- a/htdocs/resource/element_resource.php
+++ b/htdocs/resource/element_resource.php
@@ -541,7 +541,7 @@ if (!$ret) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= ' '.$langs->trans('Project').' ';
- if ($user->rights->commande->creer) {
+ if ($user->hasRight('commande', 'creer')) {
if ($action != 'classify') {
//$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
|
|