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
74e7627f
Unverified
Commit
74e7627f
authored
8 years ago
by
Tobias Reischmann
Browse files
Options
Downloads
Patches
Plain Diff
Email step now creates database entries for every mail to be sent
parent
2a3c0e71
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
step/email/db/install.xml
+18
-0
18 additions, 0 deletions
step/email/db/install.xml
step/email/lib.php
+10
-0
10 additions, 0 deletions
step/email/lib.php
step/email/version.php
+1
-1
1 addition, 1 deletion
step/email/version.php
with
29 additions
and
1 deletion
step/email/db/install.xml
0 → 100644
+
18
−
0
View file @
74e7627f
<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB
PATH=
"admin/tool/cleanupcourses/step/email/db"
VERSION=
"2017052300"
COMMENT=
"XMLDB file for Moodle cleanupcourses_step/email"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation=
"../../../lib/xmldb/xmldb.xsd"
>
<TABLES>
<TABLE
NAME=
"cleanupcoursesstep_email"
COMMENT=
"table containing all mails which still have to be sent"
>
<FIELDS>
<FIELD
NAME=
"id"
TYPE=
"int"
LENGTH=
"20"
NOTNULL=
"true"
SEQUENCE=
"true"
COMMENT=
"id of the mail"
/>
<FIELD
NAME=
"touser"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"true"
SEQUENCE=
"false"
COMMENT=
"user id to which the email should go to"
/>
<FIELD
NAME=
"courseid"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"true"
SEQUENCE=
"false"
COMMENT=
"course the user should be informed about"
/>
<FIELD
NAME=
"instanceid"
TYPE=
"int"
LENGTH=
"10"
NOTNULL=
"true"
SEQUENCE=
"false"
COMMENT=
"id of the step instance responsible"
/>
</FIELDS>
<KEYS>
<KEY
NAME=
"primary"
TYPE=
"primary"
FIELDS=
"id"
/>
</KEYS>
</TABLE>
</TABLES>
</XMLDB>
\ No newline at end of file
This diff is collapsed.
Click to expand it.
step/email/lib.php
+
10
−
0
View file @
74e7627f
...
...
@@ -45,6 +45,16 @@ class email extends base {
* @return step_response
*/
public
function
process_course
(
$instanceid
,
$course
)
{
global
$DB
;
$coursecontext
=
\context_course
::
instance
(
$course
->
id
);
$userstobeinformed
=
get_users_by_capability
(
$coursecontext
,
'cleanupcoursesstep/email:preventdeletion'
);
foreach
(
$userstobeinformed
as
$user
)
{
$record
=
new
\stdClass
();
$record
->
touser
=
$user
->
id
;
$record
->
courseid
=
$course
->
id
;
$record
->
instanceid
=
$instanceid
;
$DB
->
insert_record
(
'cleanupcoursesstep_email'
,
$record
);
}
return
step_response
::
waiting
();
}
...
...
This diff is collapsed.
Click to expand it.
step/email/version.php
+
1
−
1
View file @
74e7627f
...
...
@@ -25,5 +25,5 @@
defined
(
'MOODLE_INTERNAL'
)
||
die
;
$plugin
->
version
=
2017052
203
;
$plugin
->
version
=
2017052
302
;
$plugin
->
component
=
'cleanupcoursesstep_email'
;
\ 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