Fix selection tab plugin data

This commit is contained in:
Nathan Gray 2013-01-21 18:59:33 +00:00
parent 4d3caf78fa
commit 3102550f37
3 changed files with 27 additions and 30 deletions

View File

@ -277,9 +277,11 @@ class calendar_export_csv implements importexport_iface_export_plugin {
'content' => array(
'plugin_override' => true, // Plugin overrides preferences
'selection' => $prefs['selection'] ? $prefs['selection'] : 'criteria',
'start' => is_object($start) ? $start->format('ts') : $start,
'end' => $end,
'owner' => $states['owner']
'criteria' => array(
'start' => is_object($start) ? $start->format('ts') : $start,
'end' => $end,
'owner' => $states['owner']
)
)
);
return $data;

View File

@ -150,13 +150,8 @@ class calendar_export_ical extends calendar_export_csv {
* returns selectors of this plugin
*
*/
public function get_selectors_etpl() {
return array(
'name' => 'calendar.export_csv_select',
'content' => array(
'start' => time(),
'end' => time()
)
);
public function get_selectors_etpl($definition = null) {
$data = parent::get_selectors_etpl($definition);
return $data;
}
}

View File

@ -173,24 +173,6 @@ class importexport_export_ui {
$content['plugin_options_template'] = $options;
}
}
$content['filter'] = $definition->filter;
$content['filter']['fields'] = importexport_helper_functions::get_filter_fields($_appname, $selected_plugin);
if(!$content['filter']['fields'])
{
$this->js->set_onload("\$j('input[value=\"filter\"]').parent().hide();");
$content['no_filter'] = true;
}
else
{
// Process relative dates into the current absolute date
foreach($content['filter']['fields'] as $field => $settings)
{
if($content['filter'][$field] && strpos($settings['type'],'date') === 0)
{
$content['filter'][$field] = importexport_helper_functions::date_rel2abs($content['filter'][$field]);
}
}
}
}
// fill selection tab
@ -209,7 +191,7 @@ class importexport_export_ui {
} else {
$options = $plugin_object->get_selectors_etpl($definition);
if(is_array($options)) {
$content['selection'] = $options['content'];
$content += is_array($options['content']) ? $options['content'] : array('selection' => $options['content']);
$sel_options += (array)$options['sel_options'];
$readonlys['selection'] = (array)$options['readonlys'];
$preserv['selection'] = (array)$options['preserv'];
@ -221,6 +203,24 @@ class importexport_export_ui {
if(!$content['plugin_selectors_html'] && !$content['plugin_selectors_template']) {
$readonlys[$tabs]['selection_tab'] = true;
}
$content['filter'] = $definition->filter;
$content['filter']['fields'] = importexport_helper_functions::get_filter_fields($_appname, $selected_plugin);
if(!$content['filter']['fields'])
{
$this->js->set_onload("\$j('input[value=\"filter\"]').parent().hide();");
$content['no_filter'] = true;
}
else
{
// Process relative dates into the current absolute date
foreach($content['filter']['fields'] as $field => $settings)
{
if($content['filter'][$field] && strpos($settings['type'],'date') === 0)
{
$content['filter'][$field] = importexport_helper_functions::date_rel2abs($content['filter'][$field]);
}
}
}
} elseif (!$_selection) {
$this->js->set_onload("
disable_button('exec[preview]');