Skip to content

Commit

Permalink
Update strings
Browse files Browse the repository at this point in the history
  • Loading branch information
bwalkerl committed Mar 8, 2024
1 parent 44ed2ab commit f1dd887
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
14 changes: 7 additions & 7 deletions classes/form/override_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,13 @@ public function definition() {

// Override.
$mform->addElement('select', 'override', get_string('override', 'tool_heartbeat'), [
result::NA => 'Not applicable',
result::OK => 'OK',
result::INFO => 'Info',
result::UNKNOWN => 'Unknown',
result::WARNING => 'Warning',
result::CRITICAL => 'Critical',
result::ERROR => 'Error',
result::NA => get_string('statusna'),
result::OK => get_string('statusok'),
result::INFO => get_string('statusinfo'),
result::UNKNOWN => get_string('statusunknown'),
result::WARNING => get_string('statuswarning'),
result::CRITICAL => get_string('statuscritical'),
result::ERROR => get_string('statuserror'),
]);

// Note.
Expand Down
8 changes: 5 additions & 3 deletions classes/object/override.php
Original file line number Diff line number Diff line change
Expand Up @@ -190,16 +190,18 @@ protected static function mark_expired_as_resolved() {
$conditions = "expires_at < ? AND resolved_at = 0";
$overrides = self::get_records_select($conditions, [time()]);
foreach ($overrides as $override) {
$override->resolve($override->get('expires_at'));
$override->resolve();
}
}

/**
* Returns the time until mute ends
* Returns the human readable time until mute ends
*
* @return string
*/
public function get_time_until_mute_ends(): string {
return date('d/m/Y h:iA', $this->get('expires_at'));
$enddate = userdate($this->get('expires_at'), get_string('strftimedate', 'langconfig'));
$remainingtime = format_time($this->get('expires_at') - time());
return "$enddate ($remainingtime)";
}
}

0 comments on commit f1dd887

Please sign in to comment.