Commit 0439ed93 authored by Nigel McNie's avatar Nigel McNie
Browse files

Proper granular export: always export artefacts for views.

parent 4626a379
......@@ -5,8 +5,5 @@ See individual plugin directories for TODOs relating to them. This list isn't
exhaustive, it's mostly for Nigel's short term planning benefit.
Admin export UI
Granular export:
- check export constructor correctly sets up $this->views and $this->artefacts
for all possible modes of export
Clean up exports sitting around on disk
Split creation of archives from the export() method so it can be implemented in the base class
TODOs for export HTML plugin
============================
* Granular export: Check that we respect $this->views and $this->artefacts correctly
* i18n
* G&D
* Documentation
......
TODOs for export LEAP plugin
============================
* Granular export: Check that we respect $this->views and $this->artefacts correctly
* Resume dates on export - can't export them as leap:dates, it has to be in the content, yet we have to import them again properly too
* Export views properly!
- flag artefacts in the export properly that aren't otherwise surrounded by <a> or similar (e.g. blogs)
......
......@@ -207,16 +207,13 @@ abstract class PluginExport extends Plugin {
}
// Get the list of artefacts to export
// TODO: make sure when exporting views, all artefacts in those views
// are included regardless of whether they've been selected to be
// exported or not
if ($artefacts == self::EXPORT_ALL_ARTEFACTS) {
$tmpartefacts = get_column('artefact', 'id', 'owner', $userid);
$this->artefactexportmode = $artefacts;
}
else if ($artefacts == self::EXPORT_ARTEFACTS_FOR_VIEWS) {
else {
if ($tmpviews) {
$sql = "SELECT va.artefact
$sql = "SELECT DISTINCT va.artefact
FROM {view_artefact} va
LEFT JOIN {view} v ON v.id = va.view
WHERE v.owner = ?
......@@ -226,14 +223,13 @@ abstract class PluginExport extends Plugin {
// Some artefacts are not inside the view, but still need to be exported with it
$tmpartefacts = array_unique(array_merge($tmpartefacts, $this->get_view_extra_artefacts()));
}
if ($artefacts == self::EXPORT_ARTEFACTS_FOR_VIEWS) {
$this->artefactexportmode = $artefacts;
}
else {
$tmpartefacts = array();
$tmpartefacts = array_unique(array_merge($tmpartefacts, $artefacts));
$this->artefactexportmode = self::EXPORT_LIST_OF_ARTEFACTS;
}
$this->artefactexportmode = $artefacts;
}
else {
$tmpartefacts = $artefacts;
$this->artefactexportmode = self::EXPORT_LIST_OF_ARTEFACTS;
}
$typestoplugins = get_records_assoc('artefact_installed_type');
foreach ($tmpartefacts as $a) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment