Buchungsformular: Rücknahme-Mitarbeiter wieder direkt wählbar (ohne JS-Abhängigkeit), Asset-/SW-Version angehoben
This commit is contained in:
parent
e1e2332ce4
commit
f340995bd6
6 changed files with 17 additions and 49 deletions
|
|
@ -146,10 +146,7 @@ function booking_input(array $source): array
|
|||
return [
|
||||
'trailer_id' => (int) ($source['trailer_id'] ?? 0),
|
||||
'employee_id' => (int) ($source['employee_id'] ?? 0),
|
||||
// Abweichende Rücknahme ist ein Sonderfall: Sie gilt nur, wenn das
|
||||
// Formular sie über die Checkbox ausdrücklich aktiviert hat.
|
||||
'separate_return' => !empty($source['separate_return']),
|
||||
'return_employee_id' => !empty($source['separate_return']) ? (int) ($source['return_employee_id'] ?? 0) : 0,
|
||||
'return_employee_id' => (int) ($source['return_employee_id'] ?? 0),
|
||||
'start_date' => trim((string) ($source['start_date'] ?? '')),
|
||||
'end_date' => trim((string) ($source['end_date'] ?? '')),
|
||||
'start_time' => normalize_time($source['start_time'] ?? ''),
|
||||
|
|
@ -211,9 +208,7 @@ function booking_validate(array $data, int $excludeId = 0, int $allowTrailerId =
|
|||
|
||||
// Optionaler, abweichender Mitarbeiter für die Abholung/Rücknahme.
|
||||
$returnEmployeeId = (int) ($data['return_employee_id'] ?? 0);
|
||||
if (!empty($data['separate_return']) && $returnEmployeeId <= 0) {
|
||||
$errors['return_employee_id'] = 'Bitte einen Mitarbeiter für die Rücknahme auswählen.';
|
||||
} elseif ($returnEmployeeId > 0) {
|
||||
if ($returnEmployeeId > 0) {
|
||||
$returnEmployee = employee_find($returnEmployeeId);
|
||||
if (!$returnEmployee || ((int) $returnEmployee['active'] !== 1 && (int) $returnEmployee['id'] !== $allowEmployeeId)) {
|
||||
$errors['return_employee_id'] = 'Bitte einen gültigen Mitarbeiter für die Rücknahme auswählen.';
|
||||
|
|
|
|||
|
|
@ -621,7 +621,6 @@ function form_values_from_input(array $data): array
|
|||
'trailer_id' => (int) $data['trailer_id'],
|
||||
'employee_id' => (int) $data['employee_id'],
|
||||
'return_employee_id' => (int) ($data['return_employee_id'] ?? 0),
|
||||
'separate_return' => !empty($data['separate_return']) ? 1 : 0,
|
||||
'start_date' => (string) $data['start_date'],
|
||||
'end_date' => (string) $data['end_date'],
|
||||
'start_time' => (string) ($data['start_time'] ?? ''),
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ function url(string $path = '/'): string
|
|||
}
|
||||
|
||||
/** Cache-Buster: bei Änderungen an app.css/app.js erhöhen. */
|
||||
const DIC_ASSET_VERSION = '17';
|
||||
const DIC_ASSET_VERSION = '18';
|
||||
|
||||
function asset(string $path): string
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue