Skip to content
Snippets Groups Projects
Commit ac6ddd39 authored by Jan-Hendrik Willms's avatar Jan-Hendrik Willms Committed by Elmar Ludwig
Browse files

allow changing of many options for consultation blocks, fixes #1707

Closes #1707

Merge request studip/studip!1113
parent 0d525938
No related branches found
No related tags found
No related merge requests found
...@@ -372,6 +372,11 @@ class Consultation_AdminController extends ConsultationController ...@@ -372,6 +372,11 @@ class Consultation_AdminController extends ConsultationController
$this->block = $this->loadBlock($block_id); $this->block = $this->loadBlock($block_id);
$this->block->room = trim(Request::get('room')); $this->block->room = trim(Request::get('room'));
$this->block->note = trim(Request::get('note')); $this->block->note = trim(Request::get('note'));
$this->block->size = Request::int('size');
$this->block->calendar_events = Request::bool('calender-events', false);
$this->block->show_participants = Request::bool('show-participants', false);
$this->block->require_reason = Request::option('require-reason');
$this->block->confirmation_text = trim(Request::get('confirmation-text'));
foreach ($this->block->slots as $slot) { foreach ($this->block->slots as $slot) {
$slot->note = ''; $slot->note = '';
......
<?php
/**
* @var Consultation_AdminController $controller
* @var ConsultationBlock $block
* @var int $page
* @var array|null $responsible
*/
?>
<form action="<?= $controller->store_edited($block, $page) ?>" method="post" class="default"> <form action="<?= $controller->store_edited($block, $page) ?>" method="post" class="default">
<?= CSRFProtection::tokenTag() ?> <?= CSRFProtection::tokenTag() ?>
...@@ -22,6 +30,55 @@ ...@@ -22,6 +30,55 @@
<? if ($responsible): ?> <? if ($responsible): ?>
<?= $this->render_partial('consultation/admin/block-responsibilities.php', compact('responsible', 'block')) ?> <?= $this->render_partial('consultation/admin/block-responsibilities.php', compact('responsible', 'block')) ?>
<? endif; ?> <? endif; ?>
<label>
<?= _('Maximale Teilnehmerzahl') ?>
<?= tooltipIcon(_('Falls Sie mehrere Personen zulassen wollen (wie z.B. zu einer Klausureinsicht), so geben Sie hier die maximale Anzahl an Personen an, die sich anmelden dürfen.')) ?>
<input required type="text" name="size" id="size"
min="1" max="50" value="<?= $block->size ?>">
</label>
<label>
<input type="checkbox" name="calender-events" value="1"
<? if ($block->calendar_events) echo 'checked'; ?>>
<?= _('Die freien Termine auch im Kalender markieren') ?>
</label>
<label>
<input type="checkbox" name="show-participants" value="1"
<? if ($block->show_participants) echo 'checked'; ?>>
<?= _('Namen der buchenden Personen sind öffentlich sichtbar') ?>
</label>
<label>
<?= _('Grund der Buchung abfragen') ?>
</label>
<div class="hgroup">
<label>
<input type="radio" name="require-reason" value="yes"
<? if ($block->require_reason === 'yes') echo 'checked'; ?>>
<?= _('Ja, zwingend erforderlich') ?>
</label>
<label>
<input type="radio" name="require-reason" value="optional"
<? if ($block->require_reason === 'optional') echo 'checked'; ?>>
<?= _('Ja, optional') ?>
</label>
<label>
<input type="radio" name="require-reason" value="no"
<? if ($block->require_reason === 'no') echo 'checked'; ?>>
<?= _('Nein') ?>
</label>
</div>
<label>
<?= _('Bestätigung für folgenden Text einholen') ?>
(<?= _('optional') ?>)
<?= tooltipIcon(_('Wird hier ein Text eingegeben, so müssen Buchende bestätigen, dass sie diesen Text gelesen haben.')) ?>
<textarea name="confirmation-text"><?= htmlReady($block->confirmation_text) ?></textarea>
</label>
</fieldset> </fieldset>
<footer data-dialog-button> <footer data-dialog-button>
......
...@@ -10,22 +10,28 @@ ...@@ -10,22 +10,28 @@
* method when the dev board finally fully supports PHP7 since that * method when the dev board finally fully supports PHP7 since that
* required "yield from". * required "yield from".
* *
* @property string block_id database column * @property string $id alias column for block_id
* @property string id alias column for block_id * @property string $block_id database column
* @property string range_id database column * @property string $range_id database column
* @property string range_type database column * @property string $range_type database column
* @property string teacher_id database column * @property string $teacher_id database column
* @property string start database column * @property int $start database column
* @property string end database column * @property int $end database column
* @property string room database column * @property string $room database column
* @property string calendar_events database column * @property bool $calendar_events database column
* @property string note database column * @property bool $show_participants database column
* @property string size database column * @property bool $require_reason database column
* @property bool has_bookings computed column * @property string $confirmation_text database column
* @property Range range computed column * @property string $note database column
* @property SimpleORMapCollection slots has_many ConsultationSlot * @property string $size database column
* @property ConsultationResponsibility[]|SimpleCollection responsibilities has_many ConsultationResponsibility * @property int $mkdate database column
* @property User[] responsible_persons * @property int $chdate database column
*
* @property bool $has_bookings computed column
* @property Range $range computed column
* @property ConsultationSlot[]|SimpleORMapCollection $slots has_many ConsultationSlot
* @property ConsultationResponsibility[]|SimpleCollection $responsibilities has_many ConsultationResponsibility
* @property User[] $responsible_persons
*/ */
class ConsultationBlock extends SimpleORMap implements PrivacyObject class ConsultationBlock extends SimpleORMap implements PrivacyObject
{ {
......
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