|
@@ -162,21 +162,21 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|
|
}
|
|
|
|
|
|
// Number of project opened
|
|
|
- if (!empty($conf->project->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && $user->rights->projet->lire) {
|
|
|
+ if (!empty($conf->project->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && $user->hasRight('projet', 'lire')) {
|
|
|
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
|
|
|
$board = new Project($db);
|
|
|
$dashboardlines[$board->element] = $board->load_board($user);
|
|
|
}
|
|
|
|
|
|
// Number of tasks to do (late)
|
|
|
- if (!empty($conf->project->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && empty($conf->global->PROJECT_HIDE_TASKS) && $user->rights->projet->lire) {
|
|
|
+ if (isModEnabled('project') && empty($conf->global->MAIN_DISABLE_BLOCK_PROJECT) && empty($conf->global->PROJECT_HIDE_TASKS) && $user->hasRight('projet', 'lire')) {
|
|
|
include_once DOL_DOCUMENT_ROOT.'/projet/class/task.class.php';
|
|
|
$board = new Task($db);
|
|
|
$dashboardlines[$board->element] = $board->load_board($user);
|
|
|
}
|
|
|
|
|
|
// Number of commercial customer proposals open (expired)
|
|
|
- if (!empty($conf->propal->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->rights->propale->lire) {
|
|
|
+ if (isModEnabled('propal') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->hasRight('propale', 'lire')) {
|
|
|
include_once DOL_DOCUMENT_ROOT.'/comm/propal/class/propal.class.php';
|
|
|
$board = new Propal($db);
|
|
|
$dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened");
|
|
@@ -185,7 +185,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|
|
}
|
|
|
|
|
|
// Number of supplier proposals open (expired)
|
|
|
- if (!empty($conf->supplier_proposal->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && $user->rights->supplier_proposal->lire) {
|
|
|
+ if (isModEnabled('supplier_proposal') && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && $user->hasRight('supplier_proposal', 'lire')) {
|
|
|
$langs->load("supplier_proposal");
|
|
|
include_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
|
|
|
$board = new SupplierProposal($db);
|
|
@@ -195,14 +195,14 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|
|
}
|
|
|
|
|
|
// Number of customer orders a deal
|
|
|
- if (!empty($conf->commande->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->rights->commande->lire) {
|
|
|
+ if (isModEnabled('commande') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->hasRight('commande', 'lire')) {
|
|
|
include_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
|
|
|
$board = new Commande($db);
|
|
|
$dashboardlines[$board->element] = $board->load_board($user);
|
|
|
}
|
|
|
|
|
|
// Number of suppliers orders a deal
|
|
|
- if (!empty($conf->supplier_order->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && $user->rights->fournisseur->commande->lire) {
|
|
|
+ if (isModEnabled('supplier_order') && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && $user->rights->fournisseur->commande->lire) {
|
|
|
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
|
|
|
$board = new CommandeFournisseur($db);
|
|
|
$dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened");
|
|
@@ -210,7 +210,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|
|
}
|
|
|
|
|
|
// Number of contract / services enabled (delayed)
|
|
|
- if (!empty($conf->contrat->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_CONTRACT) && $user->rights->contrat->lire) {
|
|
|
+ if (isModEnabled('contrat') && empty($conf->global->MAIN_DISABLE_BLOCK_CONTRACT) && $user->hasRight('contrat', 'lire')) {
|
|
|
include_once DOL_DOCUMENT_ROOT.'/contrat/class/contrat.class.php';
|
|
|
$board = new Contrat($db);
|
|
|
$dashboardlines[$board->element.'_inactive'] = $board->load_board($user, "inactive");
|
|
@@ -219,7 +219,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|
|
}
|
|
|
|
|
|
// Number of tickets open
|
|
|
- if (!empty($conf->ticket->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_TICKET) && $user->rights->ticket->read) {
|
|
|
+ if (isModEnabled('ticket') && empty($conf->global->MAIN_DISABLE_BLOCK_TICKET) && $user->hasRight('ticket', 'read')) {
|
|
|
include_once DOL_DOCUMENT_ROOT.'/ticket/class/ticket.class.php';
|
|
|
$board = new Ticket($db);
|
|
|
$dashboardlines[$board->element.'_opened'] = $board->load_board($user, "opened");
|
|
@@ -228,21 +228,21 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|
|
}
|
|
|
|
|
|
// Number of invoices customers (paid)
|
|
|
- if (isModEnabled('facture') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->rights->facture->lire) {
|
|
|
+ if (isModEnabled('facture') && empty($conf->global->MAIN_DISABLE_BLOCK_CUSTOMER) && $user->hasRight('facture', 'lire')) {
|
|
|
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
|
|
|
$board = new Facture($db);
|
|
|
$dashboardlines[$board->element] = $board->load_board($user);
|
|
|
}
|
|
|
|
|
|
// Number of supplier invoices (paid)
|
|
|
- if (!empty($conf->supplier_invoice->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && !empty($user->rights->fournisseur->facture->lire)) {
|
|
|
+ if (isModEnabled('supplier_invoice') && empty($conf->global->MAIN_DISABLE_BLOCK_SUPPLIER) && !empty($user->rights->fournisseur->facture->lire)) {
|
|
|
include_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
|
|
|
$board = new FactureFournisseur($db);
|
|
|
$dashboardlines[$board->element] = $board->load_board($user);
|
|
|
}
|
|
|
|
|
|
// Number of transactions to conciliate
|
|
|
- if (!empty($conf->banque->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_BANK) && $user->rights->banque->lire && !$user->socid) {
|
|
|
+ if (isModEnabled('banque') && empty($conf->global->MAIN_DISABLE_BLOCK_BANK) && $user->hasRight('banque', 'lire') && !$user->socid) {
|
|
|
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
|
|
|
$board = new Account($db);
|
|
|
$nb = $board->countAccountToReconcile(); // Get nb of account to reconciliate
|
|
@@ -253,7 +253,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|
|
|
|
|
|
|
|
// Number of cheque to send
|
|
|
- if (!empty($conf->banque->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_BANK) && $user->rights->banque->lire && !$user->socid) {
|
|
|
+ if (isModEnabled('banque') && empty($conf->global->MAIN_DISABLE_BLOCK_BANK) && $user->hasRight('banque', 'lire') && !$user->socid) {
|
|
|
if (empty($conf->global->BANK_DISABLE_CHECK_DEPOSIT)) {
|
|
|
include_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
|
|
|
$board = new RemiseCheque($db);
|
|
@@ -272,7 +272,7 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|
|
}
|
|
|
|
|
|
// Number of foundation members
|
|
|
- if (!empty($conf->adherent->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_ADHERENT) && $user->rights->adherent->lire && !$user->socid) {
|
|
|
+ if (isModEnabled('adherent') && empty($conf->global->MAIN_DISABLE_BLOCK_ADHERENT) && $user->hasRight('adherent', 'lire') && !$user->socid) {
|
|
|
include_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent.class.php';
|
|
|
$board = new Adherent($db);
|
|
|
$dashboardlines[$board->element.'_shift'] = $board->load_board($user, 'shift');
|
|
@@ -280,21 +280,21 @@ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
|
|
|
}
|
|
|
|
|
|
// Number of expense reports to approve
|
|
|
- if (!empty($conf->expensereport->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_EXPENSEREPORT) && $user->rights->expensereport->approve) {
|
|
|
+ if (isModEnabled('expensereport') && empty($conf->global->MAIN_DISABLE_BLOCK_EXPENSEREPORT) && $user->hasRight('expensereport', 'approve')) {
|
|
|
include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
|
|
$board = new ExpenseReport($db);
|
|
|
$dashboardlines[$board->element.'_toapprove'] = $board->load_board($user, 'toapprove');
|
|
|
}
|
|
|
|
|
|
// Number of expense reports to pay
|
|
|
- if (!empty($conf->expensereport->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_EXPENSEREPORT) && $user->rights->expensereport->to_paid) {
|
|
|
+ if (isModEnabled('expensereport') && empty($conf->global->MAIN_DISABLE_BLOCK_EXPENSEREPORT) && $user->hasRight('expensereport', 'to_paid')) {
|
|
|
include_once DOL_DOCUMENT_ROOT.'/expensereport/class/expensereport.class.php';
|
|
|
$board = new ExpenseReport($db);
|
|
|
$dashboardlines[$board->element.'_topay'] = $board->load_board($user, 'topay');
|
|
|
}
|
|
|
|
|
|
// Number of holidays to approve
|
|
|
- if (!empty($conf->holiday->enabled) && empty($conf->global->MAIN_DISABLE_BLOCK_HOLIDAY) && $user->rights->holiday->approve) {
|
|
|
+ if (isModEnabled('holiday') && empty($conf->global->MAIN_DISABLE_BLOCK_HOLIDAY) && $user->hasRight('holiday', 'approve')) {
|
|
|
include_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
|
|
|
$board = new Holiday($db);
|
|
|
$dashboardlines[$board->element] = $board->load_board($user);
|