Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
6b9b308d
authored
Aug 14, 2017
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
notification email on student unlinking
parent
65a0a7aa
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
8 deletions
sails/src/api/controllers/StudentController.js
sails/src/config/locales/en-gb.json
sails/src/config/locales/es-es.json
sails/src/api/controllers/StudentController.js
View file @
6b9b308d
...
...
@@ -466,12 +466,41 @@ module.exports = {
student
:
req
.
param
(
'id_stu'
),
supervisor
:
req
.
param
(
'id_sup'
)
})
.
populate
(
'supervisor'
)
.
then
((
stuSup
)
=>
{
if
(
!
stuSup
)
throw
new
Error
(
"student and supervisor are not linked"
);
return
[
stupStup
,
Student
.
findOne
(
req
.
params
.
id_stu
).
populate
(
'license'
)];
.
spread
((
stuSup
,
student
)
=>
{
stuSup
.
destroy
();
//
// Mail to supervisor to be notified
//
student
=
student
.
toJSON
();
if
(
student
.
license
&&
student
.
license
.
number
)
{
mailService
.
mailer
()
.
send
({
to
:
stuSup
.
supervisor
.
email
,
text
:
sails
.
__
(
{
phrase
:
'student_unlinked'
,
locale
:
stuSup
.
supervisor
.
lang
},
{
name
:
student
.
name
,
surname
:
student
.
surname
,
license
:
student
.
license
.
number
})
});
.
then
(()
=>
{})
.
catch
((
err
)
=>
{});
}
//
// Broadcast event
//
const
socketToOmit
=
req
.
isSocket
?
req
.
socket
:
undefined
;
const
unlinkSupervisorFromStudentEvent
=
sails
.
hooks
.
events
.
unlinkSupervisorFromStudent
(
stuSup
.
student
,
...
...
sails/src/config/locales/en-gb.json
View file @
6b9b308d
{
"Welcome"
:
"Welcome"
,
"A brand new app."
:
"A brand new app."
,
"change_password_mail"
:
"To change your password, please click on the following link:
\n
"
,
"login"
:
"login"
,
"notification_from_pictogram"
:
"Notification from Pictogram"
,
"no_name"
:
"No name"
,
"no_surname"
:
"No surname"
,
"office_link"
:
"The office/center
\"
{{ name }}
\"
with email
\"
{{ email }}
\"
has added you as part of its team in Pictogram."
,
"signin_mail"
:
"To activate your Pictogram account, click on this link:
\n
"
,
"change_password_mail"
:
"To change your password, please click on the following link:
\n
"
,
"login"
:
"login"
,
"student_unlinked"
:
"You have lost the link to the student {{ name }} {{ surname }}, with license number {{ license }}."
,
"therapist_office_request"
:
"{{ name }}, with email {{ email }}, is requesting to be linked as therapist to any of your students."
,
"tutor_office_request"
:
"{{ name }}, with email {{ email }}, is requesting to be linked as tutor/father/mother to any of your students."
,
"Welcome"
:
"Welcome"
,
"welcome_msg1"
:
"Welcome to Pictogram, {{ name }}!"
,
"welcome_msg2"
:
"Your account is now active. You can proceed to"
,
"office_link"
:
"The office/center
\"
{{ name }}
\"
with email
\"
{{ email }}
\"
has added you as part of its team in Pictogram."
}
sails/src/config/locales/es-es.json
View file @
6b9b308d
{
"Welcome"
:
"Bienvenido"
,
"A brand new app."
:
"Una aplicación de la nueva marca."
,
"change_password_mail"
:
"Para cambiar su contraseña, haga click en el siguiente enlace:
\n
"
,
"login"
:
"acceder"
,
"notification_from_pictogram"
:
"Notificación desde Pictogram"
,
"no_name"
:
"Sin nombre"
,
"no_surname"
:
"Sin apellidos"
,
"office_link"
:
"El centro/gabinete
\"
{{ name }}
\"
, con correo electrónico
\"
{{ email }}
\"
le ha añadido como parte de su equipo."
,
"signin_mail"
:
"Para activar su cuenta en Pictogram, haga click en el siguiente enlace:
\n
"
,
"change_password_mail"
:
"Para cambiar su contraseña, haga click en el siguiente enlace:
\n
"
,
"login"
:
"acceder"
,
"student_unlinked"
:
"Se ha desvinculado de {{ name }} {{ surname }}, con número de licencia {{ license }}."
,
"therapist_office_request"
:
"El/la terapeuta {{ name }}, con correo electrónico {{ email }}, pide ser asociado a algún estudiante."
,
"tutor_office_request"
:
"El/la tutor/a/padre/madre {{ name }}, con correo electrónico {{ email }}, pide ser asociado a algún estudiante."
,
"Welcome"
:
"Bienvenido"
,
"welcome_msg1"
:
"¡Bienvenido a Pictogram, {{ name }}!"
,
"welcome_msg2"
:
"Su cuenta está ahora activa, por lo que puede"
,
"office_link"
:
"El centro/gabinete
\"
{{ name }}
\"
, con correo electrónico
\"
{{ email }}
\"
le ha añadido como parte de su equipo."
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment