mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-12 08:58:25 +01:00
allow to optionally specify app for redirect instead of always using current app
This commit is contained in:
parent
ba5254040d
commit
99ce5b41f9
@ -462,9 +462,10 @@ class egw_json_response
|
||||
*
|
||||
* @param string $url
|
||||
* @param boolean $global specifies whether to redirect the whole framework
|
||||
* @param string $app=null default current app from flags
|
||||
* or only the current application
|
||||
*/
|
||||
public function redirect($url, $global = false)
|
||||
public function redirect($url, $global = false, $app=null)
|
||||
{
|
||||
if (is_string($url) && is_bool($global))
|
||||
{
|
||||
@ -472,6 +473,7 @@ class egw_json_response
|
||||
$this->addGeneric('redirect', array(
|
||||
'url' => $url,
|
||||
'global' => $global,
|
||||
'app' => $app ? $app : $GLOBALS['egw_info']['flags']['currentapp'],
|
||||
));
|
||||
}
|
||||
}
|
||||
|
@ -528,7 +528,8 @@ egw_json_request.prototype.handleResponse = function(data, textStatus, XMLHttpRe
|
||||
case 'redirect':
|
||||
//console.log(res.data.url);
|
||||
if (typeof res.data.url == 'string' &&
|
||||
typeof res.data.global == 'boolean')
|
||||
typeof res.data.global == 'boolean' &&
|
||||
typeof res.data.app == 'string')
|
||||
{
|
||||
//Special handling for framework reload
|
||||
res.data.global |= (res.data.url.indexOf("?cd=10") > 0);
|
||||
@ -539,7 +540,7 @@ egw_json_request.prototype.handleResponse = function(data, textStatus, XMLHttpRe
|
||||
}
|
||||
else
|
||||
{
|
||||
egw_appWindowOpen(this.app, res.data.url);
|
||||
egw_appWindowOpen(res.data.app, res.data.url);
|
||||
}
|
||||
|
||||
hasResponse = true;
|
||||
|
@ -400,7 +400,7 @@ egw.extend('json', egw.MODULE_WND_LOCAL, function(_app, _wnd) {
|
||||
}
|
||||
else
|
||||
{
|
||||
egw_appWindowOpen(req.egw.getAppName(), res.data.url);
|
||||
egw_appWindowOpen(res.data.app, res.data.url);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user