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
91cc3b28
Unverified
Commit
91cc3b28
authored
8 years ago
by
Tobias Reischmann
Browse files
Options
Downloads
Patches
Plain Diff
Added an email setting specifying the timeout for user responses
parent
805b02eb
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
classes/entity/process.php
+2
-0
2 additions, 0 deletions
classes/entity/process.php
step/email/lang/en/cleanupcoursesstep_email.php
+1
-0
1 addition, 0 deletions
step/email/lang/en/cleanupcoursesstep_email.php
step/email/lib.php
+10
-0
10 additions, 0 deletions
step/email/lib.php
with
13 additions
and
0 deletions
classes/entity/process.php
+
2
−
0
View file @
91cc3b28
...
@@ -50,6 +50,8 @@ class process {
...
@@ -50,6 +50,8 @@ class process {
$this
->
waiting
=
$waiting
;
$this
->
waiting
=
$waiting
;
if
(
$timestepchanged
===
null
)
{
if
(
$timestepchanged
===
null
)
{
$this
->
timestepchanged
=
time
();
$this
->
timestepchanged
=
time
();
}
else
{
$this
->
timestepchanged
=
$timestepchanged
;
}
}
}
}
...
...
This diff is collapsed.
Click to expand it.
step/email/lang/en/cleanupcoursesstep_email.php
+
1
−
0
View file @
91cc3b28
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
$string
[
'pluginname'
]
=
'Email Step'
;
$string
[
'pluginname'
]
=
'Email Step'
;
$string
[
'email_responsetimeout'
]
=
'Time the user has for the response'
;
$string
[
'email_subject'
]
=
'Subject Template'
;
$string
[
'email_subject'
]
=
'Subject Template'
;
$string
[
'email_content'
]
=
'Content Template'
;
$string
[
'email_content'
]
=
'Content Template'
;
$string
[
'email_content_html'
]
=
'Content HTML Template'
;
$string
[
'email_content_html'
]
=
'Content HTML Template'
;
...
...
This diff is collapsed.
Click to expand it.
step/email/lib.php
+
10
−
0
View file @
91cc3b28
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
*/
*/
namespace
tool_cleanupcourses\step
;
namespace
tool_cleanupcourses\step
;
use
tool_cleanupcourses\manager\process_manager
;
use
tool_cleanupcourses\manager\settings_manager
;
use
tool_cleanupcourses\manager\settings_manager
;
use
tool_cleanupcourses\response\step_response
;
use
tool_cleanupcourses\response\step_response
;
use
tool_cleanupcourses\manager\step_manager
;
use
tool_cleanupcourses\manager\step_manager
;
...
@@ -81,6 +82,11 @@ class email extends libbase {
...
@@ -81,6 +82,11 @@ class email extends libbase {
return
step_response
::
rollback
();
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
(
$instanceid
)[
'responsetimeout'
])
{
return
step_response
::
proceed
();
}
return
step_response
::
waiting
();
return
step_response
::
waiting
();
}
}
...
@@ -139,6 +145,7 @@ class email extends libbase {
...
@@ -139,6 +145,7 @@ class email extends libbase {
public
function
instance_settings
()
{
public
function
instance_settings
()
{
return
array
(
return
array
(
new
instance_setting
(
'responsetimeout'
,
PARAM_INT
),
new
instance_setting
(
'subject'
,
PARAM_TEXT
),
new
instance_setting
(
'subject'
,
PARAM_TEXT
),
new
instance_setting
(
'content'
,
PARAM_RAW
),
new
instance_setting
(
'content'
,
PARAM_RAW
),
new
instance_setting
(
'contenthtml'
,
PARAM_RAW
),
new
instance_setting
(
'contenthtml'
,
PARAM_RAW
),
...
@@ -150,6 +157,9 @@ class email extends libbase {
...
@@ -150,6 +157,9 @@ class email extends libbase {
}
}
public
function
extend_add_instance_form_definition
(
$mform
)
{
public
function
extend_add_instance_form_definition
(
$mform
)
{
$elementname
=
'responsetimeout'
;
$mform
->
addElement
(
'duration'
,
$elementname
,
get_string
(
'email_responsetimeout'
,
'cleanupcoursesstep_email'
));
$mform
->
setType
(
$elementname
,
PARAM_INT
);
$elementname
=
'subject'
;
$elementname
=
'subject'
;
$mform
->
addElement
(
'text'
,
$elementname
,
get_string
(
'email_subject'
,
'cleanupcoursesstep_email'
));
$mform
->
addElement
(
'text'
,
$elementname
,
get_string
(
'email_subject'
,
'cleanupcoursesstep_email'
));
$mform
->
setType
(
$elementname
,
PARAM_TEXT
);
$mform
->
setType
(
$elementname
,
PARAM_TEXT
);
...
...
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