diff --git a/ChangeLog b/ChangeLog index 09061bda629d92b02d6775a396c186686ac34d0a..75c284c0283cecf0de7866aacdb4d73ebf927e2b 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 9d98823289c268d634c340586f45352215c1b5dd..5ad26b0fa387661b980136b986f8b6f1f05448d3 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -1045,7 +1045,7 @@ if ($id > 0) print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$object->label.'</td></tr>'; // Full day event - print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($object->fulldayevent).'</td></tr>'; + print '<tr><td>'.$langs->trans("EventOnFullDay").'</td><td colspan="3">'.yn($object->fulldayevent, 3).'</td></tr>'; $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 a7cb3bbee73bf615985f5e3a79e12ad4e48d878e..5c0040a74b99fbc78a8ae595a94eaa9d99863339 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='<input type="checkbox" value="1" checked="checked" disabled="disabled">'; + if ($case == 3) $result='<input type="checkbox" value="1" checked="checked" disabled="disabled"> '.$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='<input type="checkbox" value="0" disabled="disabled">'; + if ($case == 3) $result='<input type="checkbox" value="0" disabled="disabled"> '.$result; + if ($color == 2) $classname='ok'; else $classname='error'; }