Liefere das Anfrageformular je Anfragegrund aus und gib dem Widget Gründe, Formularführung und Präsentation
Das Widget Anfrage wählt statt eines Anfrage-Einstiegs mehrere Anfragegründe, jeder zeigt auf ein veröffentlichtes Formular
(optional mit vorgewähltem Anliegen). Der Besucher erhält genau das Formular seines Grundes: /anfrage/formular/{vorlage}
mit Grund in der Adresse, dasselbe Token, dieselbe Auswertung und Annahme. Ein Dialog (dialog-Element) und die Grundauswahl
als Karten oder Auswahlfeld kommen aus resources/js/inquiry-widget.js. Seiten mit einem Einstieg bleiben darstellbar.
Bereiche lassen sich wie Gruppen anzeigen oder ausblenden.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
f255bf5200
commit
fb479c1b01
18 files changed
+1394
-57
No files matched your search
@@ -16,9 +16,14 @@
|
||||
*/
|
||||
final class FormToken
|
||||
{
|
||||
public static function issue(int $entryId, int $versionId): string
|
||||
/**
|
||||
* @param string $kind 'entry' (Anfrage-Einstieg) oder 'form' (veröffentlichte Vorlage, vom Widget „Anfrage“ gewählt);
|
||||
* $entryId ist dann die Kennung des Einstiegs beziehungsweise der Vorlage
|
||||
*/
|
||||
public static function issue(int $entryId, int $versionId, string $kind = 'entry'): string
|
||||
{
|
||||
return Crypt::encryptString(json_encode([
|
||||
'k' => $kind === 'form' ? 'form' : 'entry',
|
||||
'e' => $entryId,
|
||||
'v' => $versionId,
|
||||
't' => now()->getTimestamp(),
|
||||
@@ -27,7 +32,7 @@ public static function issue(int $entryId, int $versionId): string
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array{e: int, v: int, t: int, n: string}|null
|
||||
* @return array{k: string, e: int, v: int, t: int, n: string}|null
|
||||
*/
|
||||
public static function read(mixed $token): ?array
|
||||
{
|
||||
@@ -45,6 +50,6 @@ public static function read(mixed $token): ?array
|
||||
return null;
|
||||
}
|
||||
|
||||
return ['e' => (int) $data['e'], 'v' => (int) $data['v'], 't' => (int) $data['t'], 'n' => $data['n']];
|
||||
return ['k' => ($data['k'] ?? 'entry') === 'form' ? 'form' : 'entry', 'e' => (int) $data['e'], 'v' => (int) $data['v'], 't' => (int) $data['t'], 'n' => $data['n']];
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user