if app changes while displaying content, be aware of that (as of addressbook infolog view)

This commit is contained in:
Klaus Leithoff 2009-08-20 14:11:10 +00:00
parent 4f910c4a5e
commit 796dba966d

View File

@ -83,7 +83,7 @@ class customfields_widget
var $advanced_search; var $advanced_search;
function customfields_widget($ui,$appname=null) function __construct($ui,$appname=null)
{ {
$this->appname = $appname ? $appname : $GLOBALS['egw_info']['flags']['currentapp']; $this->appname = $appname ? $appname : $GLOBALS['egw_info']['flags']['currentapp'];
$this->customfields = config::get_customfields($this->appname); $this->customfields = config::get_customfields($this->appname);
@ -92,11 +92,12 @@ class customfields_widget
} }
function pre_process($name,&$value,&$cell,&$readonlys,&$extension_data,&$tmpl) function pre_process($name,&$value,&$cell,&$readonlys,&$extension_data,&$tmpl)
{
if ($this->appname == 'etemplate' || !$this->customfields) // if we are in the etemplate editor or the app has no cf's, load the cf's from the app the tpl belongs too
{ {
list($app) = explode('.',$tmpl->name); list($app) = explode('.',$tmpl->name);
if ($app && $app != $this->appname) $this->customfields_widget(null,$app); if ($this->appname == 'etemplate' || !$this->customfields || // if we are in the etemplate editor or the app has no cf's, load the cf's from the app the tpl belongs too
($app && $app != $this->appname) ) // app changed
{
self::__construct(null,$app);
} }
list($type2,$use_private) = explode(',',$cell['size']); list($type2,$use_private) = explode(',',$cell['size']);
$fields_with_vals=array(); $fields_with_vals=array();