Skip to content
Snippets Groups Projects
Commit 09dd359e authored by Tobias Reischmann's avatar Tobias Reischmann
Browse files

Rollback of email step is now done immediately

parent 285c5092
Branches
Tags
No related merge requests found
......@@ -60,11 +60,6 @@ class interactionemail extends interactionlibbase {
* @return array of action tools
*/
public function get_action_tools($process) {
$step = step_manager::get_step_instance_by_workflow_index($process->workflowid, $process->stepindex);
$keep = process_data_manager::get_process_data($process->id, $step->id, EMAIL_PROCDATA_KEY_KEEP);
if ($keep === '1') {
return array();
}
return array(
array('action' => self::ACTION_KEEP,
'alt' => get_string('keep_course', 'cleanupcoursesstep_email'),
......@@ -78,11 +73,6 @@ class interactionemail extends interactionlibbase {
* @return string status message
*/
public function get_status_message($process) {
$step = step_manager::get_step_instance_by_workflow_index($process->workflowid, $process->stepindex);
$keep = process_data_manager::get_process_data($process->id, $step->id, EMAIL_PROCDATA_KEY_KEEP);
if ($keep === '1') {
return get_string('status_message_decision_keep', 'cleanupcoursesstep_email');
}
return get_string('status_message_requiresattention', 'cleanupcoursesstep_email');
}
......@@ -99,7 +89,6 @@ class interactionemail extends interactionlibbase {
*/
public function handle_interaction($process, $step, $action = 'default') {
if ($action == self::ACTION_KEEP) {
process_data_manager::set_process_data($process->id, $step->id, EMAIL_PROCDATA_KEY_KEEP, '1');
return step_interactive_response::rollback();
}
return step_interactive_response::no_action();
......
......@@ -77,11 +77,6 @@ class email extends libbase {
* @return step_response
*/
public function process_waiting_course($processid, $instanceid, $course) {
if ($keep = process_data_manager::get_process_data($processid, $instanceid, EMAIL_PROCDATA_KEY_KEEP)) {
if ($keep === '1') {
return step_response::rollback();
}
}
// When time runs up and no one wants to keep the course, then proceed.
$process = process_manager::get_process_by_id($processid);
if ($process->timestepchanged < time() - settings_manager::get_settings(
......
......@@ -60,9 +60,12 @@ Feature: Add a workflow with an email step and test the interaction as a teacher
And I should see the tool "Keep Course" in the "Course 2" row of the "tool_cleanupcourses_interaction" table
And I should see the tool "Keep Course" in the "Course 3" row of the "tool_cleanupcourses_interaction" table
When I click on the tool "Keep Course" in the "Course 2" row of the "tool_cleanupcourses_interaction" table
Then I should see "Course is still needed" in the "Course 2" "table_row"
And I wait "10" seconds
When I run the scheduled task "tool_cleanupcourses\task\process_cleanup"
Then I should see "Course 1" in the "tool_cleanupcourses_remaining" "table"
And I should see "Course 2" in the "tool_cleanupcourses_remaining" "table"
And I should see "Course 3" in the "tool_cleanupcourses_interaction" "table"
When I wait "10" seconds
And I run the scheduled task "tool_cleanupcourses\task\process_cleanup"
And I am on cleanupcourses view
Then I should see "Course 2"
Then I should see "Course 1" in the "tool_cleanupcourses_remaining" "table"
And I should see "Course 2" in the "tool_cleanupcourses_remaining" "table"
And I should not see "Course 3"
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment