{{--
Fields of the notice form (#2957 slice 13, card #3099), shared by partials/createForm and
partials/editForm. Expects $notice (null on create). The same names and options as before:
title, content (TinyMCE, class "tinymce"; the textarea escapes the admin HTML, TinyMCE edits
it and the customer page prints it unescaped as before), start_time and stop_time as text in
the old "Y-m-d H:i:s" format (the jQuery datetimepicker is gone, DESIGN.md), company_id
(0 = Alla, then every company), status and prio from Notice::_get(). The type select stays
left out, as it was commented out before.
--}}
@php
$notice = $notice ?? null;
$statusWords = [1 => __('notice.nh.admin.visible'), 0 => __('notice.nh.admin.hidden')];
$prioWords = [5 => __('notice.nh.admin.prioNormal'), 10 => __('notice.nh.admin.prioHigh')];
$companies = [0 => __('notice.form.global')] + Company::get()->pluck('name', 'id')->toArray();
$companyId = (string) old('company_id', $notice ? ($notice->company_id ?? 0) : 0);
$status = (string) old('status', $notice ? $notice->status : '');
$prio = (string) old('prio', $notice ? $notice->prio : '');
$start = old('start_time', $notice ? optional($notice->start_time)->format('Y-m-d H:i:s') : date('Y-m-d H:i:00'));
$stop = old('stop_time', $notice ? optional($notice->stop_time)->format('Y-m-d H:i:s') : date('Y-m-d H:i:s', strtotime(date('Y-m-d H:i:00').'+ 6 days')));
@endphp