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

@ -319,7 +319,7 @@ class addressbook_ui extends addressbook_bo
// Merge to email dialog needs the infolog types // Merge to email dialog needs the infolog types
$infolog = new infolog_bo(); $infolog = new infolog_bo();
$sel_options['info_type'] = $infolog->enums['type']; $sel_options['info_type'] = $infolog->enums['type'];
// dont show tid-selection if we have only one content_type // dont show tid-selection if we have only one content_type
// be a bit more sophisticated about it // be a bit more sophisticated about it
$availabletypes = array_keys($this->content_types); $availabletypes = array_keys($this->content_types);
@ -853,7 +853,7 @@ class addressbook_ui extends addressbook_bo
/** /**
* Unset the relevant column filters to clear a grouped view * Unset the relevant column filters to clear a grouped view
* *
* @param Array $query * @param Array $query
*/ */
protected function unset_grouped_filters(&$query) protected function unset_grouped_filters(&$query)
@ -1465,7 +1465,7 @@ window.egw_LAB.wait(function() {
$success += $loop_success; $success += $loop_success;
$failed += $loop_fail; $failed += $loop_fail;
} }
if ($extra[0]) if ($extra[0])
{ {
$grouped_contacts = array_merge($grouped_contacts,$extra); $grouped_contacts = array_merge($grouped_contacts,$extra);
} }
@ -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]);
} }
@ -1536,7 +1536,7 @@ window.egw_LAB.wait(function() {
{ {
$old_state = Api\Cache::getSession('addressbook', $what); $old_state = Api\Cache::getSession('addressbook', $what);
} }
if (!isset($this->grouped_views[(string) $query['grouped_view']]) || strpos($query['grouped_view'],':') === false) if (!isset($this->grouped_views[(string) $query['grouped_view']]) || strpos($query['grouped_view'],':') === false)
{ {
// we don't have a grouped view, unset the according col_filters // we don't have a grouped view, unset the according col_filters
$this->unset_grouped_filters($query); $this->unset_grouped_filters($query);

View File

@ -272,16 +272,21 @@ 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']))
{ {
foreach(array_keys($this->data['content']['nm']['rows']) as $n) if (is_array($this->data['content']['nm']['rows']))
{ {
if (is_int($n)) foreach(array_keys($this->data['content']['nm']['rows']) as $n)
{ {
unset($this->data['content']['nm']['rows'][$n]); if (is_int($n))
{
unset($this->data['content']['nm']['rows'][$n]);
}
} }
//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

@ -327,7 +327,7 @@ class timesheet_ui extends timesheet_bo
'view' => $view, 'view' => $view,
'tabs' => $content['tabs'], 'tabs' => $content['tabs'],
'link_to' => array( 'link_to' => array(
'to_id' => $this->data['ts_id'] ? $this->data['ts_id'] : 'to_id' => $this->data['ts_id'] ? $this->data['ts_id'] :
($this->data['link_to']['to_id'] ? $this->data['link_to']['to_id'] : $content['link_to']['to_id']), ($this->data['link_to']['to_id'] ? $this->data['link_to']['to_id'] : $content['link_to']['to_id']),
'to_app' => TIMESHEET_APP, 'to_app' => TIMESHEET_APP,
), ),
@ -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'])
{ {
@ -1322,7 +1321,7 @@ class timesheet_ui extends timesheet_bo
{ {
$original_id = $this->data['ts_id']; $original_id = $this->data['ts_id'];
unset($this->data['ts_id']); unset($this->data['ts_id']);
$this->data['ts_title'] = lang('Copy of:') . ' ' .$this->data['ts_title']; $this->data['ts_title'] = lang('Copy of:') . ' ' .$this->data['ts_title'];
unset($this->data['ts_modified']); unset($this->data['ts_modified']);
unset($this->data['ts_modifier']); unset($this->data['ts_modifier']);