MDL-41585 badges: Add a note that badge recipient is a deleted user
Signed-off-by: Yuliya Bozhko <[email protected]> Conflicts: badges/renderer.php
This commit is contained in:
committed by
Damyon Wiese
parent
0634e5d581
commit
04d32d24a6
+13
-6
@@ -279,7 +279,7 @@ class core_badges_renderer extends plugin_renderer_base {
|
||||
|
||||
// Outputs issued badge with actions available.
|
||||
protected function render_issued_badge(issued_badge $ibadge) {
|
||||
global $USER, $CFG, $DB;
|
||||
global $USER, $CFG, $DB, $SITE;
|
||||
$issued = $ibadge->issued;
|
||||
$userinfo = $ibadge->recipient;
|
||||
$badge = new badge($ibadge->badgeid);
|
||||
@@ -316,11 +316,18 @@ class core_badges_renderer extends plugin_renderer_base {
|
||||
|
||||
// Recipient information.
|
||||
$datatable->data[] = array($this->output->heading(get_string('recipientdetails', 'badges'), 3), '');
|
||||
$datatable->data[] = array(get_string('name'), fullname($userinfo));
|
||||
if (empty($userinfo->backpackemail)) {
|
||||
$datatable->data[] = array(get_string('email'), obfuscate_mailto($userinfo->accountemail));
|
||||
if ($userinfo->deleted) {
|
||||
$strdata = new stdClass();
|
||||
$strdata->user = fullname($userinfo);
|
||||
$strdata->site = format_string($SITE->fullname, true, array('context' => context_system::instance()));
|
||||
$datatable->data[] = array(get_string('name'), get_string('error:userdeleted', 'badges', $strdata));
|
||||
} else {
|
||||
$datatable->data[] = array(get_string('email'), obfuscate_mailto($userinfo->backpackemail));
|
||||
$datatable->data[] = array(get_string('name'), fullname($userinfo));
|
||||
if (empty($userinfo->backpackemail)) {
|
||||
$datatable->data[] = array(get_string('email'), obfuscate_mailto($userinfo->accountemail));
|
||||
} else {
|
||||
$datatable->data[] = array(get_string('email'), obfuscate_mailto($userinfo->backpackemail));
|
||||
}
|
||||
}
|
||||
|
||||
$datatable->data[] = array($this->output->heading(get_string('issuerdetails', 'badges'), 3), '');
|
||||
@@ -936,7 +943,7 @@ class issued_badge implements renderable {
|
||||
array('hash' => $hash), IGNORE_MISSING);
|
||||
if ($rec) {
|
||||
// Get a recipient from database.
|
||||
$user = $DB->get_record_sql('SELECT u.id, u.lastname, u.firstname,
|
||||
$user = $DB->get_record_sql('SELECT u.id, u.lastname, u.firstname, u.deleted,
|
||||
u.email AS accountemail, b.email AS backpackemail
|
||||
FROM {user} u LEFT JOIN {badge_backpack} b ON u.id = b.userid
|
||||
WHERE u.id = :userid', array('userid' => $rec->userid));
|
||||
|
||||
@@ -240,6 +240,7 @@ $string['error:personaneedsjs'] = 'Currently, Javascript is required to connect
|
||||
$string['error:requesttimeout'] = 'The connection request timed out before it could complete.';
|
||||
$string['error:requesterror'] = 'The connection request failed (error code {$a}).';
|
||||
$string['error:save'] = 'Cannot save the badge.';
|
||||
$string['error:userdeleted'] = '{$a->user} (This user no longer exists in {$a->site})';
|
||||
$string['evidence'] = 'Evidence';
|
||||
$string['existingrecipients'] = 'Existing badge recipients';
|
||||
$string['expired'] = 'Expired';
|
||||
|
||||
Reference in New Issue
Block a user