2
0
forked from Wavyzz/dolibarr

Merge pull request #25216 from frederic34/20230627

use isModEnabled
This commit is contained in:
Laurent Destailleur
2023-06-28 16:18:53 +02:00
committed by GitHub
10 changed files with 69 additions and 49 deletions

View File

@@ -890,7 +890,7 @@ if ($resql) {
$moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"').$formother->select_categories('customer', $search_categ_cus, 'search_categ_cus', 1, $tmptitle, 'maxwidth300 widthcentpercentminusx');
$moreforfilter .= '</div>';
}
if (!empty($conf->stock->enabled) && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
if (isModEnabled('stock') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_ORDER)) {
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
$moreforfilter .= '<div class="divsearchfield">';
@@ -1994,7 +1994,7 @@ if ($resql) {
// Show shippable Icon (this creates subloops, so may be slow)
if (!empty($arrayfields['shippable']['checked'])) {
print '<td class="center">';
if (!empty($show_shippable_command) && !empty($conf->stock->enabled)) {
if (!empty($show_shippable_command) && isModEnabled('stock')) {
if (($obj->fk_statut > $generic_commande::STATUS_DRAFT) && ($obj->fk_statut < $generic_commande::STATUS_CLOSED)) {
$generic_commande->loadExpeditions(); // Load array ->expeditions
@@ -2034,7 +2034,7 @@ if ($resql) {
$stock_order = 0;
$stock_order_supplier = 0;
if (!empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT) || !empty($conf->global->STOCK_CALCULATE_ON_SHIPMENT_CLOSE)) { // What about other options ?
if (!empty($conf->commande->enabled)) {
if (isModEnabled('commande')) {
if (empty($productstat_cache[$obj->fk_product]['stats_order_customer'])) {
$generic_product->load_stats_commande(0, '1,2');
$productstat_cache[$obj->fk_product]['stats_order_customer'] = $generic_product->stats_commande['qty'];

View File

@@ -182,7 +182,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (isModEnabled('don')) {
$nbElements += $project->getElementCount('donation', 'don');
}
if (!empty($conf->loan->enabled)) {
if (isModEnabled('loan')) {
$nbElements += $project->getElementCount('loan', 'loan');
}
if (isModEnabled('tax')) {
@@ -194,7 +194,7 @@ function project_prepare_head(Project $project, $moreparam = '')
if (isModEnabled('stock')) {
$nbElements += $project->getElementCount('stock_mouvement', 'stock');
}
if (!empty($conf->salaries->enabled)) {
if (isModEnabled('salaries')) {
$nbElements += $project->getElementCount('salaries', 'payment_salary');
}
if (isModEnabled("banque")) {

View File

@@ -141,7 +141,7 @@ function user_prepare_head(User $object)
// $this->tabs = array('entity:-tabname); to remove a tab
complete_head_from_modules($conf, $langs, $object, $head, $h, 'user');
if ((!empty($conf->salaries->enabled) && !empty($user->rights->salaries->read))
if ((isModEnabled('salaries') && !empty($user->rights->salaries->read))
|| (isModEnabled('hrm') && !empty($user->rights->hrm->employee->read))
|| (isModEnabled('expensereport') && !empty($user->rights->expensereport->lire) && ($user->id == $object->id || $user->rights->expensereport->readall))
|| (isModEnabled('holiday') && !empty($user->rights->holiday->read) && ($user->id == $object->id || $user->rights->holiday->readall))

View File

@@ -344,7 +344,7 @@ if (empty($conf->global->ECM_AUTO_TREE_HIDEN)) {
$rowspan++; $sectionauto[] = array('position'=>100, 'level'=>1, 'module'=>'tax', 'test'=>isModEnabled('tax'), 'label'=>$langs->trans("SocialContributions"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("SocialContributions")));
$rowspan++; $sectionauto[] = array('position'=>110, 'level'=>1, 'module'=>'tax-vat', 'test'=>isModEnabled('tax'), 'label'=>$langs->trans("VAT"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("VAT")));
}
if (!empty($conf->salaries->enabled)) {
if (isModEnabled('salaries')) {
$langs->load("compta");
$rowspan++; $sectionauto[] = array('position'=>120, 'level'=>1, 'module'=>'salaries', 'test'=>isModEnabled('salaries'), 'label'=>$langs->trans("Salaries"), 'desc'=>$langs->trans("ECMDocsBy", $langs->transnoentitiesnoconv("Salaries")));
}

View File

@@ -181,7 +181,7 @@ if (ismodEnabled('productbatch') &&
// Purchase price and project
print '<tr>';
print '<td>'.$langs->trans("UnitPurchaseValue").'</td>';
print '<td colspan="'.(!empty($conf->project->enabled) ? '1' : '3').'"><input name="unitprice" id="unitprice" size="10" value="'.GETPOST("unitprice").'"></td>';
print '<td colspan="'.(isModEnabled('project') ? '1' : '3').'"><input name="unitprice" id="unitprice" size="10" value="'.GETPOST("unitprice").'"></td>';
if (isModEnabled('project')) {
print '<td>'.$langs->trans('Project').'</td>';
print '<td>';

View File

@@ -6,10 +6,9 @@
* Copyright (C) 2015-2021 Alexandre Spangaro <aspangaro@open-dsi.fr>
* Copyright (C) 2015 Marcos García <marcosgdf@gmail.com>
* Copyright (C) 2016 Josep Lluís Amador <joseplluis@lliuretic.cat>
* Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2021-2023 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
* Copyright (C) 2021 Noé Cendrier <noe.cendrier@altairis.fr>
* Copyright (C) 2023 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
*
* Copyright (C) 2023 Frédéric France wfrederic.france@netlogic.fr>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
@@ -81,7 +80,7 @@ if (isModEnabled('agenda')) {
if (isModEnabled('don')) {
require_once DOL_DOCUMENT_ROOT.'/don/class/don.class.php';
}
if (!empty($conf->loan->enabled)) {
if (isModEnabled('loan')) {
require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php';
require_once DOL_DOCUMENT_ROOT.'/loan/class/loanschedule.class.php';
}
@@ -94,7 +93,7 @@ if (isModEnabled('tax')) {
if (isModEnabled("banque")) {
require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/paymentvarious.class.php';
}
if (!empty($conf->salaries->enabled)) {
if (isModEnabled('salaries')) {
require_once DOL_DOCUMENT_ROOT.'/salaries/class/salary.class.php';
}
if (isModEnabled('categorie')) {
@@ -127,10 +126,10 @@ if (isModEnabled('expensereport')) {
if (isModEnabled('don')) {
$langs->load("donations");
}
if (!empty($conf->loan->enabled)) {
if (isModEnabled('loan')) {
$langs->load("loan");
}
if (!empty($conf->salaries->enabled)) {
if (isModEnabled('salaries')) {
$langs->load("salaries");
}
if (isModEnabled('mrp')) {
@@ -378,7 +377,8 @@ $listofreferent = array(
'buttonnew'=>'AddWarehouse',
'project_field'=>'fk_project',
'testnew'=>$user->hasRight('stock', 'creer'),
'test'=>!empty($conf->stock->enabled) && $user->hasRight('stock', 'lire') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT)),
'test'=>isModEnabled('stock') && $user->hasRight('stock', 'lire') && !empty($conf->global->WAREHOUSE_ASK_WAREHOUSE_DURING_PROJECT)
),
'propal'=>array(
'name'=>"Proposals",
'title'=>"ListProposalsAssociatedProject",
@@ -389,7 +389,8 @@ $listofreferent = array(
'lang'=>'propal',
'buttonnew'=>'AddProp',
'testnew'=>$user->hasRight('propal', 'creer'),
'test'=>!empty($conf->propal->enabled) && $user->hasRight('propal', 'lire')),
'test'=>isModEnabled('propal') && $user->hasRight('propal', 'lire')
),
'order'=>array(
'name'=>"CustomersOrders",
'title'=>"ListOrdersAssociatedProject",
@@ -400,7 +401,8 @@ $listofreferent = array(
'lang'=>'orders',
'buttonnew'=>'CreateOrder',
'testnew'=>$user->hasRight('commande', 'creer'),
'test'=>!empty($conf->commande->enabled) && $user->hasRight('commande', 'lire')),
'test'=>isModEnabled('commande') && $user->hasRight('commande', 'lire')
),
'invoice'=>array(
'name'=>"CustomersInvoices",
'title'=>"ListInvoicesAssociatedProject",
@@ -412,7 +414,8 @@ $listofreferent = array(
'lang'=>'bills',
'buttonnew'=>'CreateBill',
'testnew'=>$user->hasRight('facture', 'creer'),
'test'=>isModEnabled('facture') && $user->hasRight('facture', 'lire')),
'test'=>isModEnabled('facture') && $user->hasRight('facture', 'lire')
),
'invoice_predefined'=>array(
'name'=>"PredefinedInvoices",
'title'=>"ListPredefinedInvoicesAssociatedProject",
@@ -423,7 +426,8 @@ $listofreferent = array(
'lang'=>'bills',
'buttonnew'=>'CreateBill',
'testnew'=>$user->hasRight('facture', 'creer'),
'test'=>isModEnabled('facture') && $user->hasRight('facture', 'lire')),
'test'=>isModEnabled('facture') && $user->hasRight('facture', 'lire')
),
'proposal_supplier'=>array(
'name'=>"SupplierProposals",
'title'=>"ListSupplierProposalsAssociatedProject",
@@ -434,7 +438,8 @@ $listofreferent = array(
'lang'=>'supplier_proposal',
'buttonnew'=>'AddSupplierProposal',
'testnew'=>$user->hasRight('supplier_proposal', 'creer'),
'test'=>!empty($conf->supplier_proposal->enabled) && $user->hasRight('supplier_proposal', 'lire')),
'test'=>isModEnabled('supplier_proposal') && $user->hasRight('supplier_proposal', 'lire')
),
'order_supplier'=>array(
'name'=>"SuppliersOrders",
'title'=>"ListSupplierOrdersAssociatedProject",
@@ -445,7 +450,8 @@ $listofreferent = array(
'lang'=>'suppliers',
'buttonnew'=>'AddSupplierOrder',
'testnew'=>$user->hasRight('fournisseur', 'commande', 'creer') || $user->hasRight('supplier_order', 'creer'),
'test'=>!empty($conf->supplier_order->enabled) && $user->hasRight('fournisseur', 'commande', 'lire') || $user->hasRight('supplier_order', 'lire')),
'test'=>isModEnabled('supplier_order') && $user->hasRight('fournisseur', 'commande', 'lire') || $user->hasRight('supplier_order', 'lire')
),
'invoice_supplier'=>array(
'name'=>"BillsSuppliers",
'title'=>"ListSupplierInvoicesAssociatedProject",
@@ -457,7 +463,8 @@ $listofreferent = array(
'lang'=>'suppliers',
'buttonnew'=>'AddSupplierInvoice',
'testnew'=>$user->hasRight('fournisseur', 'facture', 'creer') || $user->hasRight('supplier_invoice', 'creer'),
'test'=>!empty($conf->supplier_invoice->enabled) && $user->hasRight('fournisseur', 'facture', 'lire') || $user->hasRight('supplier_invoice', 'lire')),
'test'=>isModEnabled('supplier_invoice') && $user->hasRight('fournisseur', 'facture', 'lire') || $user->hasRight('supplier_invoice', 'lire')
),
'contract'=>array(
'name'=>"Contracts",
'title'=>"ListContractAssociatedProject",
@@ -468,7 +475,8 @@ $listofreferent = array(
'lang'=>'contracts',
'buttonnew'=>'AddContract',
'testnew'=>$user->hasRight('contrat', 'creer'),
'test'=>!empty($conf->contrat->enabled) && $user->hasRight('contrat', 'lire')),
'test'=>isModEnabled('contrat') && $user->hasRight('contrat', 'lire')
),
'intervention'=>array(
'name'=>"Interventions",
'title'=>"ListFichinterAssociatedProject",
@@ -481,7 +489,8 @@ $listofreferent = array(
'lang'=>'interventions',
'buttonnew'=>'AddIntervention',
'testnew'=>$user->hasRight('ficheinter', 'creer'),
'test'=>!empty($conf->ficheinter->enabled) && $user->hasRight('ficheinter', 'lire')),
'test'=>isModEnabled('ficheinter') && $user->hasRight('ficheinter', 'lire')
),
'shipping'=>array(
'name'=>"Shippings",
'title'=>"ListShippingAssociatedProject",
@@ -492,7 +501,8 @@ $listofreferent = array(
'lang'=>'sendings',
'buttonnew'=>'CreateShipment',
'testnew'=>0,
'test'=>isModEnabled('expedition') && $user->hasRight('expedition', 'lire')),
'test'=>isModEnabled('expedition') && $user->hasRight('expedition', 'lire')
),
'mrp'=>array(
'name'=>"MO",
'title'=>"ListMOAssociatedProject",
@@ -505,7 +515,8 @@ $listofreferent = array(
'testnew'=>$user->hasRight('mrp', 'write'),
'project_field'=>'fk_project',
'nototal'=>1,
'test'=>!empty($conf->mrp->enabled) && $user->hasRight('mrp', 'read')),
'test'=>isModEnabled('mrp') && $user->hasRight('mrp', 'read')
),
'trip'=>array(
'name'=>"TripsAndExpenses",
'title'=>"ListExpenseReportsAssociatedProject",
@@ -518,7 +529,8 @@ $listofreferent = array(
'lang'=>'trips',
'buttonnew'=>'AddTrip',
'testnew'=>$user->hasRight('deplacement', 'creer'),
'test'=>!empty($conf->deplacement->enabled) && $user->hasRight('deplacement', 'lire')),
'test'=>isModEnabled('deplacement') && $user->hasRight('deplacement', 'lire')
),
'expensereport'=>array(
'name'=>"ExpenseReports",
'title'=>"ListExpenseReportsAssociatedProject",
@@ -531,7 +543,8 @@ $listofreferent = array(
'lang'=>'trips',
'buttonnew'=>'AddTrip',
'testnew'=>$user->hasRight('expensereport', 'creer'),
'test'=>!empty($conf->expensereport->enabled) && $user->hasRight('expensereport', 'lire')),
'test'=>isModEnabled('expensereport') && $user->hasRight('expensereport', 'lire')
),
'donation'=>array(
'name'=>"Donation",
'title'=>"ListDonationsAssociatedProject",
@@ -544,7 +557,8 @@ $listofreferent = array(
'lang'=>'donations',
'buttonnew'=>'AddDonation',
'testnew'=>$user->hasRight('don', 'creer'),
'test'=>!empty($conf->don->enabled) && $user->hasRight('don', 'lire')),
'test'=>isModEnabled('don') && $user->hasRight('don', 'lire')
),
'loan'=>array(
'name'=>"Loan",
'title'=>"ListLoanAssociatedProject",
@@ -557,7 +571,8 @@ $listofreferent = array(
'lang'=>'loan',
'buttonnew'=>'AddLoan',
'testnew'=>$user->hasRight('loan', 'write'),
'test'=>!empty($conf->loan->enabled) && $user->hasRight('loan', 'read')),
'test'=>isModEnabled('loan') && $user->hasRight('loan', 'read')
),
'chargesociales'=>array(
'name'=>"SocialContribution",
'title'=>"ListSocialContributionAssociatedProject",
@@ -570,7 +585,8 @@ $listofreferent = array(
'lang'=>'compta',
'buttonnew'=>'AddSocialContribution',
'testnew'=>$user->hasRight('tax', 'charges', 'lire'),
'test'=>!empty($conf->tax->enabled) && $user->hasRight('tax', 'charges', 'lire')),
'test'=>isModEnabled('tax') && $user->hasRight('tax', 'charges', 'lire')
),
'project_task'=>array(
'name'=>"TaskTimeSpent",
'title'=>"ListTaskTimeUserProject",
@@ -582,7 +598,8 @@ $listofreferent = array(
'urlnew'=>DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&action=createtime&projectid='.$id.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.$id),
'buttonnew'=>'AddTimeSpent',
'testnew'=>$user->hasRight('project', 'creer'),
'test'=>!empty($conf->project->enabled) && $user->hasRight('projet', 'lire') && empty($conf->global->PROJECT_HIDE_TASKS)),
'test'=>isModEnabled('project') && $user->hasRight('projet', 'lire') && empty($conf->global->PROJECT_HIDE_TASKS)
),
'stock_mouvement'=>array(
'name'=>"MouvementStockAssociated",
'title'=>"ListMouvementStockProject",
@@ -591,7 +608,8 @@ $listofreferent = array(
'datefieldname'=>'datem',
'margin'=>'minus',
'disableamount'=>0,
'test'=>!empty($conf->stock->enabled) && $user->hasRight('stock', 'mouvement', 'lire') && !empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW)),
'test'=>isModEnabled('stock') && $user->hasRight('stock', 'mouvement', 'lire') && !empty($conf->global->STOCK_MOVEMENT_INTO_PROJECT_OVERVIEW)
),
'salaries'=>array(
'name'=>"Salaries",
'title'=>"ListSalariesAssociatedProject",
@@ -604,7 +622,8 @@ $listofreferent = array(
'lang'=>'salaries',
'buttonnew'=>'AddSalary',
'testnew'=>$user->hasRight('salaries', 'write'),
'test'=>!empty($conf->salaries->enabled) && $user->hasRight('salaries', 'read')),
'test'=>isModEnabled('salaries') && $user->hasRight('salaries', 'read')
),
'variouspayment'=>array(
'name'=>"VariousPayments",
'title'=>"ListVariousPaymentsAssociatedProject",
@@ -617,7 +636,8 @@ $listofreferent = array(
'lang'=>'banks',
'buttonnew'=>'AddVariousPayment',
'testnew'=>$user->hasRight('banque', 'modifier'),
'test'=>isModEnabled("banque") && $user->hasRight('banque', 'lire') && !empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)),
'test'=>isModEnabled("banque") && $user->hasRight('banque', 'lire') && !empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)
),
/* No need for this, available on dedicated tab "Agenda/Events"
'agenda'=>array(
'name'=>"Agenda",
@@ -1377,7 +1397,7 @@ foreach ($listofreferent as $key => $value) {
} elseif ($tablename == 'stock_mouvement') {
$total_ht_by_line = $element->price * abs($element->qty);
} elseif (in_array($tablename, array('projet_task'))) {
if (!empty($conf->salaries->enabled)) {
if (isModEnabled('salaries')) {
// TODO Permission to read daily rate to show value
$total_ht_by_line = price2num($tmpprojtime['amount'], 'MT');
if ($tmpprojtime['nblinesnull'] > 0) {
@@ -1431,7 +1451,7 @@ foreach ($listofreferent as $key => $value) {
} elseif ($tablename == 'stock_mouvement') {
$total_ttc_by_line = $element->price * abs($element->qty);
} elseif ($tablename == 'projet_task') {
if (!empty($conf->salaries->enabled)) {
if (isModEnabled('salaries')) {
// TODO Permission to read daily rate
$defaultvat = get_default_tva($mysoc, $mysoc);
$total_ttc_by_line = price2num($total_ht_by_line * (1 + ($defaultvat / 100)), 'MT');
@@ -1553,7 +1573,7 @@ foreach ($listofreferent as $key => $value) {
if (empty($value['disableamount'])) {
if ($key == 'loan') {
print $langs->trans("Total").' '.$langs->trans("LoanCapital").' : '.price($total_ttc);
} elseif ($tablename != 'projet_task' || !empty($conf->salaries->enabled)) {
} elseif ($tablename != 'projet_task' || isModEnabled('salaries')) {
print ''.$langs->trans("TotalHT").' : '.price($total_ht);
}
}
@@ -1564,7 +1584,7 @@ foreach ($listofreferent as $key => $value) {
if (empty($value['disableamount'])) {
if ($key == 'loan') {
print $langs->trans("Total").' '.$langs->trans("RemainderToPay").' : '.price($total_ttc);
} elseif ($tablename != 'projet_task' || !empty($conf->salaries->enabled)) {
} elseif ($tablename != 'projet_task' || isModEnabled('salaries')) {
print $langs->trans("TotalTTC").' : '.price($total_ttc);
}
}

View File

@@ -419,7 +419,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
// Sensitive salary/value information
if ((empty($user->socid) && in_array($id, $childids)) // A user can always see salary/value information for its subordinates
|| (!empty($conf->salaries->enabled) && !empty($user->rights->salaries->readall))
|| (isModEnabled('salaries') && !empty($user->rights->salaries->readall))
|| (isModEnabled('hrm') && !empty($user->rights->hrm->employee->read))) {
$langs->load("salaries");
@@ -582,7 +582,7 @@ if ($action != 'edit' && $action != 'create') { // If not bank account yet, $ac
$MAXLIST = $conf->global->MAIN_SIZE_SHORTLIST_LIMIT;
// Latest payments of salaries
if (!empty($conf->salaries->enabled) &&
if (isModEnabled('salaries') &&
(($user->rights->salaries->read && (in_array($object->id, $childids) || $object->id == $user->id)) || (!empty($user->rights->salaries->readall)))
) {
$payment_salary = new PaymentSalary($db);

View File

@@ -1316,8 +1316,8 @@ if ($action == 'create' || $action == 'adduserldap') {
print '<input class="maxwidth200 maxwidth150onsmartphone" type="text" name="job" value="'.dol_escape_htmltag(GETPOST('job', 'alphanohtml')).'">';
print '</td></tr>';
if ((!empty($conf->salaries->enabled) && $user->hasRight("salaries", "read") && in_array($id, $childids))
|| (!empty($conf->salaries->enabled) && $user->hasRight("salaries", "readall"))
if ((isModEnabled('salaries') && $user->hasRight("salaries", "read") && in_array($id, $childids))
|| (isModEnabled('salaries') && $user->hasRight("salaries", "readall"))
|| (isModEnabled('hrm') && $user->hasRight("hrm", "employee", "read"))) {
$langs->load("salaries");
@@ -1622,7 +1622,7 @@ if ($action == 'create' || $action == 'adduserldap') {
// Sensitive salary/value information
if ((empty($user->socid) && in_array($id, $childids)) // A user can always see salary/value information for its subordinates
|| (!empty($conf->salaries->enabled) && $user->hasRight("salaries", "readall"))
|| (isModEnabled('salaries') && $user->hasRight("salaries", "readall"))
|| (isModEnabled('hrm') && $user->hasRight("hrm", "employee", "read"))) {
$langs->load("salaries");
@@ -2815,7 +2815,7 @@ if ($action == 'create' || $action == 'adduserldap') {
// Sensitive salary/value information
if ((empty($user->socid) && in_array($id, $childids)) // A user can always see salary/value information for its subordinates
|| (!empty($conf->salaries->enabled) && $user->hasRight("salaries", "readall"))
|| (isModEnabled('salaries') && $user->hasRight("salaries", "readall"))
|| (isModEnabled('hrm') && $user->hasRight("hrm", "employee", "read"))) {
$langs->load("salaries");

View File

@@ -699,7 +699,7 @@ class Users extends DolibarrApi
unset($object->lines);
unset($object->model_pdf);
$canreadsalary = ((!empty($conf->salaries->enabled) && !empty(DolibarrApiAccess::$user->rights->salaries->read)) || (empty($conf->salaries->enabled)));
$canreadsalary = ((isModEnabled('salaries') && !empty(DolibarrApiAccess::$user->rights->salaries->read)) || (empty($conf->salaries->enabled)));
if (!$canreadsalary) {
unset($object->salary);

View File

@@ -997,8 +997,8 @@ while ($i < $imaxinloop) {
$li = $object->getNomUrl(-1, '', 0, 0, 24, 1, 'login', '', 1);
$canreadhrmdata = 0;
if ((!empty($conf->salaries->enabled) && $user->hasRight("salaries", "read") && in_array($obj->rowid, $childids))
|| (!empty($conf->salaries->enabled) && $user->hasRight("salaries", "readall"))
if ((isModEnabled('salaries') && $user->hasRight("salaries", "read") && in_array($obj->rowid, $childids))
|| (isModEnabled('salaries') && $user->hasRight("salaries", "readall"))
|| (isModEnabled('hrm') && $user->hasRight("hrm", "employee", "read"))) {
$canreadhrmdata = 1;
}