mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-25 01:13:25 +01:00
Avoid some errors from apps/plugins that don't do filters
This commit is contained in:
parent
81a674cd8c
commit
21fdd9abf2
@ -130,7 +130,7 @@ class importexport_definition implements importexport_iface_egw_record {
|
|||||||
case 'plugin_options' :
|
case 'plugin_options' :
|
||||||
return $this->set_options($_data);
|
return $this->set_options($_data);
|
||||||
case 'filter':
|
case 'filter':
|
||||||
return $this->set_filter($_data);
|
return $this->set_filter((Array)$_data);
|
||||||
default :
|
default :
|
||||||
$this->definition[$_attribute_name] = $_data;
|
$this->definition[$_attribute_name] = $_data;
|
||||||
return;
|
return;
|
||||||
|
@ -194,7 +194,7 @@ class importexport_export_ui {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// fill selection tab
|
// fill selection tab
|
||||||
if($definition && $definition->plugin_options['selection'] && !$content['selection_passed']) {
|
if($definition && is_array($definition->plugin_options) && $definition->plugin_options['selection'] && !$content['selection_passed']) {
|
||||||
$_selection = $definition->plugin_options['selection'];
|
$_selection = $definition->plugin_options['selection'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -291,23 +291,26 @@ class importexport_export_ui {
|
|||||||
// Set filter
|
// Set filter
|
||||||
// Note that because not all dates are DB dates, the plugin has to handle them
|
// Note that because not all dates are DB dates, the plugin has to handle them
|
||||||
$filter = $definition->filter;
|
$filter = $definition->filter;
|
||||||
foreach($_content['filter'] as $key => $value)
|
if(is_array($_content['filter']))
|
||||||
{
|
{
|
||||||
// Handle multiple values
|
foreach($_content['filter'] as $key => $value)
|
||||||
if(!is_array($value) && strpos($value,',') !== false) $value = explode(',',$value);
|
|
||||||
|
|
||||||
$filter[$key] = $value;
|
|
||||||
|
|
||||||
// Skip empty values or empty ranges
|
|
||||||
if(!$value || is_array($value) && array_key_exists('from',$value) && !$value['from'] && !$value['to'] )
|
|
||||||
{
|
{
|
||||||
unset($filter[$key]);
|
// Handle multiple values
|
||||||
}
|
if(!is_array($value) && strpos($value,',') !== false) $value = explode(',',$value);
|
||||||
// If user selects an end date, they most likely want entries including that date
|
|
||||||
if(is_array($value) && array_key_exists('to',$value) && $value['to'] )
|
$filter[$key] = $value;
|
||||||
{
|
|
||||||
// Adjust time to 23:59:59
|
// Skip empty values or empty ranges
|
||||||
$filter[$key]['to'] = mktime(23,59,59,date('n',$value['to']),date('j',$value['to']),date('Y',$value['to']));
|
if(!$value || is_array($value) && array_key_exists('from',$value) && !$value['from'] && !$value['to'] )
|
||||||
|
{
|
||||||
|
unset($filter[$key]);
|
||||||
|
}
|
||||||
|
// If user selects an end date, they most likely want entries including that date
|
||||||
|
if(is_array($value) && array_key_exists('to',$value) && $value['to'] )
|
||||||
|
{
|
||||||
|
// Adjust time to 23:59:59
|
||||||
|
$filter[$key]['to'] = mktime(23,59,59,date('n',$value['to']),date('j',$value['to']),date('Y',$value['to']));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
unset($_content['filter']);
|
unset($_content['filter']);
|
||||||
|
Loading…
Reference in New Issue
Block a user