Commit 7f118f46 authored by Richard Mansfield's avatar Richard Mansfield
Browse files

Make sure pieforms.js is included on view access and view view pages

parent 03cbfafc
......@@ -52,8 +52,6 @@ if (!$USER->can_edit_view($view)) {
throw new AccessDeniedException();
}
$smarty = smarty(array('tablerenderer'), pieform_element_calendar_get_headdata(pieform_element_calendar_configure(array())), array('mahara' => array('From', 'To')));
$js = '';
if (!count_records('block_instance', 'view', $view->get('id'))) {
$confirmmessage = get_string('reallyaddaccesstoemptyview', 'view');
......@@ -325,10 +323,13 @@ function editaccess_submit(Pieform $form, $values) {
}
$form = pieform($form);
$smarty = smarty(array('tablerenderer'), pieform_element_calendar_get_headdata(pieform_element_calendar_configure(array())), array('mahara' => array('From', 'To')));
$smarty->assign('INLINEJAVASCRIPT', $js);
$smarty->assign('pagetitle', TITLE);
$smarty->assign('heading', TITLE);
$smarty->assign('form', pieform($form));
$smarty->assign('form', $form);
$smarty->display('view/access.tpl');
?>
......@@ -118,6 +118,16 @@ feedbacklist.statevars.push('view');
feedbacklist.updateOnLoad();
EOF;
$anonfeedback = !$USER->is_logged_in() && ($usertoken || $viewid == get_view_from_token(get_cookie('viewaccess:'.$viewid)));
if ($USER->is_logged_in() || $anonfeedback) {
$addfeedbackform = pieform(add_feedback_form($allowattachments));
}
if ($USER->is_logged_in()) {
$objectionform = pieform(objection_form());
}
$smarty = smarty(
array('mahara', 'tablerenderer', 'feedbacklist', 'artefact/resume/resumeshowhide.js'),
array('<link rel="stylesheet" type="text/css" href="' . get_config('wwwroot') . 'theme/views.css">'),
......@@ -157,8 +167,6 @@ if ($mnetviewlist = $SESSION->get('mnetviewaccess')) {
}
}
$anonfeedback = !$USER->is_logged_in() && ($usertoken || $viewid == get_view_from_token(get_cookie('viewaccess:'.$viewid)));
$smarty->assign('SIDEBARS', false);
$smarty->assign('ownername', $view->formatted_owner());
$smarty->assign('streditviewbutton', ($new) ? get_string('backtocreatemyview', 'view') : get_string('editmyview', 'view'));
......@@ -166,11 +174,11 @@ $smarty->assign('viewdescription', $view->get('description'));
$smarty->assign('viewcontent', $view->build_columns());
$smarty->assign('releaseform', $releaseform);
$smarty->assign('anonfeedback', $anonfeedback);
if ($USER->is_logged_in() || $anonfeedback) {
$smarty->assign('addfeedbackform', pieform(add_feedback_form($allowattachments)));
if (isset($addfeedbackform)) {
$smarty->assign('addfeedbackform', $addfeedbackform);
}
if ($USER->is_logged_in()) {
$smarty->assign('objectionform', pieform(objection_form()));
if (isset($objectionform)) {
$smarty->assign('objectionform', $objectionform);
}
$smarty->assign('viewbeingwatched', $viewbeingwatched);
......
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