diff --git a/dev/initdemo/mysqldump_dolibarr_17.0.0.sql b/dev/initdemo/mysqldump_dolibarr_17.0.0.sql
index 20112e77bb6..71c7c8e50ea 100644
--- a/dev/initdemo/mysqldump_dolibarr_17.0.0.sql
+++ b/dev/initdemo/mysqldump_dolibarr_17.0.0.sql
@@ -1962,6 +1962,7 @@ CREATE TABLE `llx_c_holiday_types` (
`delay` int(11) NOT NULL,
`newbymonth` double(8,5) NOT NULL DEFAULT 0.00000,
`fk_country` int(11) DEFAULT NULL,
+ `block_if_negative` int(11) NOT NULL DEFAULT 0,
`active` int(11) DEFAULT 1,
`sortorder` smallint(6) DEFAULT NULL,
PRIMARY KEY (`rowid`),
diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php
index be86f35e0dc..6b7e40ce84a 100644
--- a/htdocs/admin/mails_templates.php
+++ b/htdocs/admin/mails_templates.php
@@ -1306,7 +1306,7 @@ if ($num) {
// If no record found
if ($nbqualified == 0) {
- $colspan = 10;
+ $colspan = 12;
print '
rights->holiday->read) {
+if ($user->hasRight("holiday", "read")) {
// LEAVE-HOLIDAY CALENDAR
$sql = "SELECT u.rowid as uid, u.lastname, u.firstname, u.statut, x.rowid, x.date_debut as date_start, x.date_fin as date_end, x.halfday, x.statut as status";
$sql .= " FROM ".MAIN_DB_PREFIX."holiday as x, ".MAIN_DB_PREFIX."user as u";
diff --git a/htdocs/core/class/cstate.class.php b/htdocs/core/class/cstate.class.php
index 46e60b2f7fd..fe5f6b53974 100644
--- a/htdocs/core/class/cstate.class.php
+++ b/htdocs/core/class/cstate.class.php
@@ -292,4 +292,20 @@ class Cstate // extends CommonObject
return 1;
}
}
+
+ /**
+ * Return a link to the object card (with optionaly the picto)
+ *
+ * @param int $withpicto Include picto in link (0=No picto, 1=Include picto into link, 2=Only picto)
+ * @param string $option On what the link point to ('nolink', ...)
+ * @param int $notooltip 1=Disable tooltip
+ * @param string $morecss Add more css on link
+ * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking
+ * @return string String with URL
+ */
+ public function getNomUrl($withpicto = 0, $option = '', $notooltip = 0, $morecss = '', $save_lastsearch_value = -1)
+ {
+ global $langs;
+ return $langs->trans($this->name);
+ }
}
diff --git a/htdocs/core/class/dolgraph.class.php b/htdocs/core/class/dolgraph.class.php
index 8fad21d5e3b..362d61e5325 100644
--- a/htdocs/core/class/dolgraph.class.php
+++ b/htdocs/core/class/dolgraph.class.php
@@ -1351,7 +1351,7 @@ class DolGraph
// Add a callback to change label to show only positive value
if (is_array($this->tooltipsLabels) || is_array($this->tooltipsTitles)) {
- $this->stringtoshow .= ', tooltips: { mode: \'nearest\',
+ $this->stringtoshow .= 'tooltips: { mode: \'nearest\',
callbacks: {';
if (is_array($this->tooltipsTitles)) {
$this->stringtoshow .='
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 09d01924dda..dd94edf7228 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -9757,7 +9757,7 @@ class Form
$nophoto = '/public/theme/common/nophoto.png';
$defaultimg = 'identicon'; // For gravatar
if (in_array($modulepart, array('societe', 'userphoto', 'contact', 'memberphoto'))) { // For modules that need a special image when photo not found
- if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && strpos($object->morphy, 'mor')) !== false) {
+ if ($modulepart == 'societe' || ($modulepart == 'memberphoto' && !empty($object->morphy) && strpos($object->morphy, 'mor')) !== false) {
$nophoto = 'company';
} else {
$nophoto = '/public/theme/common/user_anonymous.png';
diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php
index cfe7527cb02..04ecd350227 100644
--- a/htdocs/core/js/lib_head.js.php
+++ b/htdocs/core/js/lib_head.js.php
@@ -1320,6 +1320,9 @@ jQuery(document).ready(function() {
* TODO: Recheck with the select2 GH issue and remove once this is fixed on their side
*/
+global->MAIN_DISABLE_SELECT2_FOCUS_PROTECTION) && !defined('DISABLE_SELECT2_FOCUS_PROTECTION')) {
+ ?>
$(document).on('select2:open', (e) => {
console.log("Execute the focus (click on combo or use space when on component");
const target = $(e.target);
@@ -1329,6 +1332,9 @@ $(document).on('select2:open', (e) => {
document.querySelector('input[aria-controls*='+id+']').focus();
}
});
+
// End of lib_head.js.php
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index 2f1082c7ca9..084d0cd08b6 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -6817,7 +6817,7 @@ function yn($yesno, $case = 1, $color = 0)
$result = 'unknown';
$classname = '';
- if ($yesno == 1 || strtolower($yesno) == 'yes' || strtolower($yesno) == 'true') { // A mettre avant test sur no a cause du == 0
+ if ($yesno == 1 || (isset($yesno) && (strtolower($yesno) == 'yes' || strtolower($yesno) == 'true'))) { // A mettre avant test sur no a cause du == 0
$result = $langs->trans('yes');
if ($case == 1 || $case == 3) {
$result = $langs->trans("Yes");
diff --git a/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php b/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php
index e281be6ff44..657bf4fee22 100644
--- a/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php
+++ b/htdocs/core/modules/asset/doc/doc_generic_asset_odt.modules.php
@@ -262,8 +262,8 @@ class doc_generic_asset_odt extends ModelePDFAsset
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
- if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
- $format = $conf->global->MAIN_DOC_USE_TIMING;
+ if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
+ $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}
diff --git a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php
index ede4554e98a..8ef4046c466 100644
--- a/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php
+++ b/htdocs/core/modules/bom/doc/doc_generic_bom_odt.modules.php
@@ -274,8 +274,8 @@ class doc_generic_bom_odt extends ModelePDFBom
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
- if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
- $format = $conf->global->MAIN_DOC_USE_TIMING;
+ if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
+ $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}
diff --git a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
index c4ecbee453c..f37c35b185a 100644
--- a/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
+++ b/htdocs/core/modules/commande/doc/doc_generic_order_odt.modules.php
@@ -280,8 +280,8 @@ class doc_generic_order_odt extends ModelePDFCommandes
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
- if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
- $format = $conf->global->MAIN_DOC_USE_TIMING;
+ if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
+ $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}
diff --git a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
index a7cb5ada26c..478799d4518 100644
--- a/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
+++ b/htdocs/core/modules/contract/doc/doc_generic_contract_odt.modules.php
@@ -278,8 +278,8 @@ class doc_generic_contract_odt extends ModelePDFContract
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
- if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
- $format = $conf->global->MAIN_DOC_USE_TIMING;
+ if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
+ $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}
diff --git a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
index 6b7998a121c..5f216bb0ac6 100644
--- a/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
+++ b/htdocs/core/modules/expedition/doc/doc_generic_shipment_odt.modules.php
@@ -278,8 +278,8 @@ class doc_generic_shipment_odt extends ModelePdfExpedition
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
- if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
- $format = $conf->global->MAIN_DOC_USE_TIMING;
+ if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
+ $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}
diff --git a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
index f1e30925d3f..9e203e8d5ce 100644
--- a/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
+++ b/htdocs/core/modules/facture/doc/doc_generic_invoice_odt.modules.php
@@ -278,8 +278,8 @@ class doc_generic_invoice_odt extends ModelePDFFactures
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
- if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
- $format = $conf->global->MAIN_DOC_USE_TIMING;
+ if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
+ $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}
diff --git a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php
index b8cdb48a02f..024248a0ce1 100644
--- a/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php
+++ b/htdocs/core/modules/member/doc/doc_generic_member_odt.class.php
@@ -268,8 +268,8 @@ class doc_generic_member_odt extends ModelePDFMember
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
- if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
- $format = $conf->global->MAIN_DOC_USE_TIMING;
+ if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
+ $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}
diff --git a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php
index ee0532fd949..a87c920e40b 100644
--- a/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php
+++ b/htdocs/core/modules/mrp/doc/doc_generic_mo_odt.modules.php
@@ -267,8 +267,8 @@ class doc_generic_mo_odt extends ModelePDFMo
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
- if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
- $format = $conf->global->MAIN_DOC_USE_TIMING;
+ if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
+ $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}
diff --git a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
index 1d5116addba..0b8d6676bbf 100644
--- a/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
+++ b/htdocs/core/modules/product/doc/doc_generic_product_odt.modules.php
@@ -276,8 +276,8 @@ class doc_generic_product_odt extends ModelePDFProduct
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
- if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
- $format = $conf->global->MAIN_DOC_USE_TIMING;
+ if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
+ $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}
diff --git a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
index a0c52ba3b8f..4a94dc85521 100644
--- a/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
+++ b/htdocs/core/modules/project/doc/doc_generic_project_odt.modules.php
@@ -559,8 +559,8 @@ class doc_generic_project_odt extends ModelePDFProjects
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
- if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
- $format = $conf->global->MAIN_DOC_USE_TIMING;
+ if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
+ $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}
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 853329481fe..161eead8533 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
@@ -312,8 +312,8 @@ class doc_generic_proposal_odt extends ModelePDFPropales
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
- if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
- $format = $conf->global->MAIN_DOC_USE_TIMING;
+ if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
+ $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}
diff --git a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php
index 76335afc7b5..86d69220ca7 100644
--- a/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php
+++ b/htdocs/core/modules/reception/doc/doc_generic_reception_odt.modules.php
@@ -271,8 +271,8 @@ class doc_generic_reception_odt extends ModelePdfReception
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
- if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
- $format = $conf->global->MAIN_DOC_USE_TIMING;
+ if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
+ $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}
diff --git a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
index c052401203c..985fe9dfd60 100644
--- a/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
+++ b/htdocs/core/modules/societe/doc/doc_generic_odt.modules.php
@@ -252,8 +252,8 @@ class doc_generic_odt extends ModeleThirdPartyDoc
$newfiletmp = dol_sanitizeFileName(dol_string_nospecial($object->name)) . '-' . $newfiletmp;
$newfiletmp = preg_replace('/__+/', '_', $newfiletmp); // Replace repeated _ into one _ (to avoid string with substitution syntax)
}
- if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
- $format = $conf->global->MAIN_DOC_USE_TIMING;
+ if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
+ $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}
diff --git a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php
index 612aa787dce..f7cdf97f2e5 100644
--- a/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php
+++ b/htdocs/core/modules/stock/doc/doc_generic_stock_odt.modules.php
@@ -278,8 +278,8 @@ class doc_generic_stock_odt extends ModelePDFStock
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
- if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
- $format = $conf->global->MAIN_DOC_USE_TIMING;
+ if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
+ $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}
diff --git a/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php b/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php
index 94bb2d9fc0c..2b36d7a7a40 100644
--- a/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php
+++ b/htdocs/core/modules/supplier_invoice/doc/doc_generic_supplier_invoice_odt.modules.php
@@ -271,8 +271,8 @@ class doc_generic_supplier_invoice_odt extends ModelePDFSuppliersInvoices
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
- if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
- $format = $conf->global->MAIN_DOC_USE_TIMING;
+ if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
+ $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}
diff --git a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php
index a305403d6a6..76b6d2b48c7 100644
--- a/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php
+++ b/htdocs/core/modules/supplier_order/doc/doc_generic_supplier_order_odt.modules.php
@@ -266,8 +266,8 @@ class doc_generic_supplier_order_odt extends ModelePDFSuppliersOrders
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
- if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
- $format = $conf->global->MAIN_DOC_USE_TIMING;
+ if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
+ $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}
diff --git a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
index fd71e68e003..acb0774e8a0 100644
--- a/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
+++ b/htdocs/core/modules/supplier_proposal/doc/doc_generic_supplier_proposal_odt.modules.php
@@ -300,8 +300,8 @@ class doc_generic_supplier_proposal_odt extends ModelePDFSupplierProposal
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
- if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
- $format = $conf->global->MAIN_DOC_USE_TIMING;
+ if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
+ $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}
diff --git a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php
index 2d9f9a9e9ae..0e42d2fda58 100644
--- a/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php
+++ b/htdocs/core/modules/ticket/doc/doc_generic_ticket_odt.modules.php
@@ -266,8 +266,8 @@ class doc_generic_ticket_odt extends ModelePDFTicket
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
- if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
- $format = $conf->global->MAIN_DOC_USE_TIMING;
+ if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
+ $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}
diff --git a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php
index f1a7ca0f2a3..ca43431055c 100644
--- a/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php
+++ b/htdocs/core/modules/user/doc/doc_generic_user_odt.modules.php
@@ -300,8 +300,8 @@ class doc_generic_user_odt extends ModelePDFUser
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
- if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
- $format = $conf->global->MAIN_DOC_USE_TIMING;
+ if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
+ $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}
diff --git a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php
index 7c86061b057..6df859ed5b1 100644
--- a/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php
+++ b/htdocs/core/modules/usergroup/doc/doc_generic_usergroup_odt.modules.php
@@ -282,8 +282,8 @@ class doc_generic_usergroup_odt extends ModelePDFUserGroup
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
- if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
- $format = $conf->global->MAIN_DOC_USE_TIMING;
+ if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
+ $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}
diff --git a/htdocs/eventorganization/conferenceorbooth_list.php b/htdocs/eventorganization/conferenceorbooth_list.php
index 5544f790585..49940ef7881 100644
--- a/htdocs/eventorganization/conferenceorbooth_list.php
+++ b/htdocs/eventorganization/conferenceorbooth_list.php
@@ -828,7 +828,6 @@ print '
';
// Action column
if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
- //print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
$totalarray['nbfield']++;
}
foreach ($object->fields as $key => $val) {
diff --git a/htdocs/eventorganization/conferenceorboothattendee_list.php b/htdocs/eventorganization/conferenceorboothattendee_list.php
index 0a67866ce62..9636e7e8d0f 100644
--- a/htdocs/eventorganization/conferenceorboothattendee_list.php
+++ b/htdocs/eventorganization/conferenceorboothattendee_list.php
@@ -293,7 +293,7 @@ if ($object->ismultientitymanaged == 1) {
$sql .= " WHERE 1 = 1";
}
if (!empty($projectstatic->id)) {
- $sql .= " AND t.fk_project=".((int) $projectstatic->id);
+ $sql .= " AND t.fk_project = ".((int) $projectstatic->id);
}
foreach ($search as $key => $val) {
if (array_key_exists($key, $object->fields)) {
@@ -375,7 +375,7 @@ $num = $db->num_rows($resql);
if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
- header("Location: ".dol_buildpath('/eventorganization/conferenceorboothattendee_card.php', 1).'?id='.$id);
+ header("Location: ".DOL_URL_ROOT.'/eventorganization/conferenceorboothattendee_card.php?id='.((int) $id));
exit;
}
@@ -600,7 +600,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
//print '';
print '| ';
$linksuggest = $dolibarr_main_url_root.'/public/project/index.php?id='.$projectstatic->id;
- $encodedsecurekey = dol_hash(getDolUserString("EVENTORGANIZATION_SECUREKEYEVENTORGANIZATION_SECUREKEY").'conferenceorbooth'.$projectstatic->id, 'md5');
+ $encodedsecurekey = dol_hash(getDolGlobalString("EVENTORGANIZATION_SECUREKEY").'conferenceorbooth'.$projectstatic->id, 'md5');
$linksuggest .= '&securekey='.urlencode($encodedsecurekey);
//print ' ';
//print '';
@@ -617,7 +617,7 @@ if ($projectstatic->id > 0 || $confOrBooth > 0) {
//print '';
print ' | ';
$link_subscription = $dolibarr_main_url_root.'/public/eventorganization/attendee_new.php?id='.$projectstatic->id.'&type=global';
- $encodedsecurekey = dol_hash(getDolUserString("EVENTORGANIZATION_SECUREKEY").'conferenceorbooth'.$projectstatic->id, 'md5');
+ $encodedsecurekey = dol_hash(getDolGlobalString("EVENTORGANIZATION_SECUREKEY").'conferenceorbooth'.$projectstatic->id, 'md5');
$link_subscription .= '&securekey='.urlencode($encodedsecurekey);
//print '';
//print ' ';
@@ -685,6 +685,9 @@ if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.((int) $limit);
}
+if ($optioncss != '') {
+ $param .= '&optioncss='.urlencode($optioncss);
+}
foreach ($search as $key => $val) {
if (is_array($search[$key])) {
foreach ($search[$key] as $skey) {
@@ -707,9 +710,6 @@ if ($projectstatic->id > 0) {
$param .= '&fk_project='.urlencode($projectstatic->id);
}
$param .= $withProjectUrl;
-if ($optioncss != '') {
- $param .= '&optioncss='.urlencode($optioncss);
-}
// Add $param from extra fields
include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
diff --git a/htdocs/hrm/class/establishment.class.php b/htdocs/hrm/class/establishment.class.php
index 05bd8d47cf8..0801f510f10 100644
--- a/htdocs/hrm/class/establishment.class.php
+++ b/htdocs/hrm/class/establishment.class.php
@@ -192,8 +192,8 @@ class Establishment extends CommonObject
$sql .= ", address";
$sql .= ", zip";
$sql .= ", town";
- $sql .= ", status";
$sql .= ", fk_country";
+ $sql .= ", status";
$sql .= ", entity";
$sql .= ", datec";
$sql .= ", fk_user_author";
diff --git a/htdocs/hrm/establishment/card.php b/htdocs/hrm/establishment/card.php
index 8e00473bca2..57750c1b683 100644
--- a/htdocs/hrm/establishment/card.php
+++ b/htdocs/hrm/establishment/card.php
@@ -54,6 +54,7 @@ include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be includ
$permissiontoread = $user->admin;
$permissiontoadd = $user->admin; // Used by the include of actions_addupdatedelete.inc.php
+$permissiontodelete = $user->admin;
$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1];
// Security check - Protection if external user
diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php
index 1a9ba129f10..b0caa25ca97 100644
--- a/htdocs/hrm/establishment/info.php
+++ b/htdocs/hrm/establishment/info.php
@@ -78,7 +78,7 @@ if ($id > 0 || !empty($ref)) {
}
$permissiontoread = $user->admin;
-$permissiontoadd = $user->rights->hrm->write; // Used by the include of actions_addupdatedelete.inc.php
+$permissiontoadd = $user->hasRight('hrm', 'write'); // Used by the include of actions_addupdatedelete.inc.php
$upload_dir = $conf->hrm->multidir_output[isset($object->entity) ? $object->entity : 1];
// Security check - Protection if external user
diff --git a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql
index 9ef47ef2c65..a2d1267c81e 100644
--- a/htdocs/install/mysql/migration/17.0.0-18.0.0.sql
+++ b/htdocs/install/mysql/migration/17.0.0-18.0.0.sql
@@ -409,6 +409,7 @@ CREATE TABLE llx_c_invoice_subtype (
active tinyint DEFAULT 1 NOT NULL
) ENGINE=innodb;
+ALTER TABLE llx_c_invoice_subtype MODIFY COLUMN code varchar(4);
ALTER TABLE llx_c_invoice_subtype ADD UNIQUE INDEX uk_c_invoice_subtype (entity, code);
ALTER TABLE llx_projet ADD COLUMN fk_project integer DEFAULT NULL;
diff --git a/htdocs/langs/en_US/help.lang b/htdocs/langs/en_US/help.lang
index d699cb56fd2..17a6104d59a 100644
--- a/htdocs/langs/en_US/help.lang
+++ b/htdocs/langs/en_US/help.lang
@@ -11,7 +11,7 @@ TypeOfSupport=Type of support
TypeSupportCommunauty=Community (free)
TypeSupportCommercial=Commercial
TypeOfHelp=Type
-NeedHelpCenter=Need help or support?
+NeedHelpCenter=Need support?
Efficiency=Efficiency
TypeHelpOnly=Help only
TypeHelpDev=Help+Development
diff --git a/htdocs/modulebuilder/template/admin/setup.php b/htdocs/modulebuilder/template/admin/setup.php
index b9b5f262f8d..d7217ab0e8f 100644
--- a/htdocs/modulebuilder/template/admin/setup.php
+++ b/htdocs/modulebuilder/template/admin/setup.php
@@ -244,7 +244,7 @@ if ($action == 'updateMask') {
$tmpobjectkey = GETPOST('object');
if (!empty($tmpobjectkey)) {
$constforval = 'MYMODULE_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
- if ($conf->global->$constforval == "$value") {
+ if (getDolGlobalString($constforval) == "$value") {
dolibarr_del_const($db, $constforval, $conf->entity);
}
}
@@ -357,10 +357,10 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
$module = new $file($db);
// Show modules according to features level
- if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
+ if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
continue;
}
- if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
+ if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
continue;
}
@@ -494,10 +494,10 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
$module = new $classname($db);
$modulequalified = 1;
- if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
+ if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
$modulequalified = 0;
}
- if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
+ if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
$modulequalified = 0;
}
diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php
index b5b2f3d7d5b..db84a8d0317 100644
--- a/htdocs/modulebuilder/template/class/myobject.class.php
+++ b/htdocs/modulebuilder/template/class/myobject.class.php
@@ -85,7 +85,7 @@ class MyObject extends CommonObject
* Note: Filter must be a Dolibarr Universal Filter syntax string. Example: "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') or (t.status:!=:0) or (t.nature:is:NULL)"
* 'label' the translation key.
* 'picto' is code of a picto to show before value in forms
- * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->MY_SETUP_PARAM' or 'isModEnabled("multicurrency")' ...)
+ * 'enabled' is a condition when the field must be managed (Example: 1 or 'getDolGlobalInt('MY_SETUP_PARAM') or 'isModEnabled("multicurrency")' ...)
* 'position' is the sort order of field.
* 'notnull' is set to 1 if not null in database. Set to -1 if we must set data to null if empty ('' or 0).
* 'visible' says if field is visible in list (Examples: 0=Not visible, 1=Visible on list and create/update/view forms, 2=Visible on list only, 3=Visible on create/update/view form only (not list), 4=Visible on list and update/view form only (not create). 5=Visible on list and view only (not create/not update). Using a negative value means field is not shown by default on list but can be selected for viewing)
@@ -252,7 +252,7 @@ class MyObject extends CommonObject
$this->db = $db;
- if (empty($conf->global->MAIN_SHOW_TECHNICAL_ID) && isset($this->fields['rowid']) && !empty($this->fields['ref'])) {
+ if (getDolGlobalInt('MAIN_SHOW_TECHNICAL_ID') && isset($this->fields['rowid']) && !empty($this->fields['ref'])) {
$this->fields['rowid']['visible'] = 0;
}
if (!isModEnabled('multicompany') && isset($this->fields['entity'])) {
@@ -574,8 +574,8 @@ class MyObject extends CommonObject
return 0;
}
- /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->myobject->write))
- || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->myobject->myobject_advance->validate))))
+ /*if (! ((!getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->myobject->write))
+ || (getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->myobject->myobject_advance->validate))))
{
$this->error='NotEnoughPermissions';
dol_syslog(get_class($this)."::valid ".$this->error, LOG_ERR);
@@ -692,8 +692,8 @@ class MyObject extends CommonObject
return 0;
}
- /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write))
- || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate))))
+ /*if (! ((!getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->write))
+ || (getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->mymodule_advance->validate))))
{
$this->error='Permission denied';
return -1;
@@ -716,8 +716,8 @@ class MyObject extends CommonObject
return 0;
}
- /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write))
- || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate))))
+ /*if (! ((!getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->write))
+ || (getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->mymodule_advance->validate))))
{
$this->error='Permission denied';
return -1;
@@ -740,8 +740,8 @@ class MyObject extends CommonObject
return 0;
}
- /*if (! ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->write))
- || (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !empty($user->rights->mymodule->mymodule_advance->validate))))
+ /*if (! ((!getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->write))
+ || (getDolGlobalInt('MAIN_USE_ADVANCED_PERMS') && !empty($user->rights->mymodule->mymodule_advance->validate))))
{
$this->error='Permission denied';
return -1;
@@ -763,7 +763,7 @@ class MyObject extends CommonObject
$datas = [];
- if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
+ if (getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER')) {
return ['optimize' => $langs->trans("ShowMyObject")];
}
$datas['picto'] = img_picto('', $this->picto).' '.$langs->trans("MyObject").'';
@@ -824,7 +824,7 @@ class MyObject extends CommonObject
$linkclose = '';
if (empty($notooltip)) {
- if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) {
+ if (getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER')) {
$label = $langs->trans("ShowMyObject");
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
}
@@ -864,7 +864,7 @@ class MyObject extends CommonObject
$pospoint = strpos($filearray[0]['name'], '.');
$pathtophoto = $class.'/'.$this->ref.'/thumbs/'.substr($filename, 0, $pospoint).'_mini'.substr($filename, $pospoint);
- if (empty($conf->global->{strtoupper($module.'_'.$class).'_FORMATLISTPHOTOSASUSERS'})) {
+ if (!getDolGlobalInt(strtoupper($module.'_'.$class).'_FORMATLISTPHOTOSASUSERS')) {
$result .= ' ';
} else {
$result .= ' .') ';
@@ -1073,15 +1073,15 @@ class MyObject extends CommonObject
global $langs, $conf;
$langs->load("mymodule@mymodule");
- if (empty($conf->global->MYMODULE_MYOBJECT_ADDON)) {
+ if (empty(getDolGlobalString('MYMODULE_MYOBJECT_ADDON'))) {
$conf->global->MYMODULE_MYOBJECT_ADDON = 'mod_myobject_standard';
}
- if (!empty($conf->global->MYMODULE_MYOBJECT_ADDON)) {
+ if (!empty(getDolGlobalString('MYMODULE_MYOBJECT_ADDON'))) {
$mybool = false;
- $file = $conf->global->MYMODULE_MYOBJECT_ADDON.".php";
- $classname = $conf->global->MYMODULE_MYOBJECT_ADDON;
+ $file = getDolGlobalString('MYMODULE_MYOBJECT_ADDON').".php";
+ $classname = getDolGlobalString('MYMODULE_MYOBJECT_ADDON');
// Include file with class
$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
@@ -1143,8 +1143,8 @@ class MyObject extends CommonObject
if (!empty($this->model_pdf)) {
$modele = $this->model_pdf;
- } elseif (!empty($conf->global->MYOBJECT_ADDON_PDF)) {
- $modele = $conf->global->MYOBJECT_ADDON_PDF;
+ } elseif (getDolGlobalString('MYOBJECT_ADDON_PDF')) {
+ $modele = getDolGlobalString('MYOBJECT_ADDON_PDF');
}
}
diff --git a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
index 934908254ae..da4ab9660d8 100644
--- a/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
+++ b/htdocs/modulebuilder/template/core/modules/modMyModule.class.php
@@ -410,8 +410,8 @@ class modMyModule extends DolibarrModules
$this->import_convertvalue_array[$r] = array(
't.ref' => array(
'rule'=>'getrefifauto',
- 'class'=>(empty($conf->global->MYMODULE_MYOBJECT_ADDON) ? 'mod_myobject_standard' : $conf->global->MYMODULE_MYOBJECT_ADDON),
- 'path'=>"/core/modules/commande/".(empty($conf->global->MYMODULE_MYOBJECT_ADDON) ? 'mod_myobject_standard' : $conf->global->MYMODULE_MYOBJECT_ADDON).'.php'
+ 'class'=>(empty(getDolGlobalString('MYMODULE_MYOBJECT_ADDON')) ? 'mod_myobject_standard' : getDolGlobalString('MYMODULE_MYOBJECT_ADDON')),
+ 'path'=>"/core/modules/commande/".(empty(getDolGlobalString('MYMODULE_MYOBJECT_ADDON')) ? 'mod_myobject_standard' : getDolGlobalString('MYMODULE_MYOBJECT_ADDON')).'.php'
'classobject'=>'MyObject',
'pathobject'=>'/mymodule/class/myobject.class.php',
),
diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php
index 0da8c7b3150..de55003d86d 100644
--- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php
+++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/doc_generic_myobject_odt.modules.php
@@ -129,7 +129,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
// List of directories area
$texte .= ' ';
$texttitle = $langs->trans("ListOfDirectories");
- $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim($conf->global->MYMODULE_MYOBJECT_ADDON_PDF_ODT_PATH)));
+ $listofdir = explode(',', preg_replace('/[\r\n]+/', ',', trim(getDolGlobalString('MYMODULE_MYOBJECT_ADDON_PDF_ODT_PATH'))));
$listoffiles = array();
foreach ($listofdir as $key => $tmpdir) {
$tmpdir = trim($tmpdir);
@@ -155,7 +155,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
$texte .= $form->textwithpicto($texttitle, $texthelp, 1, 'help', '', 1);
$texte .= '';
$texte .= '';
$texte .= ' ';
$texte .= ' ';
@@ -163,7 +163,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
// Scan directories
$nbofiles = count($listoffiles);
- if (!empty($conf->global->MYMODULE_MYOBJECT_ADDON_PDF_ODT_PATH)) {
+ if (!empty(getDolGlobalString('MYMODULE_MYOBJECT_ADDON_PDF_ODT_PATH'))) {
$texte .= $langs->trans("NumberOfModelFilesFound").': ';
//$texte.=$nbofiles?'':'';
$texte .= count($listoffiles);
@@ -283,8 +283,8 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
- if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
- $format = $conf->global->MAIN_DOC_USE_TIMING;
+ if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
+ $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}
@@ -317,7 +317,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
$contactobject = null;
if (!empty($usecontact)) {
// We can use the company of contact instead of thirdparty company
- if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || !empty($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT))) {
+ if ($object->contact->socid != $object->thirdparty->id && (!isset($conf->global->MAIN_USE_COMPANY_NAME_OF_CONTACT) || getDolGlobalInt('MAIN_USE_COMPANY_NAME_OF_CONTACT'))) {
$object->contact->fetch_thirdparty();
$socobject = $object->contact->thirdparty;
$contactobject = $object->contact;
@@ -346,8 +346,8 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
// Line of free text
$newfreetext = '';
$paramfreetext = 'MYMODULE_MYOBJECT_FREE_TEXT';
- if (!empty($conf->global->$paramfreetext)) {
- $newfreetext = make_substitutions($conf->global->$paramfreetext, $substitutionarray);
+ if (getDolGlobalString($paramfreetext)) {
+ $newfreetext = make_substitutions(getDolGlobalString($paramfreetext), $substitutionarray);
}
// Open and load template
@@ -473,7 +473,7 @@ class doc_generic_myobject_odt extends ModelePDFMyObject
$reshook = $hookmanager->executeHooks('beforeODTSave', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
// Write new file
- if (!empty($conf->global->MAIN_ODT_AS_PDF)) {
+ if (getDolGlobalInt('MAIN_ODT_AS_PDF')) {
try {
$odfHandler->exportAsAttachedPDF($file);
} catch (Exception $e) {
diff --git a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php
index c8529c6550d..fec79373ec9 100644
--- a/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php
+++ b/htdocs/modulebuilder/template/core/modules/mymodule/doc/pdf_standard_myobject.modules.php
@@ -172,32 +172,32 @@ class pdf_standard_myobject extends ModelePDFMyObject
$outputlangs = $langs;
}
// For backward compatibility with FPDF, force output charset to ISO, because FPDF expect text to be encoded in ISO
- if (!empty($conf->global->MAIN_USE_FPDF)) {
+ if (getDolGlobalInt('MAIN_USE_FPDF')) {
$outputlangs->charset_output = 'ISO-8859-1';
}
// Load translation files required by the page
$outputlangs->loadLangs(array("main", "bills", "products", "dict", "companies"));
- if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && $outputlangs->defaultlang != $conf->global->PDF_USE_ALSO_LANGUAGE_CODE) {
+ if (!empty(getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')) && $outputlangs->defaultlang != getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE')) {
global $outputlangsbis;
$outputlangsbis = new Translate('', $conf);
- $outputlangsbis->setDefaultLang($conf->global->PDF_USE_ALSO_LANGUAGE_CODE);
+ $outputlangsbis->setDefaultLang(getDolGlobalString('PDF_USE_ALSO_LANGUAGE_CODE'));
$outputlangsbis->loadLangs(array("main", "bills", "products", "dict", "companies"));
}
$nblines = (is_array($object->lines) ? count($object->lines) : 0);
$hidetop = 0;
- if (!empty($conf->global->MAIN_PDF_DISABLE_COL_HEAD_TITLE)) {
- $hidetop = $conf->global->MAIN_PDF_DISABLE_COL_HEAD_TITLE;
+ if (getDolGlobalString('MAIN_PDF_DISABLE_COL_HEAD_TITLE')) {
+ $hidetop = getDolGlobalString('MAIN_PDF_DISABLE_COL_HEAD_TITLE');
}
// Loop on each lines to detect if there is at least one image to show
$realpatharray = array();
$this->atleastonephoto = false;
/*
- if (!empty($conf->global->MAIN_GENERATE_MYOBJECT_WITH_PICTURE))
+ if (getDolGlobalInt('MAIN_GENERATE_MYOBJECT_WITH_PICTURE')))
{
$objphoto = new Product($this->db);
@@ -285,7 +285,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
$heightforinfotot = 50; // Height reserved to output the info and total part and payment part
$heightforfreetext = (isset($conf->global->MAIN_PDF_FREETEXT_HEIGHT) ? $conf->global->MAIN_PDF_FREETEXT_HEIGHT : 5); // Height reserved to output the free text on last page
- $heightforfooter = $this->marge_basse + (empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 12 : 22); // Height reserved to output the footer (value include bottom margin)
+ $heightforfooter = $this->marge_basse + (getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 12 : 22); // Height reserved to output the footer (value include bottom margin)
if (class_exists('TCPDF')) {
$pdf->setPrintHeader(false);
@@ -294,8 +294,8 @@ class pdf_standard_myobject extends ModelePDFMyObject
$pdf->SetFont(pdf_getPDFFont($outputlangs));
// Set path to the background PDF File
- if (!empty($conf->global->MAIN_ADD_PDF_BACKGROUND)) {
- $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.$conf->global->MAIN_ADD_PDF_BACKGROUND);
+ if (getDolGlobalInt('MAIN_ADD_PDF_BACKGROUND')) {
+ $pagecount = $pdf->setSourceFile($conf->mycompany->multidir_output[$object->entity].'/'.getDolGlobalString('MAIN_ADD_PDF_BACKGROUND'));
$tplidx = $pdf->importPage(1);
}
@@ -316,7 +316,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
$cert = empty($user->conf->CERTIFICATE_CRT) ? '' : $user->conf->CERTIFICATE_CRT;
// If user has no certificate, we try to take the company one
if (!$cert) {
- $cert = empty($conf->global->CERTIFICATE_CRT) ? '' : $conf->global->CERTIFICATE_CRT;
+ $cert = getDolGlobalString('CERTIFICATE_CRT') ? '' : getDolGlobalString('CERTIFICATE_CRT');
}
// If a certificate is found
if ($cert) {
@@ -344,10 +344,10 @@ class pdf_standard_myobject extends ModelePDFMyObject
$pdf->SetTextColor(0, 0, 0);
$tab_top = 90 + $top_shift;
- $tab_top_newpage = (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD) ? 42 + $top_shift : 10);
+ $tab_top_newpage = (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD') ? 42 + $top_shift : 10);
$tab_height = 130 - $top_shift;
$tab_height_newpage = 150;
- if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
+ if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
$tab_height_newpage -= $top_shift;
}
@@ -391,7 +391,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
if (!empty($tplidx)) {
$pdf->useTemplate($tplidx);
}
- if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
+ if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
// $this->_pagefoot($pdf,$object,$outputlangs,1);
@@ -449,7 +449,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
if (!empty($tplidx)) {
$pdf->useTemplate($tplidx);
}
- if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
+ if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
$height_note = $posyafter - $tab_top_newpage;
@@ -471,7 +471,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
if (!empty($tplidx)) {
$pdf->useTemplate($tplidx);
}
- if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
+ if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
@@ -528,7 +528,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
$curY = $tab_top_newpage;
// Allows data in the first page if description is long enough to break in multiples pages
- if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) {
+ if (getDolGlobalInt('MAIN_PDF_DATA_ON_FIRST_PAGE')) {
$showpricebeforepagebreak = 1;
} else {
$showpricebeforepagebreak = 0;
@@ -569,7 +569,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
} else {
// We found a page break
// Allows data in the first page if description is long enough to break in multiples pages
- if (!empty($conf->global->MAIN_PDF_DATA_ON_FIRST_PAGE)) {
+ if (getDolGlobalInt('MAIN_PDF_DATA_ON_FIRST_PAGE')) {
$showpricebeforepagebreak = 1;
} else {
$showpricebeforepagebreak = 0;
@@ -689,7 +689,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
$nexY = max($nexY, $posYAfterImage);
// Add line
- if (!empty($conf->global->MAIN_PDF_DASH_BETWEEN_LINES) && $i < ($nblines - 1)) {
+ if (getDolGlobalInt('MAIN_PDF_DASH_BETWEEN_LINES') && $i < ($nblines - 1)) {
$pdf->setPage($pageposafter);
$pdf->SetLineStyle(array('dash'=>'1,1', 'color'=>array(80, 80, 80)));
//$pdf->SetDrawColor(190,190,200);
@@ -709,7 +709,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
$pagenb++;
$pdf->setPage($pagenb);
$pdf->setPageOrientation('', 1, 0); // The only function to edit the bottom margin of current page to set it.
- if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
+ if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
if (!empty($tplidx)) {
@@ -730,7 +730,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
$pdf->useTemplate($tplidx);
}
$pagenb++;
- if (empty($conf->global->MAIN_PDF_DONOTREPEAT_HEAD)) {
+ if (!getDolGlobalInt('MAIN_PDF_DONOTREPEAT_HEAD')) {
$this->_pagehead($pdf, $object, 0, $outputlangs);
}
}
@@ -753,7 +753,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
// Display payment area
/*
- if (($deja_regle || $amount_credit_notes_included || $amount_deposits_included) && empty($conf->global->INVOICE_NO_PAYMENT_DETAILS))
+ if (($deja_regle || $amount_credit_notes_included || $amount_deposits_included) && !getDolGlobalInt('INVOICE_NO_PAYMENT_DETAILS')))
{
$posy = $this->drawPaymentsTable($pdf, $object, $posy, $outputlangs);
}
@@ -842,7 +842,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
if (empty($hidetop)) {
$titre = $outputlangs->transnoentities("AmountInCurrency", $outputlangs->transnoentitiesnoconv("Currency".$currency));
- if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) {
+ if (getDolGlobalInt('PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) {
$titre .= ' - '.$outputlangsbis->transnoentities("AmountInCurrency", $outputlangsbis->transnoentitiesnoconv("Currency".$currency));
}
@@ -850,8 +850,8 @@ class pdf_standard_myobject extends ModelePDFMyObject
$pdf->MultiCell(($pdf->GetStringWidth($titre) + 3), 2, $titre);
//$conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR='230,230,230';
- if (!empty($conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR)) {
- $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, 'F', null, explode(',', $conf->global->MAIN_PDF_TITLE_BACKGROUND_COLOR));
+ if (getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')) {
+ $pdf->Rect($this->marge_gauche, $tab_top, $this->page_largeur - $this->marge_droite - $this->marge_gauche, $this->tabTitleHeight, 'F', null, explode(',', getDolGlobalString('MAIN_PDF_TITLE_BACKGROUND_COLOR')));
}
}
@@ -937,7 +937,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
$pdf->SetXY($posx, $posy);
$pdf->SetTextColor(0, 0, 60);
$title = $outputlangs->transnoentities("PdfTitle");
- if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) {
+ if (!empty(getDolGlobalInt('MAIN_ODT_AS_PDF')) && is_object($outputlangsbis)) {
$title .= ' - ';
$title .= $outputlangsbis->transnoentities("PdfTitle");
}
@@ -965,7 +965,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
$pdf->MultiCell($w, 3, $outputlangs->transnoentities("RefCustomer")." : ".$outputlangs->convToOutputCharset($object->ref_client), '', 'R');
}
- if (!empty($conf->global->PDF_SHOW_PROJECT_TITLE)) {
+ if (getDolGlobalInt('PDF_SHOW_PROJECT_TITLE')) {
$object->fetch_projet();
if (!empty($object->project->ref)) {
$posy += 3;
@@ -975,7 +975,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
}
}
- if (!empty($conf->global->PDF_SHOW_PROJECT)) {
+ if (getDolGlobalInt('PDF_SHOW_PROJECT')) {
$object->fetch_projet();
if (!empty($object->project->ref)) {
$outputlangs->load("projects");
@@ -991,7 +991,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
$pdf->SetTextColor(0, 0, 60);
$title = $outputlangs->transnoentities("Date");
- if (!empty($conf->global->PDF_USE_ALSO_LANGUAGE_CODE) && is_object($outputlangsbis)) {
+ if (getDolGlobalInt('PDF_USE_ALSO_LANGUAGE_CODE') && is_object($outputlangsbis)) {
$title .= ' - '.$outputlangsbis->transnoentities("Date");
}
$pdf->MultiCell($w, 3, $title." : ".dol_print_date($object->date, "day", false, $outputlangs), '', 'R');
@@ -1004,7 +1004,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
}
// Get contact
- if (!empty($conf->global->DOC_SHOW_FIRST_SALES_REP)) {
+ if (getDolGlobalInt('DOC_SHOW_FIRST_SALES_REP')) {
$arrayidcontact = $object->getIdContact('internal', 'SALESREPFOLL');
if (count($arrayidcontact) > 0) {
$usertmp = new User($this->db);
@@ -1031,15 +1031,15 @@ class pdf_standard_myobject extends ModelePDFMyObject
$carac_emetteur = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, '', 0, 'source', $object);
// Show sender
- $posy = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 40 : 42;
+ $posy = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42;
$posy += $top_shift;
$posx = $this->marge_gauche;
- if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
+ if (getDolGlobalInt('MAIN_INVERT_SENDER_RECIPIENT')) {
$posx = $this->page_largeur - $this->marge_droite - 80;
}
- $hautcadre = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 38 : 40;
- $widthrecbox = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 82;
+ $hautcadre = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? 38 : 40;
+ $widthrecbox = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 82;
// Show sender frame
@@ -1085,14 +1085,14 @@ class pdf_standard_myobject extends ModelePDFMyObject
$carac_client = pdf_build_address($outputlangs, $this->emetteur, $object->thirdparty, ($usecontact ? $object->contact : ''), $usecontact, 'target', $object);
// Show recipient
- $widthrecbox = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 92 : 100;
+ $widthrecbox = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? 92 : 100;
if ($this->page_largeur < 210) {
$widthrecbox = 84; // To work with US executive format
}
- $posy = !empty($conf->global->MAIN_PDF_USE_ISO_LOCATION) ? 40 : 42;
+ $posy = getDolGlobalInt('MAIN_PDF_USE_ISO_LOCATION') ? 40 : 42;
$posy += $top_shift;
$posx = $this->page_largeur - $this->marge_droite - $widthrecbox;
- if (!empty($conf->global->MAIN_INVERT_SENDER_RECIPIENT)) {
+ if (getDolGlobalInt('MAIN_INVERT_SENDER_RECIPIENT')) {
$posx = $this->marge_gauche;
}
@@ -1133,7 +1133,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
protected function _pagefoot(&$pdf, $object, $outputlangs, $hidefreetext = 0)
{
global $conf;
- $showdetails = empty($conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS) ? 0 : $conf->global->MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS;
+ $showdetails = !getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS') ? 0 : getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_SHOW_FOOT_DETAILS');
return pdf_pagefoot($pdf, $outputlangs, 'INVOICE_FREE_TEXT', $this->emetteur, $this->marge_basse, $this->marge_gauche, $this->page_hauteur, $object, $showdetails, $hidefreetext);
}
@@ -1203,7 +1203,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
$rank = $rank + 10;
$this->cols['photo'] = array(
'rank' => $rank,
- 'width' => (empty($conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH) ? 20 : $conf->global->MAIN_DOCUMENTS_WITH_PICTURE_WIDTH), // in mm
+ 'width' => (!getDolGlobalInt('MAIN_DOCUMENTS_WITH_PICTURE_WIDTH') ? 20 : getDolGlobalInt('MAIN_DOCUMENTS_WITH_PICTURE_WIDTH')), // in mm
'status' => false,
'title' => array(
'textkey' => 'Photo',
@@ -1215,7 +1215,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
'border-left' => false, // remove left line separator
);
- if (!empty($conf->global->MAIN_GENERATE_INVOICES_WITH_PICTURE) && !empty($this->atleastonephoto)) {
+ if (getDolGlobalInt('MAIN_GENERATE_INVOICES_WITH_PICTURE') && !empty($this->atleastonephoto)) {
$this->cols['photo']['status'] = true;
}
@@ -1231,7 +1231,7 @@ class pdf_standard_myobject extends ModelePDFMyObject
'border-left' => true, // add left line separator
);
- if (empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT) && empty($conf->global->MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN)) {
+ if (getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT') && !getDolGlobalInt('MAIN_GENERATE_DOCUMENTS_WITHOUT_VAT_COLUMN')) {
$this->cols['vat']['status'] = true;
}
diff --git a/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php b/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php
index d75f69a47f5..9f4bc9654fa 100644
--- a/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php
+++ b/htdocs/modulebuilder/template/lib/mymodule_myobject.lib.php
@@ -65,7 +65,7 @@ function myobjectPrepareHead($object)
$head[$h][0] = dol_buildpath('/mymodule/myobject_note.php', 1).'?id='.$object->id;
$head[$h][1] = $langs->trans('Notes');
if ($nbNote > 0) {
- $head[$h][1] .= (empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER) ? ''.$nbNote.'' : '');
+ $head[$h][1] .= (!getDolGlobalInt('MAIN_OPTIMIZEFORTEXTBROWSER') ? ''.$nbNote.'' : '');
}
$head[$h][2] = 'note';
$h++;
diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php
index 2f503de107f..d9e6c7705df 100644
--- a/htdocs/modulebuilder/template/myobject_agenda.php
+++ b/htdocs/modulebuilder/template/myobject_agenda.php
@@ -187,7 +187,7 @@ $form = new Form($db);
if ($object->id > 0) {
$title = $langs->trans("Agenda");
- //if (!empty($conf->global->MAIN_HTML_TITLE) && preg_match('/thirdpartynameonly/',$conf->global->MAIN_HTML_TITLE) && $object->name) $title=$object->name." - ".$title;
+ //if (!empty(getDolGlobalString('MAIN_HTML_TITLE')) && preg_match('/thirdpartynameonly/',getDolGlobalString('MAIN_HTML_TITLE')) && $object->name) $title=$object->name." - ".$title;
$help_url = 'EN:Module_Agenda_En|DE:Modul_Terminplanung';
llxHeader('', $title, $help_url);
diff --git a/htdocs/modulebuilder/template/myobject_list.php b/htdocs/modulebuilder/template/myobject_list.php
index a443753a8a7..39214c7cc92 100644
--- a/htdocs/modulebuilder/template/myobject_list.php
+++ b/htdocs/modulebuilder/template/myobject_list.php
@@ -411,7 +411,7 @@ $num = $db->num_rows($resql);
// Direct jump if only one record found
-if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
+if ($num == 1 && !getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
header("Location: ".dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$id);
diff --git a/htdocs/public/eventorganization/attendee_new.php b/htdocs/public/eventorganization/attendee_new.php
index 72e486a67f4..bacf922e5c5 100644
--- a/htdocs/public/eventorganization/attendee_new.php
+++ b/htdocs/public/eventorganization/attendee_new.php
@@ -125,7 +125,7 @@ if ($type == 'global') {
// Security check
$securekeyreceived = GETPOST('securekey', 'alpha');
-$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'md5');
+$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'conferenceorbooth'.((int) $id), 'md5');
// We check if the securekey collected is OK
if ($securekeytocompare != $securekeyreceived) {
diff --git a/htdocs/public/project/index.php b/htdocs/public/project/index.php
index dc16f7f3593..a7e3edb3ee4 100644
--- a/htdocs/public/project/index.php
+++ b/htdocs/public/project/index.php
@@ -62,7 +62,7 @@ $langs->loadLangs(array("other", "dict", "bills", "companies", "errors", "paybox
$action = GETPOST('action', 'aZ09');
$id = GETPOST('id', 'int');
$securekeyreceived = GETPOST("securekey", 'alpha');
-$securekeytocompare = dol_hash($conf->global->EVENTORGANIZATION_SECUREKEY.'conferenceorbooth'.$id, 'md5');
+$securekeytocompare = dol_hash(getDolGlobalString('EVENTORGANIZATION_SECUREKEY').'conferenceorbooth'.((int) $id), 'md5');
if ($securekeytocompare != $securekeyreceived) {
print $langs->trans('MissingOrBadSecureKey');
diff --git a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php
index 1837d9a6839..b46c2c2e17b 100644
--- a/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php
+++ b/htdocs/recruitment/core/modules/recruitment/doc/doc_generic_recruitmentjobposition_odt.modules.php
@@ -267,8 +267,8 @@ class doc_generic_recruitmentjobposition_odt extends ModelePDFRecruitmentJobPosi
//$file=$dir.'/'.$newfiletmp.'.'.dol_print_date(dol_now(),'%Y%m%d%H%M%S').'.odt';
// Get extension (ods or odt)
$newfileformat = substr($newfile, strrpos($newfile, '.') + 1);
- if (!empty($conf->global->MAIN_DOC_USE_TIMING)) {
- $format = $conf->global->MAIN_DOC_USE_TIMING;
+ if (getDolGlobalInt('MAIN_DOC_USE_TIMING')) {
+ $format = getDolGlobalInt('MAIN_DOC_USE_TIMING');
if ($format == '1') {
$format = '%Y%m%d%H%M%S';
}
diff --git a/htdocs/resource/class/html.formresource.class.php b/htdocs/resource/class/html.formresource.class.php
index 5f8c27dab4f..527fa93a483 100644
--- a/htdocs/resource/class/html.formresource.class.php
+++ b/htdocs/resource/class/html.formresource.class.php
@@ -212,7 +212,7 @@ class FormResource
print ' | |