user hasRight

This commit is contained in:
Frédéric FRANCE 2023-02-27 10:34:28 +01:00
parent e836cc4f55
commit 2daa9b2dba
12 changed files with 12 additions and 12 deletions

View File

@ -64,7 +64,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
print '</td>';
echo '<td class="linkedcol-date">'.dol_print_date($objectlink->date_creation, 'day').'</td>';
echo '<td class="linkedcol-amount right">';
if ($user->rights->commande->lire) {
if ($user->hasRight('commande', 'lire')) {
$total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht);
}

View File

@ -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();

View File

@ -55,7 +55,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
echo '<td class="linkedcol-ref">'.$objectlink->ref_client.'</td>';
echo '<td class="linkedcol-date center">'.dol_print_date($objectlink->date, 'day').'</td>';
echo '<td class="linkedcol-amount right">';
if ($user->rights->commande->lire) {
if ($user->hasRight('commande', 'lire')) {
$total = $total + $objectlink->total_ht;
echo price($objectlink->total_ht);
}

View File

@ -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");

View File

@ -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";

View File

@ -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';

View File

@ -517,7 +517,7 @@ if ($id > 0 || !empty($ref)) {
print '<table width="100%" class="nobordernopadding"><tr><td>';
print $langs->trans('IncotermLabel');
print '<td><td class="right">';
if ($user->rights->commande->creer) {
if ($user->hasRight('commande', 'creer')) {
print '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'/expedition/shipment.php?id='.$object->id.'&action=editincoterm&token='.newToken().'">'.img_edit().'</a>';
} else {
print '&nbsp;';

View File

@ -127,7 +127,7 @@ if ($object->id) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {
if ($user->hasRight('commande', 'creer')) {
if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
$morehtmlref .= ' : ';

View File

@ -82,7 +82,7 @@ $morehtmlref .= $langs->trans('ThirdParty').' : '.$object->thirdparty->getNomUrl
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {
if ($user->hasRight('commande', 'creer')) {
if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
$morehtmlref .= ' : ';

View File

@ -92,7 +92,7 @@ if ($id > 0 || !empty($ref)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {
if ($user->hasRight('commande', 'creer')) {
if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $object->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
$morehtmlref .= ' : ';

View File

@ -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";

View File

@ -541,7 +541,7 @@ if (!$ret) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {
if ($user->hasRight('commande', 'creer')) {
if ($action != 'classify') {
//$morehtmlref.='<a class="editfielda" href="' . $_SERVER['PHP_SELF'] . '?action=classify&token='.newToken().'&id=' . $fichinter->id . '">' . img_edit($langs->transnoentitiesnoconv('SetProject')) . '</a> : ';
$morehtmlref .= ' : ';