mirror of
https://github.com/moodle/moodle.git
synced 2025-08-04 16:36:37 +02:00
MDL-17465 - separate live log capability adn admin tree link
This commit is contained in:
parent
c25cedf2a5
commit
e0f81e94a6
10 changed files with 68 additions and 12 deletions
|
@ -1,4 +1,5 @@
|
||||||
<?php // $Id$
|
<?php // $Id$
|
||||||
// just a link to course report
|
// just a link to course report
|
||||||
$ADMIN->add('reports', new admin_externalpage('reportlog', get_string('log', 'admin'), "$CFG->wwwroot/course/report/log/index.php?id=".SITEID, 'coursereport/log:view'));
|
$ADMIN->add('reports', new admin_externalpage('reportlog', get_string('log', 'admin'), "$CFG->wwwroot/course/report/log/index.php?id=".SITEID, 'coursereport/log:view'));
|
||||||
|
$ADMIN->add('reports', new admin_externalpage('reportloglive', get_string('loglive', 'coursereport_log'), "$CFG->wwwroot/course/report/log/indexlive.php?id=".SITEID, 'coursereport/log:viewlive'));
|
||||||
?>
|
?>
|
|
@ -35,8 +35,22 @@ $coursereport_log_capabilities = array(
|
||||||
'admin' => CAP_ALLOW
|
'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',
|
'clonepermissionsfrom' => 'moodle/site:viewreports',
|
||||||
)
|
)
|
||||||
|
|
||||||
);
|
);
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -137,14 +137,6 @@
|
||||||
print_heading(get_string('chooselogs') .':');
|
print_heading(get_string('chooselogs') .':');
|
||||||
|
|
||||||
print_log_selector_form($course, $user, $date, $modname, $modid, $modaction, $group, $showcourses, $showusers, $logformat);
|
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);
|
print_footer($course);
|
||||||
|
|
43
course/report/log/indexlive.php
Normal file
43
course/report/log/indexlive.php
Normal file
|
@ -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 = $DB->get_record('course', array('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);
|
require_login($course);
|
||||||
|
|
||||||
$context = get_context_instance(CONTEXT_COURSE, $course->id);
|
$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);
|
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_heading(get_string('chooselogs') .':');
|
||||||
|
|
||||||
print_log_selector_form($course);
|
print_log_selector_form($course);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (has_capability('coursereport/log:viewlive', $context)) {
|
||||||
print_heading(get_string('chooselivelogs') .':');
|
print_heading(get_string('chooselivelogs') .':');
|
||||||
echo '<p>';
|
echo '<p>';
|
||||||
link_to_popup_window('/course/report/log/live.php?id='. $course->id,'livelog', get_string('livelogs'), 500, 800);
|
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;
|
$plugin->requires = 2007101532;
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
<?PHP // $Id$
|
<?PHP // $Id$
|
||||||
|
|
||||||
$string['log:view'] = 'View course logs';
|
$string['log:view'] = 'View course logs';
|
||||||
|
$string['log:viewlive'] = 'View live logs';
|
||||||
|
|
||||||
|
$string['loglive'] = 'Live logs';
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
|
@ -2389,7 +2389,8 @@ body#course-info .generalbox.info {
|
||||||
margin-right:5px;
|
margin-right:5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
#course-report-log-index .info {
|
#course-report-log-index .info,
|
||||||
|
#course-report-log-indexlive .info {
|
||||||
margin-left:auto;
|
margin-left:auto;
|
||||||
margin-right:auto;
|
margin-right:auto;
|
||||||
text-align:center;
|
text-align:center;
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
// This is compared against the values stored in the database to determine
|
// This is compared against the values stored in the database to determine
|
||||||
// whether upgrades should be performed (see lib/db/*.php)
|
// whether upgrades should be performed (see lib/db/*.php)
|
||||||
|
|
||||||
$version = 2008112900; // YYYYMMDD = date of the last version bump
|
$version = 2008112901; // YYYYMMDD = date of the last version bump
|
||||||
// XX = daily increments
|
// XX = daily increments
|
||||||
|
|
||||||
$release = '2.0 dev (Build: 20081128)'; // Human-friendly version name
|
$release = '2.0 dev (Build: 20081128)'; // Human-friendly version name
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue