aboutsummaryrefslogtreecommitdiff
path: root/app/controllers/consultation
diff options
context:
space:
mode:
authorJan-Hendrik Willms <tleilax+studip@gmail.com>2021-11-04 13:25:45 +0000
committerDavid Siegfried <david.siegfried@uni-vechta.de>2021-11-04 13:25:45 +0000
commit0fe45573d21b5110a46de7b6dc60cbcec3f99de7 (patch)
tree7b45555cff70f4aa96167f6b500d757034549aff /app/controllers/consultation
parentad2256c7d00a28c5b5022c21a887c8eb83469a61 (diff)
fixes #389
Diffstat (limited to 'app/controllers/consultation')
-rw-r--r--app/controllers/consultation/admin.php30
1 files changed, 26 insertions, 4 deletions
diff --git a/app/controllers/consultation/admin.php b/app/controllers/consultation/admin.php
index 5ff0e37..12c77a7 100644
--- a/app/controllers/consultation/admin.php
+++ b/app/controllers/consultation/admin.php
@@ -26,6 +26,21 @@ class Consultation_AdminController extends ConsultationController
$this->range_config = $this->range->getConfiguration();
$this->setupSidebar($action, $this->range_config);
+
+ // Show information about which user is edited when a deputy edits
+ if ($this->range instanceof User && Deputy::isDeputy($GLOBALS['user']->id, $this->range->id, true)) {
+ $message = sprintf(
+ _('Daten von: %1$s (%2$s), Status: %3$s'),
+ htmlReady($this->range->getFullName()),
+ htmlReady($this->range->username),
+ htmlReady($this->range->perms)
+ );
+ PageLayout::postMessage(
+ MessageBox::info($message)
+ , 'settings-user-anncouncement'
+ );
+
+ }
}
private function groupSlots(array $slots)
@@ -442,7 +457,7 @@ class Consultation_AdminController extends ConsultationController
{
if ($what === 'messages') {
// TODO: Applicable everywhere?
- $GLOBALS['user']->cfg->store(
+ $this->getUserConfig()->store(
'CONSULTATION_SEND_MESSAGES',
(bool) $state
);
@@ -453,7 +468,7 @@ class Consultation_AdminController extends ConsultationController
(bool) $state
);
} elseif ($what === 'grouped') {
- $GLOBALS['user']->cfg->store(
+ $this->getUserConfig()->store(
'CONSULTATION_SHOW_GROUPED',
(bool) $state
);
@@ -733,7 +748,7 @@ class Consultation_AdminController extends ConsultationController
$options = $sidebar->addWidget(new OptionsWidget());
$options->addCheckbox(
_('Benachrichtungen über Buchungen'),
- $GLOBALS['user']->cfg->CONSULTATION_SEND_MESSAGES,
+ $this->getUserConfig()->getValue('CONSULTATION_SEND_MESSAGES'),
$this->toggleURL('messages/1', $action === 'expired'),
$this->toggleURL('messages/0', $action === 'expired')
);
@@ -745,7 +760,7 @@ class Consultation_AdminController extends ConsultationController
);
$options->addCheckbox(
_('Termine gruppiert anzeigen'),
- $GLOBALS['user']->cfg->CONSULTATION_SHOW_GROUPED,
+ $this->getUserConfig()->getValue('CONSULTATION_SHOW_GROUPED'),
$this->toggleURL('grouped/1', $action === 'expired'),
$this->toggleURL('grouped/0', $action === 'expired')
);
@@ -774,4 +789,11 @@ class Consultation_AdminController extends ConsultationController
Request::get("{$index}-time")
]));
}
+
+ private function getUserConfig(): RangeConfig
+ {
+ return $this->range instanceof User
+ ? $this->range->getConfiguration()
+ : $GLOBALS['user']->cfg;
+ }
}