Commit 46278a80 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Pass leap2a namespace from plan importer to get_leap_dates


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent 31c42a9c
......@@ -151,14 +151,16 @@ class LeapImportPlans extends LeapImportArtefactPlugin {
// Set completiondate and completed status if we can find them
if ($artefact instanceof ArtefactTypeTask) {
$dates = PluginImportLeap::get_leap_dates($entry);
$namespaces = $importer->get_namespaces();
$ns = $importer->get_leap2a_namespace();
$dates = PluginImportLeap::get_leap_dates($entry, $namespaces, $ns);
if (!empty($dates['target']['value'])) {
$completiondate = strtotime($dates['target']['value']);
}
$artefact->set('completiondate', empty($completiondate) ? $artefact->get('mtime') : $completiondate);
$ns = $importer->get_leap2a_namespace();
if ($entry->xpath($ns . ':status[@' . $ns . ':stage="completed"]')) {
if ($entry->xpath($namespaces[$ns] . ':status[@' . $namespaces[$ns] . ':stage="completed"]')) {
$artefact->set('completed', 1);
}
}
......
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