Fix home favorite filters lost if you change sorting / filter

This commit is contained in:
Nathan Gray 2014-11-17 18:47:47 +00:00
parent d1d150b7c7
commit 5291730724
4 changed files with 12 additions and 13 deletions

View File

@ -33,10 +33,6 @@ class home_favorite_portlet extends home_portlet
* @var array
*/
protected $nm_settings = array(
'no_filter' => true,
'no_filter2' => true,
'no_cat' => true,
'no_search' => true,
'lettersearch' => false,
'favorites' => false, // Hide favorite control
);
@ -103,9 +99,11 @@ class home_favorite_portlet extends home_portlet
$etemplate->set_dom_id($id);
$content = $this->context + array('nm' => $this->nm_settings);
$sel_options = $content['sel_options'] ? $content['sel_options'] : array();
unset($content['sel_options']);
$etemplate->setElementAttribute('nm', 'template',$this->nm_settings['template']);
$etemplate->exec(get_called_class() .'::process',$content);
$etemplate->exec(get_called_class() .'::process',$content,$sel_options);
}
public static function process($content = array())

View File

@ -526,7 +526,7 @@ app.classes.home = AppJS.extend(
var window_width = Math.max(580, width+20);
var window_height = Math.max(350, height+70);
// Open popup, but add 30 to the height for the toolbar
// Open popup, but add 70 to the height for the toolbar
egw.open_link(egw.link('/index.php',{
menuaction: 'home.home_note_portlet.edit',
id: id,

View File

@ -53,4 +53,4 @@
background: rgba(0,0,0,.3);
border: 1px solid silver;
position: absolute;
}
}

View File

@ -31,20 +31,21 @@ class infolog_favorite_portlet extends home_favorite_portlet
$ui = new infolog_ui();
$this->context['template'] = 'infolog.index.rows';
$this->context['sel_options'] = array(
'info_type' => $ui->bo->enums['type'],
'pm_id' => array(lang('No project')),
'info_priority' => $ui->bo->enums['priority'],
);
$this->nm_settings += array(
'get_rows' => 'infolog.infolog_ui.get_rows',
// Use a different template so it can be accessed from client side
'template' => 'infolog.home',
// Don't overwrite infolog
'session_for' => 'home',
'no_filter2' => true,
'options-filter'=> $ui->filters,
// Allow add actions even when there's no rows
'placeholder_actions' => array(),
'sel_options' => array(
'info_type' => $ui->bo->enums['type'],
'pm_id' => array(lang('No project')),
'info_priority' => $ui->bo->enums['priority'],
)
);
}