Skip to content
Snippets Groups Projects
Commit 9c5505ff authored by Moritz Strohm's avatar Moritz Strohm
Browse files

show course details for booking on the same conditions like in the booking plan, closes #1411

Closes #1411

Merge request studip/studip!889
parent 3c260696
No related branches found
No related tags found
No related merge requests found
......@@ -91,6 +91,18 @@ class Resources_BookingController extends AuthenticatedController
)
|| $this->make_comment_editable
);
$this->user_may_see_course_data = false;
if ($this->booking->getAssignedUserType() === 'course') {
$course = $this->booking->assigned_course_date->course;
if ($course instanceof Course) {
$has_perms = $GLOBALS['perm']->have_studip_perm('user', $course->id, $user->id);
$vis_perms = $GLOBALS['perm']->have_perm(Config::get()->SEM_VISIBILITY_PERM, $user->id);
if ($has_perms || $vis_perms || $course->visible) {
$this->user_may_see_course_data = true;
}
}
Seminar_Perm::get()->have_studip_perm('user', $this->booking->getAssignedUser()->id);
}
if ($this->make_comment_editable && Request::submitted('save')) {
CSRFProtection::verifyUnsafeRequest();
......
......@@ -80,7 +80,7 @@
<? endif ?>
<? endif ?>
<? endif ?>
<? if ($booking->getAssignedUserType() === 'course'): ?>
<? if ($user_may_see_course_data): ?>
<h3><?= _('Gebucht für:') ?></h3>
<a href="<?= URLHelper::getScriptLink(
'dispatch.php/course/details/index/'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment