diff --git a/etemplate/inc/class.etemplate.inc.php b/etemplate/inc/class.etemplate.inc.php index bbeff9866f..a5e2dbbf88 100644 --- a/etemplate/inc/class.etemplate.inc.php +++ b/etemplate/inc/class.etemplate.inc.php @@ -18,7 +18,7 @@ if (!isset($GLOBALS['egw_info'])) 'flags' => array( 'currentapp' => $_REQUEST['sessionid'] ? 'etemplate' : 'login', 'nonavbar' => true, - 'debug' => 'etemplate_new', + 'debug' => 'etemplate', ) ); include_once '../../header.inc.php'; @@ -174,7 +174,7 @@ class etemplate_new extends etemplate_widget_template @@ -419,7 +419,6 @@ class etemplate_new extends etemplate_widget_template * creates HTML from an eTemplate * * Compatibility function for calendar, which uses etemplate::show to generate html --> use etemplate_old class - * @todo Once etemplate_new is renamed to etemplate and we have an explicit etemplate_old class, change it at caller (egw. calendar) * * This is done by calling show_cell for each cell in the form. show_cell itself * calls show recursivly for each included eTemplate. @@ -445,10 +444,11 @@ class etemplate_new extends etemplate_widget_template } } -if ($GLOBALS['egw_info']['flags']['debug'] == 'etemplate_new') + +if ($GLOBALS['egw_info']['flags']['debug'] == 'etemplate') { $name = isset($_GET['name']) ? $_GET['name'] : 'timesheet.edit'; - $template = new etemplate_new(); + $template = new etemplate(); if (!$template->read($name)) { header('HTTP-Status: 404 Not Found'); diff --git a/etemplate/js/et2_core_legacyJSFunctions.js b/etemplate/js/et2_core_legacyJSFunctions.js index a28d25b968..96d77b310b 100644 --- a/etemplate/js/et2_core_legacyJSFunctions.js +++ b/etemplate/js/et2_core_legacyJSFunctions.js @@ -77,6 +77,11 @@ _val = _val.replace(/^xajax_doXMLHTTP\('etemplate\.([a-z]+_widget\.[a-zA-Z0-9_]+)\'/, "xajax_doXMLHTTP('"+egw.getAppName()+".$1.etemplate'"); } + + if (_val.indexOf('this.form.submit()') != -1) + { + _val = _val.replace('this.form.submit()','widget.getInstanceManager().submit()'); + } return _val; } diff --git a/etemplate/js/et2_extension_nextmatch.js b/etemplate/js/et2_extension_nextmatch.js index ff765ca56c..a45647c81c 100644 --- a/etemplate/js/et2_extension_nextmatch.js +++ b/etemplate/js/et2_extension_nextmatch.js @@ -1052,7 +1052,8 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader, { // Set onChange var input = select.input; - if(this.nextmatch.options.settings[name+"_onchange"]) + if (this.nextmatch.options.settings[name+"_onchange"] && + !this.nextmatch.options.settings[name+"_onchange"].match('/^this\.form\.submit();?$/')) { // Get the onchange function string var onchange = this.nextmatch.options.settings[name+"_onchange"]; @@ -1060,11 +1061,13 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader, { // Connect it to the onchange event of the input element input.change(this.nextmatch, et2_compileLegacyJS(onchange, this.nextmatch, input)); } - input.change(this.nextmatch, function(event) { - event.data.activeFilters[name] = input.val() - event.data.applyFilters(); - }); - + else // default request changed rows with new filters, previous this.form.submit() + { + input.change(this.nextmatch, function(event) { + event.data.activeFilters[name] = input.val(); + event.data.applyFilters(); + }); + } return select; },