From 4110669098b9507a3df30cfc6599d7cfe3c2d9b3 Mon Sep 17 00:00:00 2001 From: Randall Mora <50120822+randallmoraes@users.noreply.github.com> Date: Thu, 22 Dec 2022 10:30:58 -0600 Subject: [PATCH 01/17] Update perf.php Check validate when BROTLI_COMPRESS is enable --- htdocs/admin/system/perf.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php index 6d7ef8f1863..a3c49ff6654 100644 --- a/htdocs/admin/system/perf.php +++ b/htdocs/admin/system/perf.php @@ -198,7 +198,7 @@ jQuery(document).ready(function() { compphpstring=getphpurl.getResponseHeader(\'Content-Encoding\'); /* alert(\'php:\'+getphpurl.getAllResponseHeaders()); */ /*alert(\'php:\'+compphpstring);*/ - if (compphpstring == null || (compphpstring.indexOf("gzip") == -1 && compphpstring.indexOf("deflate") == -1)) + if (compphpstring == null || (compphpstring.indexOf("gzip") == -1 && compphpstring.indexOf("deflate") == -1 && compphpstring.indexOf("br") == -1)) { jQuery("#httpcompphpok").hide(); jQuery("#httpcompphpko").show(); @@ -238,7 +238,7 @@ jQuery(document).ready(function() { compcssstring=getcssurl.getResponseHeader(\'Content-Encoding\'); /* alert(\'php:\'+getcssurl.getAllResponseHeaders()); */ /*alert(\'php:\'+compcssstring);*/ - if (compcssstring == null || (compcssstring.indexOf("gzip") == -1 && compcssstring.indexOf("deflate") == -1)) + if (compcssstring == null || (compcssstring.indexOf("gzip") == -1 && compcssstring.indexOf("deflate") == -1 && compcssstring.indexOf("br") == -1)) { jQuery("#httpcompcssok").hide(); jQuery("#httpcompcssko").show(); @@ -278,7 +278,7 @@ jQuery(document).ready(function() { compcssphpstring=getcssphpurl.getResponseHeader(\'Content-Encoding\'); /* alert(\'php:\'+getcssphpurl.getAllResponseHeaders()); */ /*alert(\'php:\'+compcssphpstring);*/ - if (compcssphpstring == null || (compcssphpstring.indexOf("gzip") == -1 && compcssphpstring.indexOf("deflate") == -1)) + if (compcssphpstring == null || (compcssphpstring.indexOf("gzip") == -1 && compcssphpstring.indexOf("deflate") == -1 && compcssphpstring.indexOf("br") == -1)) { jQuery("#httpcompcssphpok").hide(); jQuery("#httpcompcssphpko").show(); @@ -318,7 +318,7 @@ jQuery(document).ready(function() { compimgstring=getimgurl.getResponseHeader(\'Content-Encoding\'); /* alert(\'php:\'+getimgurl.getAllResponseHeaders()); */ /*alert(\'php:\'+compimgstring);*/ - if (compimgstring == null || (compimgstring.indexOf("gzip") == -1 && compimgstring.indexOf("deflate") == -1)) + if (compimgstring == null || (compimgstring.indexOf("gzip") == -1 && compimgstring.indexOf("deflate") == -1 && compimgstring.indexOf("br") == -1)) { jQuery("#httpcompimgok").hide(); jQuery("#httpcompimgko").show(); @@ -358,7 +358,7 @@ jQuery(document).ready(function() { compjsstring=getjsurl.getResponseHeader(\'Content-Encoding\'); /* alert(\'js:\'+getjsurl.getAllResponseHeaders()); */ /*alert(\'js:\'+compjsstring);*/ - if (compjsstring == null || (compjsstring.indexOf("gzip") == -1 && compjsstring.indexOf("deflate") == -1)) + if (compjsstring == null || (compjsstring.indexOf("gzip") == -1 && compjsstring.indexOf("deflate") == -1 && compjsstring.indexOf("br") == -1)) { jQuery("#httpcompjsok").hide(); jQuery("#httpcompjsko").show(); @@ -398,7 +398,7 @@ jQuery(document).ready(function() { compjsphpstring=getjsphpurl.getResponseHeader(\'Content-Encoding\'); /* alert(\'php:\'+getjsphpurl.getAllResponseHeaders()); */ /*alert(\'php:\'+compjsphpstring);*/ - if (compjsphpstring == null || (compjsphpstring.indexOf("gzip") == -1 && compjsphpstring.indexOf("deflate") == -1)) + if (compjsphpstring == null || (compjsphpstring.indexOf("gzip") == -1 && compjsphpstring.indexOf("deflate") == -1 && compjsphpstring.indexOf("br") == -1)) { jQuery("#httpcompjsphpok").hide(); jQuery("#httpcompjsphpko").show(); From d7dd584d62826bd20cf67c0c2e15436a2b413f67 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 22 Dec 2022 21:59:24 +0100 Subject: [PATCH 02/17] clean code --- htdocs/bookcal/admin/about.php | 27 +-------- .../admin/availabilities_extrafields.php | 27 +-------- htdocs/bookcal/admin/booking_extrafields.php | 27 +-------- htdocs/bookcal/admin/setup.php | 27 +-------- htdocs/bookcal/availabilities_agenda.php | 55 +----------------- htdocs/bookcal/availabilities_card.php | 56 +------------------ htdocs/bookcal/availabilities_contact.php | 34 +---------- htdocs/bookcal/availabilities_document.php | 55 +----------------- htdocs/bookcal/availabilities_list.php | 52 +---------------- htdocs/bookcal/availabilities_note.php | 55 +----------------- htdocs/bookcal/bookcalindex.php | 30 +--------- htdocs/bookcal/booking_agenda.php | 55 +----------------- htdocs/bookcal/booking_card.php | 56 +------------------ htdocs/bookcal/booking_contact.php | 34 +---------- htdocs/bookcal/booking_document.php | 55 +----------------- htdocs/bookcal/booking_list.php | 52 +---------------- htdocs/bookcal/booking_note.php | 55 +----------------- htdocs/core/modules/modBookCal.class.php | 7 +-- 18 files changed, 39 insertions(+), 720 deletions(-) diff --git a/htdocs/bookcal/admin/about.php b/htdocs/bookcal/admin/about.php index 85f0efcdebb..2ff4e874450 100644 --- a/htdocs/bookcal/admin/about.php +++ b/htdocs/bookcal/admin/about.php @@ -23,32 +23,7 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../../main.inc.php'; // Libraries require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php'; diff --git a/htdocs/bookcal/admin/availabilities_extrafields.php b/htdocs/bookcal/admin/availabilities_extrafields.php index 9d16d7b5395..ba7dca39570 100644 --- a/htdocs/bookcal/admin/availabilities_extrafields.php +++ b/htdocs/bookcal/admin/availabilities_extrafields.php @@ -27,32 +27,7 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once '../lib/bookcal.lib.php'; diff --git a/htdocs/bookcal/admin/booking_extrafields.php b/htdocs/bookcal/admin/booking_extrafields.php index 30122d95048..2e9163af158 100644 --- a/htdocs/bookcal/admin/booking_extrafields.php +++ b/htdocs/bookcal/admin/booking_extrafields.php @@ -27,32 +27,7 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; require_once '../lib/bookcal.lib.php'; diff --git a/htdocs/bookcal/admin/setup.php b/htdocs/bookcal/admin/setup.php index c4fd74404eb..ca9d571ebfe 100644 --- a/htdocs/bookcal/admin/setup.php +++ b/htdocs/bookcal/admin/setup.php @@ -23,32 +23,7 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../../main.inc.php'; global $langs, $user; diff --git a/htdocs/bookcal/availabilities_agenda.php b/htdocs/bookcal/availabilities_agenda.php index c3e66a17257..299acca7374 100644 --- a/htdocs/bookcal/availabilities_agenda.php +++ b/htdocs/bookcal/availabilities_agenda.php @@ -22,63 +22,14 @@ * \brief Tab of events on Availabilities */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -dol_include_once('/bookcal/class/availabilities.class.php'); -dol_include_once('/bookcal/lib/bookcal_availabilities.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bookcal/class/availabilities.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; // Load translation files required by the page diff --git a/htdocs/bookcal/availabilities_card.php b/htdocs/bookcal/availabilities_card.php index b9f5277d4ae..fd3c310958b 100644 --- a/htdocs/bookcal/availabilities_card.php +++ b/htdocs/bookcal/availabilities_card.php @@ -22,64 +22,14 @@ * \brief Page to create/edit/view availabilities */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification -//if (! defined('NOSESSION')) define('NOSESSION', '1'); // Disable session - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -dol_include_once('/bookcal/class/availabilities.class.php'); -dol_include_once('/bookcal/lib/bookcal_availabilities.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bookcal/class/availabilities.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; // Load translation files required by the page $langs->loadLangs(array("bookcal@bookcal", "other")); diff --git a/htdocs/bookcal/availabilities_contact.php b/htdocs/bookcal/availabilities_contact.php index dd01e8bf046..41508aaa46a 100644 --- a/htdocs/bookcal/availabilities_contact.php +++ b/htdocs/bookcal/availabilities_contact.php @@ -23,40 +23,12 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -dol_include_once('/bookcal/class/availabilities.class.php'); -dol_include_once('/bookcal/lib/bookcal_availabilities.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bookcal/class/availabilities.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; // Load translation files required by the page $langs->loadLangs(array("bookcal@bookcal", "companies", "other", "mails")); diff --git a/htdocs/bookcal/availabilities_document.php b/htdocs/bookcal/availabilities_document.php index 5bab9356ee1..e7335bff74c 100644 --- a/htdocs/bookcal/availabilities_document.php +++ b/htdocs/bookcal/availabilities_document.php @@ -22,64 +22,15 @@ * \brief Tab for documents linked to Availabilities */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -dol_include_once('/bookcal/class/availabilities.class.php'); -dol_include_once('/bookcal/lib/bookcal_availabilities.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bookcal/class/availabilities.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; // Load translation files required by the page $langs->loadLangs(array("bookcal@bookcal", "companies", "other", "mails")); diff --git a/htdocs/bookcal/availabilities_list.php b/htdocs/bookcal/availabilities_list.php index 6c5b4c2ed64..9af4b65a022 100644 --- a/htdocs/bookcal/availabilities_list.php +++ b/htdocs/bookcal/availabilities_list.php @@ -22,58 +22,8 @@ * \brief List page for availabilities */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification -//if (! defined('NOSESSION')) define('NOSESSION', '1'); // On CLI mode, no need to use web sessions - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; diff --git a/htdocs/bookcal/availabilities_note.php b/htdocs/bookcal/availabilities_note.php index faae7a08834..44ced158e03 100644 --- a/htdocs/bookcal/availabilities_note.php +++ b/htdocs/bookcal/availabilities_note.php @@ -22,60 +22,11 @@ * \brief Tab for notes on Availabilities */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; -dol_include_once('/bookcal/class/availabilities.class.php'); -dol_include_once('/bookcal/lib/bookcal_availabilities.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bookcal/class/availabilities.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_availabilities.lib.php'; // Load translation files required by the page $langs->loadLangs(array("bookcal@bookcal", "companies")); diff --git a/htdocs/bookcal/bookcalindex.php b/htdocs/bookcal/bookcalindex.php index 1b4e360e4ce..6ec6ae6fb3e 100644 --- a/htdocs/bookcal/bookcalindex.php +++ b/htdocs/bookcal/bookcalindex.php @@ -25,35 +25,7 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; diff --git a/htdocs/bookcal/booking_agenda.php b/htdocs/bookcal/booking_agenda.php index dec1ebee921..10a75fc9f8a 100644 --- a/htdocs/bookcal/booking_agenda.php +++ b/htdocs/bookcal/booking_agenda.php @@ -22,63 +22,14 @@ * \brief Tab of events on Booking */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php'; -dol_include_once('/bookcal/class/booking.class.php'); -dol_include_once('/bookcal/lib/bookcal_booking.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bookcal/class/booking.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_booking.lib.php'; // Load translation files required by the page diff --git a/htdocs/bookcal/booking_card.php b/htdocs/bookcal/booking_card.php index 0240ab2dccc..3f041f0d79d 100644 --- a/htdocs/bookcal/booking_card.php +++ b/htdocs/bookcal/booking_card.php @@ -22,64 +22,14 @@ * \brief Page to create/edit/view booking */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification -//if (! defined('NOSESSION')) define('NOSESSION', '1'); // Disable session - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php'; -dol_include_once('/bookcal/class/booking.class.php'); -dol_include_once('/bookcal/lib/bookcal_booking.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bookcal/class/booking.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_booking.lib.php'; // Load translation files required by the page $langs->loadLangs(array("bookcal@bookcal", "other")); diff --git a/htdocs/bookcal/booking_contact.php b/htdocs/bookcal/booking_contact.php index 923976adb47..bb73368b770 100644 --- a/htdocs/bookcal/booking_contact.php +++ b/htdocs/bookcal/booking_contact.php @@ -23,40 +23,12 @@ */ // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; -dol_include_once('/bookcal/class/booking.class.php'); -dol_include_once('/bookcal/lib/bookcal_booking.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bookcal/class/booking.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_booking.lib.php'; // Load translation files required by the page $langs->loadLangs(array("bookcal@bookcal", "companies", "other", "mails")); diff --git a/htdocs/bookcal/booking_document.php b/htdocs/bookcal/booking_document.php index 81342e1a7b6..c102597e189 100644 --- a/htdocs/bookcal/booking_document.php +++ b/htdocs/bookcal/booking_document.php @@ -22,64 +22,15 @@ * \brief Tab for documents linked to Booking */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; -dol_include_once('/bookcal/class/booking.class.php'); -dol_include_once('/bookcal/lib/bookcal_booking.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bookcal/class/booking.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_booking.lib.php'; // Load translation files required by the page $langs->loadLangs(array("bookcal@bookcal", "companies", "other", "mails")); diff --git a/htdocs/bookcal/booking_list.php b/htdocs/bookcal/booking_list.php index f4aac1e5ed8..c7ebdd6f378 100644 --- a/htdocs/bookcal/booking_list.php +++ b/htdocs/bookcal/booking_list.php @@ -22,58 +22,8 @@ * \brief List page for booking */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification -//if (! defined('NOSESSION')) define('NOSESSION', '1'); // On CLI mode, no need to use web sessions - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php'; diff --git a/htdocs/bookcal/booking_note.php b/htdocs/bookcal/booking_note.php index f68ffcbd72b..c8b2de4e6ff 100644 --- a/htdocs/bookcal/booking_note.php +++ b/htdocs/bookcal/booking_note.php @@ -22,60 +22,11 @@ * \brief Tab for notes on Booking */ -//if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db -//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user -//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc -//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs -//if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters -//if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters -//if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK', '1'); // Do not check CSRF attack (test on referer + on token if option MAIN_SECURITY_CSRF_WITH_TOKEN is on). -//if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on) -//if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data -//if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu -//if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php -//if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library -//if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too. -//if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip -//if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value -//if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler -//if (! defined("NOREDIRECTBYMAINTOLOGIN")) define('NOREDIRECTBYMAINTOLOGIN', 1); // The main.inc.php does not make a redirect if not logged, instead show simple error message -//if (! defined("FORCECSP")) define('FORCECSP', 'none'); // Disable all Content Security Policies -//if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET -//if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification - // Load Dolibarr environment -$res = 0; -// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) -if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { - $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} -// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME -$tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; -while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { - $i--; $j--; -} -if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) { - $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php"; -} -if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php")) { - $res = @include dirname(substr($tmp, 0, ($i + 1)))."/main.inc.php"; -} -// Try main.inc.php using relative path -if (!$res && file_exists("../main.inc.php")) { - $res = @include "../main.inc.php"; -} -if (!$res && file_exists("../../main.inc.php")) { - $res = @include "../../main.inc.php"; -} -if (!$res && file_exists("../../../main.inc.php")) { - $res = @include "../../../main.inc.php"; -} -if (!$res) { - die("Include of main fails"); -} +require '../main.inc.php'; -dol_include_once('/bookcal/class/booking.class.php'); -dol_include_once('/bookcal/lib/bookcal_booking.lib.php'); +require_once DOL_DOCUMENT_ROOT.'/bookcal/class/booking.class.php'; +require_once DOL_DOCUMENT_ROOT.'/bookcal/lib/bookcal_booking.lib.php'; // Load translation files required by the page $langs->loadLangs(array("bookcal@bookcal", "companies")); diff --git a/htdocs/core/modules/modBookCal.class.php b/htdocs/core/modules/modBookCal.class.php index 2703099cf77..c3066dbd2e0 100644 --- a/htdocs/core/modules/modBookCal.class.php +++ b/htdocs/core/modules/modBookCal.class.php @@ -1,7 +1,7 @@ * Copyright (C) 2018-2019 Nicolas ZABOURI - * Copyright (C) 2019-2020 Frédéric France + * Copyright (C) 2019-2022 Frédéric France * * 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 @@ -51,7 +51,7 @@ class modBookCal extends DolibarrModules // Family can be 'base' (core modules),'crm','financial','hr','projects','products','ecm','technic' (transverse modules),'interface' (link with external tools),'other','...' // It is used to group modules by family in module setup page - $this->family = "other"; + $this->family = "projects"; // Module position in the family on 2 digits ('01', '10', '20', ...) $this->module_position = '50'; @@ -68,8 +68,6 @@ class modBookCal extends DolibarrModules // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated' or a version string like 'x.y.z' $this->version = 'development'; - // Url to the file with your last numberversion of this module - //$this->url_last_version = 'http://www.example.com/versionmodule.txt'; // Key used in llx_const table to save module status enabled/disabled (where BOOKCAL is value of property name of module in uppercase) $this->const_name = 'MAIN_MODULE_'.strtoupper($this->name); @@ -140,7 +138,6 @@ class modBookCal extends DolibarrModules // Prerequisites $this->phpmin = array(7, 0); // Minimum version of PHP required by module - $this->need_dolibarr_version = array(17, -3); // Minimum version of Dolibarr required by module // Messages at activation $this->warnings_activation = array(); // Warning to show when we activate module. array('always'='text') or array('FR'='textfr','MX'='textmx'...) From 637fc95265a5dd034b68f15f33bb9df4f7d0283a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 22 Dec 2022 22:29:24 +0100 Subject: [PATCH 03/17] clean code --- htdocs/adherents/agenda.php | 2 +- htdocs/asset/agenda.php | 2 +- htdocs/asset/model/agenda.php | 2 +- htdocs/bom/bom_agenda.php | 2 +- htdocs/bookcal/availabilities_agenda.php | 2 +- htdocs/bookcal/booking_agenda.php | 2 +- htdocs/contact/agenda.php | 2 +- htdocs/contrat/agenda.php | 2 +- htdocs/hrm/establishment/info.php | 2 +- htdocs/hrm/evaluation_agenda.php | 2 +- htdocs/hrm/job_agenda.php | 2 +- htdocs/hrm/position_agenda.php | 2 +- htdocs/hrm/skill_agenda.php | 2 +- htdocs/knowledgemanagement/knowledgerecord_agenda.php | 2 +- htdocs/modulebuilder/template/myobject_agenda.php | 2 +- htdocs/mrp/mo_agenda.php | 2 +- htdocs/partnership/partnership_agenda.php | 2 +- htdocs/product/agenda.php | 2 +- htdocs/product/stock/stocktransfer/stocktransfer_agenda.php | 2 +- htdocs/projet/agenda.php | 2 +- htdocs/projet/messaging.php | 2 +- htdocs/recruitment/recruitmentcandidature_agenda.php | 2 +- htdocs/recruitment/recruitmentjobposition_agenda.php | 2 +- htdocs/resource/agenda.php | 2 +- htdocs/societe/agenda.php | 2 +- htdocs/societe/messaging.php | 2 +- htdocs/ticket/agenda.php | 2 +- htdocs/ticket/card.php | 2 +- htdocs/ticket/messaging.php | 2 +- htdocs/webhook/target_agenda.php | 2 +- 30 files changed, 30 insertions(+), 30 deletions(-) diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php index e13211fb239..918eaa5d27e 100644 --- a/htdocs/adherents/agenda.php +++ b/htdocs/adherents/agenda.php @@ -64,7 +64,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/asset/agenda.php b/htdocs/asset/agenda.php index b40ed122ec6..f18b29089d5 100644 --- a/htdocs/asset/agenda.php +++ b/htdocs/asset/agenda.php @@ -46,7 +46,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/asset/model/agenda.php b/htdocs/asset/model/agenda.php index 17fb19fe565..42706752427 100644 --- a/htdocs/asset/model/agenda.php +++ b/htdocs/asset/model/agenda.php @@ -46,7 +46,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index f133d1bbd4b..82f32e61783 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -49,7 +49,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/bookcal/availabilities_agenda.php b/htdocs/bookcal/availabilities_agenda.php index c3e66a17257..f6d7d6551dd 100644 --- a/htdocs/bookcal/availabilities_agenda.php +++ b/htdocs/bookcal/availabilities_agenda.php @@ -48,7 +48,7 @@ $res = 0; // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} +}getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT') // Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME $tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { diff --git a/htdocs/bookcal/booking_agenda.php b/htdocs/bookcal/booking_agenda.php index dec1ebee921..5706849ecc9 100644 --- a/htdocs/bookcal/booking_agenda.php +++ b/htdocs/bookcal/booking_agenda.php @@ -48,7 +48,7 @@ $res = 0; // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -} +}getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT') // Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME $tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index 29706f48b49..1445a9aa8fe 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -81,7 +81,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index 3a3c5440b30..b05f68d7680 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -41,7 +41,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/hrm/establishment/info.php b/htdocs/hrm/establishment/info.php index 641c53e0f70..3bfbe912279 100644 --- a/htdocs/hrm/establishment/info.php +++ b/htdocs/hrm/establishment/info.php @@ -42,7 +42,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php index cc314bd9bce..97f4c5453dc 100644 --- a/htdocs/hrm/evaluation_agenda.php +++ b/htdocs/hrm/evaluation_agenda.php @@ -53,7 +53,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php index 1da6b4948b1..6aee4d6ed21 100644 --- a/htdocs/hrm/job_agenda.php +++ b/htdocs/hrm/job_agenda.php @@ -52,7 +52,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php index 846202e26a0..5e52e6a9f81 100644 --- a/htdocs/hrm/position_agenda.php +++ b/htdocs/hrm/position_agenda.php @@ -53,7 +53,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/hrm/skill_agenda.php b/htdocs/hrm/skill_agenda.php index a24f3a4caa2..52b56b1507a 100644 --- a/htdocs/hrm/skill_agenda.php +++ b/htdocs/hrm/skill_agenda.php @@ -52,7 +52,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/knowledgemanagement/knowledgerecord_agenda.php b/htdocs/knowledgemanagement/knowledgerecord_agenda.php index b293a2dbdd7..48f080b633e 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_agenda.php +++ b/htdocs/knowledgemanagement/knowledgerecord_agenda.php @@ -49,7 +49,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index d7b84707b95..b7e88450f82 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -95,7 +95,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index ac944acc066..4203c0f2a19 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -50,7 +50,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php index dd886fc70d7..6f25e5fd921 100644 --- a/htdocs/partnership/partnership_agenda.php +++ b/htdocs/partnership/partnership_agenda.php @@ -49,7 +49,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php index c0ecdb2ad0f..3588fd38acc 100644 --- a/htdocs/product/agenda.php +++ b/htdocs/product/agenda.php @@ -43,7 +43,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php index b62dfa5b00d..0497520a099 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php @@ -45,7 +45,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = GETPOST('actioncode', 'array', 3); if (!count($actioncode)) $actioncode = '0'; } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/projet/agenda.php b/htdocs/projet/agenda.php index a3c120d0a23..a7cb672c0ab 100644 --- a/htdocs/projet/agenda.php +++ b/htdocs/projet/agenda.php @@ -59,7 +59,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/projet/messaging.php b/htdocs/projet/messaging.php index 7fe5b4a0b9d..d965d5e30a0 100644 --- a/htdocs/projet/messaging.php +++ b/htdocs/projet/messaging.php @@ -59,7 +59,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/recruitment/recruitmentcandidature_agenda.php b/htdocs/recruitment/recruitmentcandidature_agenda.php index 04118f55572..c99bd98afe0 100644 --- a/htdocs/recruitment/recruitmentcandidature_agenda.php +++ b/htdocs/recruitment/recruitmentcandidature_agenda.php @@ -48,7 +48,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/recruitment/recruitmentjobposition_agenda.php b/htdocs/recruitment/recruitmentjobposition_agenda.php index f2f4d37484b..abfad7bd7e6 100644 --- a/htdocs/recruitment/recruitmentjobposition_agenda.php +++ b/htdocs/recruitment/recruitmentjobposition_agenda.php @@ -47,7 +47,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/resource/agenda.php b/htdocs/resource/agenda.php index 8fddadcce11..a9378cefe1d 100644 --- a/htdocs/resource/agenda.php +++ b/htdocs/resource/agenda.php @@ -51,7 +51,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index 9e6c10a0ccd..fde1ab154a3 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -43,7 +43,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/societe/messaging.php b/htdocs/societe/messaging.php index c73d6ffe0b1..3f9011cce3f 100644 --- a/htdocs/societe/messaging.php +++ b/htdocs/societe/messaging.php @@ -43,7 +43,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php index 9111faedcb7..fb92fd44f33 100644 --- a/htdocs/ticket/agenda.php +++ b/htdocs/ticket/agenda.php @@ -68,7 +68,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php index f00d4223878..47f793f71ae 100755 --- a/htdocs/ticket/card.php +++ b/htdocs/ticket/card.php @@ -71,7 +71,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php index bd06bd32e94..ee919d99314 100644 --- a/htdocs/ticket/messaging.php +++ b/htdocs/ticket/messaging.php @@ -68,7 +68,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ?GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); diff --git a/htdocs/webhook/target_agenda.php b/htdocs/webhook/target_agenda.php index 17b9842c238..74c895a813a 100644 --- a/htdocs/webhook/target_agenda.php +++ b/htdocs/webhook/target_agenda.php @@ -46,7 +46,7 @@ if (GETPOST('actioncode', 'array')) { $actioncode = '0'; } } else { - $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : (empty($conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT) ? '' : $conf->global->AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT)); + $actioncode = GETPOST("actioncode", "alpha", 3) ? GETPOST("actioncode", "alpha", 3) : (GETPOST("actioncode") == '0' ? '0' : getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT')); } $search_agenda_label = GETPOST('search_agenda_label'); From 328b62eeb4dc4e35aa50209a2a3b4a6c0139c792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20France?= Date: Thu, 22 Dec 2022 22:31:03 +0100 Subject: [PATCH 04/17] clean code --- htdocs/bookcal/availabilities_agenda.php | 2 +- htdocs/bookcal/booking_agenda.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/bookcal/availabilities_agenda.php b/htdocs/bookcal/availabilities_agenda.php index f6d7d6551dd..c3e66a17257 100644 --- a/htdocs/bookcal/availabilities_agenda.php +++ b/htdocs/bookcal/availabilities_agenda.php @@ -48,7 +48,7 @@ $res = 0; // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -}getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT') +} // Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME $tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { diff --git a/htdocs/bookcal/booking_agenda.php b/htdocs/bookcal/booking_agenda.php index 5706849ecc9..dec1ebee921 100644 --- a/htdocs/bookcal/booking_agenda.php +++ b/htdocs/bookcal/booking_agenda.php @@ -48,7 +48,7 @@ $res = 0; // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined) if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) { $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php"; -}getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE_FOR_OBJECT') +} // Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME $tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1; while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { From ddc7e769618da9189f590472531fa87e26b2c66f Mon Sep 17 00:00:00 2001 From: Randall Mora <50120822+randallmoraes@users.noreply.github.com> Date: Thu, 22 Dec 2022 17:45:13 -0600 Subject: [PATCH 05/17] Update assets.lang additional translations --- htdocs/langs/es_ES/assets.lang | 183 +++++++++++++++++++++++++++------ 1 file changed, 151 insertions(+), 32 deletions(-) diff --git a/htdocs/langs/es_ES/assets.lang b/htdocs/langs/es_ES/assets.lang index 99b1a479095..a3eb7fd150d 100644 --- a/htdocs/langs/es_ES/assets.lang +++ b/htdocs/langs/es_ES/assets.lang @@ -1,4 +1,4 @@ -# Copyright (C) 2018 Alexandre Spangaro +# Copyright (C) 2018-2022 Alexandre Spangaro # # 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 @@ -16,52 +16,171 @@ # # Generic # -Assets = Activos -NewAsset = Nuevo activo -AccountancyCodeAsset = Código contable (activo) -AccountancyCodeDepreciationAsset = Código contable (cuenta depreciación activo) -AccountancyCodeDepreciationExpense = Código contable (cuenta depreciación gastos) -NewAssetType=Nuevo tipo de activo -AssetsTypeSetup=Configuración tipos de activos -AssetTypeModified=Tipo de activo modificado -AssetType=Tipo de activo +NewAsset=Nuevo activo +AccountancyCodeAsset=Código contable (activo) +AccountancyCodeDepreciationAsset=Código de contabilidad (cuenta de activo de depreciación) +AccountancyCodeDepreciationExpense=Código contable (cuenta de gastos de depreciación) AssetsLines=Activos DeleteType=Eliminar -DeleteAnAssetType=Eliminar un tipo de activo -ConfirmDeleteAssetType=¿Está seguro de querer eliminar este tipo de activo? -ShowTypeCard=Ver tipo '%s' +DeleteAnAssetType=Eliminar un modelo de activo +ConfirmDeleteAssetType=¿Está seguro de que desea eliminar este modelo de activos? +ShowTypeCard=Mostrar modelo '%s' # Module label 'ModuleAssetsName' -ModuleAssetsName = Activos +ModuleAssetsName=Activos # Module description 'ModuleAssetsDesc' -ModuleAssetsDesc = Descripción bien +ModuleAssetsDesc=Descripción de los activos # # Admin page # -AssetsSetup = Configuración activos -Settings = Configuraciones -AssetsSetupPage = Configuración activos -ExtraFieldsAssetsType = Campos adicionales (tipos de activos) -AssetsType=Tipo de activo -AssetsTypeId=Id tipo de activo -AssetsTypeLabel=Etiqueta tipo de activo -AssetsTypes=Tipos de activos +AssetSetup=Configuración de activos +AssetSetupPage=Página de configuración de activos +ExtraFieldsAssetModel=Atributos complementarios (Modelo de activos) + +AssetsType=Modelo de activos +AssetsTypeId=Id. de modelo de activo +AssetsTypeLabel=Etiqueta del modelo de activos +AssetsTypes=Modelos de activos +ASSET_ACCOUNTANCY_CATEGORY=Grupo de contabilidad de activos fijos # # Menu # -MenuAssets = Activos -MenuNewAsset = Nuevo bien -MenuTypeAssets = Tipo de activos -MenuListAssets = Listado -MenuNewTypeAssets = Nuevo -MenuListTypeAssets = Listado +MenuAssets=Activos +MenuNewAsset=Nuevo activo +MenuAssetModels=Activos del modelo +MenuListAssets=Lista +MenuNewAssetModel=Modelo del nuevo activo +MenuListAssetModels=Lista # # Module # +ConfirmDeleteAsset=¿Realmente desea eliminar este recurso? + +# +# Tab +# +AssetDepreciationOptions=Opciones de depreciación +AssetAccountancyCodes=Cuentas contables +AssetDepreciation=Depreciación + +# +# Asset +# Asset=Activo -NewAssetType=Nuevo tipo de activo -NewAsset=Nuevo activo -ConfirmDeleteAsset=¿Está seguro de que desea eliminar este activo? +Assets=Activos +AssetReversalAmountHT=Cantidad de inversión (sin impuestos) +AssetAcquisitionValueHT=Importe de la adquisición (sin impuestos) +AssetRecoveredVAT=IVA recuperado +AssetReversalDate=Fecha de reversión +AssetDateAcquisition=Fecha de adquisición +AssetDateStart=Fecha de puesta en marcha +AssetAcquisitionType=Tipo de adquisición +AssetAcquisitionTypeNew=Nuevo +AssetAcquisitionTypeOccasion=Usado +AssetType=Tipo de activo +AssetTypeIntangible=Intangible +AssetTypeTangible=Tangible +AssetTypeInProgress=En progreso +AssetTypeFinancial=Financiero +AssetNotDepreciated=No depreciado +AssetDisposal=Disposición +AssetConfirmDisposalAsk=¿Está seguro de que desea deshacerse del activo %s? +AssetConfirmReOpenAsk=¿Está seguro de que desea reabrir el recurso %s? + +# +# Asset status +# +AssetInProgress=En progreso +AssetDisposed=Disposed +AssetRecorded=Contabilizado + +# +# Asset disposal +# +AssetDisposalDate=Fecha de eliminación +AssetDisposalAmount=Valor de enajenación +AssetDisposalType=Tipo de eliminación +AssetDisposalDepreciated=Depreciar el año de la transferencia +AssetDisposalSubjectToVat=Enajenación sujeta a IVA + +# +# Asset model +# +AssetModel=Modelo del activo +AssetModels=Modelos de activos + +# +# Asset depreciation options +# +AssetDepreciationOptionEconomic=Depreciación económica +AssetDepreciationOptionAcceleratedDepreciation=Depreciación acelerada (impuestos) +AssetDepreciationOptionDepreciationType=Tipo de depreciación +AssetDepreciationOptionDepreciationTypeLinear=Lineal +AssetDepreciationOptionDepreciationTypeDegressive=Degresivo +AssetDepreciationOptionDepreciationTypeExceptional=Excepcional +AssetDepreciationOptionDegressiveRate=Tasa decreciente +AssetDepreciationOptionAcceleratedDepreciation=Acelerado (impuesto) +AssetDepreciationOptionDuration=Duración +AssetDepreciationOptionDurationType=Tipo de duración +AssetDepreciationOptionDurationTypeAnnual=Anual +AssetDepreciationOptionDurationTypeMonthly=Mensual +AssetDepreciationOptionDurationTypeDaily=Diario +AssetDepreciationOptionRate=Tasa (%%) +AssetDepreciationOptionAmountBaseDepreciationHT=Base de amortización (sin IVA) +AssetDepreciationOptionAmountBaseDeductibleHT=Base deducible (sin IVA) +AssetDepreciationOptionTotalAmountLastDepreciationHT=Cantidad total de la última depreciación (sin IVA) + +# +# Asset accountancy codes +# +AssetAccountancyCodeDepreciationEconomic=Depreciación económica +AssetAccountancyCodeAsset=Activo +AssetAccountancyCodeDepreciationAsset=Depreciación +AssetAccountancyCodeDepreciationExpense=Gastos de depreciación +AssetAccountancyCodeValueAssetSold=Valor del activo enajenado +AssetAccountancyCodeReceivableOnAssignment=Cuenta por cobrar por enajenación +AssetAccountancyCodeProceedsFromSales=Productos de la eliminación +AssetAccountancyCodeVatCollected=IVA cobrado +AssetAccountancyCodeVatDeductible=IVA recuperado en activos +AssetAccountancyCodeDepreciationAcceleratedDepreciation=Depreciación acelerada (impuestos) +AssetAccountancyCodeAcceleratedDepreciation=Cuenta +AssetAccountancyCodeEndowmentAcceleratedDepreciation=Gastos de depreciación +AssetAccountancyCodeProvisionAcceleratedDepreciation=Reposesión/Provisión + +# +# Asset depreciation +# +AssetBaseDepreciationHT=Deprbase de liquidación (excl. IVA) +AssetDepreciationBeginDate=Inicio de depreciación el +AssetDepreciationDuration=Duración +AssetDepreciationRate=Tasa (%%) +AssetDepreciationDate=Fecha de depreciación +AssetDepreciationHT=Depreciación (sin IVA) +AssetCumulativeDepreciationHT=Depreciación acumulada (sin IVA) +AssetResidualHT=Valor residual (sin IVA) +AssetDispatchedInBookkeeping=Depreciación registrada +AssetFutureDepreciationLine=Depreciación futura +AssetDepreciationReversal=Reversión + +# +# Errors +# +AssetErrorAssetOrAssetModelIDNotProvide=No se proporcionó la identificación del recurso o el sonido del modelo +AssetErrorFetchAccountancyCodesForMode=Error al recuperar las cuentas contables para el modo de depreciación '%s' +AssetErrorDeleteAccountancyCodesForMode=Error al eliminar cuentas contables del modo de depreciación '%s' +AssetErrorInsertAccountancyCodesForMode=Error al insertar las cuentas contables del modo de depreciación '%s' +AssetErrorFetchDepreciationOptionsForMode=Error al recuperar opciones para el modo de depreciación '%s' +AssetErrorDeleteDepreciationOptionsForMode=Error al eliminar las opciones del modo de depreciación '%s' +AssetErrorInsertDepreciationOptionsForMode=Error al insertar las opciones del modo de depreciación '%s' +AssetErrorFetchDepreciationLines=Error al recuperar líneas de depreciación registradas +AssetErrorClearDepreciationLines=Error al purgar líneas de depreciación registradas (reversión y futuro) +AssetErrorAddDepreciationLine=Error al agregar una línea de depreciación +AssetErrorCalculationDepreciationLines=Error al calcular las líneas de depreciación (recuperación y futuro) +AssetErrorReversalDateNotProvidedForMode=No se proporciona la fecha de reversión para el método de depreciación '%s' +AssetErrorReversalDateNotGreaterThanCurrentBeginFiscalDateForMode=La fecha de reversión debe ser mayor o igual que el comienzo del año fiscal actual para el método de depreciación '%s' +AssetErrorReversalAmountNotProvidedForMode=No se proporciona el importe de reversión para el modo de depreciación '%s'. +AssetErrorFetchCumulativeDepreciation=Error al recuperar la cantidad de depreciación acumulada de la línea de depreciación +AssetErrorSetLastCumulativeDepreciation=Error al registrar el último monto de depreciación acumulada From 0d56ef8c1d330569d7814419374552352dab2329 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 23 Dec 2022 14:02:23 +0100 Subject: [PATCH 06/17] fix code --- htdocs/admin/stock.php | 2 +- htdocs/bookcal/class/availabilities.class.php | 2 +- htdocs/bookcal/class/booking.class.php | 2 +- htdocs/compta/facture/card.php | 2 +- htdocs/core/lib/propal.lib.php | 2 +- htdocs/delivery/card.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php index 1d73f5238ad..7a7e49a3129 100644 --- a/htdocs/admin/stock.php +++ b/htdocs/admin/stock.php @@ -247,7 +247,7 @@ if (isModEnabled('commande')) { print "\n\n"; $found++; -//if (!empty($conf->expedition->enabled)) +//if (isModEnabled('expedition')) //{ print ''; diff --git a/htdocs/bookcal/class/availabilities.class.php b/htdocs/bookcal/class/availabilities.class.php index cfbfc8eed88..3ccc4542670 100644 --- a/htdocs/bookcal/class/availabilities.class.php +++ b/htdocs/bookcal/class/availabilities.class.php @@ -74,7 +74,7 @@ class Availabilities extends CommonObject * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') 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 '!empty($conf->multicurrency->enabled)' ...) + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->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) diff --git a/htdocs/bookcal/class/booking.class.php b/htdocs/bookcal/class/booking.class.php index a74cb87a43d..98cb5077844 100644 --- a/htdocs/bookcal/class/booking.class.php +++ b/htdocs/bookcal/class/booking.class.php @@ -74,7 +74,7 @@ class Booking extends CommonObject * Note: Filter can be a string like "(t.ref:like:'SO-%') or (t.date_creation:<:'20160101') 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 '!empty($conf->multicurrency->enabled)' ...) + * 'enabled' is a condition when the field must be managed (Example: 1 or '$conf->global->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) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 36c98a495ec..9d221411d9c 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -3066,7 +3066,7 @@ if ($action == 'create') { $remise_percent = (!empty($expesrc->remise_percent) ? $expesrc->remise_percent : (!empty($soc->remise_percent) ? $soc->remise_percent : 0)); $remise_absolue = (!empty($expesrc->remise_absolue) ? $expesrc->remise_absolue : (!empty($soc->remise_absolue) ? $soc->remise_absolue : 0)); - if (!empty($conf->multicurrency->enabled)) { + if (isModEnabled('multicurrency')) { $currency_code = (!empty($expesrc->currency_code) ? $expesrc->currency_code : (!empty($soc->currency_code) ? $soc->currency_code : $objectsrc->multicurrency_code)); $currency_tx = (!empty($expesrc->currency_tx) ? $expesrc->currency_tx : (!empty($soc->currency_tx) ? $soc->currency_tx : $objectsrc->currency_tx)); } diff --git a/htdocs/core/lib/propal.lib.php b/htdocs/core/lib/propal.lib.php index 9d1401ea47a..3d380a3904a 100644 --- a/htdocs/core/lib/propal.lib.php +++ b/htdocs/core/lib/propal.lib.php @@ -42,7 +42,7 @@ function propal_prepare_head($object) $head[$h][2] = 'comm'; $h++; - if ((empty($conf->commande->enabled) && ((isModEnabled("expedition") && !empty($conf->expedition_bon->enabled) && $user->rights->expedition->lire) + if ((empty($conf->commande->enabled) && ((isModEnabled("expedition") && isModEnabled('expedition_bon') && $user->rights->expedition->lire) || (isModEnabled("expedition") && !empty($conf->delivery_note->enabled) && $user->rights->expedition->delivery->lire)))) { $langs->load("sendings"); $text = ''; diff --git a/htdocs/delivery/card.php b/htdocs/delivery/card.php index b98b75015ab..3a269cc89bb 100644 --- a/htdocs/delivery/card.php +++ b/htdocs/delivery/card.php @@ -38,7 +38,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php'; if (isModEnabled("product") || isModEnabled("service")) { require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; } -if (!empty($conf->expedition_bon->enabled)) { +if (isModEnabled('expedition_bon')) { require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php'; } if (isModEnabled('stock')) { From 669c8d10f43a7f5fb0482b109a7b2d0788a3a6d7 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Fri, 23 Dec 2022 14:10:39 +0100 Subject: [PATCH 07/17] fix path and traduction --- .../core/modules/supplier_proposal/doc/pdf_aurore.modules.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php index 9918616714d..693cf8eac67 100644 --- a/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php +++ b/htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php @@ -22,9 +22,9 @@ */ /** - * \file htdocs/core/modules/propale/doc/pdf_azur.modules.php + * \file htdocs/core/modules/supplier_proposal/doc/pdf_aurore.modules.php * \ingroup propale - * \brief File of the class allowing to generate the supplier propals to the Aurore model + * \brief File of the class allowing to generate the supplier proposals to the Aurore model */ require_once DOL_DOCUMENT_ROOT.'/core/modules/supplier_proposal/modules_supplier_proposal.php'; require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; From a08d84b995fa0291f1f220bd14d213b7ea8cd550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 23 Dec 2022 14:11:13 +0100 Subject: [PATCH 08/17] fix code --- htdocs/asset/agenda.php | 2 +- htdocs/asset/model/agenda.php | 2 +- htdocs/bom/bom_agenda.php | 2 +- htdocs/bookcal/availabilities_agenda.php | 2 +- htdocs/bookcal/booking_agenda.php | 2 +- htdocs/comm/action/card.php | 10 +++++----- htdocs/comm/action/class/api_agendaevents.class.php | 4 ++-- htdocs/comm/action/document.php | 4 ++-- htdocs/comm/action/index.php | 8 ++++---- htdocs/comm/action/info.php | 2 +- htdocs/comm/action/list.php | 2 +- htdocs/comm/action/pertype.php | 2 +- htdocs/comm/action/peruser.php | 2 +- htdocs/contact/agenda.php | 2 +- htdocs/contrat/agenda.php | 2 +- htdocs/core/lib/functions.lib.php | 2 +- htdocs/core/modules/modAgenda.class.php | 2 +- htdocs/fourn/commande/info.php | 2 +- htdocs/hrm/evaluation_agenda.php | 2 +- htdocs/hrm/job_agenda.php | 2 +- htdocs/hrm/position_agenda.php | 2 +- htdocs/hrm/skill_agenda.php | 2 +- htdocs/knowledgemanagement/knowledgerecord_agenda.php | 2 +- htdocs/modulebuilder/template/myobject_agenda.php | 2 +- htdocs/mrp/mo_agenda.php | 2 +- htdocs/partnership/partnership_agenda.php | 2 +- htdocs/product/agenda.php | 2 +- htdocs/product/list.php | 2 +- .../stock/stocktransfer/stocktransfer_agenda.php | 2 +- htdocs/projet/agenda.php | 2 +- htdocs/projet/messaging.php | 2 +- htdocs/recruitment/recruitmentcandidature_agenda.php | 2 +- htdocs/recruitment/recruitmentjobposition_agenda.php | 2 +- htdocs/societe/agenda.php | 2 +- htdocs/societe/messaging.php | 2 +- htdocs/webhook/target_agenda.php | 2 +- htdocs/workstation/workstation_agenda.php | 2 +- 37 files changed, 46 insertions(+), 46 deletions(-) diff --git a/htdocs/asset/agenda.php b/htdocs/asset/agenda.php index f18b29089d5..f955594a5b0 100644 --- a/htdocs/asset/agenda.php +++ b/htdocs/asset/agenda.php @@ -181,7 +181,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print '' . $langs->trans("AddAction") . ''; } else { print '' . $langs->trans("AddAction") . ''; diff --git a/htdocs/asset/model/agenda.php b/htdocs/asset/model/agenda.php index 42706752427..dfc69dc3fa5 100644 --- a/htdocs/asset/model/agenda.php +++ b/htdocs/asset/model/agenda.php @@ -183,7 +183,7 @@ if ($object->id > 0) { print '
'; // if (isModEnabled('agenda')) { - // if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + // if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { // print '' . $langs->trans("AddAction") . ''; // } else { // print '' . $langs->trans("AddAction") . ''; diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php index 82f32e61783..3e06526f60f 100644 --- a/htdocs/bom/bom_agenda.php +++ b/htdocs/bom/bom_agenda.php @@ -225,7 +225,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/bookcal/availabilities_agenda.php b/htdocs/bookcal/availabilities_agenda.php index c3e66a17257..4bea892ae7e 100644 --- a/htdocs/bookcal/availabilities_agenda.php +++ b/htdocs/bookcal/availabilities_agenda.php @@ -280,7 +280,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/bookcal/booking_agenda.php b/htdocs/bookcal/booking_agenda.php index dec1ebee921..7b65b510103 100644 --- a/htdocs/bookcal/booking_agenda.php +++ b/htdocs/bookcal/booking_agenda.php @@ -280,7 +280,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 11b8330b64c..f0399fa6350 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -159,7 +159,7 @@ if ($user->socid && $socid) { $result = restrictedArea($user, 'societe', $socid); } -$usercancreate = $user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create); +$usercancreate = $user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create); /* @@ -218,7 +218,7 @@ if (empty($reshook) && (GETPOST('addassignedtouser') || GETPOST('updateassignedt } // Link to a project -if (empty($reshook) && $action == 'classin' && ($user->rights->agenda->allactions->create || +if (empty($reshook) && $action == 'classin' && ($user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create))) { //$object->fetch($id); $object->setProject(GETPOST('projectid', 'int')); @@ -1093,7 +1093,7 @@ if (empty($reshook) && GETPOST('actionmove', 'alpha') == 'mupdate') { // Actions to delete doc $upload_dir = $conf->agenda->dir_output.'/'.dol_sanitizeFileName($object->ref); -$permissiontoadd = ($user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->read)); +$permissiontoadd = ($user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->read)); if (empty($reshook)) { include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php'; } @@ -2466,14 +2466,14 @@ if ($id > 0) { $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { if ($action != 'edit') { - if ($user->rights->agenda->allactions->create || + if ($user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create)) { print ''; } else { print ''; } - if ($user->rights->agenda->allactions->create || + if ($user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create)) { print ''; } else { diff --git a/htdocs/comm/action/class/api_agendaevents.class.php b/htdocs/comm/action/class/api_agendaevents.class.php index 8c13709b250..c0accf82866 100644 --- a/htdocs/comm/action/class/api_agendaevents.class.php +++ b/htdocs/comm/action/class/api_agendaevents.class.php @@ -210,7 +210,7 @@ class AgendaEvents extends DolibarrApi if (!DolibarrApiAccess::$user->rights->agenda->myactions->create) { throw new RestException(401, "Insufficient rights to create your Agenda Event"); } - if (!DolibarrApiAccess::$user->rights->agenda->allactions->create && DolibarrApiAccess::$user->id != $request_data['userownerid']) { + if (!DolibarrApiAccess::$user->hasRight('agenda', 'allactions', 'create') && DolibarrApiAccess::$user->id != $request_data['userownerid']) { throw new RestException(401, "Insufficient rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id); } @@ -249,7 +249,7 @@ class AgendaEvents extends DolibarrApi if (!DolibarrApiAccess::$user->rights->agenda->myactions->create) { throw new RestException(401, "Insufficient rights to create your Agenda Event"); } - if (!DolibarrApiAccess::$user->rights->agenda->allactions->create && DolibarrApiAccess::$user->id != $request_data['userownerid']) { + if (!DolibarrApiAccess::$user->hasRight('agenda', 'allactions', 'create') && DolibarrApiAccess::$user->id != $request_data['userownerid']) { throw new RestException(401, "Insufficient rights to create an Agenda Event for owner id ".$request_data['userownerid'].' Your id is '.DolibarrApiAccess::$user->id); } diff --git a/htdocs/comm/action/document.php b/htdocs/comm/action/document.php index 82cc7584c07..c37920f0d99 100644 --- a/htdocs/comm/action/document.php +++ b/htdocs/comm/action/document.php @@ -92,7 +92,7 @@ if ($user->socid && $socid) { $result = restrictedArea($user, 'societe', $socid); } -$usercancreate = $user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create); +$usercancreate = $user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create); $permissiontoadd = $usercancreate; @@ -305,7 +305,7 @@ if ($object->id > 0) { $modulepart = 'actions'; - $permissiontoadd = $user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create; + $permissiontoadd = $user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create'); $param = '&id='.$object->id; include DOL_DOCUMENT_ROOT.'/core/tpl/document_actions_post_headers.tpl.php'; } else { diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index ab814957e5b..5b51d48392b 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -540,7 +540,7 @@ $viewmode .= ''; // To add a space before t $newcardbutton = ''; $newparam = ''; -if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { +if ($user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create')) { $tmpforcreatebutton = dol_getdate(dol_now(), true); $newparam .= '&month='.((int) $month).'&year='.((int) $tmpforcreatebutton['year']).'&mode='.urlencode($mode); @@ -1703,7 +1703,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $curtime = dol_mktime(0, 0, 0, $month, $day, $year); $urltoshow = DOL_URL_ROOT.'/comm/action/index.php?mode=show_day&day='.str_pad($day, 2, "0", STR_PAD_LEFT).'&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year.$newparam; $urltocreate = ''; - if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { + if ($user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create')) { $newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$year; $hourminsec = '100000'; $urltocreate = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.sprintf("%04d%02d%02d", $year, $month, $day).$hourminsec.'&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : '')); @@ -1722,7 +1722,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa } print ''; print '
'; - if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { + if ($user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create')) { print ''; // Explicit link, usefull for nojs interfaces print img_picto($langs->trans("NewAction"), 'edit_add.png'); print ''; @@ -1849,7 +1849,7 @@ function show_day_events($db, $day, $month, $year, $monthshown, $style, &$eventa $cssclass .= ' movable cursormove'; } } else { - if ($user->rights->agenda->allactions->create || + if ($user->hasRight('agenda', 'allactions', 'create') || (($event->authorid == $user->id || $event->userownerid == $user->id) && $user->rights->agenda->myactions->create)) { $cssclass .= " movable cursormove"; } else { diff --git a/htdocs/comm/action/info.php b/htdocs/comm/action/info.php index d4588223b26..21651bb7446 100644 --- a/htdocs/comm/action/info.php +++ b/htdocs/comm/action/info.php @@ -53,7 +53,7 @@ if ($user->socid && $socid) { $result = restrictedArea($user, 'societe', $socid); } -$usercancreate = $user->rights->agenda->allactions->create || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create); +$usercancreate = $user->hasRight('agenda', 'allactions', 'create') || (($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create); /* diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index 5eb538d4e62..4be3195561e 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -700,7 +700,7 @@ $url = DOL_URL_ROOT.'/comm/action/card.php?action=create'; $url .= '&datep='.sprintf("%04d%02d%02d", $tmpforcreatebutton['year'], $tmpforcreatebutton['mon'], $tmpforcreatebutton['mday']).$hourminsec; $url .= '&backtopage='.urlencode($_SERVER["PHP_SELF"].($newparam ? '?'.$newparam : '')); -$newcardbutton = dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, '', $user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create); +$newcardbutton = dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, '', $user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create')); $param .= '&mode='.$mode; diff --git a/htdocs/comm/action/pertype.php b/htdocs/comm/action/pertype.php index 61092df5665..ce33d0f40b2 100644 --- a/htdocs/comm/action/pertype.php +++ b/htdocs/comm/action/pertype.php @@ -479,7 +479,7 @@ if (empty($reshook)) { $newcardbutton = ''; -if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { +if ($user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create')) { $tmpforcreatebutton = dol_getdate(dol_now(), true); $newparam .= '&month='.str_pad($month, 2, "0", STR_PAD_LEFT).'&year='.$tmpforcreatebutton['year']; diff --git a/htdocs/comm/action/peruser.php b/htdocs/comm/action/peruser.php index 5c5ef948c30..bd35fc16e7d 100644 --- a/htdocs/comm/action/peruser.php +++ b/htdocs/comm/action/peruser.php @@ -475,7 +475,7 @@ if (empty($reshook)) { $newparam = ''; $newcardbutton = ''; -if ($user->rights->agenda->myactions->create || $user->rights->agenda->allactions->create) { +if ($user->rights->agenda->myactions->create || $user->hasRight('agenda', 'allactions', 'create')) { $tmpforcreatebutton = dol_getdate(dol_now(), true); $newparam .= '&month='.urlencode(str_pad($month, 2, "0", STR_PAD_LEFT)).'&year='.urlencode($tmpforcreatebutton['year']); diff --git a/htdocs/contact/agenda.php b/htdocs/contact/agenda.php index 1445a9aa8fe..2f5dea5535a 100644 --- a/htdocs/contact/agenda.php +++ b/htdocs/contact/agenda.php @@ -266,7 +266,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) { $out .= '&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog')); } - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { $newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); } } diff --git a/htdocs/contrat/agenda.php b/htdocs/contrat/agenda.php index b05f68d7680..c3fa3756655 100644 --- a/htdocs/contrat/agenda.php +++ b/htdocs/contrat/agenda.php @@ -234,7 +234,7 @@ if ($id > 0) { $newcardbutton = ''; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { $backtopage = $_SERVER['PHP_SELF'].'?id='.$object->id; $out = '&origin='.$object->element.'&originid='.$object->id.'&backtopage='.urlencode($backtopage); $newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 00defaf909c..d1d408656af 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -12061,7 +12061,7 @@ function show_actions_messaging($conf, $langs, $db, $filterobj, $objcon = '', $n $out .= $actionstatic->getNomUrl(1, -1, 'valignmiddle').' '; } - if (!empty($user->rights->agenda->allactions->create) || + if ($user->hasRight('agenda', 'allactions', 'create') || (($actionstatic->authorid == $user->id || $actionstatic->userownerid == $user->id) && !empty($user->rights->agenda->myactions->create))) { $out .= ''; } diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index d9858a017e0..a7b3e0b09b1 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -241,7 +241,7 @@ class modAgenda extends DolibarrModules 'url'=>'/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create', 'langs'=>'commercial', 'position'=>101, - 'perms'=>'($user->rights->agenda->myactions->create||$user->rights->agenda->allactions->create)', + 'perms'=>'($user->rights->agenda->myactions->create||$user->hasRight('agenda', 'allactions', 'create'))', 'enabled'=>'$conf->agenda->enabled', 'target'=>'', 'user'=>2 diff --git a/htdocs/fourn/commande/info.php b/htdocs/fourn/commande/info.php index fc3918a32f3..2ec9450bcfa 100644 --- a/htdocs/fourn/commande/info.php +++ b/htdocs/fourn/commande/info.php @@ -196,7 +196,7 @@ if ($permok) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/hrm/evaluation_agenda.php b/htdocs/hrm/evaluation_agenda.php index 97f4c5453dc..76d48597c00 100644 --- a/htdocs/hrm/evaluation_agenda.php +++ b/htdocs/hrm/evaluation_agenda.php @@ -200,7 +200,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/hrm/job_agenda.php b/htdocs/hrm/job_agenda.php index 6aee4d6ed21..9809aea6ec1 100644 --- a/htdocs/hrm/job_agenda.php +++ b/htdocs/hrm/job_agenda.php @@ -191,7 +191,7 @@ if ($object->id > 0) { if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { $newcardbutton = ''; $newcardbutton .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); } diff --git a/htdocs/hrm/position_agenda.php b/htdocs/hrm/position_agenda.php index 5e52e6a9f81..12d10825fad 100644 --- a/htdocs/hrm/position_agenda.php +++ b/htdocs/hrm/position_agenda.php @@ -200,7 +200,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/hrm/skill_agenda.php b/htdocs/hrm/skill_agenda.php index 52b56b1507a..73d3ad17610 100644 --- a/htdocs/hrm/skill_agenda.php +++ b/htdocs/hrm/skill_agenda.php @@ -194,7 +194,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/knowledgemanagement/knowledgerecord_agenda.php b/htdocs/knowledgemanagement/knowledgerecord_agenda.php index 48f080b633e..f5a71f0ccc2 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_agenda.php +++ b/htdocs/knowledgemanagement/knowledgerecord_agenda.php @@ -221,7 +221,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/modulebuilder/template/myobject_agenda.php b/htdocs/modulebuilder/template/myobject_agenda.php index b7e88450f82..fab00847eab 100644 --- a/htdocs/modulebuilder/template/myobject_agenda.php +++ b/htdocs/modulebuilder/template/myobject_agenda.php @@ -280,7 +280,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/mrp/mo_agenda.php b/htdocs/mrp/mo_agenda.php index 4203c0f2a19..75db1a21476 100644 --- a/htdocs/mrp/mo_agenda.php +++ b/htdocs/mrp/mo_agenda.php @@ -219,7 +219,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/partnership/partnership_agenda.php b/htdocs/partnership/partnership_agenda.php index 6f25e5fd921..cfe8985349a 100644 --- a/htdocs/partnership/partnership_agenda.php +++ b/htdocs/partnership/partnership_agenda.php @@ -220,7 +220,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/product/agenda.php b/htdocs/product/agenda.php index 3588fd38acc..e21089730b8 100644 --- a/htdocs/product/agenda.php +++ b/htdocs/product/agenda.php @@ -197,7 +197,7 @@ if ($id > 0 || $ref) { $out .= (!empty($objcon->id) ? '&contactid='.$objcon->id : '').'&backtopage='.$_SERVER["PHP_SELF"].'?id='.$object->id.'&percentage=-1'; } - $linktocreatetimeBtnStatus = !empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create); + $linktocreatetimeBtnStatus = !empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create'); $morehtmlcenter = dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out, '', $linktocreatetimeBtnStatus); } diff --git a/htdocs/product/list.php b/htdocs/product/list.php index 14d43e038f1..411ab569a0b 100644 --- a/htdocs/product/list.php +++ b/htdocs/product/list.php @@ -210,7 +210,7 @@ $alias_product_perentity = empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED) ? $arrayfields = array( 'p.rowid'=>array('type'=>'integer', 'label'=>'TechnicalID', 'enabled'=>1, 'visible'=>-2, 'noteditable'=>1, 'notnull'=> 1, 'index'=>1, 'position'=>1, 'comment'=>'Id', 'css'=>'left'), 'p.ref'=>array('label'=>"Ref", 'checked'=>1, 'position'=>10), - //'pfp.ref_fourn'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'enabled'=>(!empty($conf->barcode->enabled))), + //'pfp.ref_fourn'=>array('label'=>$langs->trans("RefSupplier"), 'checked'=>1, 'enabled'=>(isModEnabled('barcode'))), 'thumbnail'=>array('label'=>'Photo', 'checked'=>0, 'position'=>10), 'p.label'=>array('label'=>"Label", 'checked'=>1, 'position'=>10), 'p.fk_product_type'=>array('label'=>"Type", 'checked'=>0, 'enabled'=>(isModEnabled("product") && isModEnabled("service")), 'position'=>11), diff --git a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php index 0497520a099..2f06badf2cc 100644 --- a/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php +++ b/htdocs/product/stock/stocktransfer/stocktransfer_agenda.php @@ -201,7 +201,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/projet/agenda.php b/htdocs/projet/agenda.php index a7cb672c0ab..65d73751423 100644 --- a/htdocs/projet/agenda.php +++ b/htdocs/projet/agenda.php @@ -196,7 +196,7 @@ if (!empty($object->id)) { // Show link to add event if (isModEnabled('agenda')) { - $addActionBtnRight = !empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create); + $addActionBtnRight = !empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create'); $morehtmlcenter .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $addActionBtnRight); } diff --git a/htdocs/projet/messaging.php b/htdocs/projet/messaging.php index d965d5e30a0..b266b87700d 100644 --- a/htdocs/projet/messaging.php +++ b/htdocs/projet/messaging.php @@ -196,7 +196,7 @@ if (!empty($object->id)) { // Show link to add event if (isModEnabled('agenda')) { - $addActionBtnRight = !empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create); + $addActionBtnRight = !empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create'); $morehtmlcenter .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out.'&socid='.$object->socid.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?id='.$object->id), '', $addActionBtnRight); } diff --git a/htdocs/recruitment/recruitmentcandidature_agenda.php b/htdocs/recruitment/recruitmentcandidature_agenda.php index c99bd98afe0..0cb1e3a4f1f 100644 --- a/htdocs/recruitment/recruitmentcandidature_agenda.php +++ b/htdocs/recruitment/recruitmentcandidature_agenda.php @@ -221,7 +221,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/recruitment/recruitmentjobposition_agenda.php b/htdocs/recruitment/recruitmentjobposition_agenda.php index abfad7bd7e6..9a3a0e2fe7d 100644 --- a/htdocs/recruitment/recruitmentjobposition_agenda.php +++ b/htdocs/recruitment/recruitmentjobposition_agenda.php @@ -218,7 +218,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/societe/agenda.php b/htdocs/societe/agenda.php index fde1ab154a3..9df581a6999 100644 --- a/htdocs/societe/agenda.php +++ b/htdocs/societe/agenda.php @@ -178,7 +178,7 @@ if ($socid > 0) { // $morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fa fa-comment-dots', $url, 'add-new-ticket-title-button', $btnstatus); if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); } } diff --git a/htdocs/societe/messaging.php b/htdocs/societe/messaging.php index 3f9011cce3f..10a34c48dec 100644 --- a/htdocs/societe/messaging.php +++ b/htdocs/societe/messaging.php @@ -178,7 +178,7 @@ if ($socid > 0) { // $morehtmlright .= dolGetButtonTitle($langs->trans('TicketAddMessage'), '', 'fa fa-comment-dots', $url, 'add-new-ticket-title-button', $btnstatus); if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { $morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/comm/action/card.php?action=create'.$out); } } diff --git a/htdocs/webhook/target_agenda.php b/htdocs/webhook/target_agenda.php index 74c895a813a..bf9cee2ec72 100644 --- a/htdocs/webhook/target_agenda.php +++ b/htdocs/webhook/target_agenda.php @@ -233,7 +233,7 @@ if ($object->id > 0) { print '
'; if (isModEnabled('agenda')) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; diff --git a/htdocs/workstation/workstation_agenda.php b/htdocs/workstation/workstation_agenda.php index 777da58f92c..7739cec620e 100644 --- a/htdocs/workstation/workstation_agenda.php +++ b/htdocs/workstation/workstation_agenda.php @@ -223,7 +223,7 @@ if ($object->id > 0) { print '
'; if (!empty($conf->agenda->enabled)) { - if (!empty($user->rights->agenda->myactions->create) || !empty($user->rights->agenda->allactions->create)) { + if (!empty($user->rights->agenda->myactions->create) || $user->hasRight('agenda', 'allactions', 'create')) { print ''.$langs->trans("AddAction").''; } else { print ''.$langs->trans("AddAction").''; From 1e9ab45947222a1f3941f8ba0aac66228e4bf941 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 23 Dec 2022 14:24:28 +0100 Subject: [PATCH 09/17] fix code --- htdocs/core/modules/modAgenda.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/modules/modAgenda.class.php b/htdocs/core/modules/modAgenda.class.php index a7b3e0b09b1..38debb8633a 100644 --- a/htdocs/core/modules/modAgenda.class.php +++ b/htdocs/core/modules/modAgenda.class.php @@ -241,7 +241,7 @@ class modAgenda extends DolibarrModules 'url'=>'/comm/action/card.php?mainmenu=agenda&leftmenu=agenda&action=create', 'langs'=>'commercial', 'position'=>101, - 'perms'=>'($user->rights->agenda->myactions->create||$user->hasRight('agenda', 'allactions', 'create'))', + 'perms'=>'($user->hasRight("agenda", "myactions", "create")||$user->hasRight("agenda", "allactions", "create"))', 'enabled'=>'$conf->agenda->enabled', 'target'=>'', 'user'=>2 From 40f55e8f8e0c71ee87abf1a49d9bd21a61038761 Mon Sep 17 00:00:00 2001 From: Mo Date: Sat, 24 Dec 2022 03:19:12 +0100 Subject: [PATCH 10/17] correct to the right apostrophe in tow occurrences MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit no more message after this correction in Luxembourg plan comptable normalisé 2020 (PCN 2020) "Erreur lors du chargement du tableau de compte. Si certains comptes n’ont pas été chargés, vous pouvez toujours les entrer manuellement." --- htdocs/install/mysql/data/llx_accounting_account_lu.sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/install/mysql/data/llx_accounting_account_lu.sql b/htdocs/install/mysql/data/llx_accounting_account_lu.sql index 831ac6b8f08..06d4def6b51 100644 --- a/htdocs/install/mysql/data/llx_accounting_account_lu.sql +++ b/htdocs/install/mysql/data/llx_accounting_account_lu.sql @@ -207,7 +207,7 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17201, 'PCN2020-LUXEMBURG', 'ASSETS', '41229', 0, 'Corrections de valeur', '1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17202, 'PCN2020-LUXEMBURG', 'ASSETS', '42111', 0, 'Avances et acomptes', '1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17203, 'PCN2020-LUXEMBURG', 'ASSETS', '42119', 0, 'Corrections de valeur', '1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17204, 'PCN2020-LUXEMBURG', 'ASSETS', '4212', 0, 'Cr./assoc. ou act.(aut. qu'ent. liées)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17204, 'PCN2020-LUXEMBURG', 'ASSETS', '4212', 0, 'Cr./assoc. ou act.(aut. qu’ent. liées)', '1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17205, 'PCN2020-LUXEMBURG', 'ASSETS', '42121', 0, 'De Franco Vincent', '1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17206, 'PCN2020-LUXEMBURG', 'ASSETS', '42131', 0, 'Subventions d’investissement', '1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17207, 'PCN2020-LUXEMBURG', 'ASSETS', '42132', 0, 'Subventions d’exploitation', '1'); @@ -237,7 +237,7 @@ INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, acc INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17231, 'PCN2020-LUXEMBURG', 'ASSETS', '42188', 0, 'Autres créances diverses', '1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17232, 'PCN2020-LUXEMBURG', 'ASSETS', '42189', 0, 'Corrections de valeur', '1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17233, 'PCN2020-LUXEMBURG', 'ASSETS', '4221', 0, 'Personnel - Avances et acomptes', '1'); -INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17234, 'PCN2020-LUXEMBURG', 'ASSETS', '4222', 0, 'Cr./assoc. ou act.(aut. qu'ent. liées)', '1'); +INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17234, 'PCN2020-LUXEMBURG', 'ASSETS', '4222', 0, 'Cr./assoc. ou act.(aut. qu’ent. liées)', '1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17235, 'PCN2020-LUXEMBURG', 'ASSETS', '42231', 0, 'Subventions d’investissement', '1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17236, 'PCN2020-LUXEMBURG', 'ASSETS', '42232', 0, 'Subventions d’exploitation', '1'); INSERT INTO llx_accounting_account (entity, rowid, fk_pcg_version, pcg_type, account_number, account_parent, label, active) VALUES (__ENTITY__, 17237, 'PCN2020-LUXEMBURG', 'ASSETS', '42238', 0, 'Autres subventions', '1'); From d3a0ad068705328a6957621a5569ce10617690fa Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Dec 2022 15:29:23 +0100 Subject: [PATCH 11/17] Warning: count(): Parameter must be an array or an object --- htdocs/core/boxes/box_actions.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index fb0f93086d2..ac0df03184a 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -220,7 +220,9 @@ class box_actions extends ModeleBoxes if (!empty($conf->global->SHOW_DIALOG_HOMEPAGE)) { $actioncejour = false; $contents = $this->info_box_contents; - $nblines = count($contents); + if (is_countable($contents) && count($contents) > 0) { + $nblines = count($contents); + } if ($contents[0][0]['text'] != $langs->trans("NoActionsToDo")) { $out .= '
trans("ActionsToDo").'">'; $out .= ''; From 344c241970a7f0d5012e383750bed8b3cb30a472 Mon Sep 17 00:00:00 2001 From: Philippe GRAND Date: Sat, 24 Dec 2022 15:37:36 +0100 Subject: [PATCH 12/17] Warning: count(): Parameter must be an array or an object --- htdocs/core/lib/files.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index ae4afc695e6..77375200bc4 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1567,7 +1567,9 @@ function dol_meta_create($object) } if (is_dir($dir)) { + if (is_countable($object->lines) && count($object->lines) > 0) { $nblines = count($object->lines); + } $client = $object->thirdparty->name." ".$object->thirdparty->address." ".$object->thirdparty->zip." ".$object->thirdparty->town; $meta = "REFERENCE=\"".$object->ref."\" DATE=\"" . dol_print_date($object->date, '')."\" From 6df6f786df35cb6ab5c94faa739eea2c183f5f8c Mon Sep 17 00:00:00 2001 From: stickler-ci Date: Sat, 24 Dec 2022 14:38:11 +0000 Subject: [PATCH 13/17] Fixing style errors. --- htdocs/core/lib/files.lib.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php index 77375200bc4..452d0ca4bb5 100644 --- a/htdocs/core/lib/files.lib.php +++ b/htdocs/core/lib/files.lib.php @@ -1568,8 +1568,8 @@ function dol_meta_create($object) if (is_dir($dir)) { if (is_countable($object->lines) && count($object->lines) > 0) { - $nblines = count($object->lines); - } + $nblines = count($object->lines); + } $client = $object->thirdparty->name." ".$object->thirdparty->address." ".$object->thirdparty->zip." ".$object->thirdparty->town; $meta = "REFERENCE=\"".$object->ref."\" DATE=\"" . dol_print_date($object->date, '')."\" From e1747f342f7ae5aa2c5206e1c752b6285208dee8 Mon Sep 17 00:00:00 2001 From: Mo Date: Sun, 25 Dec 2022 03:19:14 +0100 Subject: [PATCH 14/17] Add SARL-S for Luxembourg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The simplified limited liability company (Société à responsabilité limitée simplifiée – SARL-S) is a form of commercial company that is subject to rules that are somewhat different to those that apply to a conventional private limited liability company (Société à responsabilité limitée – SARL). La société à responsabilité limitée simplifiée (SARL-S) est une forme de société commerciale qui déroge à certaines règles propres à la société à responsabilité limitée (SARL) classique. https://guichet.public.lu/fr/entreprises/creation-developpement/forme-juridique/societe-capitaux/sarl-s.html --- htdocs/install/mysql/data/llx_c_forme_juridique.sql | 1 + 1 file changed, 1 insertion(+) diff --git a/htdocs/install/mysql/data/llx_c_forme_juridique.sql b/htdocs/install/mysql/data/llx_c_forme_juridique.sql index c35824fa235..af625035804 100644 --- a/htdocs/install/mysql/data/llx_c_forme_juridique.sql +++ b/htdocs/install/mysql/data/llx_c_forme_juridique.sql @@ -332,6 +332,7 @@ INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (140, INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (140, '14006', 'Société anonyme (SA)', 1); INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (140, '14007', 'Société coopérative (SC)', 1); INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (140, '14008', 'Société européenne (SE)', 1); +INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (140, '14009', 'Société à responsabilité limitée simplifiée (SARL-S)', 1); -- Romania INSERT INTO llx_c_forme_juridique (fk_pays, code, libelle, active) VALUES (188, '18801', 'AFJ - Alte forme juridice', 1); From b2a7894f724858113f1d27d6cdd6b1436789c881 Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Sun, 25 Dec 2022 16:05:46 +0100 Subject: [PATCH 15/17] FIX: Show supplier product reference input field The title of ref_fournis is displayed but not the input field Here you have disabled the show of the title but not of the input field /* jQuery("#title_fourn_ref").hide(); */ --- htdocs/core/tpl/objectline_create.tpl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/core/tpl/objectline_create.tpl.php b/htdocs/core/tpl/objectline_create.tpl.php index 110b379c22f..f008aacc10e 100644 --- a/htdocs/core/tpl/objectline_create.tpl.php +++ b/htdocs/core/tpl/objectline_create.tpl.php @@ -1148,7 +1148,7 @@ if (!empty($usemargins) && $user->rights->margins->creer) { jQuery("#multicurrency_price_ttc").val('').hide(); jQuery("#title_up_ttc, #title_up_ttc_currency").hide(); - jQuery("#fourn_ref, #tva_tx, #title_vat").hide(); + jQuery("#tva_tx, #title_vat").hide(); /* jQuery("#title_fourn_ref").hide(); */ jQuery("#np_marginRate, #np_markRate, .np_marginRate, .np_markRate, #units, #title_units").hide(); jQuery("#buying_price").show(); From 2c940c5bf85a4759b67b90708c88c917f8665766 Mon Sep 17 00:00:00 2001 From: wdammak <26695620+wdammak@users.noreply.github.com> Date: Sun, 25 Dec 2022 22:20:27 +0100 Subject: [PATCH 16/17] Take the correct value of the product supplier ref --- htdocs/fourn/facture/card.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index 6bc9ae679bb..bc9ab3cf2fd 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -1627,7 +1627,7 @@ if (empty($reshook)) { $productsupplier->fk_unit, 0, $pu_devise, - $ref_supplier, + GETPOST('fourn_ref', 'alpha'), '' ); } From 44c05ebca58d3e70cdb3e2108938067c2996d97d Mon Sep 17 00:00:00 2001 From: sonikf <93765174+sonikf@users.noreply.github.com> Date: Mon, 26 Dec 2022 04:47:20 +0200 Subject: [PATCH 17/17] ADD Greek public holidays --- .../mysql/data/llx_c_hrm_public_holiday.sql | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql b/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql index a8e9ac3be80..772a9ad612f 100644 --- a/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql +++ b/htdocs/install/mysql/data/llx_c_hrm_public_holiday.sql @@ -7,6 +7,8 @@ -- Copyright (C) 2007 Patrick Raguin -- Copyright (C) 2019 Markus Welters -- Copyright (C) 2022 Joachim Kueter +-- Copyright (C) 2022 Nick Fragoulis + -- -- 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 @@ -104,6 +106,20 @@ INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, m INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-SAINTSTEFAN', 0, 41, '', 0, 12, 26, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('AT-Silvester', 0, 41, '', 0, 12, 31, 1); +-- Greece (102) +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-ΠΡΩΤΟΧΡΟΝΙΑ', 0, 102, '', 0, 1, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-ΘΕΟΦΑΝΕΙΑ', 0, 102, '', 0, 1, 6, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-25Η ΜΑΡΤΙΟΥ', 0, 102, '', 0, 3, 25, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-ΠΡΩΤΟΜΑΓΙΑ', 0, 102, '', 0, 5, 1, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-ΚΑΘΑΡΑ ΔΕΥΤΕΡΑ', 0, 102, 'ΚΑΘΑΡΑ_ΔΕΥΤΕΡΑ', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-ΜΕΓΑΛΗ ΠΑΡΑΣΚΕΥΗ', 0, 102, 'ΜΕΓΑΛΗ_ΠΑΡΑΣΚΕΥΗ', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-ΔΕΥΤΕΡΑ ΤΟΥ ΠΑΣΧΑ', 0, 102, 'ΔΕΥΤΕΡΑ_ΤΟΥ_ΠΑΣΧΑ', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-ΤΟΥ ΑΓΙΟΥ ΠΝΕΥΜΑΤΟΣ', 0, 102, 'ΤΟΥ_ΑΓΙΟΥ_ΠΝΕΥΜΑΤΟΣ', 0, 0, 0, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-ΚΟΙΜΗΣΗ ΤΗΣ ΘΕΟΤΟΚΟΥ', 0, 102, '', 0, 8, 15, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-28Η ΟΚΤΩΒΡΙΟΥ', 0, 102, '', 0, 10, 28, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-ΧΡΙΣΤΟΥΓΕΝΝΑ', 0, 102, '', 0, 12, 25, 1); +INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('GR-ΣΥΝΑΞΗ ΘΕΟΤΟΚΟΥ', 0, 102, '', 0, 12, 26, 1); + -- India (117) INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('IN-REPUBLICDAY', 0, 117, '', 0, 1, 26, 1); INSERT INTO llx_c_hrm_public_holiday (code, entity, fk_country, dayrule, year, month, day, active) VALUES('IN-GANDI', 0, 117, '', 0, 10, 2, 1);