Run applications categories with ajax=true

- Fix categories colors not showing up
- Fix categories list refresh does not work
This commit is contained in:
Hadi Nategh 2016-06-13 12:30:21 +02:00
parent 2db301ac7a
commit 5e4412aea5
3 changed files with 9 additions and 2 deletions

View File

@ -221,7 +221,7 @@ class admin_categories
if ($button == 'save') if ($button == 'save')
{ {
Framework::refresh_opener($msg, $refresh_app, $content['id'], $change_color ? null : 'update', $this->appname); Framework::refresh_opener($msg, $this->appname, $content['id'], $change_color ? null : 'update', $refresh_app);
Framework::window_close(); Framework::window_close();
} }
break; break;
@ -244,7 +244,7 @@ class admin_categories
break; break;
} }
// This should probably refresh the application $this->appname in the target tab $refresh_app, but that breaks pretty much everything // This should probably refresh the application $this->appname in the target tab $refresh_app, but that breaks pretty much everything
Framework::refresh_opener($msg, $refresh_app, $content['id'], $change_color ? null : 'update', $this->appname); Framework::refresh_opener($msg, $this->appname, $content['id'], $change_color ? null : 'update', $refresh_app);
} }
$content['msg'] = $msg; $content['msg'] = $msg;
if(!$content['appname']) $content['appname'] = $appname; if(!$content['appname']) $content['appname'] = $appname;

View File

@ -927,6 +927,11 @@ var fw_base = (function(){ "use strict"; return Class.extend(
} }
// Call appropriate default / fallback refresh // Call appropriate default / fallback refresh
var win = window; var win = window;
// Preferences app is running under admin app, we need to trigger admin refersh
// in order to refresh categories list
_app = _app === 'preferences'?'admin':_app;
var app = this.getApplicationByName(_app); var app = this.getApplicationByName(_app);
if (app) if (app)
{ {

View File

@ -150,8 +150,10 @@ egw.extend('preferences', egw.MODULE_GLOBAL, function()
} }
else else
{ {
delete query.current_app;
query.menuaction='preferences.preferences_categories_ui.index'; query.menuaction='preferences.preferences_categories_ui.index';
query.cats_app=current_app; query.cats_app=current_app;
query.ajax = true;
} }
egw.link_handler(egw.link(url, query), current_app); egw.link_handler(egw.link(url, query), current_app);
break; break;