mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
Merge branch 'MDL-32124_22_wip' of git://github.com/grabs/moodle into MOODLE_22_STABLE
This commit is contained in:
commit
ec01a02d8b
1 changed files with 25 additions and 6 deletions
|
@ -33,7 +33,7 @@ $id = required_param('id', PARAM_INT);
|
||||||
$subject = optional_param('subject', '', PARAM_CLEANHTML);
|
$subject = optional_param('subject', '', PARAM_CLEANHTML);
|
||||||
$message = optional_param('message', '', PARAM_CLEANHTML);
|
$message = optional_param('message', '', PARAM_CLEANHTML);
|
||||||
$format = optional_param('format', FORMAT_MOODLE, PARAM_INT);
|
$format = optional_param('format', FORMAT_MOODLE, PARAM_INT);
|
||||||
$messageuser = optional_param('messageuser', false, PARAM_INT);
|
$messageuser = optional_param_array('messageuser', false, PARAM_INT);
|
||||||
$action = optional_param('action', '', PARAM_ALPHA);
|
$action = optional_param('action', '', PARAM_ALPHA);
|
||||||
$perpage = optional_param('perpage', FEEDBACK_DEFAULT_PAGE_COUNT, PARAM_INT); // how many per page
|
$perpage = optional_param('perpage', FEEDBACK_DEFAULT_PAGE_COUNT, PARAM_INT); // how many per page
|
||||||
$showall = optional_param('showall', false, PARAM_INT); // should we show all users
|
$showall = optional_param('showall', false, PARAM_INT); // should we show all users
|
||||||
|
@ -80,9 +80,31 @@ if (($formdata = data_submitted()) AND !confirm_sesskey()) {
|
||||||
print_error('invalidsesskey');
|
print_error('invalidsesskey');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$strfeedbacks = get_string("modulenameplural", "feedback");
|
||||||
|
$strfeedback = get_string("modulename", "feedback");
|
||||||
|
|
||||||
require_capability('mod/feedback:viewreports', $context);
|
require_capability('mod/feedback:viewreports', $context);
|
||||||
|
|
||||||
if ($action == 'sendmessage' AND has_capability('moodle/course:bulkmessaging', $coursecontext)) {
|
if ($action == 'sendmessage' AND has_capability('moodle/course:bulkmessaging', $coursecontext)) {
|
||||||
|
$shortname = format_string($course->shortname,
|
||||||
|
true,
|
||||||
|
array('context' => get_context_instance(CONTEXT_COURSE, $course->id)));
|
||||||
|
|
||||||
|
$htmlmessage = "<body id=\"email\">";
|
||||||
|
|
||||||
|
$link1 = $CFG->wwwroot.'/course/view.php?id='.$course->id;
|
||||||
|
$link2 = $CFG->wwwroot.'/mod/feedback/index.php?id='.$course->id;
|
||||||
|
$link3 = $CFG->wwwroot.'/mod/feedback/view.php?id='.$cm->id;
|
||||||
|
|
||||||
|
$htmlmessage .= '<div class="navbar">'.
|
||||||
|
'<a target="_blank" href="'.$link1.'">'.$shortname.'</a> » '.
|
||||||
|
'<a target="_blank" href="'.$link2.'">'.$strfeedbacks.'</a> » '.
|
||||||
|
'<a target="_blank" href="'.$link3.'">'.format_string($feedback->name, true).'</a>'.
|
||||||
|
'</div>';
|
||||||
|
|
||||||
|
$htmlmessage .= $message;
|
||||||
|
$htmlmessage .= '</body>';
|
||||||
|
|
||||||
$good = 1;
|
$good = 1;
|
||||||
if (is_array($messageuser)) {
|
if (is_array($messageuser)) {
|
||||||
foreach ($messageuser as $userid) {
|
foreach ($messageuser as $userid) {
|
||||||
|
@ -93,9 +115,9 @@ if ($action == 'sendmessage' AND has_capability('moodle/course:bulkmessaging', $
|
||||||
$eventdata->userfrom = $USER;
|
$eventdata->userfrom = $USER;
|
||||||
$eventdata->userto = $senduser;
|
$eventdata->userto = $senduser;
|
||||||
$eventdata->subject = $subject;
|
$eventdata->subject = $subject;
|
||||||
$eventdata->fullmessage = $message;
|
$eventdata->fullmessage = html_to_text($htmlmessage);
|
||||||
$eventdata->fullmessageformat = FORMAT_PLAIN;
|
$eventdata->fullmessageformat = FORMAT_PLAIN;
|
||||||
$eventdata->fullmessagehtml = '';
|
$eventdata->fullmessagehtml = $htmlmessage;
|
||||||
$eventdata->smallmessage = '';
|
$eventdata->smallmessage = '';
|
||||||
$good = $good && message_send($eventdata);
|
$good = $good && message_send($eventdata);
|
||||||
}
|
}
|
||||||
|
@ -114,9 +136,6 @@ if ($action == 'sendmessage' AND has_capability('moodle/course:bulkmessaging', $
|
||||||
////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////
|
||||||
|
|
||||||
/// Print the page header
|
/// Print the page header
|
||||||
$strfeedbacks = get_string("modulenameplural", "feedback");
|
|
||||||
$strfeedback = get_string("modulename", "feedback");
|
|
||||||
|
|
||||||
$PAGE->navbar->add(get_string('show_nonrespondents', 'feedback'));
|
$PAGE->navbar->add(get_string('show_nonrespondents', 'feedback'));
|
||||||
$PAGE->set_heading(format_string($course->fullname));
|
$PAGE->set_heading(format_string($course->fullname));
|
||||||
$PAGE->set_title(format_string($feedback->name));
|
$PAGE->set_title(format_string($feedback->name));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue