Skip to content

Commit d7954e8

Browse files
committed
workflowoverview: show triggered 0 as well
1 parent 9c46f87 commit d7954e8

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

classes/processor.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,7 @@ public function get_count_of_courses_to_trigger_for_workflow($workflow) {
376376
} else {
377377
$obj->automatic = true;
378378
$obj->triggered = 0;
379+
$obj->excluded = false;
379380
// Only use triggers with true sql to display the real amounts for the others (instead of always 0).
380381
$obj->sql = trigger_manager::get_trigger_sqlresult($trigger);
381382
$obj->response = $lib->check_course(null, null);

templates/overview_trigger.mustache

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,15 @@
6060
</span>
6161
</a>
6262
{{/triggeredcourses}}
63+
{{^triggeredcourses}}
64+
{{^excludedcourses}}
65+
{{^exclude}}
66+
<span class="btn btn-outline-success">
67+
0
68+
</span>
69+
{{/exclude}}
70+
{{/excludedcourses}}
71+
{{/triggeredcourses}}
6372
{{#excludedcourses}}
6473
<a href="{{{popuplink}}}&excluded={{id}}&showdetails={{showdetails}}" data-toggle="tooltip" title="{{tooltip}}">
6574
<span class="btn btn-outline-danger">

workflowoverview.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@
277277
$trigger->classfires = "border-danger";
278278
}
279279
$trigger->tooltip = "";
280-
if (isset($amounts[$trigger->sortindex]->excluded)) {
280+
if ($amounts[$trigger->sortindex]->excluded !== false) {
281281
$trigger->excludedcourses = $amounts[$trigger->sortindex]->excluded;
282282
$trigger->tooltip = get_string('courses_will_be_excluded',
283283
'tool_lifecycle', $trigger->excludedcourses);
@@ -482,6 +482,9 @@
482482
$workflowprocesseslink = "<br>".$workflowprocesseslink;
483483
}
484484

485+
if (!($isactive || $isdeactivated)) {
486+
$lastrun = 0;
487+
}
485488
$data = [
486489
'editsettingslink' => (new moodle_url(urls::EDIT_WORKFLOW, ['wf' => $workflow->id]))->out(false),
487490
'title' => $workflow->title,
@@ -507,7 +510,8 @@
507510
'showdetailsicon' => $showdetails == 0,
508511
'isactive' => $isactive || $isdeactivated,
509512
'nextrun' => $nextrunout,
510-
'lastrun' => userdate($lastrun, get_string('strftimedatetimeshort', 'langconfig')),
513+
'lastrun' => $lastrun ?
514+
userdate($lastrun, get_string('strftimedatetimeshort', 'langconfig')) : '-',
511515
'nomanualtriggerinvolved' => $nomanualtriggerinvolved,
512516
'disableworkflowlink' => $disableworkflowlink,
513517
'abortdisableworkflowlink' => $abortdisableworkflowlink,

0 commit comments

Comments
 (0)