Use isModEnabled

This commit is contained in:
Alexandre SPANGARO 2022-09-25 15:31:07 +02:00
parent 6c848333e6
commit 1dfcf8eceb
5 changed files with 8 additions and 8 deletions

View File

@ -2603,7 +2603,7 @@ function top_menu_bookmark()
$html = '';
// Define $bookmarks
if (empty($conf->bookmark->enabled) || empty($user->rights->bookmark->lire)) {
if (!isModEnabled('bookmark') || empty($user->rights->bookmark->lire)) {
return $html;
}
@ -3304,7 +3304,7 @@ if (!function_exists("llxFooter")) {
}
// Wrapper to add log when clicking on download or preview
if (!empty($conf->blockedlog->enabled) && is_object($object) && !empty($object->id) && $object->id > 0 && $object->statut > 0) {
if (isModEnabled('blockedlog') && is_object($object) && !empty($object->id) && $object->id > 0 && $object->statut > 0) {
if (in_array($object->element, array('facture'))) { // Restrict for the moment to element 'facture'
print "\n<!-- JS CODE TO ENABLE log when making a download or a preview of a document -->\n";
?>

View File

@ -153,7 +153,7 @@ if ($object->id > 0) {
// Thirdparty
$morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($permissiontoadd) {

View File

@ -436,7 +436,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}*/
$formquestion = array();
if (!empty($conf->mrp->enabled)) {
if (isModEnabled('mrp')) {
$langs->load("mrp");
require_once DOL_DOCUMENT_ROOT.'/product/class/html.formproduct.class.php';
$formproduct = new FormProduct($db);
@ -487,7 +487,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
$morehtmlref .= $langs->trans('ThirdParty').' ';
$morehtmlref .= ': '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($permissiontoadd) {

View File

@ -131,7 +131,7 @@ if ($object->id) {
// Thirdparty
$morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($permissiontoadd) {

View File

@ -327,7 +327,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Thirdparty
$morehtmlref .= $langs->trans('ThirdParty').' : '.(is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
// Project
if (!empty($conf->project->enabled)) {
if (isModEnabled('project')) {
$langs->load("projects");
$morehtmlref .= '<br>'.$langs->trans('Project').' ';
if ($permissiontoadd) {
@ -605,7 +605,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (!empty($arrayfields['m.datem']['checked'])) {
print '<td class="liste_titre nowraponall">';
print '<input class="flat" type="text" size="2" maxlength="2" placeholder="'.dol_escape_htmltag($langs->trans("Month")).'" name="month" value="'.$month.'">';
if (empty($conf->productbatch->enabled)) {
if (!isModEnabled('productbatch')) {
print '&nbsp;';
}
//else print '<br>';