U-C: Kanalkonfigurator (Kanal › Ablauf): Modellwahl nach Kanalprofil (E2/O2), Schritte mit Schalter, Ausführung, Ausführenden und Fristen, Herkunft der Werte, Vorschau; ConfigureChannelProcess; Modell legt Einstellungen fest
Flache Prozessfelder im Kanalformular entfallen als Hauptansicht. Volle Suite 820/820. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d695566a7a
commit
c255783cec
13 files changed
+981
-50
No files matched your search
@@ -8,9 +8,7 @@
|
||||
use App\Enums\ChannelEchoBehavior;
|
||||
use App\Enums\ChannelExportMode;
|
||||
use App\Enums\ChannelStatus;
|
||||
use App\Enums\IntakeKind;
|
||||
use App\Enums\ProcessSetting;
|
||||
use App\Filament\Forms\ProcessSettingFields;
|
||||
use App\Filament\Resources\Channels\ChannelResource;
|
||||
use App\Models\Channel;
|
||||
use App\Models\Property;
|
||||
use App\Support\CurrentProperty;
|
||||
@@ -21,6 +19,7 @@
|
||||
use Filament\Forms\Components\TextInput;
|
||||
use Filament\Forms\Components\Toggle;
|
||||
use Filament\Infolists\Components\TextEntry;
|
||||
use Filament\Schemas\Components\Component;
|
||||
use Filament\Schemas\Components\Group;
|
||||
use Filament\Schemas\Components\Section;
|
||||
use Filament\Schemas\Components\Utilities\Get;
|
||||
@@ -68,7 +67,12 @@ public static function configure(Schema $schema, bool $selectProperty = false):
|
||||
->required()
|
||||
->helperText('Zuerst „Beobachten“: Dann entsteht nichts, aber das Eingangsprotokoll (Expertenansicht) zeigt, welche Vorgänge entstanden wären. Unklare Belegungen und Meldungen zu gebuchten Vorgängen erscheinen unter „Zu erledigen“. Unterlagen gehen nie ohne Ihre Freigabe hinaus.')
|
||||
->columnSpanFull(),
|
||||
...self::processSections(),
|
||||
Select::make('settings.portal_profile')->label('Art des Portals (Kanalprofil)')
|
||||
->options(fn (): array => collect(config('channels.portal_profiles'))->except('website')->map(fn (array $profile): string => $profile['label'])->all())
|
||||
->placeholder('am Namen erkennen')
|
||||
->helperText('Legt fest, welche Ablaufmodelle für Anfragen und feste Buchungen dieses Portals wählbar sind (Kanal › Ablauf). Weitere Modelle werden nach fachlicher Prüfung im Kanalprofil freigegeben.')
|
||||
->columnSpanFull(),
|
||||
...self::processLink('Ablauf dieses Portals'),
|
||||
Select::make('connector')
|
||||
->label('Kalenderanbindung')
|
||||
->helperText('Diese Verbindung gleicht Belegungszeiträume über iCal ab. Weitere Portalfunktionen benötigen eine eigene Anbindung.')
|
||||
@@ -125,56 +129,27 @@ public static function configure(Schema $schema, bool $selectProperty = false):
|
||||
*/
|
||||
private static function websiteSections(): array
|
||||
{
|
||||
$defaults = (array) (Settings::tenant()?->process_defaults ?? []);
|
||||
$inherited = function (ProcessSetting $setting) use ($defaults): string {
|
||||
$value = $setting->normalize($defaults[$setting->value] ?? null) ?? $setting->default();
|
||||
|
||||
return $setting === ProcessSetting::ContractTemplate ? 'Vorlage der Wohnung' : $setting->describe($value);
|
||||
};
|
||||
$settings = array_values(array_filter(ProcessSetting::cases(), fn (ProcessSetting $setting): bool => in_array(IntakeKind::Inquiry, $setting->channelIntakes(), true)));
|
||||
|
||||
return [
|
||||
Section::make('Anfragen über die eigene Webseite')
|
||||
->description('Nur ausfüllen, was für Anfragen über Ihre Webseite anders sein soll als in Ihren Standardeinstellungen (System › So arbeite ich). Telefon- und E-Mail-Anfragen folgen weiter den Standardeinstellungen.')
|
||||
->columns(2)
|
||||
->description('Wie Anfragen über Ihre Webseite abgewickelt werden – Ablaufmodell, Schritte, Fristen –, stellen Sie unter „Ablauf“ ein. Telefon- und E-Mail-Anfragen folgen Ihren Standardeinstellungen (System › So arbeite ich).')
|
||||
->columnSpanFull()
|
||||
->visible(fn (?Channel $record): bool => $record?->isWebsite() ?? false)
|
||||
->schema(ProcessSettingFields::make('process_overrides.inquiry.', $settings, $inherited)),
|
||||
->schema(self::processLink('Ablauf der Webseite')),
|
||||
];
|
||||
}
|
||||
|
||||
/**
|
||||
* What a contract template brings along, shown under the template choice.
|
||||
*/
|
||||
/**
|
||||
* Deviations of this portal from the landlord's defaults, separately for requests and for bookings that are already
|
||||
* binding when they arrive. Empty fields follow the defaults (System › So arbeite ich).
|
||||
* The process of a channel is set up step by step on its own page (Kanal › Ablauf), no longer as a flat list here.
|
||||
*
|
||||
* @return list<Section>
|
||||
* @return list<Component>
|
||||
*/
|
||||
private static function processSections(): array
|
||||
private static function processLink(string $label): array
|
||||
{
|
||||
$defaults = (array) (Settings::tenant()?->process_defaults ?? []);
|
||||
$inherited = function (ProcessSetting $setting) use ($defaults): string {
|
||||
$value = $setting->normalize($defaults[$setting->value] ?? null) ?? $setting->default();
|
||||
|
||||
return $setting === ProcessSetting::ContractTemplate ? 'Vorlage der Wohnung' : $setting->describe($value);
|
||||
};
|
||||
$settingsFor = fn (IntakeKind $intake): array => array_values(array_filter(ProcessSetting::cases(), fn (ProcessSetting $setting): bool => $setting !== ProcessSetting::FormRequiresAddress && in_array($intake, $setting->channelIntakes(), true)));
|
||||
|
||||
return [
|
||||
Section::make('Anfragen über dieses Portal')
|
||||
->description('Nur ausfüllen, was bei diesem Portal anders ist als in Ihren Standardeinstellungen.')
|
||||
->columns(2)
|
||||
->columnSpanFull()
|
||||
->collapsible()
|
||||
->schema(ProcessSettingFields::make('process_overrides.inquiry.', $settingsFor(IntakeKind::Inquiry), $inherited)),
|
||||
Section::make('Feste Buchungen über dieses Portal')
|
||||
->description('Buchungen, die beim Portal schon verbindlich sind. Die Vertragsvorlage bringt Vertragstext, Stornoregel und Anlagen mit.')
|
||||
->columns(2)
|
||||
->columnSpanFull()
|
||||
->collapsible()
|
||||
->schema(ProcessSettingFields::make('process_overrides.booking.', $settingsFor(IntakeKind::Booking), $inherited)),
|
||||
TextEntry::make('process_link')->hiddenLabel()->columnSpanFull()
|
||||
->state(fn (?Channel $record): string => $record === null ? 'Den Ablauf richten Sie nach dem Anlegen unter „Ablauf“ ein.' : $label.': Ablaufmodell wählen und Schritte einstellen.')
|
||||
->url(fn (?Channel $record): ?string => $record === null ? null : ChannelResource::getUrl('process', ['record' => $record]))
|
||||
->color('primary'),
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user