Esempio n. 1
0
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @package    mahara
 * @subpackage artefact-plans
 * @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
 *
 */
define('INTERNAL', 1);
define('MENUITEM', 'myportfolio/plans');
define('SECTION_PLUGINTYPE', 'artefact');
define('SECTION_PLUGINNAME', 'plans');
require dirname(dirname(dirname(__FILE__))) . '/init.php';
safe_require('artefact', 'plans');
$id = param_integer('id', 0);
if ($id) {
    $plan = new ArtefactTypePlan($id);
    if (!$USER->can_edit_artefact($plan)) {
        throw new AccessDeniedException(get_string('accessdenied', 'error'));
    }
    define('TITLE', get_string('newtask', 'artefact.plans'));
    $form = ArtefactTypeTask::get_form($id);
} else {
    define('TITLE', get_string('newplan', 'artefact.plans'));
    $form = ArtefactTypePlan::get_form();
}
$smarty =& smarty();
$smarty->assign_by_ref('form', $form);
$smarty->assign_by_ref('PAGEHEADING', hsc(TITLE));
$smarty->display('artefact:plans:new.tpl');
Esempio n. 2
0
/**
 *
 * @package    mahara
 * @subpackage artefact-plans
 * @author     Catalyst IT Ltd
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL version 3 or later
 * @copyright  For copyright information on Mahara, please see the README file distributed with this software.
 *
 */
define('INTERNAL', true);
define('MENUITEM', 'content/plans');
require_once dirname(dirname(dirname(dirname(__FILE__)))) . '/init.php';
require_once 'pieforms/pieform.php';
require_once 'pieforms/pieform/elements/calendar.php';
require_once get_config('docroot') . 'artefact/lib.php';
safe_require('artefact', 'plans');
if (!PluginArtefactPlans::is_active()) {
    throw new AccessDeniedException(get_string('plugindisableduser', 'mahara', get_string('plans', 'artefact.plans')));
}
define('TITLE', get_string('edittask', 'artefact.plans'));
$id = param_integer('id');
$task = new ArtefactTypeTask($id);
if (!$USER->can_edit_artefact($task)) {
    throw new AccessDeniedException(get_string('accessdenied', 'error'));
}
$form = ArtefactTypeTask::get_form($task->get('parent'), $task);
$smarty = smarty();
$smarty->assign('editform', $form);
$smarty->assign('PAGEHEADING', hsc(get_string("editingtask", "artefact.plans")));
$smarty->display('artefact:plans:edit.tpl');