diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index 05f692be526..e2b8ace4783 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -526,7 +526,7 @@ $tabcond[40] = (isModEnabled("societe") && !empty($conf->global->THIRDPARTY_ENAB
$tabcond[41] = !empty($conf->intracommreport->enabled);
$tabcond[42] = isModEnabled("product");
$tabcond[43] = isModEnabled("product") && !empty($conf->productbatch->enabled) && $conf->global->MAIN_FEATURES_LEVEL >= 2;
-$tabcond[44] = !empty($conf->asset->enabled);
+$tabcond[44] = isModEnabled('asset');
// List of help for fields (no more used, help is defined into tabcomplete)
$tabhelp = array();
diff --git a/htdocs/admin/ecm.php b/htdocs/admin/ecm.php
index 44df7f74189..3e0c2378742 100644
--- a/htdocs/admin/ecm.php
+++ b/htdocs/admin/ecm.php
@@ -22,6 +22,8 @@
* \brief Page to setup ECM (GED) module
*/
+
+// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/ecm.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
@@ -37,6 +39,8 @@ if (!$user->admin) {
/*
* Action
*/
+
+// set
if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) {
$code = $reg[1];
if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) {
@@ -47,6 +51,7 @@ if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) {
}
}
+// delete
if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) {
$code = $reg[1];
if (dolibarr_del_const($db, $code, $conf->entity) > 0) {
diff --git a/htdocs/asset/accountancy_codes.php b/htdocs/asset/accountancy_codes.php
index 431b4ba7c68..824f1a75bbb 100644
--- a/htdocs/asset/accountancy_codes.php
+++ b/htdocs/asset/accountancy_codes.php
@@ -58,7 +58,7 @@ $permissiontoadd = $user->rights->asset->write; // Used by the include of action
if ($user->socid > 0) accessforbidden();
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
-if (empty($conf->asset->enabled)) accessforbidden();
+if (!isModEnabled('asset')) accessforbidden();
$result = $assetaccountancycodes->fetchAccountancyCodes($object->id);
if ($result < 0) {
diff --git a/htdocs/asset/agenda.php b/htdocs/asset/agenda.php
index 3d40cf62328..437e51cf0b1 100644
--- a/htdocs/asset/agenda.php
+++ b/htdocs/asset/agenda.php
@@ -86,7 +86,7 @@ $permissiontoadd = $user->rights->asset->write; // Used by the include of action
if ($user->socid > 0) accessforbidden();
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
-if (empty($conf->asset->enabled)) accessforbidden();
+if (!isModEnabled('asset')) accessforbidden();
/*
diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php
index d94ba613d91..c2d768b5405 100644
--- a/htdocs/asset/card.php
+++ b/htdocs/asset/card.php
@@ -80,7 +80,7 @@ if ($user->socid > 0) accessforbidden();
if ($user->socid > 0) $socid = $user->socid;
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
-if (empty($conf->asset->enabled)) accessforbidden();
+if (!isModEnabled('asset')) accessforbidden();
if (!$permissiontoread) accessforbidden();
diff --git a/htdocs/asset/depreciation.php b/htdocs/asset/depreciation.php
index 8f3547d81fb..679d750c668 100644
--- a/htdocs/asset/depreciation.php
+++ b/htdocs/asset/depreciation.php
@@ -56,7 +56,7 @@ if ($id > 0 || !empty($ref)) {
if ($user->socid > 0) accessforbidden();
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
-if (empty($conf->asset->enabled)) accessforbidden();
+if (!isModEnabled('asset')) accessforbidden();
if (!empty($object->not_depreciated)) accessforbidden();
$object->asset_depreciation_options = &$assetdepreciationoptions;
diff --git a/htdocs/asset/depreciation_options.php b/htdocs/asset/depreciation_options.php
index ba5719705dc..23c66d8961b 100644
--- a/htdocs/asset/depreciation_options.php
+++ b/htdocs/asset/depreciation_options.php
@@ -58,7 +58,7 @@ $permissiontoadd = $user->rights->asset->write; // Used by the include of action
if ($user->socid > 0) accessforbidden();
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
-if (empty($conf->asset->enabled)) accessforbidden();
+if (!isModEnabled('asset')) accessforbidden();
if (!empty($object->not_depreciated)) accessforbidden();
$object->asset_depreciation_options = &$assetdepreciationoptions;
diff --git a/htdocs/asset/disposal.php b/htdocs/asset/disposal.php
index 7fddb92b05f..e06e86c78ac 100644
--- a/htdocs/asset/disposal.php
+++ b/htdocs/asset/disposal.php
@@ -57,7 +57,7 @@ $permissiontoadd = $user->rights->asset->write; // Used by the include of action
if ($user->socid > 0) accessforbidden();
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
-if (empty($conf->asset->enabled)) accessforbidden();
+if (!isModEnabled('asset')) accessforbidden();
if (!isset($object->disposal_date) || $object->disposal_date === "") accessforbidden();
diff --git a/htdocs/asset/document.php b/htdocs/asset/document.php
index 96b222b26c1..9f4439f94d6 100644
--- a/htdocs/asset/document.php
+++ b/htdocs/asset/document.php
@@ -78,7 +78,7 @@ $permissiontoadd = $user->rights->asset->asset->write; // Used by the include of
if ($user->socid > 0) accessforbidden();
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
-if (empty($conf->asset->enabled)) accessforbidden();
+if (!isModEnabled('asset')) accessforbidden();
/*
diff --git a/htdocs/asset/list.php b/htdocs/asset/list.php
index c475e22fc83..45f90101adc 100644
--- a/htdocs/asset/list.php
+++ b/htdocs/asset/list.php
@@ -125,7 +125,7 @@ $permissiontoadd = $user->rights->asset->write;
$permissiontodelete = $user->rights->asset->delete;
// Security check
-if (empty($conf->asset->enabled)) {
+if (!isModEnabled('asset')) {
accessforbidden('Module not enabled');
}
@@ -134,7 +134,7 @@ if ($user->socid > 0) accessforbidden();
$socid = 0; if ($user->socid > 0) $socid = $user->socid;
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
-if (empty($conf->asset->enabled)) accessforbidden();
+if (!isModEnabled('asset')) accessforbidden();
if (!$permissiontoread) accessforbidden();
diff --git a/htdocs/asset/model/accountancy_codes.php b/htdocs/asset/model/accountancy_codes.php
index 7582b61177e..6eb6d70abaf 100644
--- a/htdocs/asset/model/accountancy_codes.php
+++ b/htdocs/asset/model/accountancy_codes.php
@@ -59,7 +59,7 @@ $permissiontoadd = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rig
if ($user->socid > 0) accessforbidden();
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
-if (empty($conf->asset->enabled)) accessforbidden();
+if (!isModEnabled('asset')) accessforbidden();
if (!$permissiontoread) accessforbidden();
$result = $assetaccountancycodes->fetchAccountancyCodes(0, $object->id);
diff --git a/htdocs/asset/model/agenda.php b/htdocs/asset/model/agenda.php
index f1db3030dc2..51a7fb515bf 100644
--- a/htdocs/asset/model/agenda.php
+++ b/htdocs/asset/model/agenda.php
@@ -88,7 +88,7 @@ if ($user->socid > 0) accessforbidden();
if ($user->socid > 0) $socid = $user->socid;
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
-if (empty($conf->asset->enabled)) accessforbidden();
+if (!isModEnabled('asset')) accessforbidden();
if (!$permissiontoread) accessforbidden();
diff --git a/htdocs/asset/model/card.php b/htdocs/asset/model/card.php
index 3d3ec2f67d2..756ac32e31f 100644
--- a/htdocs/asset/model/card.php
+++ b/htdocs/asset/model/card.php
@@ -80,7 +80,7 @@ if ($user->socid > 0) accessforbidden();
if ($user->socid > 0) $socid = $user->socid;
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
-if (empty($conf->asset->enabled)) accessforbidden();
+if (!isModEnabled('asset')) accessforbidden();
if (!$permissiontoread) accessforbidden();
diff --git a/htdocs/asset/model/depreciation_options.php b/htdocs/asset/model/depreciation_options.php
index c34bd38dc46..f3f585f5397 100644
--- a/htdocs/asset/model/depreciation_options.php
+++ b/htdocs/asset/model/depreciation_options.php
@@ -59,7 +59,7 @@ $permissiontoadd = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rig
if ($user->socid > 0) accessforbidden();
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
-if (empty($conf->asset->enabled)) accessforbidden();
+if (!isModEnabled('asset')) accessforbidden();
if (!$permissiontoread) accessforbidden();
$object->asset_depreciation_options = &$assetdepreciationoptions;
diff --git a/htdocs/asset/model/list.php b/htdocs/asset/model/list.php
index a55d5f49f9a..1d85a982e5d 100644
--- a/htdocs/asset/model/list.php
+++ b/htdocs/asset/model/list.php
@@ -126,7 +126,7 @@ $permissiontoadd = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rig
$permissiontodelete = ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $user->rights->asset->delete) || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->asset->model_advance->delete)));
// Security check
-if (empty($conf->asset->enabled)) {
+if (!isModEnabled('asset')) {
accessforbidden('Module not enabled');
}
@@ -140,7 +140,7 @@ if ($user->socid > 0) {
}
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, 'asset', $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
-if (empty($conf->asset->enabled)) accessforbidden();
+if (!isModEnabled('asset')) accessforbidden();
if (!$permissiontoread) accessforbidden();
/*
diff --git a/htdocs/asset/note.php b/htdocs/asset/note.php
index 8de86d49bb7..810ab7f4462 100644
--- a/htdocs/asset/note.php
+++ b/htdocs/asset/note.php
@@ -57,7 +57,7 @@ $permissiontoadd = $user->rights->asset->write; // Used by the include of action
if ($user->socid > 0) accessforbidden();
$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
restrictedArea($user, $object->element, $object->id, $object->table_element, '', 'fk_soc', 'rowid', $isdraft);
-if (empty($conf->asset->enabled)) accessforbidden();
+if (!isModEnabled('asset')) accessforbidden();
/*
diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php
index d486432f142..d7eb7f53d82 100644
--- a/htdocs/contact/card.php
+++ b/htdocs/contact/card.php
@@ -32,6 +32,8 @@
* \brief Card of a contact
*/
+
+// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/comm/action/class/actioncomm.class.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
@@ -52,14 +54,15 @@ $langs->loadLangs(array('companies', 'users', 'other', 'commercial'));
$mesg = ''; $error = 0; $errors = array();
+// Get parameters
$action = (GETPOST('action', 'alpha') ? GETPOST('action', 'alpha') : 'view');
$confirm = GETPOST('confirm', 'alpha');
$backtopage = GETPOST('backtopage', 'alpha');
$cancel = GETPOST('cancel', 'alpha');
-
$id = GETPOST('id', 'int');
$socid = GETPOST('socid', 'int');
+// Initialize technical object
$object = new Contact($db);
$extrafields = new ExtraFields($db);
diff --git a/htdocs/contact/consumption.php b/htdocs/contact/consumption.php
index c3cd54d890e..fff1ba17644 100644
--- a/htdocs/contact/consumption.php
+++ b/htdocs/contact/consumption.php
@@ -22,9 +22,11 @@
/**
* \file htdocs/contact/consumption.php
* \ingroup societe
- * \brief Add a tab on thirpdarty view to list all products/services bought or sells by thirdparty
+ * \brief Add a tab on thirdparty view to list all products/services bought or sells by thirdparty
*/
+
+// Load Dolibarr environment
require "../main.inc.php";
require_once DOL_DOCUMENT_ROOT.'/core/lib/contact.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
diff --git a/htdocs/contact/document.php b/htdocs/contact/document.php
index 3fac8adea15..f62e82ee5a1 100644
--- a/htdocs/contact/document.php
+++ b/htdocs/contact/document.php
@@ -23,6 +23,8 @@
* \brief Page with attached files on contact
*/
+
+// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
@@ -33,6 +35,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
// Load translation files required by the page
$langs->loadLangs(array('other', 'companies', 'contact'));
+// Get parameters
$id = GETPOST('id', 'int');
$action = GETPOST('action', 'aZ09');
$confirm = GETPOST('confirm', 'alpha');
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index f5810db2b13..d5c0d333d03 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -33,6 +33,8 @@
* \brief Page to list all contacts
*/
+
+// Load Dolibarr environment
require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
@@ -44,6 +46,7 @@ $langs->loadLangs(array("companies", "suppliers", "categories"));
$socialnetworks = getArrayOfSocialNetworks();
+// Get parameters
$action = GETPOST('action', 'aZ09');
$massaction = GETPOST('massaction', 'alpha');
$show_files = GETPOST('show_files', 'int');
diff --git a/htdocs/core/modules/takepos/mod_takepos_ref_simple.php b/htdocs/core/modules/takepos/mod_takepos_ref_simple.php
index 41b7bb8c90e..31eb9345110 100644
--- a/htdocs/core/modules/takepos/mod_takepos_ref_simple.php
+++ b/htdocs/core/modules/takepos/mod_takepos_ref_simple.php
@@ -15,8 +15,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- * or see http://www.gnu.org/
+ * along with this program. If not, see .
+ * or see https://www.gnu.org/
*/
/**
@@ -24,6 +24,7 @@
* \ingroup takepos
* \brief File with Simple ref numbering module for takepos
*/
+
dol_include_once('/core/modules/takepos/modules_takepos.php');
/**
@@ -80,10 +81,10 @@ class mod_takepos_ref_simple extends ModeleNumRefTakepos
}
/**
- * Test si les numeros deja en vigueur dans la base ne provoquent pas de
- * de conflits qui empechera cette numerotation de fonctionner.
+ * Test if the numbers already in the database do not cause any conflicts that will prevent this
+ * of conflicts that will prevent this numbering from working.
*
- * @return boolean false si conflit, true si ok
+ * @return boolean false if KO (there is a conflict), true if OK
*/
public function canBeActivated()
{
diff --git a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php
index 7e46c10a341..9a6e632b92c 100644
--- a/htdocs/core/modules/takepos/mod_takepos_ref_universal.php
+++ b/htdocs/core/modules/takepos/mod_takepos_ref_universal.php
@@ -17,8 +17,8 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- * or see http://www.gnu.org/
+ * along with this program. If not, see .
+ * or see https://www.gnu.org/
*/
/**
@@ -26,6 +26,7 @@
* \ingroup takepos
* \brief File with Universal ref numbering module for takepos
*/
+
dol_include_once('/core/modules/takepos/modules_takepos.php');
/**
@@ -51,7 +52,7 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos
public $nom = 'Universal';
/**
- * Renvoi la description du modele de numerotation
+ * return description of the numbering model
*
* @return string Texte descripif
*/
@@ -77,7 +78,7 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos
$tooltip .= $langs->trans('GenericMaskCodes5');
$tooltip .= $langs->trans('CashDeskGenericMaskCodes6');
- // Parametrage du prefix
+ // Setting up the prefix
$texte .= '
'.$langs->trans("Mask").':
';
$texte .= '
'.$form->textwithpicto('', $tooltip, 1, 1).'
';
@@ -92,7 +93,7 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos
}
/**
- * Renvoi un exemple de numerotation
+ * Return an example of numbering
*
* @return string Example
*/
@@ -125,7 +126,7 @@ class mod_takepos_ref_universal extends ModeleNumRefTakepos
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
- // On defini critere recherche compteur
+ // We define search criteria counter
$mask = $conf->global->TAKEPOS_REF_UNIVERSAL_MASK;
if (!$mask) {
diff --git a/htdocs/core/modules/takepos/modules_takepos.php b/htdocs/core/modules/takepos/modules_takepos.php
index 24fa70b7f28..89b3dbde5bc 100644
--- a/htdocs/core/modules/takepos/modules_takepos.php
+++ b/htdocs/core/modules/takepos/modules_takepos.php
@@ -16,14 +16,14 @@
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- * or see http://www.gnu.org/
+ * along with this program. If not, see .
+ * or see https://www.gnu.org/
*/
/**
* \file htdocs/core/modules/takepos/modules_takepos.php
* \ingroup takepos
- * \brief Fichier contenant la classe mere de numerotation des tickets de caisse
+ * \brief File containing the parent class for the numbering of cash register receipts
*/
diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php
index cb38d7a3546..54e64ccc769 100644
--- a/htdocs/core/tpl/objectline_create.tpl.php
+++ b/htdocs/core/tpl/objectline_create.tpl.php
@@ -71,7 +71,7 @@ if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf-
if (in_array($object->element, array('propal', 'commande', 'order', 'facture', 'facturerec', 'invoice', 'supplier_proposal', 'order_supplier', 'invoice_supplier', 'invoice_supplier_rec'))) {
$colspan++; // With this, there is a column move button
}
-if (!empty($conf->asset->enabled) && $object->element == 'invoice_supplier') {
+if (isModEnabled('asset') && $object->element == 'invoice_supplier') {
$colspan++;
}
diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php
index 761be27b512..b2974ffbbfc 100644
--- a/htdocs/core/tpl/objectline_edit.tpl.php
+++ b/htdocs/core/tpl/objectline_edit.tpl.php
@@ -73,7 +73,7 @@ if (in_array($object->element, array('propal', 'supplier_proposal', 'facture', '
if (!empty($conf->multicurrency->enabled) && $this->multicurrency_code != $conf->currency) {
$colspan += 2;
}
-if (!empty($conf->asset->enabled) && $object->element == 'invoice_supplier') {
+if (isModEnabled('asset') && $object->element == 'invoice_supplier') {
$colspan++;
}
diff --git a/htdocs/core/tpl/objectline_title.tpl.php b/htdocs/core/tpl/objectline_title.tpl.php
index 762e9b4eefa..79d4ebeae11 100644
--- a/htdocs/core/tpl/objectline_title.tpl.php
+++ b/htdocs/core/tpl/objectline_title.tpl.php
@@ -160,7 +160,7 @@ if ($outputalsopricetotalwithtax) {
print '