diff --git a/etemplate/inc/class.etemplate_widget_nextmatch.inc.php b/etemplate/inc/class.etemplate_widget_nextmatch.inc.php index ffb85578cf..3daa81b5f9 100644 --- a/etemplate/inc/class.etemplate_widget_nextmatch.inc.php +++ b/etemplate/inc/class.etemplate_widget_nextmatch.inc.php @@ -140,16 +140,21 @@ class etemplate_widget_nextmatch extends etemplate_widget } unset($send_value['col_filter']); } + // Old type if($favorite && $favorite['filter']) { - $send_value = array_merge($value, $favorite['filter']); + $favorite['state'] = $favorite['filter']; + } + if($favorite && $favorite['state']) + { + $send_value = array_merge($value, $favorite['state']); // Ajax call can handle the saved sort here, but this can't - if($favorite['filter']['sort']) + if($favorite['state']['sort']) { unset($send_value['sort']); - $send_value['order'] = $favorite['filter']['sort']['id']; - $send_value['sort'] = $favorite['filter']['sort']['asc'] ? 'ASC' : 'DESC'; + $send_value['order'] = $favorite['state']['sort']['id']; + $send_value['sort'] = $favorite['state']['sort']['asc'] ? 'ASC' : 'DESC'; } } } diff --git a/etemplate/js/et2_widget_textbox.js b/etemplate/js/et2_widget_textbox.js index c46c49ffde..03b1306f7a 100644 --- a/etemplate/js/et2_widget_textbox.js +++ b/etemplate/js/et2_widget_textbox.js @@ -141,7 +141,7 @@ var et2_textbox = et2_inputWidget.extend([et2_IResizeable], getValue: function() { - if(this.options.blur && this.input.val() == this.options.blur) return ""; + if(this.options && this.options.blur && this.input.val() == this.options.blur) return ""; return this._super.apply(this, arguments); }, diff --git a/etemplate/js/et2_widget_vfs.js b/etemplate/js/et2_widget_vfs.js index f8fc17435c..4fafdfc2ba 100644 --- a/etemplate/js/et2_widget_vfs.js +++ b/etemplate/js/et2_widget_vfs.js @@ -195,7 +195,7 @@ var et2_vfsName = et2_textbox.extend( this._super.apply(this,[_value]); }, getValue: function() { - return egw.encodePath(this._super.apply(this)); + return egw.encodePath(this._super.apply(this)||''); } }); et2_register_widget(et2_vfsName, ["vfs-name"]); @@ -334,7 +334,7 @@ var et2_vfsMime = expose(et2_valueWidget.extend([et2_IDetachedDOM], type: _value.mime, poster:'', // TODO: Should be changed by correct video thumbnail later thumbnail:this.egw().mime_icon(_value['mime'], _value['path']) , - href: base_url + _value.download_url, + href: base_url + _value.download_url }]; } else diff --git a/filemanager/js/app.js b/filemanager/js/app.js index eab45a3e21..913ab70d3e 100644 --- a/filemanager/js/app.js +++ b/filemanager/js/app.js @@ -123,7 +123,7 @@ app.classes.filemanager = AppJS.extend( state = JSON.parse(state); } } - var result = this._super.call(this,state); + var result = this._super.call(this, state, 'filemanager.index'); // This has to happen after the parent, changing to tile recreates // nm controller diff --git a/phpgwapi/js/jsapi/app_base.js b/phpgwapi/js/jsapi/app_base.js index f0b11870b2..083c716994 100644 --- a/phpgwapi/js/jsapi/app_base.js +++ b/phpgwapi/js/jsapi/app_base.js @@ -248,10 +248,10 @@ var AppJS = Class.extend( * * @param {{name: string, state: object}|string} state Object (or JSON string) for a state. * Only state is required, and its contents are application specific. - * + * @param {string} template template name to check, instead of trying all templates of current app * @return {boolean} false - Returns false to stop event propagation */ - setState: function(state) + setState: function(state, template) { // State should be an object, not a string, but we'll parse if(typeof state == "string") @@ -279,7 +279,7 @@ var AppJS = Class.extend( // Try and find a nextmatch widget, and set its filters var nextmatched = false; - var et2 = etemplate2.getByApplication(this.appname); + var et2 = template ? etemplate2.getByTemplate(template) : etemplate2.getByApplication(this.appname); for(var i = 0; i < et2.length; i++) { et2[i].widgetContainer.iterateOver(function(_widget) { @@ -297,11 +297,21 @@ var AppJS = Class.extend( if(nextmatched) return false; } - // Try a redirect to list // 'blank' is the special name for no filters, send that instead of the nice translated name var safe_name = jQuery.isEmptyObject(state) || jQuery.isEmptyObject(state.state||state.filter) ? 'blank' : state.name.replace(/[^A-Za-z0-9-_]/g, '_'); - egw.open('',this.appname,'list',{'favorite': safe_name},this.appname); + var url = '/'+this.appname+'/index.php'; + // Try a redirect to list, if app defines a "list" value in registry + if (egw.link_get_registry(this.appname, 'list')) + { + url = egw.link('/index.php', jQuery.extend({'favorite': safe_name}, egw.link_get_registry(this.appname, 'list'))); + } + // if no list try index value from application + else if (egw.app(this.appname).index) + { + url = egw.link('/index.php', 'menuaction='+egw.app(this.appname).index+'&favorite='+safe_name); + } + egw.open_link(url, undefined, undefined, this.appname); return false; }, @@ -705,9 +715,9 @@ var AppJS = Class.extend( return false; }, - + /** - * Fix scrolling iframe browsed by iPhone/iPod/iPad touch devices + * Fix scrolling iframe browsed by iPhone/iPod/iPad touch devices */ _fix_iFrameScrolling: function() { @@ -732,7 +742,7 @@ var AppJS = Class.extend( }); } }, - + /** * Set document title, uses getWindowTitle to get the correct title, * otherwise set it with uniqueID as default title @@ -745,11 +755,11 @@ var AppJS = Class.extend( document.title = this.et2._inst.uniqueId + ": " + title; } }, - + /** * Window title getter function in order to set the window title * this can be overridden on each application app.js file to customize the title value - * + * * @returns {string} window title */ getWindowTitle: function ()