added date input in room reservation creation

This commit is contained in:
adisposkofh
2026-10-22 08:36:36 +02:00
parent e68634cf6f
commit 4cfa4955f4
4 changed files with 69 additions and 7 deletions
@@ -92,7 +92,7 @@ class RoomPlan extends FHCAPI_Controller
$result = $this->stundenplanlib->addReservation($start, $end, $title, $beschreibung, $ort_kurzbz, $lektoren, $studiengang_kz, $semester, $verband, $gruppe, $spezialgruppe);
if (isError($result))
$this->terminateWithError($result);
$this->terminateWithError(getError($result));
$this->terminateWithSuccess($result);
}
+3 -2
View File
@@ -528,6 +528,7 @@ class StundenplanLib
$this->_ci->load->model('ressource/stundenplandev_model', 'StundenplandevModel');
$this->_ci->load->model('ressource/stundenplan_model', 'StundenplanModel');
$this->_ci->load->library('PermissionLib');
$this->_ci->load->library('PhrasesLib', ['LvPlan']);
$startTime = new DateTime($start);
$endTime = new DateTime($end);
@@ -558,7 +559,7 @@ class StundenplanLib
if ((hasData($stundenplandev_belegung) || hasData($stundenplan_belegung))
&& !$this->_ci->permissionlib->isBerechtigt('lehre/reservierungAdvanced'))
return error ('lvplan/bereitsReserviert');
return error($this->_ci->phraseslib->t('LvPlan', 'bereitsReserviert'));
$this->_ci->ReservierungModel->addSelect('stunde');
$reservation_hours = $this->_ci->ReservierungModel->loadWhere(array('datum' => $startTime->format('Y-m-d'), 'ort_kurzbz' => $ort_kurzbz));
@@ -571,7 +572,7 @@ class StundenplanLib
if (!empty(array_intersect($stunden, $reservation_hours))
&& !$this->_ci->permissionlib->isBerechtigt('lehre/reservierungAdvanced'))
return error("lvplan/bereitsReserviert");
return error($this->_ci->phraseslib->t('LvPlan', 'bereitsReserviert'));
if (!empty($lektoren))
@@ -29,6 +29,7 @@ export default {
selectedGruppe: null,
selectedLektoren: [],
nestedGroupOptions: {},
selectedDate: null,
};
},
computed: {
@@ -84,6 +85,10 @@ export default {
?.setZone?.(this.timezone)
?.toFormat?.("HH:mm:ss");
this.selectedDate = newEvent.start
.startOf("day")
.toISO()
.slice(0, 10);
this.selectedStart =
this.timeGrid.find((t) => t.start === startTime)?.start ||
this.timeGrid[0]?.start;
@@ -92,16 +97,20 @@ export default {
this.timeGrid.at(-1)?.end;
},
saveEvent() {
const date = this.selectedDate
? luxon.DateTime.fromFormat(this.selectedDate, "yyyy-MM-dd")
: this.event.start.startOf("day");
const [startHour, startMinute] = this.selectedStart
.split(":")
.map(Number);
const [endHour, endMinute] = this.selectedEnd
.split(":")
.map(Number);
const selectedStart = this.event.start
.startOf("day")
.set({ hour: startHour, minute: startMinute });
const selectedEnd = this.event.start
const selectedStart = date.set({
hour: startHour,
minute: startMinute,
});
const selectedEnd = date
.startOf("day")
.set({ hour: endHour, minute: endMinute });
@@ -197,6 +206,18 @@ export default {
{{ slot.end }}
</option>
</form-input>
<form-input
v-model="selectedDate"
:label="capitalize($p.t('ui', 'date'))"
type="datepicker"
container-class="col-6"
name="selectedDate"
format="dd.MM.yyyy"
preview-format="dd.MM.yyyy"
model-type="yyyy-MM-dd"
required
/>
</div>
<div class="row">
<form-input
+40
View File
@@ -30563,6 +30563,26 @@ In the list:
)
)
),
array(
'app' => 'core',
'category' => 'LvPlan',
'phrase' => 'bereitsReserviert',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Bereits reserviert!',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Already reserved!',
'description' => '',
'insertvon' => 'system'
)
)
),
// LvPlan Phrasen ende
//ProfilUpdate Phrasen start
array(
@@ -55880,6 +55900,26 @@ and represent the current state of research on the topic. The prescribed citatio
)
)
),
array(
'app' => 'core',
'category' => 'ui',
'phrase' => 'date',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Datum',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Date',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'ui',