diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php
index 79896d0ed74..daa0d7e8570 100644
--- a/htdocs/admin/fichinter.php
+++ b/htdocs/admin/fichinter.php
@@ -537,7 +537,7 @@ print ' '
print '
';
print $langs->trans("PrintProductsOnFichinter").' ('.$langs->trans("PrintProductsOnFichinterDetails").') ';
print ' global->FICHINTER_PRINT_PRODUCTS) {
+if (getDolGlobalString("FICHINTER_PRINT_PRODUCTS")) {
print 'checked ';
}
print '/>';
@@ -554,7 +554,7 @@ print '';
print $langs->trans("UseServicesDurationOnFichinter");
print ' ';
print '';
-print ' global->FICHINTER_USE_SERVICE_DURATION ? ' checked' : '').'>';
+print ' ';
print ' ';
print '';
print ' ';
@@ -570,7 +570,7 @@ print ' ';
print $langs->trans("UseDurationOnFichinter");
print ' ';
print '';
-print ' global->FICHINTER_WITHOUT_DURATION ? ' checked' : '').'>';
+print ' ';
print ' ';
print '';
print ' ';
@@ -586,7 +586,7 @@ print ' ';
print $langs->trans("UseDateWithoutHourOnFichinter");
print ' ';
print '';
-print ' global->FICHINTER_DATE_WITHOUT_HOUR ? ' checked' : '').'>';
+print ' ';
print ' ';
print '';
print ' ';
diff --git a/htdocs/admin/hrm.php b/htdocs/admin/hrm.php
index c568e6de39c..838e9bf9a0b 100644
--- a/htdocs/admin/hrm.php
+++ b/htdocs/admin/hrm.php
@@ -624,7 +624,7 @@ if ($action == 'edit') {
setEventMessages(null, $object->errors, "errors");
}
} else {
- print $conf->global->{$constname};
+ print getDolGlobalString($constname);
}
print ' ';
}
diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php
index a06760b9da4..a43b8c8003f 100644
--- a/htdocs/admin/reception_setup.php
+++ b/htdocs/admin/reception_setup.php
@@ -237,7 +237,7 @@ foreach ($dirmodels as $reldir) {
if ($conf->global->RECEPTION_ADDON_NUMBER == "$file") {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
- print 'scandir.'&label='.urlencode($module->name).'">';
+ print ' scandir) ? '&scan_dir='.$module->scandir : '').(!empty($module->name) ? '&label='.urlencode($module->name) : '').'">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
@@ -344,10 +344,10 @@ foreach ($dirmodels as $reldir) {
$module = new $classname($db);
$modulequalified = 1;
- if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
+ if (isset($module->version) && $module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
$modulequalified = 0;
}
- if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
+ if (isset($module->version) && $module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
$modulequalified = 0;
}
diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php
index aa337ff1f29..646b5e1e13d 100644
--- a/htdocs/admin/supplier_invoice.php
+++ b/htdocs/admin/supplier_invoice.php
@@ -392,7 +392,7 @@ foreach ($dirmodels as $reldir) {
// Default
print '';
- if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF == "$name") {
+ if (getDolGlobalString("INVOICE_SUPPLIER_ADDON_PDF") == "$name") {
//print img_picto($langs->trans("Default"),'on');
// Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').' ';
diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php
index 0204f184de7..905721128ad 100644
--- a/htdocs/admin/supplier_order.php
+++ b/htdocs/admin/supplier_order.php
@@ -1,63 +1,63 @@
- * Copyright (C) 2004-2011 Laurent Destailleur
- * Copyright (C) 2005-2011 Regis Houssin
- * Copyright (C) 2004 Sebastien Di Cintio
- * Copyright (C) 2004 Benoit Mortier
- * Copyright (C) 2010-2013 Juanjo Menent
- * Copyright (C) 2011-2018 Philippe Grand
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * 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 .
- */
+ /* Copyright (C) 2003-2007 Rodolphe Quiedeville
+ * Copyright (C) 2004-2011 Laurent Destailleur
+ * Copyright (C) 2005-2011 Regis Houssin
+ * Copyright (C) 2004 Sebastien Di Cintio
+ * Copyright (C) 2004 Benoit Mortier
+ * Copyright (C) 2010-2013 Juanjo Menent
+ * Copyright (C) 2011-2018 Philippe Grand
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * 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 .
+ */
-/**
- * \file htdocs/admin/supplier_order.php
- * \ingroup fournisseur
- * \brief Page d'administration-configuration du module Fournisseur
- */
+ /**
+ * \file htdocs/admin/supplier_order.php
+ * \ingroup fournisseur
+ * \brief Page d'administration-configuration du module Fournisseur
+ */
-require '../main.inc.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
-require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
-require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
-require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
+ require '../main.inc.php';
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
+ require_once DOL_DOCUMENT_ROOT.'/core/lib/fourn.lib.php';
+ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.class.php';
+ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
-// Load translation files required by the page
-$langs->loadLangs(array("admin", "other", "orders", "stocks"));
+ // Load translation files required by the page
+ $langs->loadLangs(array("admin", "other", "orders", "stocks"));
if (!$user->admin) {
accessforbidden();
}
-$type = GETPOST('type', 'alpha');
-$value = GETPOST('value', 'alpha');
-$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
+ $type = GETPOST('type', 'alpha');
+ $value = GETPOST('value', 'alpha');
+ $modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
-$label = GETPOST('label', 'alpha');
-$action = GETPOST('action', 'aZ09');
-$scandir = GETPOST('scan_dir', 'alpha');
+ $label = GETPOST('label', 'alpha');
+ $action = GETPOST('action', 'aZ09');
+ $scandir = GETPOST('scan_dir', 'alpha');
-$specimenthirdparty = new Societe($db);
-$specimenthirdparty->initAsSpecimen();
+ $specimenthirdparty = new Societe($db);
+ $specimenthirdparty->initAsSpecimen();
-/*
- * Actions
- */
+ /*
+ * Actions
+ */
-include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
+ include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
if ($action == 'updateMask') {
$maskconstorder = GETPOST('maskconstorder', 'alpha');
@@ -193,40 +193,40 @@ if ($action == 'updateMask') {
}
-/*
- * View
- */
+ /*
+ * View
+ */
-$form = new Form($db);
+ $form = new Form($db);
-$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
+ $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
-llxHeader("", "");
+ llxHeader("", "");
-$linkback = ''.$langs->trans("BackToModuleList").' ';
-print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup');
+ $linkback = ''.$langs->trans("BackToModuleList").' ';
+ print load_fiche_titre($langs->trans("SuppliersSetup"), $linkback, 'title_setup');
-print " ";
+ print " ";
-$head = supplierorder_admin_prepare_head();
+ $head = supplierorder_admin_prepare_head();
-print dol_get_fiche_head($head, 'order', $langs->trans("Suppliers"), -1, 'company');
+ print dol_get_fiche_head($head, 'order', $langs->trans("Suppliers"), -1, 'company');
-// Supplier order numbering module
+ // Supplier order numbering module
-print load_fiche_titre($langs->trans("OrdersNumberingModules"), '', '');
+ print load_fiche_titre($langs->trans("OrdersNumberingModules"), '', '');
-print '';
-print '';
-print ''.$langs->trans("Name").' ';
-print ''.$langs->trans("Description").' ';
-print ''.$langs->trans("Example").' ';
-print ''.$langs->trans("Status").' ';
-print ''.$langs->trans("ShortInfo").' ';
-print " \n";
+ print '';
+ print '';
+ print ''.$langs->trans("Name").' ';
+ print ''.$langs->trans("Description").' ';
+ print ''.$langs->trans("Example").' ';
+ print ''.$langs->trans("Status").' ';
+ print ''.$langs->trans("ShortInfo").' ';
+ print " \n";
-clearstatcache();
+ clearstatcache();
foreach ($dirmodels as $reldir) {
$dir = dol_buildpath($reldir."core/modules/supplier_order/");
@@ -309,24 +309,24 @@ foreach ($dirmodels as $reldir) {
}
}
-print '
';
+ print '
';
-/*
- * Documents models for supplier orders
- */
+ /*
+ * Documents models for supplier orders
+ */
-print load_fiche_titre($langs->trans("OrdersModelModule"), '', '');
+ print load_fiche_titre($langs->trans("OrdersModelModule"), '', '');
-// Defini tableau def de modele
-$def = array();
+ // Defini tableau def de modele
+ $def = array();
-$sql = "SELECT nom";
-$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
-$sql .= " WHERE type = 'order_supplier'";
-$sql .= " AND entity = ".$conf->entity;
+ $sql = "SELECT nom";
+ $sql .= " FROM ".MAIN_DB_PREFIX."document_model";
+ $sql .= " WHERE type = 'order_supplier'";
+ $sql .= " AND entity = ".$conf->entity;
-$resql = $db->query($sql);
+ $resql = $db->query($sql);
if ($resql) {
$i = 0;
$num_rows = $db->num_rows($resql);
@@ -339,17 +339,17 @@ if ($resql) {
dol_print_error($db);
}
-print ''."\n";
-print ''."\n";
-print ''.$langs->trans("Name").' '."\n";
-print ''.$langs->trans("Description").' '."\n";
-print ''.$langs->trans("Status").' '."\n";
-print ''.$langs->trans("Default").' '."\n";
-print ''.$langs->trans("ShortInfo").' ';
-print ''.$langs->trans("Preview").' ';
-print ' '."\n";
+ print ''."\n";
+ print ''."\n";
+ print ''.$langs->trans("Name").' '."\n";
+ print ''.$langs->trans("Description").' '."\n";
+ print ''.$langs->trans("Status").' '."\n";
+ print ''.$langs->trans("Default").' '."\n";
+ print ''.$langs->trans("ShortInfo").' ';
+ print ''.$langs->trans("Preview").' ';
+ print ' '."\n";
-clearstatcache();
+ clearstatcache();
foreach ($dirmodels as $reldir) {
$realpath = $reldir."core/modules/supplier_order/doc";
@@ -434,76 +434,76 @@ foreach ($dirmodels as $reldir) {
}
}
-print '
';
+ print '
';
-/*
- * Other options
- */
+ /*
+ * Other options
+ */
-print '';
+ print '';
-/*
- * Notifications
- */
+ /*
+ * Notifications
+ */
-print load_fiche_titre($langs->trans("Notifications"), '', '');
-print '';
-print '';
-print ''.$langs->trans("Parameter").' ';
-print ' ';
-print ' ';
-print " \n";
+ print load_fiche_titre($langs->trans("Notifications"), '', '');
+ print '';
+ print '';
+ print ''.$langs->trans("Parameter").' ';
+ print ' ';
+ print ' ';
+ print " \n";
-print '';
-print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").' ';
-print ' ';
-print " \n";
+ print '';
+ print $langs->trans("YouMayFindNotificationsFeaturesIntoModuleNotification").' ';
+ print ' ';
+ print " \n";
-print '
';
+ print '
';
-// End of page
-llxFooter();
-$db->close();
+ // End of page
+ llxFooter();
+ $db->close();
diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php
index a41f9fdf80c..187123ebbe7 100644
--- a/htdocs/admin/supplier_payment.php
+++ b/htdocs/admin/supplier_payment.php
@@ -74,7 +74,7 @@ if ($action == 'updateMask') {
} elseif ($action == 'del') {
$ret = delDocumentModel($value, $type);
if ($ret > 0) {
- if ($conf->global->FACTURE_ADDON_PDF == "$value") {
+ if (getDolGlobalString("FACTURE_ADDON_PDF") == "$value") {
dolibarr_del_const($db, 'SUPPLIER_PAYMENT_ADDON_PDF', $conf->entity);
}
}
@@ -262,7 +262,7 @@ foreach ($dirmodels as $reldir) {
if ($conf->global->SUPPLIER_PAYMENT_ADDON == $file || $conf->global->SUPPLIER_PAYMENT_ADDON.'.php' == $file) {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir) ? '&scandir='.$module->scandir : '').'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print ' ';
@@ -288,7 +288,7 @@ foreach ($dirmodels as $reldir) {
print '';
print $form->textwithpicto('', $htmltooltip, 1, 0);
- if ($conf->global->PAYMENT_ADDON.'.php' == $file) { // If module is the one used, we show existing errors
+ if (getDolGlobalString("PAYMENT_ADDON").'.php' == $file) { // If module is the one used, we show existing errors
if (!empty($module->error)) {
dol_htmloutput_mesg($module->error, '', 'error', 1);
}
@@ -350,7 +350,7 @@ foreach ($dirmodels as $reldir) {
print " \n";
print "\n";
require_once $dir.'/'.$file;
- $module = new $classname($db, $specimenthirdparty);
+ $module = new $classname($db, new Societe($db));
if (method_exists($module, 'info')) {
print $module->info($langs);
} else {
@@ -382,7 +382,7 @@ foreach ($dirmodels as $reldir) {
// Default
print ' ';
- if ($conf->global->SUPPLIER_PAYMENT_ADDON_PDF == "$name") {
+ if (getDolGlobalString("SUPPLIER_PAYMENT_ADDON_PDF") == "$name") {
//print img_picto($langs->trans("Default"),'on');
// Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
print 'scandir).'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').' ';
@@ -441,7 +441,7 @@ print "\n";
print ' ';
print $langs->trans("GroupPaymentsByModOnReports");
print ' ';
-print $form->selectyesno("PAYMENTS_FOURN_REPORT_GROUP_BY_MOD", $conf->global->PAYMENTS_FOURN_REPORT_GROUP_BY_MOD, 1);
+print $form->selectyesno("PAYMENTS_FOURN_REPORT_GROUP_BY_MOD", getDolGlobalString("PAYMENTS_FOURN_REPORT_GROUP_BY_MOD"), 1);
print ' ';
print " \n";
diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php
index f1fbba03840..66b7f24a719 100644
--- a/htdocs/admin/ticket.php
+++ b/htdocs/admin/ticket.php
@@ -428,7 +428,7 @@ foreach ($dirmodels as $reldir) {
// Default
print '';
- if ($conf->global->TICKET_ADDON_PDF == $name) {
+ if (getDolGlobalString("TICKET_ADDON_PDF") == $name) {
print img_picto($langs->trans("Default"), 'on');
} else {
print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
@@ -540,9 +540,10 @@ print ' ';
print '';
if (isModEnabled('product')) {
+ $htmlname = "product_category_id";
print ''.$langs->trans("TicketChooseProductCategory").' ';
print '';
- $formcategory->selectProductCategory($conf->global->TICKET_PRODUCT_CATEGORY, 'product_category_id');
+ $formcategory->selectProductCategory($conf->global->TICKET_PRODUCT_CATEGORY, $htmlname);
if ($conf->use_javascript_ajax) {
print ajax_combobox('select_'.$htmlname);
}
diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php
index 3e4c088620d..3d2a64e4d96 100644
--- a/htdocs/admin/ticket_public.php
+++ b/htdocs/admin/ticket_public.php
@@ -381,10 +381,10 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
}
// Interface topic
- $url_interface = $conf->global->TICKET_PUBLIC_INTERFACE_TOPIC;
+ $url_interface = getDolGlobalString("TICKET_PUBLIC_INTERFACE_TOPIC");
print ' '.$langs->trans("TicketPublicInterfaceTopicLabelAdmin").'';
print ' ';
- print ' ';
+ print ' ';
print '';
print '';
print $form->textwithpicto('', $langs->trans("TicketPublicInterfaceTopicHelp"), 1, 'help');
@@ -403,7 +403,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
print ' ';
// Text to help to enter a ticket
- $public_text_help_message = $conf->global->TICKET_PUBLIC_TEXT_HELP_MESSAGE ? $conf->global->TICKET_PUBLIC_TEXT_HELP_MESSAGE : $langs->trans('TicketPublicPleaseBeAccuratelyDescribe');
+ $public_text_help_message = getDolGlobalString("TICKET_PUBLIC_TEXT_HELP_MESSAGE", $langs->trans('TicketPublicPleaseBeAccuratelyDescribe'));
print ''.$langs->trans("TicketPublicInterfaceTextHelpMessageLabelAdmin").'';
print ' ';
require_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
@@ -415,10 +415,10 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
print ' ';
// Url public interface
- $url_interface = $conf->global->TICKET_URL_PUBLIC_INTERFACE;
+ $url_interface = getDolGlobalString("TICKET_URL_PUBLIC_INTERFACE");
print ''.$langs->trans("TicketUrlPublicInterfaceLabelAdmin").'';
print ' ';
- print ' ';
+ print ' ';
print '';
print '';
print $form->textwithpicto('', $langs->trans("TicketUrlPublicInterfaceHelpAdmin"), 1, 'help');
@@ -448,7 +448,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
print ' ';
// Text of email after creatio of a ticket
- $mail_mesg_new = $conf->global->TICKET_MESSAGE_MAIL_NEW ? $conf->global->TICKET_MESSAGE_MAIL_NEW : $langs->trans('TicketNewEmailBody');
+ $mail_mesg_new = getDolGlobalString("TICKET_MESSAGE_MAIL_NEW", $langs->trans('TicketNewEmailBody'));
print '';
print $form->textwithpicto($langs->trans("TicketNewEmailBodyLabel"), $langs->trans("TicketNewEmailBodyHelp"), 1, 'help');
print '';
@@ -468,7 +468,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
print ajax_constantonoff('TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED');
} else {
$arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes"));
- print $form->selectarray("TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED", $arrval, $conf->global->TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED);
+ print $form->selectarray("TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED", $arrval, getDolGlobalString("TICKET_PUBLIC_NOTIFICATION_NEW_MESSAGE_ENABLED"));
}
print ' ';
print ' ';
@@ -477,7 +477,7 @@ if (!empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
print '';
print $form->textwithpicto($langs->trans("TicketPublicNotificationNewMessageDefaultEmail"), $langs->trans("TicketPublicNotificationNewMessageDefaultEmailHelp"), 1, 'help');
print ' ';
- print ' ';
+ print ' ';
print '';
print ' ';
diff --git a/htdocs/core/db/mysqli.class.php b/htdocs/core/db/mysqli.class.php
index 9b1d78f1694..1fe4ce77414 100644
--- a/htdocs/core/db/mysqli.class.php
+++ b/htdocs/core/db/mysqli.class.php
@@ -421,7 +421,7 @@ class DoliDBMysqli extends DoliDB
if (!is_object($resultset)) {
$resultset = $this->_results;
}
- return $resultset->num_rows;
+ return isset($resultset->num_rows) ? $resultset->num_rows : 0;
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
diff --git a/htdocs/core/modules/commande/mod_commande_saphir.php b/htdocs/core/modules/commande/mod_commande_saphir.php
index 36efdcc1d88..ad2b109f2d1 100644
--- a/htdocs/core/modules/commande/mod_commande_saphir.php
+++ b/htdocs/core/modules/commande/mod_commande_saphir.php
@@ -79,7 +79,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes
// Parametrage du prefix
$texte .= ''.$langs->trans("Mask").': ';
- $texte .= ''.$form->textwithpicto(' ', $tooltip, 1, 1).' ';
+ $texte .= ''.$form->textwithpicto(' ', $tooltip, 1, 1).' ';
$texte .= ' ';
@@ -128,7 +128,7 @@ class mod_commande_saphir extends ModeleNumRefCommandes
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// We get cursor rule
- $mask = $conf->global->COMMANDE_SAPHIR_MASK;
+ $mask = getDolGlobalString("COMMANDE_SAPHIR_MASK");
if (!$mask) {
$this->error = 'NotConfigured';
diff --git a/htdocs/core/modules/contract/mod_contract_magre.php b/htdocs/core/modules/contract/mod_contract_magre.php
index e0c54c1d022..e88d2c46b32 100644
--- a/htdocs/core/modules/contract/mod_contract_magre.php
+++ b/htdocs/core/modules/contract/mod_contract_magre.php
@@ -85,7 +85,7 @@ class mod_contract_magre extends ModelNumRefContracts
$tooltip .= $langs->trans("GenericMaskCodes5");
$texte .= ''.$langs->trans("Mask").': ';
- $texte .= ''.$form->textwithpicto(' ', $tooltip, 1, 1).' ';
+ $texte .= ''.$form->textwithpicto(' ', $tooltip, 1, 1).' ';
$texte .= ' ';
$texte .= ' ';
$texte .= '';
@@ -127,7 +127,7 @@ class mod_contract_magre extends ModelNumRefContracts
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
- $mask = $conf->global->CONTRACT_MAGRE_MASK;
+ $mask = getDolGlobalString("CONTRACT_MAGRE_MASK");
if (!$mask) {
$this->error = 'NotConfigured';
diff --git a/htdocs/core/modules/fichinter/mod_arctic.php b/htdocs/core/modules/fichinter/mod_arctic.php
index cb5acddd6e9..8efd936601b 100644
--- a/htdocs/core/modules/fichinter/mod_arctic.php
+++ b/htdocs/core/modules/fichinter/mod_arctic.php
@@ -84,7 +84,7 @@ class mod_arctic extends ModeleNumRefFicheinter
// Setting the prefix
$texte .= ''.$langs->trans("Mask").': ';
- $texte .= ''.$form->textwithpicto(' ', $tooltip, 1, 1).' ';
+ $texte .= ''.$form->textwithpicto(' ', $tooltip, 1, 1).' ';
$texte .= ' ';
@@ -130,7 +130,7 @@ class mod_arctic extends ModeleNumRefFicheinter
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// We define the search criteria of the counter
- $mask = $conf->global->FICHINTER_ARTIC_MASK;
+ $mask = getDolGlobalString("FICHINTER_ARTIC_MASK");
if (!$mask) {
$this->error = 'NotConfigured';
diff --git a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
index 8314d62dada..dfcc9273505 100644
--- a/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
+++ b/htdocs/core/modules/propale/doc/doc_generic_proposal_odt.modules.php
@@ -123,7 +123,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
$texte .= ' ';
$texte .= ' ';
$texte .= ' ';
- if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0) {
+ if (getDolGlobalInt("MAIN_PROPAL_CHOOSE_ODT_DOCUMENT") > 0) {
$texte .= ' ';
$texte .= ' ';
$texte .= ' ';
@@ -187,7 +187,7 @@ class doc_generic_proposal_odt extends ModelePDFPropales
$texte .= '';
// Set default template for different status of proposal
- if ($conf->global->MAIN_PROPAL_CHOOSE_ODT_DOCUMENT > 0) {
+ if (getDolGlobalInt("MAIN_PROPAL_CHOOSE_ODT_DOCUMENT") > 0) {
// Model for creation
$list = ModelePDFPropales::liste_modeles($this->db);
$texte .= '';
@@ -106,7 +106,7 @@ class mod_reception_moonstone extends ModelNumRefReception
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
- $mask = $conf->global->RECEPTION_MOONSTONE_MASK;
+ $mask = getDolGlobalString("RECEPTION_MOONSTONE_MASK");
if (!$mask) {
$this->error = 'NotConfigured';
diff --git a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php
index e6838b9c4c4..0aacecc69da 100644
--- a/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php
+++ b/htdocs/core/modules/supplier_invoice/mod_facture_fournisseur_tulip.php
@@ -67,12 +67,12 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices
*/
public function info()
{
- global $conf, $langs;
+ global $conf, $langs, $db;
// Load translation files required by the page
$langs->loadLangs(array("bills", "admin"));
- $form = new Form($this->db);
+ $form = new Form($db);
$texte = $langs->trans('GenericNumRefModelDesc')." \n";
$texte .= '';
@@ -93,7 +93,7 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices
// Setting the prefix
$texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceStandard").')';
$texte .= ': ';
- $texte .= ''.$form->textwithpicto(' ', $tooltip, 1, 1).' ';
+ $texte .= ''.$form->textwithpicto(' ', $tooltip, 1, 1).' ';
$texte .= ' ';
@@ -101,19 +101,19 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices
// Prefix setting of credit note
$texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceAvoir").'): ';
- $texte .= ''.$form->textwithpicto(' ', $tooltip, 1, 1).' ';
+ $texte .= ''.$form->textwithpicto(' ', $tooltip, 1, 1).' ';
$texte .= ' ';
if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
// Parametrage du prefix des replacement
$texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceReplacement").'): ';
- $texte .= ''.$form->textwithpicto(' ', $tooltip, 1, 1).' ';
+ $texte .= ''.$form->textwithpicto(' ', $tooltip, 1, 1).' ';
$texte .= ' ';
}
// Prefix setting of deposit
$texte .= ''.$langs->trans("Mask").' ('.$langs->trans("InvoiceDeposit").'): ';
- $texte .= ''.$form->textwithpicto(' ', $tooltip, 1, 1).' ';
+ $texte .= ''.$form->textwithpicto(' ', $tooltip, 1, 1).' ';
$texte .= ' ';
$texte .= '';
@@ -159,16 +159,16 @@ class mod_facture_fournisseur_tulip extends ModeleNumRefSuppliersInvoices
// Get Mask value
$mask = '';
if (is_object($object) && $object->type == 1) {
- $mask = $conf->global->SUPPLIER_REPLACEMENT_TULIP_MASK;
+ $mask = getDolGlobalString("SUPPLIER_REPLACEMENT_TULIP_MASK");
if (!$mask) {
- $mask = $conf->global->SUPPLIER_INVOICE_TULIP_MASK;
+ $mask = getDolGlobalString("SUPPLIER_INVOICE_TULIP_MASK");
}
} elseif (is_object($object) && $object->type == 2) {
- $mask = $conf->global->SUPPLIER_CREDIT_TULIP_MASK;
+ $mask = getDolGlobalString("SUPPLIER_CREDIT_TULIP_MASK");
} elseif (is_object($object) && $object->type == 3) {
- $mask = $conf->global->SUPPLIER_DEPOSIT_TULIP_MASK;
+ $mask = getDolGlobalString("SUPPLIER_DEPOSIT_TULIP_MASK");
} else {
- $mask = $conf->global->SUPPLIER_INVOICE_TULIP_MASK;
+ $mask = getDolGlobalString("SUPPLIER_INVOICE_TULIP_MASK");
}
if (!$mask) {
$this->error = 'NotConfigured';
diff --git a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php
index 473664cb44c..8f67f28b42d 100644
--- a/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php
+++ b/htdocs/core/modules/supplier_order/mod_commande_fournisseur_orchidee.php
@@ -85,7 +85,7 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders
// Parametrage du prefix
$texte .= ''.$langs->trans("Mask").': ';
- $texte .= ''.$form->textwithpicto(' ', $tooltip, 1, 1).' ';
+ $texte .= ''.$form->textwithpicto(' ', $tooltip, 1, 1).' ';
$texte .= ' ';
@@ -131,7 +131,7 @@ class mod_commande_fournisseur_orchidee extends ModeleNumRefSuppliersOrders
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// On defini critere recherche compteur
- $mask = $conf->global->COMMANDE_FOURNISSEUR_ORCHIDEE_MASK;
+ $mask = getDolGlobalString("COMMANDE_FOURNISSEUR_ORCHIDEE_MASK");
if (!$mask) {
$this->error = 'NotConfigured';
diff --git a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php
index 0bc0543e6cd..292662a14ad 100644
--- a/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php
+++ b/htdocs/core/modules/supplier_payment/mod_supplier_payment_brodator.php
@@ -61,11 +61,11 @@ class mod_supplier_payment_brodator extends ModeleNumRefSupplierPayments
*/
public function info()
{
- global $conf, $langs;
+ global $conf, $langs, $db;
$langs->load("bills");
- $form = new Form($this->db);
+ $form = new Form($db);
$texte = $langs->trans('GenericNumRefModelDesc')." \n";
$texte .= '';
@@ -82,7 +82,7 @@ class mod_supplier_payment_brodator extends ModeleNumRefSupplierPayments
// Parametrage du prefix
$texte .= ''.$langs->trans("Mask").': ';
- $texte .= ''.$form->textwithpicto(' ', $tooltip, 1, 1).' ';
+ $texte .= ''.$form->textwithpicto(' ', $tooltip, 1, 1).' ';
$texte .= ' ';
@@ -128,7 +128,7 @@ class mod_supplier_payment_brodator extends ModeleNumRefSupplierPayments
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// We get cursor rule
- $mask = $conf->global->SUPPLIER_PAYMENT_BRODATOR_MASK;
+ $mask = getDolGlobalString("SUPPLIER_PAYMENT_BRODATOR_MASK");
if (!$mask) {
$this->error = 'NotConfigured';
diff --git a/htdocs/core/modules/ticket/mod_ticket_universal.php b/htdocs/core/modules/ticket/mod_ticket_universal.php
index 2c46376eea1..8efc2f6a4e5 100644
--- a/htdocs/core/modules/ticket/mod_ticket_universal.php
+++ b/htdocs/core/modules/ticket/mod_ticket_universal.php
@@ -81,7 +81,7 @@ class mod_ticket_universal extends ModeleNumRefTicket
// Parametrage du prefix
$texte .= ''.$langs->trans("Mask").': ';
- $texte .= ''.$form->textwithpicto(' ', $tooltip, 1, 1).' ';
+ $texte .= ''.$form->textwithpicto(' ', $tooltip, 1, 1).' ';
$texte .= ' ';
@@ -127,7 +127,7 @@ class mod_ticket_universal extends ModeleNumRefTicket
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
// On defini critere recherche compteur
- $mask = $conf->global->TICKET_UNIVERSAL_MASK;
+ $mask = getDolGlobalString("TICKET_UNIVERSAL_MASK");
if (!$mask) {
$this->error = 'NotConfigured';
diff --git a/htdocs/hrm/admin/admin_establishment.php b/htdocs/hrm/admin/admin_establishment.php
index 223f8a720d5..f28c0285e1f 100644
--- a/htdocs/hrm/admin/admin_establishment.php
+++ b/htdocs/hrm/admin/admin_establishment.php
@@ -53,10 +53,10 @@ if (empty($page) || $page == -1) {
$page = 0;
}
+$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
$offset = $limit * $page;
$pageprev = $page - 1;
$pagenext = $page + 1;
-$limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
/*
diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php
index 1b30eed663a..fa2ed2f55fd 100644
--- a/htdocs/hrm/establishment/card.php
+++ b/htdocs/hrm/establishment/card.php
@@ -254,7 +254,7 @@ if ($action == 'create') {
}
// Part to edit record
-if (($id || $ref) && $action == 'edit') {
+if ((!empty($id) || !empty($ref)) && $action == 'edit') {
$result = $object->fetch($id);
if ($result > 0) {
$head = establishment_prepare_head($object);