|
88 | 88 | } else if ($excluded) { |
89 | 89 | $params['excluded'] = $excluded; |
90 | 90 | } |
| 91 | +if ($search) { |
| 92 | + $params['search'] = $search; |
| 93 | +} |
91 | 94 |
|
92 | 95 | $syscontext = context_system::instance(); |
93 | 96 | $PAGE->set_url(new \moodle_url(urls::WORKFLOW_DETAILS, $params)); |
|
177 | 180 | 'move_down' => get_string('move_down', 'tool_lifecycle'), |
178 | 181 | ]; |
179 | 182 |
|
180 | | -$nextrun = 0; |
| 183 | +$nextrun = false; |
181 | 184 | $coursestriggered = []; |
182 | 185 | $coursesdelayed = []; |
183 | 186 | $displaytotaltriggered = false; |
|
190 | 193 | $amounts = (new processor())->get_count_of_courses_to_trigger_for_workflow($workflow); |
191 | 194 | $coursestriggered = $amounts['all']->coursestriggered; |
192 | 195 | $coursesdelayed = $amounts['all']->delayedcourses; |
193 | | - $nextrun = $amounts['all']->nextrun; |
| 196 | + $nextrun = $amounts['all']->nextrun == 0 ? false : $amounts['all']->nextrun; |
194 | 197 | $displaytotaltriggered = !empty($triggers); |
195 | 198 | } |
196 | 199 |
|
|
204 | 207 | } else if ($nextrunt < time()) { |
205 | 208 | $nextrunt = get_string('asap', 'tool_task'); |
206 | 209 | } |
207 | | -if (is_int($nextrunt) && $nextrun ?? false) { // Task nextrun and trigger nextrun are valid times: take the minimum. |
| 210 | +if (is_int($nextrunt) && is_int($nextrun)) { // Task nextrun and trigger nextrun are valid times: take the minimum. |
208 | 211 | $nextrun = userdate(min($nextrunt, $nextrun), get_string('strftimedatetimeshort', 'langconfig')); |
209 | | -} else if (!is_int($nextrunt) && $nextrun ?? false) { // Only trigger nextrun is valid time. |
| 212 | +} else if (!is_int($nextrunt) && is_int($nextrun)) { // Only trigger nextrun is valid time. |
210 | 213 | $nextrun = userdate($nextrun, get_string('strftimedatetimeshort', 'langconfig')); |
211 | 214 | } else if (is_int($nextrunt)) { // Only task next run is valid time. |
212 | 215 | $nextrun = userdate($nextrunt, get_string('strftimedatetimeshort', 'langconfig')); |
|
480 | 483 | ['type' => settings_type::TRIGGER, 'wf' => $workflow->id]), |
481 | 484 | 'subplugin', $selectabletriggers, '', ['' => get_string('add_new_trigger_instance', 'tool_lifecycle')], |
482 | 485 | null, ['id' => 'tool_lifecycle-choose-trigger']); |
483 | | - |
484 | 486 | // Add step selection field. |
485 | 487 | if (!$newworkflow) { // At first select a course selection trigger, than you can select the first step. |
486 | 488 | if ($steptypes = step_manager::get_step_types()) { |
|
0 commit comments