aboutsummaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorThomas Hackl <hackl@data-quest.de>2025-11-25 11:58:42 +0100
committerThomas Hackl <hackl@data-quest.de>2025-11-25 11:58:42 +0100
commitf5539ca0dace099b495b0b03fb50de16a0a73930 (patch)
tree95225ca6f748d905642f37ea0a373ec27805df54 /app
parent04db48dbe7a41068ec004d39be480d9b1c61b120 (diff)
Resolve "Root Assistent: Optionen direkt bearbeiten können"
Closes #5777 Merge request studip/studip!4577
Diffstat (limited to 'app')
-rw-r--r--app/controllers/admin/configuration.php13
-rw-r--r--app/views/admin/configuration/edit_configuration.php4
-rw-r--r--app/views/root_assistant/index.php28
3 files changed, 37 insertions, 8 deletions
diff --git a/app/controllers/admin/configuration.php b/app/controllers/admin/configuration.php
index 1538334..9673cf2 100644
--- a/app/controllers/admin/configuration.php
+++ b/app/controllers/admin/configuration.php
@@ -101,7 +101,16 @@ class Admin_ConfigurationController extends AuthenticatedController
htmlReady($field)
));
- $this->relocate($this->action_url("configuration#field-{$field}", ['open_section' => $section]));
+ if (Request::bool('from_root_assi')) {
+ $this->redirect(
+ URLHelper::getURL(
+ 'dispatch.php/root_assistant',
+ ['contentbox_open' => 'new-configurations']
+ )
+ );
+ } else {
+ $this->relocate($this->action_url("configuration#field-{$field}", ['open_section' => $section]));
+ }
return;
}
}
@@ -110,6 +119,8 @@ class Admin_ConfigurationController extends AuthenticatedController
$this->config = ConfigurationModel::getConfigInfo($field);
$this->allconfigs = ConfigurationModel::getConfig();
+ $this->from_root_assi = Request::bool('from_root_assi');
+
PageLayout::setTitle(sprintf(_('Konfigurationsparameter: %s editieren'), $this->config['field']));
}
diff --git a/app/views/admin/configuration/edit_configuration.php b/app/views/admin/configuration/edit_configuration.php
index 6d8354f..aad38b2 100644
--- a/app/views/admin/configuration/edit_configuration.php
+++ b/app/views/admin/configuration/edit_configuration.php
@@ -3,6 +3,7 @@
* @var Admin_ConfigurationController $controller
* @var array $config
* @var array $allconfigs
+ * @var bool $from_root_assi
*/
?>
<form action="<?= $controller->link_for('admin/configuration/edit_configuration', ['field' => $config['field']]) ?>"
@@ -62,6 +63,9 @@
</label>
</div>
</fieldset>
+ <? if ($from_root_assi): ?>
+ <input type="hidden" name="from_root_assi" value="1">
+ <? endif ?>
<footer data-dialog-button>
<?= Studip\Button::createAccept(_('Übernehmen')) ?>
<?= Studip\LinkButton::createCancel(
diff --git a/app/views/root_assistant/index.php b/app/views/root_assistant/index.php
index 3b3e14c..c9b6c71 100644
--- a/app/views/root_assistant/index.php
+++ b/app/views/root_assistant/index.php
@@ -39,7 +39,10 @@
<section>
<table class="default">
<colgroup>
- <col style="width: 30%">
+ <col>
+ <col>
+ <col>
+ <col>
<col>
</colgroup>
<thead>
@@ -48,28 +51,29 @@
<th><?= _('Typ') ?></th>
<th><?= _('Beschreibung') ?></th>
<th><?= _('Aktueller Wert') ?></th>
+ <th></th>
</tr>
</thead>
<tbody>
- <? foreach ($configurations as $configuration) : ?>
+ <? foreach ($configurations as $configuration) : $field = $configuration->field; ?>
<tr>
- <td><?= htmlReady($configuration->field) ?></td>
+ <td><?= htmlReady($field) ?></td>
<td><?= htmlReady($configuration->type) ?></td>
<td><?= mb_strlen($configuration->description) > 120
? htmlReady(mb_substr($configuration->description, 0, 120))
- . '...' . tooltip2($configuration->description)
+ . '...' . tooltip2($configuration->description)['title']
: htmlReady($configuration->description) ?></td>
<td>
<? switch ($configuration->type) {
case 'string':
case 'i18n':
- echo htmlReady($configuration->value);
+ echo htmlReady(Config::get()->getValue($field));
break;
case 'integer':
- echo (int) $configuration->value;
+ echo (int) Config::get()->getValue($field);
break;
case 'boolean':
- echo $configuration->value
+ echo Config::get()->getValue($field)
? Icon::create('accept', Icon::ROLE_STATUS_GREEN,
['title' => _('TRUE')])
: Icon::create('decline', Icon::ROLE_STATUS_RED,
@@ -77,6 +81,16 @@
break;
} ?>
</td>
+ <td>
+ <a href="<?= URLHelper::getLink(
+ 'dispatch.php/admin/configuration/edit_configuration',
+ ['field' => $configuration->field, 'from_root_assi' => 1]) ?>"
+ title="<?= _('Diesen Eintrag bearbeiten') ?>?>"
+ data-dialog="size=auto"
+ >
+ <?= Icon::create('edit') ?>
+ </a>
+ </td>
</tr>
<? endforeach ?>
</tbody>