Commit ee09b424 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Leap export for plans plugin (bug #617126)


Signed-off-by: default avatarRichard Mansfield <richardm@catalyst.net.nz>
parent bddd8eb2
<?php
/**
* Mahara: Electronic portfolio, weblog, resume builder and social networking
* Copyright (C) 2006-2009 Catalyst IT Ltd and others; see:
* http://wiki.mahara.org/Contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @package mahara
* @subpackage artefact-plans-export-leap
* @author Catalyst IT Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL
* @copyright (C) 2006-2009 Catalyst IT Ltd http://catalyst.net.nz
*
*/
defined('INTERNAL') || die();
class LeapExportElementPlan extends LeapExportElement {
public function get_leap_type() {
return 'plan';
}
public function get_template_path() {
return 'export:leap/plans:plan.tpl';
}
}
class LeapExportElementTask extends LeapExportElementPlan {
public function assign_smarty_vars() {
parent::assign_smarty_vars();
$this->smarty->assign('completion', $this->artefact->get('completed') ? 'completed' : 'planned');
}
public function get_dates() {
return array(
array(
'point' => 'target',
'date' => format_date($this->artefact->get('completiondate'), 'strftimew3cdate'),
),
);
}
}
?>
{include file="export:leap:entry.tpl" skipfooter=true}
{if $completion} <leap:status leap:stage="{$completion}" />{/if}
{include file="export:leap:entryfooter.tpl"}
......@@ -650,6 +650,7 @@ class LeapExportElement {
$this->smarty->assign('contenttype', $this->get_content_type());
$this->smarty->assign('leaptype', $this->get_leap_type());
$this->smarty->assign('author', $this->get_entry_author());
$this->smarty->assign('dates', $this->get_dates());
if ($tags = $this->artefact->get('tags')) {
$tags = array_map(create_function('$a',
......@@ -832,6 +833,15 @@ class LeapExportElement {
return $this->artefact->get('authorname');
}
/**
* Get leap:date items for the entry
*
* @return array
*/
public function get_dates() {
return array();
}
/**
* The relationship this artefact has to a view.
* Almost always is_part_of, but could also be supports or anything else.
......
......@@ -13,6 +13,9 @@
{if $artefacttype} <mahara:artefactplugin mahara:type="{$artefacttype}" mahara:plugin="{$artefactplugin}"/>{/if}
{include file="export:leap:links.tpl"}
{include file="export:leap:categories.tpl"}
{foreach from=$dates item=date}
<leap:date leap:point="{$date.point}"{if $date.label} leap:label="{$date.label}"{/if}>{$date.date}</leap:date>
{/foreach}
{if !$skipfooter}
{include file="export:leap:entryfooter.tpl"}
{/if}
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