From: <nat...@us...> - 2011-09-30 14:59:48
|
Author: nathangray Date: Fri Sep 30 16:59:41 2011 New Revision: 36788 URL: http://svn.stylite.de/viewvc/egroupware?rev=36788&view=rev Log: If hooked, keep app in extension_data to persist across etemplate loops. Fixes lost infolog custom fields in addressbook view when changing nm filters Modified: trunk/etemplate/inc/class.customfields_widget.inc.php Modified: trunk/etemplate/inc/class.customfields_widget.inc.php URL: http://svn.stylite.de/viewvc/egroupware/trunk/etemplate/inc/class.customfields_widget.inc.php?rev=36788&r1=36787&r2=36788&view=diff ============================================================================== --- trunk/etemplate/inc/class.customfields_widget.inc.php (original) +++ trunk/etemplate/inc/class.customfields_widget.inc.php Fri Sep 30 16:59:41 2011 @@ -26,6 +26,7 @@ { var $public_functions = array( 'pre_process' => True, + 'post_process' => True, ); var $human_name = array( 'customfields' => 'custom fields', @@ -112,10 +113,16 @@ function pre_process($form_name,&$value,&$cell,&$readonlys,&$extension_data,etemplate $tmpl) { list($app) = explode('.',$tmpl->name); + if($extension_data['app']) $app = $extension_data['app']; // 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 - if ($app && $app != 'stylite' && $app != $this->appname && ($this->appname == 'etemplate' || !$this->customfields || etemplate::$hooked)) + if ($app && $app != 'stylite' && $app != $this->appname && ( + $this->appname == 'etemplate' || !$this->customfields || etemplate::$hooked || $extension_data['app'] + )) { self::__construct(null,$app); // app changed + + // Need to keep hooked app for things like nm filter changes and validation errors + if(etemplate::$hooked) $extension_data['app'] = $app; } list($type2,$use_private,$field_names) = explode(',',$cell['size'],3); $fields_with_vals=array(); @@ -494,6 +501,12 @@ } /** + * Override to pass along extension_data - doesn't happen otherwise + */ + public function post_process($name,&$value,&$extension_data,&$loop,etemplate &$tmpl,$value_in) { + } + + /** * Read the options of a 'select' or 'radio' custom field from a file * * For security reasons that file has to be relative to the eGW root |