mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-29 03:13:40 +01:00
Addressbook: Fix group view in favorite did not select group properly
This commit is contained in:
parent
e53efd8389
commit
92b0beb134
@ -1279,6 +1279,15 @@ class AddressbookApp extends EgwApp
|
|||||||
// Regular handling first to clear everything but advanced search
|
// Regular handling first to clear everything but advanced search
|
||||||
super.setState(state);
|
super.setState(state);
|
||||||
|
|
||||||
|
// Clear group view template since the change event is not fired when we programmatically change the value
|
||||||
|
let index = etemplate2.getById('addressbook-index');
|
||||||
|
if(index && index.widgetContainer)
|
||||||
|
{
|
||||||
|
const grouped = index.widgetContainer.getWidgetById('grouped_view');
|
||||||
|
const nm = index.widgetContainer.getWidgetById("nm");
|
||||||
|
this.change_grouped_view(grouped, nm, grouped);
|
||||||
|
}
|
||||||
|
|
||||||
// Clear advanced search, which is in session and etemplate
|
// Clear advanced search, which is in session and etemplate
|
||||||
egw.json('addressbook.addressbook_ui.ajax_clear_advanced_search',[], function() {
|
egw.json('addressbook.addressbook_ui.ajax_clear_advanced_search',[], function() {
|
||||||
framework.setWebsiteTitle('addressbook','');
|
framework.setWebsiteTitle('addressbook','');
|
||||||
@ -1303,25 +1312,22 @@ class AddressbookApp extends EgwApp
|
|||||||
var index = etemplate2.getById('addressbook-index');
|
var index = etemplate2.getById('addressbook-index');
|
||||||
if(index && index.widgetContainer)
|
if(index && index.widgetContainer)
|
||||||
{
|
{
|
||||||
var grouped = index.widgetContainer.getWidgetById('grouped_view');
|
const grouped = index.widgetContainer.getWidgetById('grouped_view');
|
||||||
var options : any[];
|
let options : any[];
|
||||||
if(grouped && grouped.options && grouped.options.select_options)
|
if(grouped && grouped.select_options)
|
||||||
{
|
{
|
||||||
options = grouped.options.select_options;
|
options = grouped.select_options;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check to see if it's not there
|
// Check to see if it's not there
|
||||||
if(options && (options.find &&
|
if(options && (options.find &&
|
||||||
!options.find(function(e) {console.log(e); return e.value === state.state.grouped_view;}) ||
|
!options.find(function(e) {return e.value === state.state.grouped_view;}) ||
|
||||||
typeof options.find === 'undefined' && !options[state.state.grouped_view]
|
typeof options.find === 'undefined' && !options[state.state.grouped_view]
|
||||||
))
|
))
|
||||||
{
|
{
|
||||||
window.setTimeout(function() {
|
const nm = index.widgetContainer.getWidgetById('nm');
|
||||||
app.addressbook.setState(state);
|
const action = nm.controller._actionManager.getActionById('view_org');
|
||||||
}, 500);
|
const senders = [{_context: {_widget: nm}}];
|
||||||
var nm = index.widgetContainer.getWidgetById('nm');
|
|
||||||
var action = nm.controller._actionManager.getActionById('view_org');
|
|
||||||
var senders = [{_context: {_widget: nm}}];
|
|
||||||
return nm_action(action, senders, {}, {ids:[state.state.grouped_view]});
|
return nm_action(action, senders, {}, {ids:[state.state.grouped_view]});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user