Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
moodle-tool_lifecycle
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
elc
moodle-tool_lifecycle
Commits
09dd359e
Commit
09dd359e
authored
7 years ago
by
Tobias Reischmann
Browse files
Options
Downloads
Patches
Plain Diff
Rollback of email step is now done immediately
parent
285c5092
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
step/email/interactionlib.php
+0
-11
0 additions, 11 deletions
step/email/interactionlib.php
step/email/lib.php
+0
-5
0 additions, 5 deletions
step/email/lib.php
tests/behat/interaction.feature
+7
-4
7 additions, 4 deletions
tests/behat/interaction.feature
with
7 additions
and
20 deletions
step/email/interactionlib.php
+
0
−
11
View file @
09dd359e
...
...
@@ -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
();
...
...
This diff is collapsed.
Click to expand it.
step/email/lib.php
+
0
−
5
View file @
09dd359e
...
...
@@ -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
(
...
...
This diff is collapsed.
Click to expand it.
tests/behat/interaction.feature
+
7
−
4
View file @
09dd359e
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment