forked from extern/egroupware
- Add in any missing filter/left/right header select options from favorites or other changes instead of rejecting. Server side get_rows is responsible for actually providing the missing option(s)
- Propagate changed exec_id to controller
This commit is contained in:
parent
a5e0ee9cd0
commit
ab4873553b
@ -328,7 +328,8 @@ class etemplate_widget_nextmatch extends etemplate_widget
|
||||
// Check for anything changed in the query
|
||||
// Tell the client about the changes
|
||||
$request_value =& self::get_array(self::$request->content, $form_name,true);
|
||||
$no_rows = false;
|
||||
$changes = $no_rows = false;
|
||||
|
||||
foreach($value_in as $key => $original_value)
|
||||
{
|
||||
// These keys are ignored
|
||||
@ -341,6 +342,7 @@ class etemplate_widget_nextmatch extends etemplate_widget
|
||||
// These keys we don't send row data back, as they cause a partial reload
|
||||
if(in_array($key, array('template'))) $no_rows = true;
|
||||
|
||||
$changes = true;
|
||||
$request_value[$key] = $value[$key];
|
||||
|
||||
egw_json_response::get()->generic('assign', array(
|
||||
@ -350,6 +352,13 @@ class etemplate_widget_nextmatch extends etemplate_widget
|
||||
'value' => $value[$key],
|
||||
));
|
||||
}
|
||||
// Request doesn't handle changing by reference, so force it
|
||||
if($changes)
|
||||
{
|
||||
$content = self::$request->content;
|
||||
self::$request->content = array();
|
||||
self::$request->content = $content;
|
||||
}
|
||||
if($no_rows) $rows = Array();
|
||||
|
||||
$row_id = isset($value['row_id']) ? $value['row_id'] : 'id';
|
||||
|
@ -125,8 +125,10 @@ var et2_dataview_controller = Class.extend({
|
||||
* The update function queries the server for changes in the currently
|
||||
* managed index range -- those changes are then merged into the current
|
||||
* view without a complete rebuild of every row.
|
||||
*
|
||||
* @param {boolean} clear
|
||||
*/
|
||||
update: function () {
|
||||
update: function (clear) {
|
||||
// Clear the fetch queue
|
||||
this._queue = {};
|
||||
this._clearTimer();
|
||||
@ -136,6 +138,10 @@ var et2_dataview_controller = Class.extend({
|
||||
// TODO: Actually stuff here should be done if the server responds that
|
||||
// there at all were some changes (needs implementation of "refresh")
|
||||
|
||||
if(clear)
|
||||
{
|
||||
this._grid.clear();
|
||||
}
|
||||
// Remove all rows which are outside the view range
|
||||
this._grid.cleanup();
|
||||
|
||||
|
@ -1834,6 +1834,20 @@ var et2_nextmatch_header_bar = et2_DOMWidget.extend(et2_INextmatchHeader,
|
||||
{
|
||||
value = mgr.getEntry(child.id);
|
||||
if (value == null) value = '';
|
||||
/**
|
||||
* Sometimes a filter value is not in current options. This can
|
||||
* happen in a saved favorite, for example, or if server changes
|
||||
* some filter options, and the order doesn't work out. The normal behaviour
|
||||
* is to warn & not set it, but for nextmatch we'll just add it
|
||||
* in, and let the server either set it properly, or ignore.
|
||||
*/
|
||||
if(value && child.instanceOf(et2_selectbox) && typeof child.options.select_options[value] == 'undefined')
|
||||
{
|
||||
var old_options = child.options.select_options;
|
||||
// Actual label is not available, obviously, or it would be there
|
||||
old_options[value] = child.egw().lang("Loading");
|
||||
child.set_select_options(old_options);
|
||||
}
|
||||
child.set_value(value);
|
||||
}
|
||||
if(typeof child.get_value == "function" && child.id)
|
||||
|
@ -296,7 +296,7 @@ var et2_nextmatch_controller = et2_dataview_controller.extend(et2_IDataProvider,
|
||||
// Pass the fetch call to the API, multiplex the data about the
|
||||
// nextmatch instance into the call.
|
||||
this.egw.dataFetch(
|
||||
this._execId,
|
||||
this._widget.getInstanceManager().etemplate_exec_id || this._execId,
|
||||
_queriedRange,
|
||||
this._filters,
|
||||
this._widgetId,
|
||||
@ -305,8 +305,10 @@ var et2_nextmatch_controller = et2_dataview_controller.extend(et2_IDataProvider,
|
||||
},
|
||||
|
||||
dataRegisterUID: function (_uid, _callback, _context) {
|
||||
this.egw.dataRegisterUID(_uid, _callback, _context, this._execId,
|
||||
this._widgetId);
|
||||
this.egw.dataRegisterUID(_uid, _callback, _context,
|
||||
this._widget.getInstanceManager().etemplate_exec_id || this._execId,
|
||||
this._widgetId
|
||||
);
|
||||
},
|
||||
|
||||
dataUnregisterUID: function () {
|
||||
|
Loading…
Reference in New Issue
Block a user