- Export plugins now specify the export record class

- Projectmanager now has filters
This commit is contained in:
Nathan Gray 2016-05-04 19:34:30 +00:00
parent f9b551236c
commit 0eeb8b56c0
12 changed files with 119 additions and 23 deletions

View File

@ -422,6 +422,15 @@ class addressbook_export_contacts_csv implements importexport_iface_export_plugi
$this->selects['tid'][$tid] = $data['name'];
}
}
/**
* Get the class name for the egw_record to use while exporting
*
* @return string;
*/
public static function get_egw_record_class()
{
return 'addressbook_egw_record';
}
/**
* Adjust automatically generated filter fields

View File

@ -142,4 +142,13 @@ class addressbook_export_vcard implements importexport_iface_export_plugin {
'content' => 'all',
);
}
/**
* Get the class name for the egw_record to use while exporting
*
* @return string;
*/
public static function get_egw_record_class()
{
return 'addressbook_egw_record';
}
}

View File

@ -103,4 +103,14 @@ class admin_export_groups_csv implements importexport_iface_export_plugin
'preserv' => array('no_error_for_no_selection'),
);
}
/**
* Get the class name for the egw_record to use while exporting
*
* @return string;
*/
public static function get_egw_record_class()
{
return 'admin_egw_group_record';
}
}

View File

@ -109,4 +109,13 @@ class admin_export_users_csv implements importexport_iface_export_plugin
'preserv' => array('no_error_for_all'),
);
}
/**
* Get the class name for the egw_record to use while exporting
*
* @return string;
*/
public static function get_egw_record_class()
{
return 'admin_egw_user_record';
}
}

View File

@ -423,4 +423,14 @@ class calendar_export_csv implements importexport_iface_export_plugin {
}
}
}
/**
* Get the class name for the egw_record to use while exporting
*
* @return string;
*/
public static function get_egw_record_class()
{
return 'calendar_egw_record';
}
}

View File

@ -170,4 +170,13 @@ class calendar_export_ical extends calendar_export_csv {
$data = parent::get_selectors_etpl($definition);
return $data;
}
/**
* Get the class name for the egw_record to use while exporting
*
* @return string;
*/
public static function get_egw_record_class()
{
return 'calendar_egw_record';
}
}

View File

@ -68,7 +68,7 @@ class importexport_export_ui {
$content['appname'] = $_appname;
$preserv['appname'] = $_appname;
if(empty($_appname)) {
$et.setElementAttribute('select_definition','disabled',true);
$et->setElementAttribute('select_definition','disabled',true);
}
// Check for preferred definition

View File

@ -596,12 +596,12 @@ class importexport_helper_functions {
{
$fields = array();
try {
if($record_classname == null) $record_classname = $app_name . '_egw_record';
if(!class_exists($record_classname)) throw new Exception('Bad class name ' . $record_classname);
$plugin = is_object($plugin_name) ? $plugin_name : new $plugin_name();
$plugin_name = get_class($plugin);
if($record_classname == null) $record_classname = $plugin::get_egw_record_class();
if(!class_exists($record_classname)) throw new Exception('Bad class name ' . $record_classname);
if(!$wizard_plugin)
{
$wizard_name = $app_name . '_wizard_' . str_replace($app_name . '_', '', $plugin_name);

View File

@ -100,5 +100,15 @@ interface importexport_iface_export_plugin {
*/
public function get_selectors_etpl();
/**
* Get the class name for the egw_record to use while exporting
*
* importexport_iface_egw_record classes are used for a lot of field detection
* and automatic conversions. In most cases they are named <appname>_egw_record,
* but projectmanager is an exception to this.
*
* @return string;
*/
public static function get_egw_record_class();
} // end of iface_export_plugin
?>

View File

@ -266,4 +266,14 @@ class infolog_export_csv implements importexport_iface_export_plugin {
public static function convert(infolog_egw_record &$record) {
// Stub, for now
}
/**
* Get the class name for the egw_record to use while exporting
*
* @return string;
*/
public static function get_egw_record_class()
{
return 'infolog_egw_record';
}
}

View File

@ -194,4 +194,15 @@ class resources_export_csv implements importexport_iface_export_plugin {
if($this->selects[$field_name]) $settings['values'] = $this->selects[$field_name];
}
}
/**
* Get the class name for the egw_record to use while exporting
*
* @return string;
*/
public static function get_egw_record_class()
{
return 'resources_egw_record';
}
}

View File

@ -169,4 +169,13 @@ class timesheet_export_csv implements importexport_iface_export_plugin {
}
}
/**
* Get the class name for the egw_record to use while exporting
*
* @return string;
*/
public static function get_egw_record_class()
{
return 'timesheet_egw_record';
}
}