Tracking $conf->module->enabled part 2 (#31899)

Co-authored-by: Theobald <f.moreau@theobald-groupe.com>
This commit is contained in:
moreauftheobald
2024-11-15 23:00:56 +01:00
committed by GitHub
parent 39d0debfd4
commit ee65f40512
7 changed files with 10 additions and 10 deletions

View File

@@ -402,8 +402,8 @@ class Propal extends CommonObject
'fk_delivery_address' => array('type' => 'integer', 'label' => 'DeliveryAddress', 'enabled' => 1, 'visible' => 0, 'position' => 200), // deprecated
'fk_input_reason' => array('type' => 'integer', 'label' => 'InputReason', 'enabled' => 1, 'visible' => -1, 'position' => 205),
'extraparams' => array('type' => 'varchar(255)', 'label' => 'Extraparams', 'enabled' => 1, 'visible' => -1, 'position' => 215),
'fk_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => '$conf->incoterm->enabled', 'visible' => -1, 'position' => 220),
'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLabel', 'enabled' => '$conf->incoterm->enabled', 'visible' => -1, 'position' => 225),
'fk_incoterms' => array('type' => 'integer', 'label' => 'IncotermCode', 'enabled' => 'isModEnabled("incoterm")', 'visible' => -1, 'position' => 220),
'location_incoterms' => array('type' => 'varchar(255)', 'label' => 'IncotermLabel', 'enabled' => 'isModEnabled("incoterm")', 'visible' => -1, 'position' => 225),
'fk_multicurrency' => array('type' => 'integer', 'label' => 'MulticurrencyID', 'enabled' => 1, 'visible' => -1, 'position' => 230),
'multicurrency_code' => array('type' => 'varchar(255)', 'label' => 'MulticurrencyCurrency', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 235),
'multicurrency_tx' => array('type' => 'double(24,8)', 'label' => 'MulticurrencyRate', 'enabled' => 'isModEnabled("multicurrency")', 'visible' => -1, 'position' => 240, 'isameasure' => 1),

View File

@@ -97,7 +97,7 @@ $bookmarkList = '';
$searchForm = '';
if (empty($conf->bookmark->enabled)) {
if (!isModEnabled('bookmark')) {
$langs->load("admin");
$bookmarkList .= '<br><span class="opacitymedium">'.$langs->trans("WarningModuleNotActive", $langs->transnoentitiesnoconv("Bookmarks")).'</span>';
$bookmarkList .= '<br><br>';

View File

@@ -507,7 +507,7 @@ class FormFile
$printer = 0;
// The direct print feature is implemented only for such elements
if (in_array($modulepart, array('contract', 'facture', 'supplier_proposal', 'propal', 'proposal', 'order', 'commande', 'expedition', 'commande_fournisseur', 'expensereport', 'delivery', 'ticket'))) {
$printer = ($user->hasRight('printing', 'read') && !empty($conf->printing->enabled));
$printer = ($user->hasRight('printing', 'read') && isModEnabled('printing'));
}
$hookmanager->initHooks(array('formfile'));

View File

@@ -43,7 +43,7 @@ function contact_prepare_head(Contact $object)
$head[$tab][2] = 'card';
$tab++;
if ((!empty($conf->ldap->enabled) && getDolGlobalString('LDAP_CONTACT_ACTIVE'))
if ((isModEnabled('ldap') && getDolGlobalString('LDAP_CONTACT_ACTIVE'))
&& (!getDolGlobalString('MAIN_DISABLE_LDAP_TAB') || !empty($user->admin))) {
$langs->load("ldap");

View File

@@ -43,7 +43,7 @@ function member_prepare_head(Adherent $object)
$head[$h][2] = 'general';
$h++;
if ((!empty($conf->ldap->enabled) && getDolGlobalString('LDAP_MEMBER_ACTIVE'))
if ((isModEnabled('ldap') && getDolGlobalString('LDAP_MEMBER_ACTIVE'))
&& (!getDolGlobalString('MAIN_DISABLE_LDAP_TAB') || !empty($user->admin))) {
$langs->load("ldap");
@@ -193,7 +193,7 @@ function member_type_prepare_head(AdherentType $object)
$h++;
}
if ((!empty($conf->ldap->enabled) && getDolGlobalString('LDAP_MEMBER_TYPE_ACTIVE'))
if ((isModEnabled('ldap') && getDolGlobalString('LDAP_MEMBER_TYPE_ACTIVE'))
&& (!getDolGlobalString('MAIN_DISABLE_LDAP_TAB') || !empty($user->admin))) {
$langs->load("ldap");

View File

@@ -53,7 +53,7 @@ function user_prepare_head(User $object)
$head[$h][2] = 'user';
$h++;
if ((!empty($conf->ldap->enabled) && getDolGlobalString('LDAP_SYNCHRO_ACTIVE'))
if ((isModEnabled('ldap') && getDolGlobalString('LDAP_SYNCHRO_ACTIVE'))
&& (!getDolGlobalString('MAIN_DISABLE_LDAP_TAB') || !empty($user->admin))) {
$langs->load("ldap");
$head[$h][0] = DOL_URL_ROOT.'/user/ldap.php?id='.$object->id;
@@ -254,7 +254,7 @@ function group_prepare_head($object)
$head[$h][2] = 'group';
$h++;
if ((!empty($conf->ldap->enabled) && getDolGlobalString('LDAP_SYNCHRO_ACTIVE'))
if ((isModEnabled('ldap') && getDolGlobalString('LDAP_SYNCHRO_ACTIVE'))
&& (!getDolGlobalString('MAIN_DISABLE_LDAP_TAB') || !empty($user->admin))) {
$langs->load("ldap");
$head[$h][0] = DOL_URL_ROOT.'/user/group/ldap.php?id='.$object->id;

View File

@@ -167,7 +167,7 @@ function check_user_password_ldap($usertotest, $passwordtotest, $entitytotest)
// Note: Test on date validity is done later natively with isNotIntoValidityDateRange() by core after calling checkLoginPassEntity() that call this method
// ldap2dolibarr synchronisation
if ($login && !empty($conf->ldap->enabled) && getDolGlobalInt('LDAP_SYNCHRO_ACTIVE') == Ldap::SYNCHRO_LDAP_TO_DOLIBARR) { // ldap2dolibarr synchronization
if ($login && isModEnabled('ldap') && getDolGlobalInt('LDAP_SYNCHRO_ACTIVE') == Ldap::SYNCHRO_LDAP_TO_DOLIBARR) { // ldap2dolibarr synchronization
dol_syslog("functions_ldap::check_user_password_ldap Sync ldap2dolibarr");
// On charge les attributes du user ldap