From 848c7d71d2118772ab38aa9902923a286eb256e1 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 22 Feb 2016 13:03:57 +0000 Subject: [PATCH] Mobile theme W.I.P.: - Fix error 500 happens when opening view template - Implement better approach for specifying currentapp --- etemplate/js/etemplate2.js | 2 +- phpgwapi/js/jsapi/app_base.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/etemplate/js/etemplate2.js b/etemplate/js/etemplate2.js index 22d8b2b6de..97052b3d1b 100644 --- a/etemplate/js/etemplate2.js +++ b/etemplate/js/etemplate2.js @@ -350,7 +350,7 @@ etemplate2.prototype.load = function(_name, _url, _data, _callback) this.template_base_url += _url.split(_name.split('.').shift())[0]; egw().debug("info", "Loaded data", _data); - var currentapp = this.app = _data.currentapp || window.egw_appName; + var currentapp = this.app = _data.currentapp || egw().app_name(); // extract $content['msg'] and call egw.message() with it var msg = _data.content.msg; diff --git a/phpgwapi/js/jsapi/app_base.js b/phpgwapi/js/jsapi/app_base.js index 681a71797a..caac4521a8 100644 --- a/phpgwapi/js/jsapi/app_base.js +++ b/phpgwapi/js/jsapi/app_base.js @@ -455,7 +455,7 @@ var AppJS = Class.extend( var templateName = _action.data.mobileViewTemplate || 'edit.xet'; var etemplate = new etemplate2 (this.viewTemplate[0], false); var template = egw.webserverUrl+ '/' + this.appname + '/templates/mobile/'+templateName+'?1'; - var data = {content:content, readonlys:{'__ALL__':true,'link_to':false}}; + var data = {content:content, readonlys:{'__ALL__':true,'link_to':false}, currentapp:id_app[0]}; if(template.indexOf('.xet') > 0) {