From 7e01741c2c83c50ffa828535b7f4cfb24ef39a24 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michaela=20Br=C3=BCckner?= Date: Thu, 8 Jun 2023 16:01:41 +0000 Subject: =?UTF-8?q?fixes=20Systemeigenschaften=20eines=20Raumes=20sind=20u?= =?UTF-8?q?nver=C3=A4nderbar=20#2707?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #2707 Merge request studip/studip!1831 --- app/controllers/resources/property.php | 25 ++++++++++--------------- app/views/resources/property/_add_edit_form.php | 11 ++++------- 2 files changed, 14 insertions(+), 22 deletions(-) diff --git a/app/controllers/resources/property.php b/app/controllers/resources/property.php index 6c2bff4..e5c18ea 100644 --- a/app/controllers/resources/property.php +++ b/app/controllers/resources/property.php @@ -157,32 +157,27 @@ class Resources_PropertyController extends AuthenticatedController ); return; } - if (!in_array($this->write_permission_level, ['user', 'autor', 'tutor', 'admin', 'admin-global'])) { - PageLayout::postError( - _('Die angegebene Rechtestufe ist ungültig!') - ); - return; - } + } + + if (!in_array($this->write_permission_level, ['user', 'autor', 'tutor', 'admin', 'admin-global'])) { + PageLayout::postError( + _('Die angegebene Rechtestufe ist ungültig!') + ); + return; } $this->property->description = $this->description; $this->property->display_name = $this->display_name; + $this->property->write_permission_level = $this->write_permission_level; + $this->property->searchable = $this->searchable ? '1' : '0'; $this->property->info_label = $this->info_label ? '1' : '0'; + $this->property->range_search = $this->range_search ? '1' : '0'; if (!$this->property->system) { //The following fields may only be edited //if the property is not a system property: $this->property->name = $this->name; $this->property->type = $this->type; - $this->property->searchable = ($this->searchable ? '1' : '0'); - $this->property->options = $this->options; - $this->property->range_search = ( - $this->range_search - ? '1' - : '0' - ); - $this->property->write_permission_level = $this->write_permission_level; - } $success = $this->property->store(); diff --git a/app/views/resources/property/_add_edit_form.php b/app/views/resources/property/_add_edit_form.php index 75f3ddc..8070fd4 100644 --- a/app/views/resources/property/_add_edit_form.php +++ b/app/views/resources/property/_add_edit_form.php @@ -23,8 +23,7 @@