diff --git a/CHANGELOG.md b/CHANGELOG.md
index 4fb21b41..9e67728a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -6,13 +6,14 @@ Der Self-Updater zeigt diese Abschnitte bei neuen Versionen an.
## 0.10.0
+- **„Dokumente“ heißt jetzt „Downloads“** (Adresse /downloads, alte Links leiten weiter). Der Name „Dokumente“ ist für das kommende QM-Modul mit QM-Dokumenten und Formularen vorgesehen. Ordner, Dateien, Rechte, Sichtbarkeiten, Favoriten, Menüpunkte und eingebundene Blöcke werden beim Update automatisch übernommen
- **Menü selbst gestalten** (Admin → Portal → Menü): Bereiche, Seiten (auf Wunsch mit Unterseiten als Untermenü), eigene Links (auch im neuen Tab) und Gruppen mit Unterpunkten; per Ziehen sortieren, optional mit Symbol, einzelne Punkte nur für bestimmte Rollen. Ohne eigenes Menü gilt weiter das automatische
- Symbole: alle 1.854 Lucide-Symbole lokal verfügbar für Menü, Schnellzugriffe und Pagebuilder – 66 häufig gebrauchte mit deutscher Bezeichnung vorneweg, alle übrigen über die Suche (englische Namen); im Portal wird der vollständige Satz nur bei Bedarf geladen
- Passt das Menü nicht in die Kopfzeile, wandern die letzten Punkte unter „Mehr“
- Initialen ohne Foto erscheinen in einer festen Farbe je Person; das Organigramm zeigt jede Abteilung mit eigener Farbe samt Legende
- Einheitliche Seitenköpfe (Pfad, Titel, Beschreibung, Aktionen) auf allen Übersichtsseiten
-- Dokumente: mit dem Stern gemerkte Dokumente unter „Meine Dokumente“ – in der Ablage und als Kachel auf der Startseite; „Häufig genutzt“ nach Downloads
-- Dokumente: Vorschaubilder in der Kachelansicht (Bilder und erste PDF-Seite, im Browser erzeugt)
+- Downloads: mit dem Stern gemerkte Dateien unter „Meine Downloads“ – im Bereich und als Kachel auf der Startseite; „Häufig genutzt“ nach Anzahl der Downloads
+- Downloads: Vorschaubilder in der Kachelansicht (Bilder und erste PDF-Seite, im Browser erzeugt)
- Platzhalter beim Nachladen statt springender Inhalte
## 0.9.1
diff --git a/docs/PLAN.md b/docs/PLAN.md
index cd2d99ce..1c8ab885 100644
--- a/docs/PLAN.md
+++ b/docs/PLAN.md
@@ -454,7 +454,7 @@ Entwickler, ohne Build, direkt im Admin unter „Erscheinungsbild“.
## 13. Mitgelieferte Plugins
**Start:** Dashboard, News/Feed mit Kategorien, CMS-Seiten, Formulare,
-WordPress-Import, Verzeichnis & Organigramm, Dokumente, App-Launcher.
+WordPress-Import, Verzeichnis & Organigramm, Downloads, QM-Dokumente (eigenes Modul), App-Launcher.
**Später:** Events, Umfragen, Geburtstage/Jubiläen, Onboarding, Raumbuchung,
Kantinenplan, Ideenbox, Urlaubsanträge.
@@ -485,7 +485,7 @@ Kantinenplan, Ideenbox, Urlaubsanträge.
| **4 – CMS** ✅ | Seitenbaum, Pagebuilder (Layout-, Inhalts-, Medien- und dynamische Blöcke, Sichtbarkeit je Block), Entwürfe, Versionen, Zeitsteuerung, Bearbeitungssperre, Freigaben; News-Freigabe-Workflow und Redaktion im Portal; Benachrichtigungen. Offen: Vorlagen und wiederverwendbare Blöcke |
| **4b – Formulare & Umstieg** ✅ | Formular-Plugin (visueller Baukasten im Portal, Bedingungen, Uploads, anonyme Formulare, Mail + Backend, Ergebnis-Rechte je Formular und Rolle, CSV, Löschfristen; eingebunden per Pagebuilder-Block und unter Beiträgen, kein eigener Menüpunkt); WordPress-Import (Beiträge, Kategorien, Bilder, Seiten); E-Mail-Versand im Admin; anpassbare Startseite mit eigenen Kacheln; Geburtstage (optionales Plugin) |
| **5 – Branding & Theming** ✅ | Vollständige Seite „Erscheinungsbild“: Logo-Varianten, Farben inkl. Farbtreue & Kontrastprüfung, Schriften, Form, Login-Seite, E-Mails, Live-Vorschau, Entwurf/Veröffentlichen, Export/Import |
-| **6 – Weitere Plugins & IdPs** | ✅ Organigramm (aus Vorgesetzten, im Admin pflegbar), ✅ Dokumente (Ordner mit vererbten Rechten und Sichtbarkeit, Versionen, Suche, Pagebuilder-Block); ✅ OIDC generisch, LDAP/AD, SAML 2 (als Plugins auf gemeinsamem Treiber-Unterbau); offen: Lasttests 5.000 User |
+| **6 – Weitere Plugins & IdPs** | ✅ Organigramm (aus Vorgesetzten, im Admin pflegbar), ✅ Downloads (Ordner mit vererbten Rechten und Sichtbarkeit, Versionen, Suche, Favoriten, Pagebuilder-Block – früher „Dokumente“); geplant: QM-Modul für QM-Dokumente und -Formulare; ✅ OIDC generisch, LDAP/AD, SAML 2 (als Plugins auf gemeinsamem Treiber-Unterbau); offen: Lasttests 5.000 User |
| **7 – Plugin-SDK öffentlich** | Doku, Generator, Beispiel-Plugins (kein Plugin-Verzeichnis) |
| **8 – Mobil** | REST-API (Sanctum), Web-Push, native App |
diff --git a/docs/PLUGINS.md b/docs/PLUGINS.md
index e53e732e..7c8da356 100644
--- a/docs/PLUGINS.md
+++ b/docs/PLUGINS.md
@@ -84,7 +84,7 @@ class Plugin extends BasePlugin
`permissionResource()`.
- Zielgruppen: `App\Support\Permissions\Audiences::constrain($query, 'mein_typ', 'tabelle.id', $user)`
und im Admin-Formular `App\Filament\Components\AudienceSection::make('mein_typ')`.
-- Hierarchische Objekttypen (z. B. Seiten, Dokumentordner – Vorlage: `plugins-core/documents`):
+- Hierarchische Objekttypen (z. B. Seiten, Download-Ordner – Vorlage: `plugins-core/downloads`):
`resourceType(..., descendants: fn (array $ids) => [...])`.
Rechte mit „inkl. Unterobjekten“ gelten dann auch für alle Nachfahren; ändert sich
der Baum, `App\Support\Permissions\Permissions::flush()` aufrufen.
diff --git a/plugins-core/documents/database/migrations/2026_09_30_000001_add_document_favorites_and_downloads.php b/plugins-core/documents/database/migrations/2026_09_30_000001_add_document_favorites_and_downloads.php
deleted file mode 100644
index 0fa21901..00000000
--- a/plugins-core/documents/database/migrations/2026_09_30_000001_add_document_favorites_and_downloads.php
+++ /dev/null
@@ -1,34 +0,0 @@
-foreignId('user_id')->constrained()->cascadeOnDelete();
- $table->foreignId('document_id')->constrained()->cascadeOnDelete();
- $table->timestamp('created_at')->nullable();
-
- $table->primary(['user_id', 'document_id']);
- });
-
- Schema::table('documents', function (Blueprint $table) {
- $table->unsignedInteger('downloads')->default(0)->after('updated_by');
- $table->index('downloads');
- });
- }
-
- public function down(): void
- {
- Schema::table('documents', function (Blueprint $table) {
- $table->dropIndex(['downloads']);
- $table->dropColumn('downloads');
- });
-
- Schema::dropIfExists('document_favorites');
- }
-};
diff --git a/plugins-core/documents/plugin.json b/plugins-core/documents/plugin.json
deleted file mode 100644
index 6703bd04..00000000
--- a/plugins-core/documents/plugin.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{
- "slug": "documents",
- "name": "Dokumente",
- "version": "1.0.0",
- "description": "Dokumentenablage mit Ordnern, Versionen, Suche und Rechten je Ordner – z. B. Formulare, Dienstanweisungen, Handbücher.",
- "author": "Inhaus",
- "namespace": "Inhaus\\Plugins\\Documents\\",
- "class": "Inhaus\\Plugins\\Documents\\DocumentsPlugin",
- "requires": {
- "core": ">=0.8.0",
- "php": ">=8.3"
- }
-}
diff --git a/plugins-core/documents/resources/js/components/FavoriteButton.vue b/plugins-core/documents/resources/js/components/FavoriteButton.vue
deleted file mode 100644
index 3f4a7af1..00000000
--- a/plugins-core/documents/resources/js/components/FavoriteButton.vue
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
-
-
-
diff --git a/plugins-core/documents/routes/web.php b/plugins-core/documents/routes/web.php
deleted file mode 100644
index 3dded627..00000000
--- a/plugins-core/documents/routes/web.php
+++ /dev/null
@@ -1,20 +0,0 @@
-prefix('dokumente')->name('documents.')->controller(DocumentController::class)->where(['document' => '[0-9]+', 'folder' => '[0-9]+', 'version' => '[0-9]+'])->group(function () {
- Route::get('/', 'index')->name('index');
- Route::get('/ordner/{folder}', 'folder')->name('folder');
- Route::post('/ordner', 'storeFolder')->name('folders.store');
- Route::put('/ordner/{folder}', 'updateFolder')->name('folders.update');
- Route::delete('/ordner/{folder}', 'destroyFolder')->name('folders.destroy');
- Route::post('/ordner/{folder}/dateien', 'upload')->name('upload');
- Route::put('/{document}', 'update')->name('update');
- Route::delete('/{document}', 'destroy')->name('destroy');
- Route::post('/{document}/versionen', 'newVersion')->name('versions.store');
- Route::get('/{document}/versionen', 'versions')->name('versions');
- Route::post('/{document}/favorit', 'favorite')->name('favorite');
- Route::delete('/{document}/favorit', 'unfavorite')->name('unfavorite');
- Route::get('/{document}/herunterladen/{version}/{name}', 'download')->name('download');
-});
diff --git a/plugins-core/documents/src/DocumentsPlugin.php b/plugins-core/documents/src/DocumentsPlugin.php
deleted file mode 100644
index 6307c1f2..00000000
--- a/plugins-core/documents/src/DocumentsPlugin.php
+++ /dev/null
@@ -1,78 +0,0 @@
-app->singleton(FolderTree::class);
-
- $this->app->make(Navigation::class)->add('documents', 'Dokumente', '/dokumente', active: 'documents.*', sort: 50);
-
- $abilities = $this->app->make(Abilities::class);
- $abilities->define('documents.manage', 'Dokumente: gesamte Ablage verwalten', 'Dokumente');
- $abilities->define('documents.edit', 'Dokumente pflegen', 'Dokumente', resource: 'document_folder');
- $abilities->resourceType(
- 'document_folder',
- 'Dokumentenordner',
- fn () => $this->app->make(FolderTree::class)->options(),
- fn (array $ids) => $this->app->make(FolderTree::class)->descendantIds($ids),
- );
-
- Gate::policy(DocumentFolder::class, DocumentFolderPolicy::class);
-
- // Startseite: gemerkte Dokumente – ohne Favoriten die meistgenutzten.
- $this->app->make(Widgets::class)->add('documents.favorites', 'documents::MyDocuments', 'aside', sort: 25, props: function (User $user) {
- $visible = $this->app->make(FolderTree::class)->visibleIds($user) ?: [0];
- $favorites = Document::query()->whereIn('folder_id', $visible)
- ->whereIn('id', DB::table('document_favorites')->where('user_id', $user->id)->select('document_id'))
- ->with('currentVersion')->orderBy('title')->limit(6)->get();
- $popular = $favorites->isEmpty()
- ? Document::query()->whereIn('folder_id', $visible)->where('downloads', '>', 0)->with('currentVersion')->orderByDesc('downloads')->limit(5)->get()
- : collect();
-
- return [
- 'favorites' => $favorites->map(fn (Document $d) => DocumentPresenter::row($d, null, true))->all(),
- 'popular' => $popular->map(fn (Document $d) => DocumentPresenter::row($d))->all(),
- ];
- }, label: 'Meine Dokumente');
-
- $this->app->make(Blocks::class)->add(BlockType::make('documents.folder', 'Dokumente', 'file-down', 'dynamic', 'documents::FolderBlock')
- ->description('Die Dokumente eines Ordners – immer in der aktuellen Fassung.')
- ->fields([
- Field::text('title', 'Überschrift', 150),
- Field::select('folder', 'Ordner', fn () => collect($this->app->make(FolderTree::class)->options())->mapWithKeys(fn ($name, $id) => [(string) $id => $name])->all()),
- Field::toggle('show_description', 'Beschreibungen anzeigen', true),
- ])
- ->resolveUsing(function (array $data, ?User $user) {
- $tree = $this->app->make(FolderTree::class);
- $folderId = (int) $data['folder'];
-
- if (! $folderId || ! $tree->isVisible($folderId, $user)) {
- return null;
- }
-
- $documents = Document::query()->where('folder_id', $folderId)->with('currentVersion')->orderBy('title')->limit(100)->get();
-
- return [
- 'folder_url' => route('documents.folder', $folderId),
- 'documents' => $documents->map(fn (Document $d) => DocumentPresenter::row($d))->all(),
- ];
- }));
- }
-}
diff --git a/plugins-core/documents/src/Policies/DocumentFolderPolicy.php b/plugins-core/documents/src/Policies/DocumentFolderPolicy.php
deleted file mode 100644
index 48289447..00000000
--- a/plugins-core/documents/src/Policies/DocumentFolderPolicy.php
+++ /dev/null
@@ -1,41 +0,0 @@
-can('documents.manage') || $user->permissions()->ids('documents.edit', 'document_folder') !== [];
- }
-
- public function view(User $user, DocumentFolder $folder): bool
- {
- return app(FolderTree::class)->isVisible($folder->id, $user) || $this->update($user, $folder);
- }
-
- public function create(User $user, ?DocumentFolder $parent = null): bool
- {
- return $user->can('documents.manage') || ($parent !== null && $this->update($user, $parent));
- }
-
- /** Dokumente hochladen, ändern, löschen; Unterordner anlegen. */
- public function update(User $user, DocumentFolder $folder): bool
- {
- return $user->can('documents.manage') || $user->can('documents.edit', ['document_folder', $folder->id]);
- }
-
- public function delete(User $user, DocumentFolder $folder): bool
- {
- return $user->can('documents.manage') || ($folder->parent_id !== null && $user->can('documents.edit', ['document_folder', $folder->parent_id]));
- }
-}
diff --git a/plugins-core/documents/database/migrations/2026_09_29_000001_create_documents_tables.php b/plugins-core/downloads/database/migrations/2026_09_29_000001_create_documents_tables.php
similarity index 71%
rename from plugins-core/documents/database/migrations/2026_09_29_000001_create_documents_tables.php
rename to plugins-core/downloads/database/migrations/2026_09_29_000001_create_documents_tables.php
index 8f9d07d7..199f9e90 100644
--- a/plugins-core/documents/database/migrations/2026_09_29_000001_create_documents_tables.php
+++ b/plugins-core/downloads/database/migrations/2026_09_29_000001_create_documents_tables.php
@@ -8,9 +8,9 @@ return new class extends Migration
{
public function up(): void
{
- Schema::create('document_folders', function (Blueprint $table) {
+ Schema::create('download_folders', function (Blueprint $table) {
$table->id();
- $table->foreignId('parent_id')->nullable()->constrained('document_folders')->restrictOnDelete();
+ $table->foreignId('parent_id')->nullable()->constrained('download_folders')->restrictOnDelete();
$table->string('name');
$table->string('description', 500)->nullable();
$table->unsignedInteger('sort')->default(0);
@@ -20,12 +20,12 @@ return new class extends Migration
$table->index(['parent_id', 'sort']);
});
- Schema::create('documents', function (Blueprint $table) {
+ Schema::create('downloads', function (Blueprint $table) {
$table->id();
- $table->foreignId('folder_id')->constrained('document_folders')->restrictOnDelete();
+ $table->foreignId('folder_id')->constrained('download_folders')->restrictOnDelete();
$table->string('title');
$table->text('description')->nullable();
- // Aktuelle Fassung; ältere bleiben in document_versions abrufbar.
+ // Aktuelle Fassung; ältere bleiben in download_versions abrufbar.
$table->unsignedBigInteger('current_version_id')->nullable();
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
$table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete();
@@ -34,9 +34,9 @@ return new class extends Migration
$table->index(['folder_id', 'title']);
});
- Schema::create('document_versions', function (Blueprint $table) {
+ Schema::create('download_versions', function (Blueprint $table) {
$table->id();
- $table->foreignId('document_id')->constrained('documents')->cascadeOnDelete();
+ $table->foreignId('download_id')->constrained('downloads')->cascadeOnDelete();
$table->unsignedInteger('version');
$table->string('name');
$table->string('path');
@@ -46,15 +46,15 @@ return new class extends Migration
$table->foreignId('uploaded_by')->nullable()->constrained('users')->nullOnDelete();
$table->timestamp('created_at')->nullable();
- $table->unique(['document_id', 'version']);
+ $table->unique(['download_id', 'version']);
$table->index('name');
});
}
public function down(): void
{
- Schema::dropIfExists('document_versions');
- Schema::dropIfExists('documents');
- Schema::dropIfExists('document_folders');
+ Schema::dropIfExists('download_versions');
+ Schema::dropIfExists('downloads');
+ Schema::dropIfExists('download_folders');
}
};
diff --git a/plugins-core/downloads/database/migrations/2026_09_29_000002_rename_documents_to_downloads.php b/plugins-core/downloads/database/migrations/2026_09_29_000002_rename_documents_to_downloads.php
new file mode 100644
index 00000000..679a2595
--- /dev/null
+++ b/plugins-core/downloads/database/migrations/2026_09_29_000002_rename_documents_to_downloads.php
@@ -0,0 +1,109 @@
+ $table->renameColumn('document_id', 'download_id'));
+ }
+
+ if (Schema::hasTable('document_favorites') && ! Schema::hasTable('download_favorites')) {
+ Schema::rename('document_favorites', 'download_favorites');
+ Schema::table('download_favorites', fn (Blueprint $table) => $table->renameColumn('document_id', 'download_id'));
+ }
+
+ if (Schema::hasTable('downloads') && Schema::hasColumn('downloads', 'downloads')) {
+ Schema::table('downloads', fn (Blueprint $table) => $table->renameColumn('downloads', 'download_count'));
+ }
+
+ // Rechte und Sichtbarkeiten
+ DB::table('grants')->where('ability', 'documents.manage')->update(['ability' => 'downloads.manage']);
+ DB::table('grants')->where('ability', 'documents.edit')->update(['ability' => 'downloads.edit']);
+ DB::table('grants')->where('resource_type', 'document_folder')->update(['resource_type' => 'download_folder']);
+ DB::table('audiences')->where('resource_type', 'document_folder')->update(['resource_type' => 'download_folder']);
+
+ // Einstellungen: Menü-Einträge und Anordnung der Startseite
+ $this->updateSetting('navigation.menu', function (array $menu) {
+ $rename = function (array $item) use (&$rename) {
+ if (($item['type'] ?? null) === 'module' && ($item['module'] ?? null) === 'documents') {
+ $item['module'] = 'downloads';
+ }
+ if (isset($item['children']) && is_array($item['children'])) {
+ $item['children'] = array_map($rename, $item['children']);
+ }
+
+ return $item;
+ };
+
+ return array_map($rename, $menu);
+ });
+ $this->updateSetting('dashboard.layout', function (array $layout) {
+ if (isset($layout['documents.favorites'])) {
+ $layout['downloads.favorites'] = $layout['documents.favorites'];
+ unset($layout['documents.favorites']);
+ }
+
+ return $layout;
+ });
+
+ // Pagebuilder-Blöcke in Seiten und ihren Fassungen
+ foreach (['pages' => ['content', 'draft', 'scheduled_content'], 'page_revisions' => ['content']] as $table => $columns) {
+ if (! Schema::hasTable($table)) {
+ continue;
+ }
+
+ foreach ($columns as $column) {
+ DB::table($table)->where($column, 'like', '%documents.folder%')->orderBy('id')->each(function ($row) use ($table, $column) {
+ DB::table($table)->where('id', $row->id)->update([
+ $column => str_replace('"documents.folder"', '"downloads.folder"', $row->{$column}),
+ ]);
+ });
+ }
+ }
+
+ // Plugin-Zustand (z. B. „deaktiviert“) übernehmen
+ $state = app(PluginState::class);
+ $old = $state->all()['documents'] ?? null;
+
+ if (is_array($old)) {
+ $state->setEnabled('downloads', (bool) ($old['enabled'] ?? true), $old['disabled_reason'] ?? null);
+ $state->forget('documents');
+ }
+
+ app(Settings::class)->flush();
+ Permissions::flush();
+ }
+
+ public function down(): void
+ {
+ // Umbenennung wird nicht zurückgenommen.
+ }
+
+ private function updateSetting(string $key, callable $change): void
+ {
+ $row = DB::table('settings')->where('key', $key)->first();
+ $value = $row ? json_decode((string) $row->value, true) : null;
+
+ if (is_array($value)) {
+ DB::table('settings')->where('key', $key)->update(['value' => json_encode($change($value), JSON_UNESCAPED_UNICODE)]);
+ }
+ }
+};
diff --git a/plugins-core/downloads/database/migrations/2026_09_30_000001_add_download_favorites_and_counter.php b/plugins-core/downloads/database/migrations/2026_09_30_000001_add_download_favorites_and_counter.php
new file mode 100644
index 00000000..705a0172
--- /dev/null
+++ b/plugins-core/downloads/database/migrations/2026_09_30_000001_add_download_favorites_and_counter.php
@@ -0,0 +1,41 @@
+foreignId('user_id')->constrained()->cascadeOnDelete();
+ $table->foreignId('download_id')->constrained()->cascadeOnDelete();
+ $table->timestamp('created_at')->nullable();
+
+ $table->primary(['user_id', 'download_id']);
+ });
+ }
+
+ if (Schema::hasColumn('downloads', 'download_count')) {
+ return;
+ }
+
+ Schema::table('downloads', function (Blueprint $table) {
+ $table->unsignedInteger('download_count')->default(0)->after('updated_by');
+ $table->index('download_count');
+ });
+ }
+
+ public function down(): void
+ {
+ Schema::table('downloads', function (Blueprint $table) {
+ $table->dropIndex(['download_count']);
+ $table->dropColumn('download_count');
+ });
+
+ Schema::dropIfExists('download_favorites');
+ }
+};
diff --git a/plugins-core/downloads/plugin.json b/plugins-core/downloads/plugin.json
new file mode 100644
index 00000000..f60ea6a7
--- /dev/null
+++ b/plugins-core/downloads/plugin.json
@@ -0,0 +1,13 @@
+{
+ "slug": "downloads",
+ "name": "Downloads",
+ "version": "1.0.0",
+ "description": "Download-Bereich mit Ordnern, Versionen, Suche und Rechten je Ordner – z. B. Vorlagen, Anträge, Infomaterial. Für QM-Dokumente ist das QM-Modul gedacht.",
+ "author": "Inhaus",
+ "namespace": "Inhaus\\Plugins\\Downloads\\",
+ "class": "Inhaus\\Plugins\\Downloads\\DownloadsPlugin",
+ "requires": {
+ "core": ">=0.8.0",
+ "php": ">=8.3"
+ }
+}
diff --git a/plugins-core/documents/resources/js/blocks/FolderBlock.vue b/plugins-core/downloads/resources/js/blocks/FolderBlock.vue
similarity index 89%
rename from plugins-core/documents/resources/js/blocks/FolderBlock.vue
rename to plugins-core/downloads/resources/js/blocks/FolderBlock.vue
index 9c2079b8..7b77358f 100644
--- a/plugins-core/documents/resources/js/blocks/FolderBlock.vue
+++ b/plugins-core/downloads/resources/js/blocks/FolderBlock.vue
@@ -15,7 +15,7 @@ const formatSize = (bytes) => (bytes >= 1024 * 1024 ? `${(bytes / 1024 / 1024).t
Zum Ordner
{{ folderSummary(folder) }}
{{ area.description }}
- · {{ sub.name }} + · {{ sub.name }}