diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index 5a6853a5f9b..33c2de205ee 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -3061,7 +3061,7 @@ class Adherent extends CommonObject $blockingerrormsg = ''; - if (empty($conf->adherent->enabled)) { // Should not happen. If module disabled, cron job should not be visible. + if (!isModEnabled('adherent')) { // Should not happen. If module disabled, cron job should not be visible. $langs->load("agenda"); $this->output = $langs->trans('ModuleNotEnabled', $langs->transnoentitiesnoconv("Adherent")); return 0; diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php index 5b94224b85f..df648c9766f 100644 --- a/htdocs/commande/list.php +++ b/htdocs/commande/list.php @@ -890,7 +890,7 @@ if ($search_billed != '' && $search_billed >= 0) { } if ($search_status <> '') { if ($search_status <= 3 && $search_status >= -1) { // status from -1 to 3 are real status (other are virtual combination) - if ($search_status == 1 && empty($conf->expedition->enabled)) { + if ($search_status == 1 && !isModEnabled('expedition')) { $sql .= ' AND c.fk_statut IN (1,2)'; // If module expedition disabled, we include order with status 'sending in process' into 'validated' } else { $sql .= ' AND c.fk_statut = '.((int) $search_status); // draft, validated, in process or canceled @@ -1116,7 +1116,7 @@ if ($resql) { $title .= ' - '.$langs->trans('StatusOrderToProcessShort'); } if ($search_status == -3) { - $title .= ' - '.$langs->trans('StatusOrderValidated').', '.(empty($conf->expedition->enabled) ? '' : $langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill'); + $title .= ' - '.$langs->trans('StatusOrderValidated').', '.(!isModEnabled('expedition') ? '' : $langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill'); } if ($search_status == -4) { $title .= ' - '.$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort"); diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php index 5b1a85f3f43..1d5addd76a8 100644 --- a/htdocs/commande/list_det.php +++ b/htdocs/commande/list_det.php @@ -188,7 +188,7 @@ $arrayfields = array( 'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers, 'position'=>55), 'c.date_commande'=>array('label'=>"OrderDateShort", 'checked'=>1, 'position'=>60), 'c.date_delivery'=>array('label'=>"DateDeliveryPlanned", 'checked'=>1, 'enabled'=>empty($conf->global->ORDER_DISABLE_DELIVERY_DATE), 'position'=>65), - 'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>-1, 'position'=>66 , 'enabled'=>!empty($conf->expedition->enabled)), + 'c.fk_shipping_method'=>array('label'=>"SendingMethod", 'checked'=>-1, 'position'=>66 , 'enabled'=>isModEnabled('expedition')), 'c.fk_cond_reglement'=>array('label'=>"PaymentConditionsShort", 'checked'=>-1, 'position'=>67), 'c.fk_mode_reglement'=>array('label'=>"PaymentMode", 'checked'=>-1, 'position'=>68), 'c.fk_input_reason'=>array('label'=>"Channel", 'checked'=>-1, 'position'=>69), @@ -212,7 +212,7 @@ $arrayfields = array( 'c.date_cloture'=>array('label'=>"DateClosing", 'checked'=>0, 'position'=>130), 'c.note_public'=>array('label'=>'NotePublic', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PUBLIC_NOTES)), 'position'=>135), 'c.note_private'=>array('label'=>'NotePrivate', 'checked'=>0, 'enabled'=>(empty($conf->global->MAIN_LIST_ALLOW_PRIVATE_NOTES)), 'position'=>140), - 'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(!empty($conf->expedition->enabled)), 'position'=>990), + 'shippable'=>array('label'=>"Shippable", 'checked'=>1,'enabled'=>(isModEnabled('expedition')), 'position'=>990), 'c.facture'=>array('label'=>"Billed", 'checked'=>1, 'enabled'=>(empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)), 'position'=>995), 'c.import_key' =>array('type'=>'varchar(14)', 'label'=>'ImportId', 'enabled'=>1, 'visible'=>-2, 'position'=>999), 'c.fk_statut'=>array('label'=>"Status", 'checked'=>1, 'position'=>1000) @@ -466,7 +466,7 @@ if ($search_billed != '' && $search_billed >= 0) { } if ($search_status <> '') { if ($search_status <= 3 && $search_status >= -1) { // status from -1 to 3 are real status (other are virtual combination) - if ($search_status == 1 && empty($conf->expedition->enabled)) { + if ($search_status == 1 && !isModEnabled('expedition')) { $sql .= ' AND c.fk_statut IN (1,2)'; // If module expedition disabled, we include order with status 'sending in process' into 'validated' } else { $sql .= ' AND c.fk_statut = '.((int) $search_status); // brouillon, validee, en cours, annulee @@ -646,7 +646,7 @@ if ($resql) { $title .= ' - '.$langs->trans('StatusOrderToProcessShort'); } if ($search_status == -3) { - $title .= ' - '.$langs->trans('StatusOrderValidated').', '.(empty($conf->expedition->enabled) ? '' : $langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill'); + $title .= ' - '.$langs->trans('StatusOrderValidated').', '.(!isModEnabled('expedition') ? '' : $langs->trans("StatusOrderSent").', ').$langs->trans('StatusOrderToBill'); } if ($search_status == -4) { $title .= ' - '.$langs->trans("StatusOrderValidatedShort").'+'.$langs->trans("StatusOrderSentShort"); diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php index 407b2dc4e3c..859584361b7 100644 --- a/htdocs/compta/facture/list.php +++ b/htdocs/compta/facture/list.php @@ -1178,7 +1178,7 @@ if ($resql) { if (!empty($user->rights->facture->paiement)) { $arrayofmassactions['makepayment'] = img_picto('', 'payment', 'class="pictofixedwidth"').$langs->trans("MakePaymentAndClassifyPayed"); } - if (!empty($conf->prelevement->enabled) && !empty($user->rights->prelevement->bons->creer)) { + if (isModEnabled('prelevement') && !empty($user->rights->prelevement->bons->creer)) { $langs->load("withdrawals"); $arrayofmassactions['withdrawrequest'] = img_picto('', 'payment', 'class="pictofixedwidth"').$langs->trans("MakeWithdrawRequest"); } diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index f2cd1fe18f9..f62768bdff9 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -746,7 +746,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie // Remain to take or to pay back print ''; print price($sign * $remaintopay); - if (!empty($conf->prelevement->enabled)) { + if (isModEnabled('prelevement')) { $numdirectdebitopen = 0; $totaldirectdebit = 0; $sql = "SELECT COUNT(pfd.rowid) as nb, SUM(pfd.amount) as amount"; @@ -859,8 +859,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie print '
'; print ' '.$checkboxlabel; - /*if (!empty($conf->prelevement->enabled)) - { + /*if (isModEnabled('prelevement')) { $langs->load("withdrawals"); if (!empty($conf->global->WITHDRAW_DISABLE_AUTOCREATE_ONPAYMENTS)) print '
'.$langs->trans("IfInvoiceNeedOnWithdrawPaymentWontBeClosed"); }*/ diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 17752f9081b..cba7b3aa10d 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -56,7 +56,7 @@ function facture_prepare_head($object) $h++; } - if (!empty($conf->prelevement->enabled)) { + if (isModEnabled('prelevement')) { $nbStandingOrders = 0; $sql = "SELECT COUNT(pfd.rowid) as nb"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_demande as pfd"; diff --git a/htdocs/core/modules/modUser.class.php b/htdocs/core/modules/modUser.class.php index 22e7425c7fa..df5cfba961f 100644 --- a/htdocs/core/modules/modUser.class.php +++ b/htdocs/core/modules/modUser.class.php @@ -274,7 +274,7 @@ class modUser extends DolibarrModules $keyforelement = 'user'; $keyforaliasextra = 'extra'; include DOL_DOCUMENT_ROOT.'/core/extrafieldsinexport.inc.php'; - if (empty($conf->adherent->enabled)) { + if (!isModEnabled('adherent')) { unset($this->export_fields_array[$r]['u.fk_member']); unset($this->export_entities_array[$r]['u.fk_member']); } diff --git a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php index 54073df0b09..f788b402247 100644 --- a/htdocs/core/triggers/interface_50_modNotification_Notification.class.php +++ b/htdocs/core/triggers/interface_50_modNotification_Notification.class.php @@ -139,11 +139,11 @@ class InterfaceNotification extends DolibarrTriggers $qualified = 0; } elseif ($element == 'invoice_supplier' && !isModEnabled('supplier_invoice')) { $qualified = 0; - } elseif ($element == 'withdraw' && empty($conf->prelevement->enabled)) { + } elseif ($element == 'withdraw' && !isModEnabled('prelevement')) { $qualified = 0; - } elseif ($element == 'shipping' && empty($conf->expedition->enabled)) { + } elseif ($element == 'shipping' && !isModEnabled('expedition')) { $qualified = 0; - } elseif ($element == 'member' && empty($conf->adherent->enabled)) { + } elseif ($element == 'member' && !isModEnabled('adherent')) { $qualified = 0; } elseif (($element == 'expense_report' || $element == 'expensereport') && empty($conf->expensereport->enabled)) { $qualified = 0; diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index ed46b8f1dae..59423caa901 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -81,7 +81,7 @@ $error = 0; $langs->loadLangs(array("main", "members", "companies", "install", "other", "errors")); // Security check -if (empty($conf->adherent->enabled)) { +if (!isModEnabled('adherent')) { httponly_accessforbidden('Module Membership not enabled'); } diff --git a/htdocs/public/members/public_card.php b/htdocs/public/members/public_card.php index ffce8730d8f..24300b3cbd5 100644 --- a/htdocs/public/members/public_card.php +++ b/htdocs/public/members/public_card.php @@ -53,7 +53,7 @@ require_once DOL_DOCUMENT_ROOT.'/adherents/class/adherent_type.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; // Security check -if (empty($conf->adherent->enabled)) { +if (!isModEnabled('adherent')) { httponly_accessforbidden('Module Memebership no enabled'); } diff --git a/htdocs/public/members/public_list.php b/htdocs/public/members/public_list.php index 700c0383516..262afac175a 100644 --- a/htdocs/public/members/public_list.php +++ b/htdocs/public/members/public_list.php @@ -49,7 +49,7 @@ if (is_numeric($entity)) { require '../../main.inc.php'; // Security check -if (empty($conf->adherent->enabled)) { +if (!isModEnabled('adherent')) { httponly_accessforbidden('Module Membership not enabled'); } diff --git a/htdocs/societe/class/companybankaccount.class.php b/htdocs/societe/class/companybankaccount.class.php index 26a6169dbe6..c56a6db007d 100644 --- a/htdocs/societe/class/companybankaccount.class.php +++ b/htdocs/societe/class/companybankaccount.class.php @@ -205,7 +205,7 @@ class CompanyBankAccount extends Account $sql .= ",proprio = '".$this->db->escape($this->proprio)."'"; $sql .= ",owner_address = '".$this->db->escape($this->owner_address)."'"; $sql .= ",default_rib = ".((int) $this->default_rib); - if (!empty($conf->prelevement->enabled)) { + if (isModEnabled('prelevement')) { $sql .= ",frstrecur = '".$this->db->escape($this->frstrecur)."'"; $sql .= ",rum = '".$this->db->escape($this->rum)."'"; $sql .= ",date_rum = ".($this->date_rum ? "'".$this->db->idate($this->date_rum)."'" : "null"); diff --git a/htdocs/societe/paymentmodes.php b/htdocs/societe/paymentmodes.php index 93ec01e0524..4d00d056a82 100644 --- a/htdocs/societe/paymentmodes.php +++ b/htdocs/societe/paymentmodes.php @@ -1440,7 +1440,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print_liste_field_titre("RIB"); print_liste_field_titre("IBAN"); print_liste_field_titre("BIC"); - if (!empty($conf->prelevement->enabled)) { + if (isModEnabled('prelevement')) { print_liste_field_titre("RUM"); print_liste_field_titre("DateRUM"); print_liste_field_titre("WithdrawMode"); @@ -1530,7 +1530,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' print dol_escape_htmltag($rib->bic); print ''; - if (!empty($conf->prelevement->enabled)) { + if (isModEnabled('prelevement')) { // RUM //print ''.$prelevement->buildRumNumber($object->code_client, $rib->datec, $rib->id).''; print ''.dol_escape_htmltag($rib->rum).''; @@ -1695,7 +1695,7 @@ if ($socid && $action != 'edit' && $action != 'create' && $action != 'editcard' //var_dump($src); print ''; - if (!empty($conf->prelevement->enabled)) { + if (isModEnabled('prelevement')) { // RUM print ''; //var_dump($src);