Loading public/javascript/app/base/views/extensions/_EditionCommons.js +15 −3 Original line number Diff line number Diff line Loading @@ -22,14 +22,26 @@ define([ _cleanProp: function(item, prop) { var propSplitted = prop.split("."); var propSplitted = prop.split('.'); if (propSplitted.length > 1) { this._cleanProp(item[propSplitted[0]], propSplitted[1]); var currentPropertyKey = propSplitted[0], nextPropertyKeys = propSplitted.slice(1).join('.'); var currentPropertyValue; if (currentPropertyKey === '{i}') { for (var i = 0; i < item.length; i++) { currentPropertyValue = item[i]; this._cleanProp(currentPropertyValue, nextPropertyKeys); } } else { currentPropertyValue = item[currentPropertyKey]; this._cleanProp(currentPropertyValue, nextPropertyKeys); } } else { var cleanValue = null; if (typeof item[prop] === "object") { if (typeof item[prop] === "object" && item[prop] !== null) { if (item[prop] instanceof Array) { cleanValue = []; } else { Loading public/javascript/app/base/views/extensions/_GetActivityData.js +6 −2 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ define([ aspect.after(this, "_initialize", lang.hitch(this, this._initializeGetActivityData)); aspect.before(this, "_itemAvailable", lang.hitch(this, this._itemGetActivityDataAvailable)); aspect.before(this, "_beforeShow", lang.hitch(this, this._beforeShowGetActivityData)); }, _initializeGetActivityData: function() { Loading @@ -40,8 +41,6 @@ define([ } else { this.target = [this.activityTarget]; } this._emitGetActivity(); }, _emitGetActivity: function() { Loading @@ -53,6 +52,11 @@ define([ }); }, _beforeShowGetActivityData: function() { this._emitGetActivity(); }, _itemGetActivityDataAvailable: function(res) { var target = res.target, Loading public/javascript/app/components/ModuleStore.js +32 −31 Original line number Diff line number Diff line Loading @@ -148,23 +148,19 @@ define([ // Recorremos las categorías y sus módulos para generar nuestro store de módulos for (var i = 0; i < categories.length; i++) { var category = categories[i]; if (category.modules) { if (category.modules) { for (var j = 0; j < category.modules.length; j++) { var module = category.modules[j]; if (module.perms/* > 0*/ && module.enable) { this._addModule(category.name + "/" + module.name, module.name, module.internPath, module.perms); var moduleItem = category.modules[j]; if (moduleItem.perms && moduleItem.enable) { this._addModule(category.name + "/" + moduleItem.name, moduleItem.name, moduleItem.internPath, moduleItem.perms); } } } if (category.perms/* && category.perms > 0*/ && category.enable) { if (category.perms && category.enable) { this._addModule(category.name, category.name, category.internPath, category.perms); } } Loading Loading @@ -278,37 +274,42 @@ define([ // returns: // Promesa de la instancia del módulo var module = this._findModuleByPath(key); var moduleList = this._findModuleByPath(key); if (module.length < 1) if (!moduleList.length) { return; } moduleItem = moduleList[0]; module = module[0]; // Si aun no se ha creado la vista if (!module.instance) return this._createModule(module, query); // return Object if (!moduleItem.instance) { return this._createModule(moduleItem, query); // return Object } // Si ya se creó la vista anteriormente module.timeStamp = new Date().getTime(); // Actualizamos el módulo module.instance.pathVariableId = this.pathVariableId !== "$1" ? this.pathVariableId :null; moduleItem.timeStamp = new Date().getTime(); this.moduleStore.put(moduleItem); //module.instance._query.set(query); this.moduleStore.put(module); this._publish(moduleItem.instance.getChannel("CONNECT")); this._publish(module.instance.getChannel("CONNECT")); this._publish(moduleItem.instance.getChannel('SET_PROPS'), { pathVariableId: this.pathVariableId !== "$1" ? this.pathVariableId : null, queryParameters: query }); var dfd = new Deferred(); dfd.resolve(module.instance); dfd.resolve(moduleItem.instance); return dfd; // return Object }, _createModule: function(/*Object*/ module, /*Object*/ query) { _createModule: function(/*Object*/ moduleItem, /*Object*/ query) { // summary: // Crea la instancia de un módulo de la aplicación. // tags: // private // module: // moduleItem: // Módulo a crear // query: // Objeto de consulta Loading @@ -317,20 +318,20 @@ define([ var dfd = new Deferred(); require(["app" + module.internPath + "View"], lang.hitch(this, function(ModuleView) { require(["app" + moduleItem.internPath + "View"], lang.hitch(this, function(ModuleView) { // Creamos el módulo var moduleInstance = new ModuleView({ perms: module.perms, query: query, perms: moduleItem.perms, parentChannel: this.parentChannel, ownChannel: this.viewSeparator+module.id, pathVariableId: this.pathVariableId !== "$1" ? this.pathVariableId :null ownChannel: this.viewSeparator + moduleItem.id, pathVariableId: this.pathVariableId !== "$1" ? this.pathVariableId : null, queryParameters: query }); // Añadimos al store la instancia del módulo module.instance = moduleInstance; module.timeStamp = new Date().getTime(); this.moduleStore.put(module); moduleItem.instance = moduleInstance; moduleItem.timeStamp = new Date().getTime(); this.moduleStore.put(moduleItem); // Resolvemos para devolver la instancia creada dfd.resolve(moduleInstance); Loading public/javascript/app/components/Router.js +2 −6 Original line number Diff line number Diff line Loading @@ -235,7 +235,7 @@ define([ // looking for all the links with 'ajax' class found if (target && target.nodeName === 'A' && domAttr.get(target, 'd-state-url')) { var url = /*'/'+kernel.locale+*/target.pathname; var url = target.pathname + target.search; if (mouse.isMiddle(event)) { globalContext.open(globalContext.location.protocol + '//' + globalContext.location.hostname + url, '_blank'); Loading Loading @@ -276,10 +276,8 @@ define([ query = urlSplitted[1]; if ((!route || (route === '') || (route === this.paths.ROOT)) && !this._userFound) { this._addHistory(this.paths.LOGIN); route = this.paths.LOGIN; } else if (!route || (route === '') || (route === this.paths.ROOT) || (route === this.paths.LOGIN && this._userFound)) { Loading Loading @@ -385,9 +383,7 @@ define([ this._emitEvt('GET_MODULE', { key: this._currModuleKey, query: { where: ioQuery.queryToObject(this.query) } query: ioQuery.queryToObject(this.query) }); }, Loading public/javascript/app/dataLoader/base/_GeographicBase.js +1 −4 Original line number Diff line number Diff line Loading @@ -65,12 +65,9 @@ define([ lang.mixin(this, this.config, args); aspect.before(this, "_setConfigurations", lang.hitch(this, this._setGeographicBaseConfigurations)); aspect.before(this, "_setConfigurations", lang.hitch(this, this._setGeographicBaseConfigurations)); aspect.before(this, "_initialize", lang.hitch(this, this._initializeGeographicBase)); aspect.before(this, "_definePublications", lang.hitch(this, this._defineGeographicBasePublications)); aspect.before(this, "_beforeShow", lang.hitch(this, this._beforeShowGeographicBase)); if (!Utilities.isValidNumber(this.pathVariableId)) { Loading Loading
public/javascript/app/base/views/extensions/_EditionCommons.js +15 −3 Original line number Diff line number Diff line Loading @@ -22,14 +22,26 @@ define([ _cleanProp: function(item, prop) { var propSplitted = prop.split("."); var propSplitted = prop.split('.'); if (propSplitted.length > 1) { this._cleanProp(item[propSplitted[0]], propSplitted[1]); var currentPropertyKey = propSplitted[0], nextPropertyKeys = propSplitted.slice(1).join('.'); var currentPropertyValue; if (currentPropertyKey === '{i}') { for (var i = 0; i < item.length; i++) { currentPropertyValue = item[i]; this._cleanProp(currentPropertyValue, nextPropertyKeys); } } else { currentPropertyValue = item[currentPropertyKey]; this._cleanProp(currentPropertyValue, nextPropertyKeys); } } else { var cleanValue = null; if (typeof item[prop] === "object") { if (typeof item[prop] === "object" && item[prop] !== null) { if (item[prop] instanceof Array) { cleanValue = []; } else { Loading
public/javascript/app/base/views/extensions/_GetActivityData.js +6 −2 Original line number Diff line number Diff line Loading @@ -27,6 +27,7 @@ define([ aspect.after(this, "_initialize", lang.hitch(this, this._initializeGetActivityData)); aspect.before(this, "_itemAvailable", lang.hitch(this, this._itemGetActivityDataAvailable)); aspect.before(this, "_beforeShow", lang.hitch(this, this._beforeShowGetActivityData)); }, _initializeGetActivityData: function() { Loading @@ -40,8 +41,6 @@ define([ } else { this.target = [this.activityTarget]; } this._emitGetActivity(); }, _emitGetActivity: function() { Loading @@ -53,6 +52,11 @@ define([ }); }, _beforeShowGetActivityData: function() { this._emitGetActivity(); }, _itemGetActivityDataAvailable: function(res) { var target = res.target, Loading
public/javascript/app/components/ModuleStore.js +32 −31 Original line number Diff line number Diff line Loading @@ -148,23 +148,19 @@ define([ // Recorremos las categorías y sus módulos para generar nuestro store de módulos for (var i = 0; i < categories.length; i++) { var category = categories[i]; if (category.modules) { if (category.modules) { for (var j = 0; j < category.modules.length; j++) { var module = category.modules[j]; if (module.perms/* > 0*/ && module.enable) { this._addModule(category.name + "/" + module.name, module.name, module.internPath, module.perms); var moduleItem = category.modules[j]; if (moduleItem.perms && moduleItem.enable) { this._addModule(category.name + "/" + moduleItem.name, moduleItem.name, moduleItem.internPath, moduleItem.perms); } } } if (category.perms/* && category.perms > 0*/ && category.enable) { if (category.perms && category.enable) { this._addModule(category.name, category.name, category.internPath, category.perms); } } Loading Loading @@ -278,37 +274,42 @@ define([ // returns: // Promesa de la instancia del módulo var module = this._findModuleByPath(key); var moduleList = this._findModuleByPath(key); if (module.length < 1) if (!moduleList.length) { return; } moduleItem = moduleList[0]; module = module[0]; // Si aun no se ha creado la vista if (!module.instance) return this._createModule(module, query); // return Object if (!moduleItem.instance) { return this._createModule(moduleItem, query); // return Object } // Si ya se creó la vista anteriormente module.timeStamp = new Date().getTime(); // Actualizamos el módulo module.instance.pathVariableId = this.pathVariableId !== "$1" ? this.pathVariableId :null; moduleItem.timeStamp = new Date().getTime(); this.moduleStore.put(moduleItem); //module.instance._query.set(query); this.moduleStore.put(module); this._publish(moduleItem.instance.getChannel("CONNECT")); this._publish(module.instance.getChannel("CONNECT")); this._publish(moduleItem.instance.getChannel('SET_PROPS'), { pathVariableId: this.pathVariableId !== "$1" ? this.pathVariableId : null, queryParameters: query }); var dfd = new Deferred(); dfd.resolve(module.instance); dfd.resolve(moduleItem.instance); return dfd; // return Object }, _createModule: function(/*Object*/ module, /*Object*/ query) { _createModule: function(/*Object*/ moduleItem, /*Object*/ query) { // summary: // Crea la instancia de un módulo de la aplicación. // tags: // private // module: // moduleItem: // Módulo a crear // query: // Objeto de consulta Loading @@ -317,20 +318,20 @@ define([ var dfd = new Deferred(); require(["app" + module.internPath + "View"], lang.hitch(this, function(ModuleView) { require(["app" + moduleItem.internPath + "View"], lang.hitch(this, function(ModuleView) { // Creamos el módulo var moduleInstance = new ModuleView({ perms: module.perms, query: query, perms: moduleItem.perms, parentChannel: this.parentChannel, ownChannel: this.viewSeparator+module.id, pathVariableId: this.pathVariableId !== "$1" ? this.pathVariableId :null ownChannel: this.viewSeparator + moduleItem.id, pathVariableId: this.pathVariableId !== "$1" ? this.pathVariableId : null, queryParameters: query }); // Añadimos al store la instancia del módulo module.instance = moduleInstance; module.timeStamp = new Date().getTime(); this.moduleStore.put(module); moduleItem.instance = moduleInstance; moduleItem.timeStamp = new Date().getTime(); this.moduleStore.put(moduleItem); // Resolvemos para devolver la instancia creada dfd.resolve(moduleInstance); Loading
public/javascript/app/components/Router.js +2 −6 Original line number Diff line number Diff line Loading @@ -235,7 +235,7 @@ define([ // looking for all the links with 'ajax' class found if (target && target.nodeName === 'A' && domAttr.get(target, 'd-state-url')) { var url = /*'/'+kernel.locale+*/target.pathname; var url = target.pathname + target.search; if (mouse.isMiddle(event)) { globalContext.open(globalContext.location.protocol + '//' + globalContext.location.hostname + url, '_blank'); Loading Loading @@ -276,10 +276,8 @@ define([ query = urlSplitted[1]; if ((!route || (route === '') || (route === this.paths.ROOT)) && !this._userFound) { this._addHistory(this.paths.LOGIN); route = this.paths.LOGIN; } else if (!route || (route === '') || (route === this.paths.ROOT) || (route === this.paths.LOGIN && this._userFound)) { Loading Loading @@ -385,9 +383,7 @@ define([ this._emitEvt('GET_MODULE', { key: this._currModuleKey, query: { where: ioQuery.queryToObject(this.query) } query: ioQuery.queryToObject(this.query) }); }, Loading
public/javascript/app/dataLoader/base/_GeographicBase.js +1 −4 Original line number Diff line number Diff line Loading @@ -65,12 +65,9 @@ define([ lang.mixin(this, this.config, args); aspect.before(this, "_setConfigurations", lang.hitch(this, this._setGeographicBaseConfigurations)); aspect.before(this, "_setConfigurations", lang.hitch(this, this._setGeographicBaseConfigurations)); aspect.before(this, "_initialize", lang.hitch(this, this._initializeGeographicBase)); aspect.before(this, "_definePublications", lang.hitch(this, this._defineGeographicBasePublications)); aspect.before(this, "_beforeShow", lang.hitch(this, this._beforeShowGeographicBase)); if (!Utilities.isValidNumber(this.pathVariableId)) { Loading