* 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');
* 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 * @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', true); define('MENUITEM', 'myportfolio/myplans'); 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'); define('TITLE', get_string('editplan', 'artefact.plans')); $id = param_integer('id'); $artefact = new ArtefactTypePlan($id); if (!$USER->can_edit_artefact($artefact)) { throw new AccessDeniedException(get_string('accessdenied', 'error')); } $editform = ArtefactTypePlan::get_form($artefact); $smarty = smarty(); $smarty->assign('editform', $editform); $smarty->assign('PAGEHEADING', hsc(get_string("editingplan", "artefact.plans"))); $smarty->display('artefact:plans:edit.tpl');