Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
iena-course-format
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iena
iena-course-format
Commits
f64bfefc
Commit
f64bfefc
authored
2 years ago
by
CORDEL Yannick
Browse files
Options
Downloads
Patches
Plain Diff
Ajout entête avec le nom et la date du cours dans la notification par mail
parent
6ba816be
No related branches found
No related tags found
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
entity/course_format_iena_cron_action.php
+17
-17
17 additions, 17 deletions
entity/course_format_iena_cron_action.php
lang/fr/format_iena.php
+1
-1
1 addition, 1 deletion
lang/fr/format_iena.php
with
18 additions
and
18 deletions
entity/course_format_iena_cron_action.php
+
17
−
17
View file @
f64bfefc
...
...
@@ -52,13 +52,7 @@ class course_format_iena_cron_action {
if
(
$datenotif
==
false
)
{
continue
;
}
if
((
empty
(
$section
->
msg
))
&&
(
$section
->
presence
==
2
))
{
$this
->
iena_send_message
(
$requete
,
$section
,
get_config
(
'format_iena'
,
'msg_dist'
));
}
else
if
((
empty
(
$section
->
msg
))
&&
(
$section
->
presence
==
1
))
{
$this
->
iena_send_message
(
$requete
,
$section
,
get_config
(
'format_iena'
,
'msg_pres'
));
}
else
{
$this
->
iena_send_message
(
$requete
,
$section
,
$section
->
msg
);
}
$this
->
iena_send_message
(
$requete
,
$section
);
}
}
...
...
@@ -84,10 +78,23 @@ class course_format_iena_cron_action {
* @throws coding_exception
* @throws dml_exception
*/
private
function
iena_send_message
(
$requete
,
$section
,
$message
)
{
private
function
iena_send_message
(
$requete
,
$section
)
{
global
$DB
,
$CFG
,
$USER
;
$coursectx
=
context_course
::
instance
(
$requete
->
course
);
if
(
$section
->
presence
==
2
)
{
$modalite
=
get_string
(
'not_presence'
,
'format_iena'
);
}
else
if
(
$section
->
presence
==
1
)
{
$modalite
=
get_string
(
'in_presence'
,
'format_iena'
);
}
// Si le message personnalisé est vide.
if
((
empty
(
$section
->
msg
))
&&
(
$section
->
presence
==
2
))
{
$section
->
msg
=
get_config
(
'format_iena'
,
'msg_dist'
);
}
else
if
((
empty
(
$section
->
msg
))
&&
(
$section
->
presence
==
1
))
{
$section
->
msg
=
get_config
(
'format_iena'
,
'msg_pres'
);
}
// A vérifier : on récupère tous les utilisateurs, même les invités.
// 2. $students = get_role_users(5 , $context) (the 5 represents the role-id with role.shortname = 'student').
$students
=
get_enrolled_users
(
$coursectx
);
...
...
@@ -96,19 +103,12 @@ class course_format_iena_cron_action {
$messagecontent
=
false
;
$messagecontent
.
=
"<h1>Rappel</h1>"
;
$messagecontent
.
=
"<h2>
$course->fullname
</h2>"
;
$datejour
=
date
(
'd/m'
,
$section
->
daterendu
);
$dateheure
=
date
(
'H:i'
,
$section
->
daterendu
);
$messagecontent
.
=
"<h2>
$course->fullname
(
$modalite
) - "
.
date
(
'd/m/Y H:i'
,
$section
->
daterendu
)
.
"</h2>"
;
// 0 : NC
// 1 : work in the classroom
// 2 : online work
if
(
$section
->
presence
<
2
)
{
$messagecontent
.
=
"
$message
"
;
}
else
if
(
$section
->
presence
==
2
)
{
$messagecontent
.
=
"
$message
"
;
}
$messagecontent
.
=
"
$section->msg
"
;
$messagecontent
.
=
"<p>Lien vers le cours : <a href='"
.
$CFG
->
wwwroot
.
"/course/view.php?id="
.
$course
->
id
.
"'>"
.
$course
->
fullname
.
"</a></p>"
;
...
...
This diff is collapsed.
Click to expand it.
lang/fr/format_iena.php
+
1
−
1
View file @
f64bfefc
...
...
@@ -97,4 +97,4 @@ $string['message_default_pres'] = "message par defaut pres";
$string
[
'message_pres_desc'
]
=
"Paramétrez le message qui sera envoyé par défaut pour un cours en présentiel"
;
$string
[
'message_dist'
]
=
"Message distanciel"
;
$string
[
'message_dist_desc'
]
=
"Paramétrez le message qui sera envoyé par défaut pour un cours à distance"
;
$string
[
'message_default_dist'
]
=
"message par défaut distance"
;
$string
[
'message_default_dist'
]
=
"message par défaut distance"
;
\ 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