MDL-17465 - separate live log capability adn admin tree link; backported from HEAD
This commit is contained in:
@@ -35,8 +35,22 @@ $coursereport_log_capabilities = array(
|
||||
'admin' => CAP_ALLOW
|
||||
),
|
||||
|
||||
'clonepermissionsfrom' => 'moodle/site:viewreports',
|
||||
),
|
||||
|
||||
'coursereport/log:viewlive' => array(
|
||||
'riskbitmask' => RISK_PERSONAL,
|
||||
'captype' => 'read',
|
||||
'contextlevel' => CONTEXT_COURSE,
|
||||
'legacy' => array(
|
||||
'teacher' => CAP_ALLOW,
|
||||
'editingteacher' => CAP_ALLOW,
|
||||
'admin' => CAP_ALLOW
|
||||
),
|
||||
|
||||
'clonepermissionsfrom' => 'moodle/site:viewreports',
|
||||
)
|
||||
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
@@ -136,14 +136,6 @@
|
||||
print_heading(get_string('chooselogs') .':');
|
||||
|
||||
print_log_selector_form($course, $user, $date, $modname, $modid, $modaction, $group, $showcourses, $showusers, $logformat);
|
||||
|
||||
echo '<br />';
|
||||
print_heading(get_string('chooselivelogs') .':');
|
||||
|
||||
echo '<center><h3>';
|
||||
link_to_popup_window('/course/report/log/live.php?id='. $course->id,'livelog', get_string('livelogs'), 500, 800);
|
||||
echo '</h3></center>';
|
||||
|
||||
}
|
||||
|
||||
print_footer($course);
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php // $Id$
|
||||
// Display link to live logs in separate window
|
||||
|
||||
require_once('../../../config.php');
|
||||
require_once('../../lib.php');
|
||||
require_once('lib.php');
|
||||
require_once($CFG->libdir.'/adminlib.php');
|
||||
|
||||
$id = optional_param('id', 0, PARAM_INT);// Course ID
|
||||
|
||||
if (!$course = get_record('course', 'id', $id) ) {
|
||||
error('That\'s an invalid course id'.$id);
|
||||
}
|
||||
|
||||
require_login($course);
|
||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
|
||||
require_capability('coursereport/log:viewlive', $context);
|
||||
|
||||
$strlogs = get_string('logs');
|
||||
$strreports = get_string('reports');
|
||||
|
||||
if ($course->id == SITEID) {
|
||||
admin_externalpage_setup('reportloglive');
|
||||
admin_externalpage_print_header();
|
||||
|
||||
} else {
|
||||
$navlinks = array();
|
||||
$navlinks[] = array('name' => $strreports, 'link' => "$CFG->wwwroot/course/report.php?id=$course->id", 'type' => 'misc');
|
||||
$navlinks[] = array('name' => $strlogs, 'link' => null, 'type' => 'misc');
|
||||
$navigation = build_navigation($navlinks);
|
||||
print_header($course->shortname .': '. $strlogs, $course->fullname, $navigation, '');
|
||||
}
|
||||
|
||||
print_heading(get_string('loglive', 'coursereport_log'));
|
||||
|
||||
echo '<div class="info">';
|
||||
link_to_popup_window('/course/report/log/live.php?id='. $course->id,'livelog', get_string('livelogs'), 500, 800);
|
||||
echo '<div>';
|
||||
|
||||
print_footer($course);
|
||||
|
||||
?>
|
||||
@@ -14,7 +14,7 @@
|
||||
require_login($course);
|
||||
|
||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
||||
require_capability('coursereport/log:view', $context);
|
||||
require_capability('coursereport/log:viewlive', $context);
|
||||
|
||||
add_to_log($course->id, "course", "report live", "report/log/live.php?id=$course->id", $course->id);
|
||||
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
print_heading(get_string('chooselogs') .':');
|
||||
|
||||
print_log_selector_form($course);
|
||||
}
|
||||
|
||||
if (has_capability('coursereport/log:viewlive', $context)) {
|
||||
print_heading(get_string('chooselivelogs') .':');
|
||||
echo '<p>';
|
||||
link_to_popup_window('/course/report/log/live.php?id='. $course->id,'livelog', get_string('livelogs'), 500, 800);
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
// //
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
||||
$plugin->version = 2007101500;
|
||||
$plugin->version = 2007101502;
|
||||
$plugin->requires = 2007101532;
|
||||
|
||||
?>
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<?PHP // $Id$
|
||||
|
||||
$string['log:view'] = 'View course logs';
|
||||
$string['log:viewlive'] = 'View live logs';
|
||||
|
||||
$string['loglive'] = 'Live logs';
|
||||
|
||||
?>
|
||||
|
||||
@@ -2101,7 +2101,8 @@ body#course-info .generalbox.info {
|
||||
margin-right:5px;
|
||||
}
|
||||
|
||||
#course-report-log-index .info {
|
||||
#course-report-log-index .info,
|
||||
#course-report-log-indexlive .info {
|
||||
margin-left:auto;
|
||||
margin-right:auto;
|
||||
text-align:center;
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
// This is compared against the values stored in the database to determine
|
||||
// whether upgrades should be performed (see lib/db/*.php)
|
||||
|
||||
$version = 2007101532.02; // YYYYMMDD = date of the 1.9 branch (don't change)
|
||||
$version = 2007101532.03; // YYYYMMDD = date of the 1.9 branch (don't change)
|
||||
// X = release number 1.9.[0,1,2,3...]
|
||||
// Y.YY = micro-increments between releases
|
||||
|
||||
|
||||
Reference in New Issue
Block a user