mirror of
https://github.com/moodle/moodle.git
synced 2025-08-05 00:46:50 +02:00
MDL-10181, user management improvements fixes
This commit is contained in:
parent
0a5a42ed76
commit
c55dee3fa9
12 changed files with 127 additions and 109 deletions
|
@ -15,6 +15,8 @@ if (!$note = note_load($noteid)) {
|
|||
if (!$course = get_record('course', 'id', $note->courseid)) {
|
||||
error('Incorrect course id found');
|
||||
}
|
||||
// require login to access notes
|
||||
require_login($course->id);
|
||||
|
||||
// locate context information
|
||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
|
@ -54,7 +56,6 @@ if ($formdata = $noteform->get_data()){
|
|||
$note->userid = $formdata->user;
|
||||
$note->content = $formdata->content;
|
||||
$note->format = FORMAT_PLAIN;
|
||||
$note->rating = $formdata->rating;
|
||||
$note->publishstate = $formdata->publishstate;
|
||||
if (note_save($note)) {
|
||||
add_to_log($note->courseid, 'notes', 'update', 'index.php?course='.$note->courseid.'&user='.$note->userid . '#note-' . $note->id, 'update note');
|
||||
|
@ -74,9 +75,10 @@ if($noteform->is_submitted()) {
|
|||
$note->note = $note->id;
|
||||
}
|
||||
$noteform->set_data($note);
|
||||
$strnotes = get_string('notes', 'notes');
|
||||
$strnotes = get_string('editnote', 'notes');
|
||||
|
||||
// output HTML
|
||||
print_header($course->shortname . ': ' . $strnotes, $course->fullname);
|
||||
$crumbs = array(array('name' => $strnotes, 'link' => '', 'type' => 'activity'));
|
||||
print_header($course->shortname . ': ' . $strnotes, $course->fullname, build_navigation($crumbs));
|
||||
$noteform->display();
|
||||
print_footer();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue