Commit 35a8f79d authored by Nigel McNie's avatar Nigel McNie
Browse files

Revert "Export resume dates in <content>, and in a custom element so Mahara...

Revert "Export resume dates in <content>, and in a custom element so Mahara <-> Mahara transfers will be able to work 100%."

After discussion with Simon Grant, and the resulting clarification to
the spec, we can export our text dates as labels for leap:date elements.

http://wiki.cetis.ac.uk/2009-03/LEAP2A_literals#Clarification_2009-07-14

This reverts commit 376f3a90.
parent f513b6aa
......@@ -252,18 +252,22 @@ abstract class LeapExportElementResumeCompositeChild extends LeapExportElement {
$this->smarty->assign('artefacttype', 'pseudo:' . $this->parentartefact->get('artefacttype'));
$this->smarty->assign('artefactplugin', 'resume');
$this->smarty->assign('id', 'portfolio:' . $this->get_id());
if (isset($this->entrydata['start']) && isset($this->entrydata['end'])) {
$this->entrydata['content'] .= "\n\n";
$lines = array();
if (isset($this->entrydata['start']) && $this->entrydata['start']) {
$lines[] = get_string('startdate', 'artefact.resume') . ': ' . $this->entrydata['start'];
}
if (isset($this->entrydata['end']) && $this->entrydata['end']) {
$lines[] = get_string('enddate', 'artefact.resume') . ': ' . $this->entrydata['end'];
}
$this->entrydata['content'] .= implode("\n", $lines);
}
foreach ($this->entrydata as $field => $value) {
if ($field == 'start' || $field == 'end') {
// Special case. Start and end are dates as per
// http://wiki.cetis.ac.uk/LEAP2A_types#activity - but Mahara
// allows date input for resume items as text fields. So we try
// and coerce them into "real" dates if possible.
// Unfortunately, strtotime isn't a mind reader, so this is
// going to result in some invalid dates...
if (($date = strtotime($value)) === false) {
// TODO What to do when we can't establish a real date?
}
else {
$this->smarty->assign($field . '_date', PluginExportLeap::format_rfc3339_date($date));
$this->smarty->assign($field . '_label', $value);
}
}
$this->smarty->assign($field, $value);
}
$this->smarty->assign('leaptype', $this->get_leap_type());
......
{include file="export:leap:entry.tpl" skipfooter=true}
{if $start || $end} <mahara:resumedate start="{$start|escape}" end="{$end|escape}"/>
{if $start_date} <leap:date leap:point="start" leap:label="{$start_label|escape}">{$start_date|escape}</leap:date>
{/if}
{if $end_date} <leap:date leap:point="end" leap:label="{$end_label|escape}">{$end_date|escape}</leap:date>
{/if}
{include file="export:leap:entryfooter.tpl"}
TODOs for export LEAP plugin
============================
* 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)
- rewrite links to views when the views are part of the export
......
Supports Markdown
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