Phase 6 (Teil 1): Dokumente und Organigramm
- Dokumente-Plugin: Ordnerbaum mit vererbten Rechten und Sichtbarkeit, Hochladen per Ziehen und Ablegen, Versionen, Suche, Pagebuilder-Block - Organigramm aus den Vorgesetzten, Vorgesetzte im Admin pflegbar - Personensuche im Kopf übernimmt nur noch Suchbegriffe des Verzeichnisses Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
21c706e5f5
commit
d6d5d4b0fe
110 changed files with 2209 additions and 208 deletions
29
plugins-core/documents/src/DocumentPresenter.php
Normal file
29
plugins-core/documents/src/DocumentPresenter.php
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\Documents;
|
||||
|
||||
use Inhaus\Plugins\Documents\Models\Document;
|
||||
|
||||
final class DocumentPresenter
|
||||
{
|
||||
/**
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public static function row(Document $document): array
|
||||
{
|
||||
$version = $document->currentVersion;
|
||||
|
||||
return [
|
||||
'id' => $document->id,
|
||||
'title' => $document->title,
|
||||
'description' => $document->description,
|
||||
'folder_id' => $document->folder_id,
|
||||
'version' => $version?->version,
|
||||
'name' => $version?->name,
|
||||
'extension' => $version?->extension(),
|
||||
'size' => (int) ($version?->size ?? 0),
|
||||
'updated_at' => ($version?->created_at ?? $document->updated_at)?->toIso8601String(),
|
||||
'download_url' => $version ? $document->downloadUrl($version) : null,
|
||||
];
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue