MDL-40084 mod_data: Rename and move entries ex-/importer classes

Also:
- Extend test coverage
- Small bug fixes
- Codestyle
This commit is contained in:
Philipp Memmel
2023-07-01 20:42:01 +02:00
parent cf2c91dae2
commit fc13869f5a
19 changed files with 692 additions and 295 deletions
+3 -3
View File
@@ -98,11 +98,11 @@ if ($mform->is_cancelled()) {
$exporter = null;
switch ($formdata['exporttype']) {
case 'csv':
$exporter = new \mod_data\local\csv_exporter();
$exporter = new \mod_data\local\exporter\csv_entries_exporter();
$exporter->set_delimiter_name($formdata['delimiter_name']);
break;
case 'ods':
$exporter = new \mod_data\local\ods_exporter();
$exporter = new \mod_data\local\exporter\ods_entries_exporter();
break;
default:
throw new coding_exception('Invalid export format has been specified. '
@@ -110,7 +110,7 @@ if ($mform->is_cancelled()) {
}
$includefiles = !empty($formdata['includefiles']);
\mod_data\local\exporter_utils::data_exportdata($data->id, $fields, $selectedfields, $exporter, $currentgroup, $context,
\mod_data\local\exporter\utils::data_exportdata($data->id, $fields, $selectedfields, $exporter, $currentgroup, $context,
$exportuser, $exporttime, $exportapproval, $tags, $includefiles);
$count = $exporter->get_records_count();
$filename = clean_filename("{$data->name}-{$count}_record");