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
4 days 9 hours ago
4 days 9 hours ago
1 week 13 hours ago
1 week 6 days ago
2 weeks 1 day ago
2 weeks 5 days ago
2 weeks 5 days ago
3 weeks 1 day ago
5 weeks 6 hours ago
12 weeks 5 days ago