do NOT store actions in session or eT2 request, nor send for mobile devices skiped actions

This commit is contained in:
Ralf Becker 2017-04-04 16:52:25 +02:00
parent 786ad5b71b
commit dfbd0d2e6f
7 changed files with 31 additions and 18 deletions

View File

@ -1525,7 +1525,7 @@ window.egw_LAB.wait(function() {
{ {
$store_query = $query; $store_query = $query;
// Do not store these // Do not store these
foreach(array('options-cat_id','actions') as $key) foreach(array('options-cat_id','actions','action_links','placeholder_actions') as $key)
{ {
unset($store_query[$key]); unset($store_query[$key]);
} }

View File

@ -272,7 +272,9 @@ class Request
*/ */
protected function cleanup() protected function cleanup()
{ {
if (isset($this->data['content']['nm']) && is_array($this->data['content']['nm']['rows'])) if (isset($this->data['content']['nm']))
{
if (is_array($this->data['content']['nm']['rows']))
{ {
foreach(array_keys($this->data['content']['nm']['rows']) as $n) foreach(array_keys($this->data['content']['nm']['rows']) as $n)
{ {
@ -283,6 +285,9 @@ class Request
} }
//error_log(__METHOD__."() content[nm][rows]=".array2string($this->data['content']['nm']['rows'])); //error_log(__METHOD__."() content[nm][rows]=".array2string($this->data['content']['nm']['rows']));
} }
// do not store actions
unset($this->data['content']['nm']['actions'], $this->data['content']['nm']['action_links']);
}
} }
/** /**

View File

@ -808,6 +808,10 @@ class Nextmatch extends Etemplate\Widget
foreach((array)$actions as $id => $action) foreach((array)$actions as $id => $action)
{ {
if (!empty($action['hideOnMobile']) && Api\Header\UserAgent::mobile())
{
continue; // no need to send this action to client, specially document actions can be huge
}
// in case it's only selectbox id => label pairs // in case it's only selectbox id => label pairs
if (!is_array($action)) $action = array('caption' => $action); if (!is_array($action)) $action = array('caption' => $action);
if ($default_attrs) $action += $default_attrs; if ($default_attrs) $action += $default_attrs;

View File

@ -274,8 +274,12 @@ class calendar_uilist extends calendar_ui
$this->filter = $params['filter']; $this->filter = $params['filter'];
} }
} }
if (!$params['csv_export']) Api\Cache::setSession('calendar', 'calendar_list', $params);
if (!$params['csv_export'])
{
Api\Cache::setSession('calendar', 'calendar_list',
array_diff_key ($params, array_flip('rows', 'actions', 'action_links', 'placeholder_actions')));
}
// do we need to query custom fields and which // do we need to query custom fields and which
// Check stored preference if selectcols isn't available (ie: first call) // Check stored preference if selectcols isn't available (ie: first call)
$select_cols = $params['selectcols'] ? $params['selectcols'] : $GLOBALS['egw_info']['user']['preferences']['calendar']['nextmatch-calendar.list.rows']; $select_cols = $params['selectcols'] ? $params['selectcols'] : $GLOBALS['egw_info']['user']['preferences']['calendar']['nextmatch-calendar.list.rows'];

View File

@ -349,7 +349,6 @@ class filemanager_ui
'default_cols' => '!comment,ctime', // I columns to use if there's no user or default pref (! as first char uses all but the named columns), default all columns 'default_cols' => '!comment,ctime', // I columns to use if there's no user or default pref (! as first char uses all but the named columns), default all columns
'csv_fields' => false, // I false=disable csv export, true or unset=enable it with auto-detected fieldnames, 'csv_fields' => false, // I false=disable csv export, true or unset=enable it with auto-detected fieldnames,
//or array with name=>label or name=>array('label'=>label,'type'=>type) pairs (type is a eT widget-type) //or array with name=>label or name=>array('label'=>label,'type'=>type) pairs (type is a eT widget-type)
'actions' => static::get_actions(),
'row_id' => 'path', 'row_id' => 'path',
'row_modified' => 'mtime', 'row_modified' => 'mtime',
'parent_id' => 'dir', 'parent_id' => 'dir',
@ -359,6 +358,7 @@ class filemanager_ui
); );
$content['nm']['path'] = static::get_home_dir(); $content['nm']['path'] = static::get_home_dir();
} }
$content['nm']['actions'] = static::get_actions();
$content['nm']['home_dir'] = static::get_home_dir(); $content['nm']['home_dir'] = static::get_home_dir();
$content['nm']['view'] = $GLOBALS['egw_info']['user']['preferences']['filemanager']['nm_view']; $content['nm']['view'] = $GLOBALS['egw_info']['user']['preferences']['filemanager']['nm_view'];
@ -832,7 +832,8 @@ class filemanager_ui
// do NOT store query, if hierarchical data / children are requested // do NOT store query, if hierarchical data / children are requested
if (!$query['csv_export']) if (!$query['csv_export'])
{ {
Api\Cache::setSession('filemanager', 'index',$query); Api\Cache::setSession('filemanager', 'index',
array_diff_key ($query, array_flip('rows','actions','action_links','placeholder_actions')));
} }
if(!$query['path']) $query['path'] = static::get_home_dir(); if(!$query['path']) $query['path'] = static::get_home_dir();

View File

@ -316,8 +316,8 @@ class infolog_ui
unset($query['col_filter']['parent_id']); unset($query['col_filter']['parent_id']);
if(!$query['action']) if(!$query['action'])
{ {
unset($query['rows']); Api\Cache::setSession('infolog', $query['session_for'].'session_data',
Api\Cache::setSession('infolog', $query['session_for'].'session_data', $query); array_diff_key ($query, array_flip('rows','actions','action_links','placeholder_actions')));
} }
$query['actions'] = $this->get_actions($query); $query['actions'] = $this->get_actions($query);
$query['row_id'] = 'info_id'; $query['row_id'] = 'info_id';

View File

@ -934,7 +934,6 @@ class timesheet_ui extends timesheet_bo
'placeholder_actions' => array('add') 'placeholder_actions' => array('add')
); );
} }
$content['nm']['actions'] = $this->get_actions($content['nm']);
if($_GET['search']) if($_GET['search'])
{ {