diff --git a/ChangeLog b/ChangeLog
index 09061bda629..75c284c0283 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,18 @@ English Dolibarr ChangeLog
--------------------------------------------------------------
+***** ChangeLog for 3.8 compared to 3.7.* *****
+For users:
+- New:
+
+For translators:
+- Update language files.
+- New: When a translation is not available we always jump to en_US and only en_US.
+
+For developers:
+- New: Function yn can show a visual checkbox
+
+
***** ChangeLog for 3.7 compared to 3.6.* *****
For users:
- New: Match other auth system: Login can be done entering login or user
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index 9d98823289c..5ad26b0fa38 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -1045,7 +1045,7 @@ if ($id > 0)
print '
'.$langs->trans("Title").'
'.$object->label.'
';
// Full day event
- print '
'.$langs->trans("EventOnFullDay").'
'.yn($object->fulldayevent).'
';
+ print '
'.$langs->trans("EventOnFullDay").'
'.yn($object->fulldayevent, 3).'
';
$rowspan=4;
if (empty($conf->global->AGENDA_DISABLE_LOCATION)) $rowspan++;
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index a7cb3bbee73..5c0040a74b9 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -1029,7 +1029,7 @@ function dol_print_date($time,$format='',$tzoutput='tzserver',$outputlangs='',$e
function dol_getdate($timestamp,$fast=false)
{
global $conf;
-
+
$usealternatemethod=false;
if ($timestamp <= 0) $usealternatemethod=true; // <= 1970
if ($timestamp >= 2145913200) $usealternatemethod=true; // >= 2038
@@ -1041,7 +1041,7 @@ function dol_getdate($timestamp,$fast=false)
else
{
$arrayinfo=getdate($timestamp);
-
+
$startday=isset($conf->global->MAIN_START_WEEK)?$conf->global->MAIN_START_WEEK:1;
if($startday==1)
{
@@ -1116,11 +1116,11 @@ function dol_mktime($hour,$minute,$second,$month,$day,$year,$gm=false,$check=1)
$default_timezone=@date_default_timezone_get();
}
}
-
+
if (empty($localtz)) {
$localtz = new DateTimeZone('UTC');
}
-
+
$dt = new DateTime(null,$localtz);
$dt->setDate($year,$month,$day);
$dt->setTime((int) $hour, (int) $minute, (int) $second);
@@ -3595,7 +3595,7 @@ function get_default_localtax($thirdparty_seller, $thirdparty_buyer, $local, $id
* Return yes or no in current language
*
* @param string $yesno Value to test (1, 'yes', 'true' or 0, 'no', 'false')
- * @param string $case 1=Yes/No, 0=yes/no
+ * @param string $case 1=Yes/No, 0=yes/no, 2=Disabled checkbox, 3=Disabled checkbox + Yes/No
* @param int $color 0=texte only, 1=Text is formated with a color font style ('ok' or 'error'), 2=Text is formated with 'ok' color.
* @return string HTML string
*/
@@ -3605,12 +3605,20 @@ function yn($yesno, $case=1, $color=0)
$result='unknown';
if ($yesno == 1 || strtolower($yesno) == 'yes' || strtolower($yesno) == 'true') // A mettre avant test sur no a cause du == 0
{
- $result=($case?$langs->trans("Yes"):$langs->trans("yes"));
+ $result=$langs->trans('yes');
+ if ($case == 1 || $case == 3) $result=$langs->trans("Yes");
+ if ($case == 2) $result='';
+ if ($case == 3) $result=' '.$result;
+
$classname='ok';
}
elseif ($yesno == 0 || strtolower($yesno) == 'no' || strtolower($yesno) == 'false')
{
- $result=($case?$langs->trans("No"):$langs->trans("no"));
+ $result=$langs->trans("no");
+ if ($case == 1 || $case == 3) $result=$langs->trans("No");
+ if ($case == 2) $result='';
+ if ($case == 3) $result=' '.$result;
+
if ($color == 2) $classname='ok';
else $classname='error';
}