Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
show an error page instead of no users in box
Browse files Browse the repository at this point in the history
  • Loading branch information
chadmazilly committed Jun 1, 2017
1 parent 0400731 commit 3946f9e
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions email.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,19 @@
}
}

// if we have no users to email, show an error page with explanation and a link back
if (empty($users)) {
echo $OUTPUT->header();
echo $OUTPUT->heading($blockname);
echo $OUTPUT->notification(quickmail::_s('no_usergroups'), 'notifyproblem');

echo html_writer::start_tag('div', array('class' => 'no-overflow'));
echo html_writer::link(new moodle_url('/course/view.php', ['id' => $courseid]), 'Back to previous page', null);
echo html_writer::end_tag('div');

echo $OUTPUT->footer();
}

// we are presenting the form with values populated from either the log or drafts table in the db
if (!empty($type)) {

Expand Down

0 comments on commit 3946f9e

Please sign in to comment.