Skip to content
Snippets Groups Projects
Commit ed00a0fb authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms
Browse files

add sharable link to consultation overview and redirect unpriviledged users to...

Closes #3373

Merge request studip/studip!2325
parent 7a4c5a1d
No related branches found
No related tags found
No related merge requests found
...@@ -17,7 +17,8 @@ class Consultation_AdminController extends ConsultationController ...@@ -17,7 +17,8 @@ class Consultation_AdminController extends ConsultationController
parent::before_filter($action, $args); parent::before_filter($action, $args);
if (!$this->range->isEditableByUser()) { if (!$this->range->isEditableByUser()) {
throw new AccessDeniedException(); $this->redirect('consultation/overview');
return;
} }
$this->activateNavigation('admin'); $this->activateNavigation('admin');
...@@ -846,6 +847,18 @@ class Consultation_AdminController extends ConsultationController ...@@ -846,6 +847,18 @@ class Consultation_AdminController extends ConsultationController
$this->url_for('consultation/export/all', $action === 'expired'), $this->url_for('consultation/export/all', $action === 'expired'),
Icon::create('export') Icon::create('export')
); );
if ($action !== 'expired') {
$share = new ShareWidget();
$share->addCopyableLink(
_('Link zur Terminübersicht kopieren'),
$this->url_for('consultation/overview', [
'again' => 'yes',
]),
Icon::create('clipboard')
);
$sidebar->addWidget($share);
}
} }
private function getDateAndTime($index) private function getDateAndTime($index)
......
...@@ -16,6 +16,7 @@ class Consultation_OverviewController extends ConsultationController ...@@ -16,6 +16,7 @@ class Consultation_OverviewController extends ConsultationController
if ($this->range->isEditableByUser()) { if ($this->range->isEditableByUser()) {
$this->redirect('consultation/admin'); $this->redirect('consultation/admin');
return;
} }
PageLayout::setTitle(sprintf( PageLayout::setTitle(sprintf(
......
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