Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Jan-Hendrik Willms
Stud.IP
Commits
cc50188f
Commit
cc50188f
authored
6 months ago
by
André Noack
Browse files
Options
Downloads
Patches
Plain Diff
Resolve "RVV: Ablehnen einer Raumanfrage"
Closes #2941 Merge request
studip/studip!3671
parent
d520c567
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lib/models/resources/ResourceRequest.php
+38
-26
38 additions, 26 deletions
lib/models/resources/ResourceRequest.php
with
38 additions
and
26 deletions
lib/models/resources/ResourceRequest.php
+
38
−
26
View file @
cc50188f
...
@@ -2211,41 +2211,53 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen
...
@@ -2211,41 +2211,53 @@ class ResourceRequest extends SimpleORMap implements PrivacyObject, Studip\Calen
*/
*/
public
function
sendRequestDeniedMail
()
public
function
sendRequestDeniedMail
()
{
{
$users
=
[];
//Get the user who made the request:
//Get the user who made the request:
$user
=
$this
->
user
;
if
(
$this
->
user
)
{
if
(
!
(
$user
instanceof
User
))
{
$users
[
$this
->
user
->
id
]
=
$this
->
user
->
username
;
}
$range_object
=
$this
->
getRangeObject
();
if
(
$range_object
instanceof
Course
&&
$this
->
reply_recipients
===
ResourceRequest
::
REPLY_LECTURER
)
{
foreach
(
$range_object
->
getMembersWithStatus
(
'dozent'
)
as
$lecturer
)
{
$users
[
$lecturer
->
user_id
]
=
$lecturer
->
username
;
}
}
if
(
count
(
$users
)
===
0
)
{
//No mail to send.
//No mail to send.
return
;
return
;
}
}
//Load the mail template:
$factory
=
new
Flexi\Factory
(
$GLOBALS
[
'STUDIP_BASE_PATH'
]
.
'/locale/'
);
$user_lang_path
=
getUserLanguagePath
(
$user
->
id
);
$template
=
$factory
->
open
(
$user_lang_path
.
'/LC_MAILS/request_denied_mail.inc.php'
);
$range_object
=
$this
->
getRangeObject
();
$mail_title
=
_
(
'Raumanfrage wurde abgelehnt'
);
$mail_title
=
_
(
'Raumanfrage wurde abgelehnt'
);
if
(
$range_object
instanceof
Course
)
{
if
(
$range_object
instanceof
Course
)
{
$mail_title
.
=
': '
.
$range_object
->
getFullName
();
$mail_title
.
=
': '
.
$range_object
->
getFullName
();
}
}
$mail_text
=
$template
->
render
(
[
'request'
=>
$this
,
'range_object'
=>
$range_object
]
);
//Send the mail:
foreach
(
$users
as
$user_id
=>
$username
)
{
Message
::
send
(
//Load the mail template:
User
::
findCurrent
()
->
id
,
$factory
=
new
Flexi\Factory
(
$user
->
username
,
$GLOBALS
[
'STUDIP_BASE_PATH'
]
.
'/locale/'
$mail_title
,
);
$mail_text
$user_lang_path
=
getUserLanguagePath
(
$user_id
);
);
$template
=
$factory
->
open
(
$user_lang_path
.
'/LC_MAILS/request_denied_mail.inc.php'
);
$mail_text
=
$template
->
render
(
[
'request'
=>
$this
,
'range_object'
=>
$range_object
]
);
//Send the mail:
Message
::
send
(
User
::
findCurrent
()
->
id
,
$username
,
$mail_title
,
$mail_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