forked from extern/egroupware
if date_widget is readonly: just generate a label with the Date in the form spec. in the user-prefs
This commit is contained in:
parent
ec1ffc81be
commit
7a07eef5b5
@ -65,10 +65,23 @@
|
|||||||
'd' => date('d',$value)
|
'd' => date('d',$value)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
$format = split('[/.-]',$sep=$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
|
||||||
|
$sep = $sep[1];
|
||||||
|
if ($cell['readonly'] || $readonlys) // is readonly
|
||||||
|
{
|
||||||
|
for ($str='',$n = 0; $n < 3; ++$n)
|
||||||
|
{
|
||||||
|
$str .= ($str != '' ? $sep : '');
|
||||||
|
$str .= $value[$format[$n]];
|
||||||
|
}
|
||||||
|
$value = $str;
|
||||||
|
$cell['type'] = 'label';
|
||||||
|
$cell['no_lang'] = True;
|
||||||
|
return True;
|
||||||
|
}
|
||||||
$tpl = new etemplate;
|
$tpl = new etemplate;
|
||||||
$tpl->init('*** generated fields for date','','',0,'',0,0); // make an empty template
|
$tpl->init('*** generated fields for date','','',0,'',0,0); // make an empty template
|
||||||
|
|
||||||
$format = split('[/.-]',$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat']);
|
|
||||||
$fields = array('Y' => 'year', 'm' => 'month', 'd' => 'day');
|
$fields = array('Y' => 'year', 'm' => 'month', 'd' => 'day');
|
||||||
$row = array();
|
$row = array();
|
||||||
for ($n=0; $n < 3; ++$n)
|
for ($n=0; $n < 3; ++$n)
|
||||||
|
Loading…
Reference in New Issue
Block a user