MDL-69017 user: Show all links should work for students

This commit is contained in:
Andrew Nicols 2020-06-11 12:13:09 +08:00
parent 71a34a039f
commit d3bfae8fcc
2 changed files with 39 additions and 31 deletions

View file

@ -171,19 +171,17 @@ $participanttable->out($perpage, true);
$participanttablehtml = ob_get_contents();
ob_end_clean();
if ($bulkoperations) {
echo html_writer::start_tag('form', [
'action' => 'action_redir.php',
'method' => 'post',
'id' => 'participantsform',
'data-course-id' => $course->id,
'data-table-unique-id' => $participanttable->uniqueid,
'data-table-default-per-page' => ($perpage < DEFAULT_PAGE_SIZE) ? $perpage : DEFAULT_PAGE_SIZE,
]);
echo '<div>';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="hidden" name="returnto" value="'.s($PAGE->url->out(false)).'" />';
}
echo html_writer::start_tag('form', [
'action' => 'action_redir.php',
'method' => 'post',
'id' => 'participantsform',
'data-course-id' => $course->id,
'data-table-unique-id' => $participanttable->uniqueid,
'data-table-default-per-page' => ($perpage < DEFAULT_PAGE_SIZE) ? $perpage : DEFAULT_PAGE_SIZE,
]);
echo '<div>';
echo '<input type="hidden" name="sesskey" value="'.sesskey().'" />';
echo '<input type="hidden" name="returnto" value="'.s($PAGE->url->out(false)).'" />';
echo html_writer::tag(
'p',
@ -229,6 +227,10 @@ echo $OUTPUT->container(html_writer::link(
]
), [], 'showall');
$bulkoptions = (object) [
'uniqueid' => $participanttable->uniqueid,
];
if ($bulkoperations) {
echo '<br /><div class="buttons"><div class="form-inline">';
@ -310,15 +312,12 @@ if ($bulkoperations) {
echo '<input type="hidden" name="id" value="' . $course->id . '" />';
echo '<div class="d-none" data-region="state-help-icon">' . $OUTPUT->help_icon('publishstate', 'notes') . '</div>';
echo '</div></div></div>';
echo '</form>';
$options = (object) [
'uniqueid' => $participanttable->uniqueid,
'noteStateNames' => note_get_state_names(),
];
$PAGE->requires->js_call_amd('core_user/participants', 'init', [$options]);
$bulkoptions->noteStateNames = note_get_state_names();
}
echo '</form>';
$PAGE->requires->js_call_amd('core_user/participants', 'init', [$bulkoptions]);
echo '</div>'; // Userlist.
$enrolrenderer = $PAGE->get_renderer('core_enrol');