Project: moodle
Issue MDL-40060: Replace add_to_log with an event trigger - mod_book
Replace the add_to_log calls for the following area, with a call to the get_legacy_logdata function in the event class. *mod/book (17 calls)* /mod/book/show.php:67: add_to_log($course->id, 'course', 'update mod', '../mod/book/view.php?id='.$cm->id, 'book '.$book->id); /mod/book/show.php:68: add_to_log($course->id, 'book', 'update', 'view.php?id='.$cm->id, $book->id, $cm->id); /mod/book/tool/exportimscp/index.php:46: add_to_log($course->id, 'book', 'exportimscp', 'tool/exportimscp/index.php?id='.$cm->id, $book->id, $cm->id); /mod/book/tool/importhtml/locallib.php:87: add_to_log($book->course, 'book', 'add chapter', 'view.php?id='.$context->instanceid.'&chapterid='.$chapter->id, $chapter->id, $context->instanceid); /mod/book/tool/importhtml/locallib.php:151: add_to_log($book->course, 'course', 'update mod', '../mod/book/view.php?id='.$context->instanceid, 'book '.$book->id); /mod/book/tool/print/index.php:80: add_to_log($course->id, 'book', 'print chapter', 'tool/print/index.php?id='.$cm->id.'&chapterid='.$chapter->id, $chapter->id, $cm->id); /mod/book/tool/print/index.php:123: add_to_log($course->id, 'book', 'print', 'tool/print/index.php?id='.$cm->id, $book->id, $cm->id); /mod/book/index.php:51: add_to_log($course->id, 'book', 'view all', 'index.php?id='.$course->id, ''); /mod/book/delete.php:71: add_to_log($course->id, 'course', 'update mod', '../mod/book/view.php?id='.$cm->id, 'book '.$book->id); /mod/book/delete.php:72: add_to_log($course->id, 'book', 'update', 'view.php?id='.$cm->id, $book->id, $cm->id); /mod/book/edit.php:78: add_to_log($course->id, 'course', 'update mod', '../mod/book/view.php?id='.$cm->id, 'book '.$book->id); /mod/book/edit.php:79: add_to_log($course->id, 'book', 'update chapter', 'view.php?id='.$cm->id.'&chapterid='.$data->id, $data->id, $cm->id); /mod/book/edit.php:104: add_to_log($course->id, 'course', 'update mod', '../mod/book/view.php?id='.$cm->id, 'book '.$book->id); /mod/book/edit.php:105: add_to_log($course->id, 'book', 'add chapter', 'view.php?id='.$cm->id.'&chapterid='.$data->id, $data->id, $cm->id); /mod/book/move.php:180: add_to_log($course->id, 'course', 'update mod', '../mod/book/view.php?id='.$cm->id, 'book '.$book->id); /mod/book/move.php:181: add_to_log($course->id, 'book', 'update', 'view.php?id='.$cm->id, $book->id, $cm->id); /mod/book/view.php:78: add_to_log($course->id, 'book', 'view', 'view.php?id='.$cm->id, $book->id, $cm->id); /mod/book/view.php:113: add_to_log($course->id, 'book', 'view chapter', 'view.php?id='.$cm->id.'&chapterid='.$chapter->id, $chapter->id, $cm->id);
Story points: 40