- Eigene Webseite als Kanal eigener Art (channels.kind = website), nur zur Konfiguration: Webseiten-Anfragen bleiben direkt (A1) ohne Kanalbezug; der Eintrag nimmt an Sync, Export, Überwachung und Sperraufgaben nicht teil (active()/Property::channels() nur Portale, Feed nur für Portale). - Neue Einstellungen im bestehenden ProcessSetting: Klärungsreservierung automatisch/Freigabe (15/180 min, 0 = keine), Rückfragemodus, Erinnerungen, Folgefragen, Erinnerungsabstand, Linkgültigkeit, Anschrift im Webformular verlangen (Standard: nein). - „Kanäle“ in der einfachen Ansicht: Webseite und Portale an einer Stelle, Verweis auf „Ihre Standards“; „Wirksame Einstellungen“ mit Spalte „Eigene Webseite“ und Herkunft „Webseite“. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
56 lines
2.0 KiB
PHP
56 lines
2.0 KiB
PHP
<?php
|
|
|
|
namespace App\Filament\Resources\Channels\Pages;
|
|
|
|
use App\Actions\AnalyzeChannelCalendar;
|
|
use App\Actions\ConfigureChannel;
|
|
use App\Channels\ChannelSyncException;
|
|
use App\Filament\Resources\Channels\ChannelResource;
|
|
use App\Models\Channel;
|
|
use Filament\Actions\Action;
|
|
use Filament\Notifications\Notification;
|
|
use Filament\Resources\Pages\EditRecord;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class EditChannel extends EditRecord
|
|
{
|
|
protected static string $resource = ChannelResource::class;
|
|
|
|
protected function getHeaderActions(): array
|
|
{
|
|
return [
|
|
Action::make('rules')->label('Regeln & Exportfelder')->url(fn (): string => ChannelResource::getUrl('rules', ['record' => $this->record]))->visible(fn (): bool => $this->record->isPortal()),
|
|
Action::make('analyze')->label('Kalender analysieren')->visible(fn (): bool => $this->record->isPortal())->action(function (AnalyzeChannelCalendar $analyze): void {
|
|
try {
|
|
$analyze->handle($this->record);
|
|
$this->redirect(ChannelResource::getUrl('rules', ['record' => $this->record]));
|
|
} catch (ChannelSyncException $exception) {
|
|
Notification::make()->title('Analyse nicht möglich')->body($exception->getMessage())->danger()->send();
|
|
}
|
|
}),
|
|
];
|
|
}
|
|
|
|
protected function mutateFormDataBeforeFill(array $data): array
|
|
{
|
|
return [...$data, 'settings' => $this->record->settings];
|
|
}
|
|
|
|
protected function handleRecordUpdate(Model $record, array $data): Model
|
|
{
|
|
// The own website's entry only keeps its settings; there is no connection to configure.
|
|
if ($record instanceof Channel && $record->isWebsite()) {
|
|
$record->update(['process_overrides' => $data['process_overrides'] ?? []]);
|
|
|
|
return $record;
|
|
}
|
|
|
|
return app(ConfigureChannel::class)->handle($record->property, $data, $record);
|
|
}
|
|
|
|
protected function getRedirectUrl(): string
|
|
{
|
|
return ChannelResource::getUrl('index');
|
|
}
|
|
}
|