Skip to content

Commit 93d1fe1

Browse files
authored
in case the action column is empty display a string (#217)
1 parent bb0af5a commit 93d1fe1

File tree

4 files changed

+9
-1
lines changed

4 files changed

+9
-1
lines changed

classes/local/table/interaction_attention_table.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,9 @@ public function col_tools($row) {
118118
$step = step_manager::get_step_instance($row->stepinstanceid);
119119

120120
$tools = interaction_manager::get_action_tools($step->subpluginname, $row->processid);
121+
if (empty($tools)) {
122+
return get_string('noactiontools', 'tool_lifecycle');
123+
}
121124
foreach ($tools as $tool) {
122125
$output .= $this->format_icon_link($tool['action'], $row->processid, $step->id, $tool['alt']);
123126
}

classes/local/table/interaction_remaining_table.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,9 @@ public function col_tools($row) {
126126
if ($row->processid !== null) {
127127
return '';
128128
}
129-
129+
if (empty($this->availabletools)) {
130+
return get_string('noactiontools', 'tool_lifecycle');
131+
}
130132
$actions = [];
131133
foreach ($this->availabletools as $tool) {
132134
if (has_capability($tool->capability, \context_course::instance($row->courseid), null, false)) {

lang/de/tool_lifecycle.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@
111111
$string['manual_trigger_success'] = 'Workflow erfolgreich gestartet.';
112112
$string['move_down'] = 'Nach unten bewegen';
113113
$string['move_up'] = 'Nach oben bewegen';
114+
$string['name_until_date'] = '"{$a->name}" bis {$a->date}';
115+
$string['noactiontools'] = 'Keine Aktionen verfügbar';
114116
$string['nocoursestodisplay'] = 'Es gibt derzeit keine Kurse, die Ihre Aufmerksamkeit erfordern!';
115117
$string['nointeractioninterface'] = 'Keine Interaktionsschnittstelle verfügbar!';
116118
$string['noprocesserrors'] = 'Es gibt keine fehlerhaften Prozesse, die behandelt werden müssen!';

lang/en/tool_lifecycle.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
$string['move_down'] = 'Move down';
131131
$string['move_up'] = 'Move up';
132132
$string['name_until_date'] = '"{$a->name}" until {$a->date}';
133+
$string['noactiontools'] = 'No tools available';
133134
$string['nocoursestodisplay'] = 'There are currently no courses which require your attention!';
134135
$string['nointeractioninterface'] = 'No interaction interface available!';
135136
$string['noprocesserrors'] = 'There are no process errors to handle!';

0 commit comments

Comments
 (0)