diff options
| author | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2023-03-22 14:59:57 +0000 |
|---|---|---|
| committer | Jan-Hendrik Willms <tleilax+studip@gmail.com> | 2023-03-22 14:59:57 +0000 |
| commit | 9157f7c55d75c7e55aac425948abc132981ecfd7 (patch) | |
| tree | 9db468ab272264840d9b3d24c1aa130962eeb763 /lib/models/Course.class.php | |
| parent | fd4be9d94001402f10d7ca92cb6d140741edfea1 (diff) | |
add appropriate title for course completion icon, fixes #2416
Closes #2416
Merge request studip/studip!1614
Diffstat (limited to 'lib/models/Course.class.php')
| -rw-r--r-- | lib/models/Course.class.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/models/Course.class.php b/lib/models/Course.class.php index 5df3e3e..429bb1b 100644 --- a/lib/models/Course.class.php +++ b/lib/models/Course.class.php @@ -755,6 +755,20 @@ class Course extends SimpleORMap implements Range, PrivacyObject, StudipItem, Fe } /** + * Returns the appropriate label for the completion status. + * + * @return string + */ + public function getCompetionLabel(): string + { + return [ + 0 => _('unvollständig'), + 1 => _('in Bearbeitung'), + 2 => _('fertig'), + ][$this->completion] ?? _('undefiniert'); + } + + /** * Generates a general log entry if the course were changed. * Furthermore, this method emits notifications when the * start and/or the end semester has/have changed. |
