diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index c65c53652a8..4010823806c 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -3185,13 +3185,13 @@ if ($action == 'create' && $usercancreate) {
if ($totalWeight) {
print '
| ' . $langs->trans("CalculatedWeight") . ' | ';
print '';
- print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, getDolGlobalInt('MAIN_WEIGHT_DEFAULT_ROUND', -1), isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? $conf->global->MAIN_WEIGHT_DEFAULT_UNIT : 'no');
+ print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, getDolGlobalInt('MAIN_WEIGHT_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT', 'no'));
print ' |
';
}
if ($totalVolume) {
print '| ' . $langs->trans("CalculatedVolume") . ' | ';
print '';
- print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, getDolGlobalInt('MAIN_VOLUME_DEFAULT_ROUND', -1), isset($conf->global->MAIN_VOLUME_DEFAULT_UNIT) ? $conf->global->MAIN_VOLUME_DEFAULT_UNIT : 'no');
+ print showDimensionInBestUnit($totalVolume, 0, "volume", $langs, getDolGlobalInt('MAIN_VOLUME_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_VOLUME_DEFAULT_UNIT', 'no'));
print ' |
';
}
diff --git a/htdocs/core/datepicker.php b/htdocs/core/datepicker.php
index 12bc0fc9d94..13af821dbc6 100644
--- a/htdocs/core/datepicker.php
+++ b/htdocs/core/datepicker.php
@@ -224,7 +224,7 @@ function displayBox($selectedDate, $month, $year)
global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1;
+ $startday = getDolGlobalInt('MAIN_START_WEEK', 1);
$day_names = array('ShortSunday', 'ShortMonday', 'ShortTuesday', 'ShortWednesday', 'ShortThursday', 'ShortFriday', 'ShortSaturday');
for ($i = 0; $i < 7; $i++) {
echo '| ', $langs->trans($day_names[($i + $startday) % 7]), ' | ', "\n";
diff --git a/htdocs/core/js/lib_head.js.php b/htdocs/core/js/lib_head.js.php
index 48018bc1f62..2426a738ddc 100644
--- a/htdocs/core/js/lib_head.js.php
+++ b/htdocs/core/js/lib_head.js.php
@@ -203,7 +203,7 @@ jQuery(function($){
dayNamesMin: tradDaysMin,
weekHeader: 'trans("Week"); ?>',
dateFormat: 'trans("FormatDateShortJQuery"); ?>', /* Note dd/mm/yy means year on 4 digit in jquery format */
- firstDay: global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : '1'); ?>,
+ firstDay: ,
isRTL: trans("DIRECTION") == 'rtl' ? 'true' : 'false'); ?>,
showMonthAfterYear: false, /* TODO add specific to country */
yearSuffix: '' /* TODO add specific to country */
diff --git a/htdocs/core/lib/date.lib.php b/htdocs/core/lib/date.lib.php
index 61d21e9abe6..2e3faf20efb 100644
--- a/htdocs/core/lib/date.lib.php
+++ b/htdocs/core/lib/date.lib.php
@@ -674,13 +674,11 @@ function dol_get_first_hour($date, $gm = 'tzserver')
*/
function dol_get_first_day_week($day, $month, $year, $gm = false)
{
- global $conf;
-
//$day=2; $month=2; $year=2015;
$date = dol_mktime(0, 0, 0, $month, $day, $year, $gm);
//Checking conf of start week
- $start_week = (isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1);
+ $start_week = getDolGlobalInt('MAIN_START_WEEK', 1);
$tmparray = dol_getdate($date, true); // detail of current day
diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php
index 46c77e0c8f8..2dc153a5f7f 100644
--- a/htdocs/expedition/card.php
+++ b/htdocs/expedition/card.php
@@ -2318,7 +2318,7 @@ if ($action == 'create') {
if (!empty($object->trueWeight)) {
print ' (' . $langs->trans("SumOfProductWeights") . ': ';
}
- print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, getDolGlobalInt('MAIN_WEIGHT_DEFAULT_ROUND', -1), isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? $conf->global->MAIN_WEIGHT_DEFAULT_UNIT : 'no');
+ print showDimensionInBestUnit($totalWeight, 0, "weight", $langs, getDolGlobalInt('MAIN_WEIGHT_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT', 'no'));
if (!empty($object->trueWeight)) {
print ')';
}
diff --git a/htdocs/expedition/list.php b/htdocs/expedition/list.php
index 2df3d35c9f0..962a5fb2396 100644
--- a/htdocs/expedition/list.php
+++ b/htdocs/expedition/list.php
@@ -1622,7 +1622,7 @@ while ($i < $imaxinloop) {
print '';
if (empty($object->trueWeight)) {
$tmparray = $object->getTotalWeightVolume();
- print showDimensionInBestUnit($tmparray['weight'], 0, "weight", $langs, getDolGlobalInt('MAIN_WEIGHT_DEFAULT_ROUND', -1), isset($conf->global->MAIN_WEIGHT_DEFAULT_UNIT) ? $conf->global->MAIN_WEIGHT_DEFAULT_UNIT : 'no');
+ print showDimensionInBestUnit($tmparray['weight'], 0, "weight", $langs, getDolGlobalInt('MAIN_WEIGHT_DEFAULT_ROUND', -1), getDolGlobalString('MAIN_WEIGHT_DEFAULT_UNIT', 'no'));
print $form->textwithpicto('', $langs->trans('EstimatedWeight'), 1);
} else {
print $object->trueWeight;
diff --git a/htdocs/holiday/document.php b/htdocs/holiday/document.php
index bf30730f0d9..88522722419 100644
--- a/htdocs/holiday/document.php
+++ b/htdocs/holiday/document.php
@@ -218,8 +218,8 @@ if ($object->id) {
print ' |
';
print '';
$htmlhelp = $langs->trans('NbUseDaysCPHelp');
- $includesaturday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY : 1);
- $includesunday = (isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY) ? $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY : 1);
+ $includesaturday = getDolGlobalInt('MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY', 1);
+ $includesunday = getDolGlobalInt('MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY', 1);
if ($includesaturday) {
$htmlhelp .= ' '.$langs->trans("DayIsANonWorkingDay", $langs->trans("Saturday"));
}
diff --git a/htdocs/hrm/lib/hrm_skillrank.lib.php b/htdocs/hrm/lib/hrm_skillrank.lib.php
index ca220d7d062..e89f43f24da 100644
--- a/htdocs/hrm/lib/hrm_skillrank.lib.php
+++ b/htdocs/hrm/lib/hrm_skillrank.lib.php
@@ -128,7 +128,7 @@ function displayRankInfos($selected_rank, $fk_skill, $inputname = 'TNote', $mode
$ret .= '';
if (is_array($Lines) && !empty($Lines)) {
foreach ($Lines as $line) {
- $MaxNumberSkill = isset($conf->global->HRM_MAXRANK) ? $conf->global->HRM_MAXRANK : Skill::DEFAULT_MAX_RANK_PER_SKILL;
+ $MaxNumberSkill = getDolGlobalInt('HRM_MAXRANK', Skill::DEFAULT_MAX_RANK_PER_SKILL);
if ($line->rankorder > $MaxNumberSkill) {
continue;
}
diff --git a/htdocs/public/bookcal/index.php b/htdocs/public/bookcal/index.php
index f0738408272..aaf05e537e4 100644
--- a/htdocs/public/bookcal/index.php
+++ b/htdocs/public/bookcal/index.php
@@ -388,7 +388,7 @@ if ($action == 'afteradd') {
print ' | # | ';
$i = 0;
while ($i < 7) {
- $numdayinweek = (($i + (isset($conf->global->MAIN_START_WEEK) ? $conf->global->MAIN_START_WEEK : 1)) % 7);
+ $numdayinweek = (($i + getDolGlobalInt('MAIN_START_WEEK', 1)) % 7);
if (!empty($conf->dol_optimize_smallscreen)) {
print ' ';
$labelshort = array(0 => 'SundayMin', 1 => 'MondayMin', 2 => 'TuesdayMin', 3 => 'WednesdayMin', 4 => 'ThursdayMin', 5 => 'FridayMin', 6 => 'SaturdayMin');
|