I extended render function in lists in order to show fields with custom format using sprintf standard function.
Then we could define custom format in this way:
$form->formatField("MyCurrencyField", "%d €");
The modification is the following:
File: Zoop/gui/plugins/functions.forms_list.php
Line: ~220
Code fragment:
function smarty_function_forms_list($params, &$smarty)
{
...
switch($field->type)
{
case "timestamptz":
case "date":
if(isset($field->format))
$lvalue = sql_format_date($record->values[$name]->value, $field->format);
else
$lvalue = $record->values[$name]->value;
break;
default:
//FIX: custom format with sprintf
if(isset($field->format))
{
$lvalue = sprintf($field->format, $record->values[$name]->value);
}
else
{
$lvalue = $record->values[$name]->value;
}
}
...
}
Hope this help...
Recent comments
15 hours 7 min ago
3 weeks 5 days ago
6 weeks 4 days ago
12 weeks 3 days ago
13 weeks 1 day ago
13 weeks 5 days ago
13 weeks 5 days ago
13 weeks 5 days ago
13 weeks 5 days ago
14 weeks 20 hours ago