forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MDL-29030 update completion block to use migrated report
- Loading branch information
Showing
3 changed files
with
35 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
<?php | ||
|
||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
|
@@ -15,15 +14,19 @@ | |
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
|
||
/** | ||
* Block for displayed logged in user's course completion status | ||
* | ||
* @package moodlecore | ||
* @copyright 2009 Catalyst IT Ltd | ||
* @author Aaron Barnes <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
* @package block | ||
* @subpackage completion | ||
* @copyright 2009 Catalyst IT Ltd | ||
* @author Aaron Barnes <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
|
||
require_once($CFG->libdir.'/completionlib.php'); | ||
|
||
/** | ||
|
@@ -81,8 +84,8 @@ public function get_content() { | |
// Check this user is enroled | ||
if (!$info->is_tracked_user($USER->id)) { | ||
// If not enrolled, but are can view the report: | ||
if (has_capability('coursereport/completion:view', get_context_instance(CONTEXT_COURSE, $COURSE->id))) { | ||
$this->content->text = '<a href="'.$CFG->wwwroot.'/course/report/completion/index.php?course='.$COURSE->id. | ||
if (has_capability('report/completion:view', get_context_instance(CONTEXT_COURSE, $COURSE->id))) { | ||
$this->content->text = '<a href="'.$CFG->wwwroot.'/report/completion/index.php?course='.$COURSE->id. | ||
'">'.get_string('viewcoursereport', 'completion').'</a>'; | ||
return $this->content; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
<?php | ||
|
||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
|
@@ -15,15 +14,16 @@ | |
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
|
||
/** | ||
* Block for displayed logged in user's course completion status | ||
* | ||
* @package moodlecore | ||
* @copyright 2009 Catalyst IT Ltd | ||
* @author Aaron Barnes <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
* @package block | ||
* @subpackage completion | ||
* @copyright 2009 Catalyst IT Ltd | ||
* @author Aaron Barnes <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
require_once('../../config.php'); | ||
require_once($CFG->libdir.'/completionlib.php'); | ||
|
||
|
@@ -62,9 +62,9 @@ | |
$can_view = true; | ||
} else if (has_capability('moodle/user:viewuseractivitiesreport', $personalcontext)) { | ||
$can_view = true; | ||
} else if (has_capability('coursereport/completion:view', $coursecontext)) { | ||
} else if (has_capability('report/completion:view', $coursecontext)) { | ||
$can_view = true; | ||
} else if (has_capability('coursereport/completion:view', $personalcontext)) { | ||
} else if (has_capability('report/completion:view', $personalcontext)) { | ||
$can_view = true; | ||
} | ||
|
||
|
@@ -165,7 +165,7 @@ | |
echo '<th class="c2 header" scope="col">'.get_string('requirement', 'block_completionstatus').'</th>'; | ||
echo '<th class="c3 header" scope="col">'.get_string('status').'</th>'; | ||
echo '<th class="c4 header" scope="col">'.get_string('complete').'</th>'; | ||
echo '<th class="c5 header" scope="col">'.get_string('completiondate', 'coursereport_completion').'</th>'; | ||
echo '<th class="c5 header" scope="col">'.get_string('completiondate', 'report_completion').'</th>'; | ||
echo '</tr>'; | ||
|
||
// Save row data | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
<?php | ||
|
||
// This file is part of Moodle - http://moodle.org/ | ||
// | ||
// Moodle is free software: you can redistribute it and/or modify | ||
|
@@ -15,4 +14,18 @@ | |
// You should have received a copy of the GNU General Public License | ||
// along with Moodle. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
$plugin->version = 2009072800; | ||
/** | ||
* Version info | ||
* | ||
* @package block | ||
* @subpackage completion | ||
* @copyright 2009 Catalyst IT Ltd | ||
* @author Aaron Barnes <[email protected]> | ||
* @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later | ||
*/ | ||
|
||
defined('MOODLE_INTERNAL') || die(); | ||
|
||
$plugin->version = 2011110300; | ||
$plugin->component = 'block_completionstatus'; | ||
$plugin->dependencies = array('report_completion' => 2011110200); |