aboutsummaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2023-11-03 12:34:30 +0000
committerJan-Hendrik Willms <tleilax+studip@gmail.com>2023-11-03 12:34:30 +0000
commited00a0fbd4342f1d30bed8615a8a8273b5d17cdd (patch)
treecb737a226572d9bb113ca5816d9dfb326b6131d8 /app/controllers
parent7a4c5a1d7c9ba376a2ca46c0d6a7f1cd40d7bbbb (diff)
add sharable link to consultation overview and redirect unpriviledged users to...
Closes #3373 Merge request studip/studip!2325
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/consultation/admin.php15
-rw-r--r--app/controllers/consultation/overview.php1
2 files changed, 15 insertions, 1 deletions
diff --git a/app/controllers/consultation/admin.php b/app/controllers/consultation/admin.php
index 47d2ecd..b335e36 100644
--- a/app/controllers/consultation/admin.php
+++ b/app/controllers/consultation/admin.php
@@ -17,7 +17,8 @@ class Consultation_AdminController extends ConsultationController
parent::before_filter($action, $args);
if (!$this->range->isEditableByUser()) {
- throw new AccessDeniedException();
+ $this->redirect('consultation/overview');
+ return;
}
$this->activateNavigation('admin');
@@ -846,6 +847,18 @@ class Consultation_AdminController extends ConsultationController
$this->url_for('consultation/export/all', $action === 'expired'),
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)
diff --git a/app/controllers/consultation/overview.php b/app/controllers/consultation/overview.php
index e7456da..c8085f2 100644
--- a/app/controllers/consultation/overview.php
+++ b/app/controllers/consultation/overview.php
@@ -16,6 +16,7 @@ class Consultation_OverviewController extends ConsultationController
if ($this->range->isEditableByUser()) {
$this->redirect('consultation/admin');
+ return;
}
PageLayout::setTitle(sprintf(