New: Function yn can show a visual checkbox
This commit is contained in:
parent
1ad4ae5c78
commit
c731321024
12
ChangeLog
12
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.* *****
|
***** ChangeLog for 3.7 compared to 3.6.* *****
|
||||||
For users:
|
For users:
|
||||||
- New: Match other auth system: Login can be done entering login or user
|
- New: Match other auth system: Login can be done entering login or user
|
||||||
|
|||||||
@ -1045,7 +1045,7 @@ if ($id > 0)
|
|||||||
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$object->label.'</td></tr>';
|
print '<tr><td>'.$langs->trans("Title").'</td><td colspan="3">'.$object->label.'</td></tr>';
|
||||||
|
|
||||||
// Full day event
|
// 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;
|
$rowspan=4;
|
||||||
if (empty($conf->global->AGENDA_DISABLE_LOCATION)) $rowspan++;
|
if (empty($conf->global->AGENDA_DISABLE_LOCATION)) $rowspan++;
|
||||||
|
|||||||
@ -3595,7 +3595,7 @@ function get_default_localtax($thirdparty_seller, $thirdparty_buyer, $local, $id
|
|||||||
* Return yes or no in current language
|
* Return yes or no in current language
|
||||||
*
|
*
|
||||||
* @param string $yesno Value to test (1, 'yes', 'true' or 0, 'no', 'false')
|
* @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.
|
* @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
|
* @return string HTML string
|
||||||
*/
|
*/
|
||||||
@ -3605,12 +3605,20 @@ function yn($yesno, $case=1, $color=0)
|
|||||||
$result='unknown';
|
$result='unknown';
|
||||||
if ($yesno == 1 || strtolower($yesno) == 'yes' || strtolower($yesno) == 'true') // A mettre avant test sur no a cause du == 0
|
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';
|
$classname='ok';
|
||||||
}
|
}
|
||||||
elseif ($yesno == 0 || strtolower($yesno) == 'no' || strtolower($yesno) == 'false')
|
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';
|
if ($color == 2) $classname='ok';
|
||||||
else $classname='error';
|
else $classname='error';
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user