mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-25 16:19:00 +01:00
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)
|
||||
);
|
||||
}
|
||||
$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->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');
|
||||
$row = array();
|
||||
for ($n=0; $n < 3; ++$n)
|
||||
@ -140,4 +153,4 @@
|
||||
}
|
||||
return True;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user