Neues Modul: Qualitätsmanagement
All checks were successful
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m46s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m51s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 3m2s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m55s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 4m15s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 4m16s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 3m44s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 3m46s
CI / Build-Artefakte aktuell (pull_request) Successful in 52s
All checks were successful
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 2m46s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 2m51s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 3m2s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 2m55s
CI / PHP 8.3 / mysql:8.0 (pull_request) Successful in 4m15s
CI / PHP 8.4 / mysql:8.0 (pull_request) Successful in 4m16s
CI / PHP 8.4 / mysql:8.4 (pull_request) Successful in 3m44s
CI / PHP 8.3 / mysql:8.4 (pull_request) Successful in 3m46s
CI / Build-Artefakte aktuell (pull_request) Successful in 52s
- Kategorien mit farbigen Ordnerkacheln; Farbe und Symbol je Ordner (Auswahl oder eigener Upload, SVG bereinigt), an Unterordner vererbt - Ordnerseite: Einführungstext, Ansprechpartner (Profilfelder wählbar), Unterordner, Liste mit Dokument, Version, Stand, Größe, Aktion - Einträge: Datei (Lesefassung + bearbeitbare Vorlage), Link, Online-Formular; neue Fassungen archivieren die bisherigen - PDF-Betrachter im Portal (pdf.js) - Eigene Volltextsuche (PDF, Word, Excel, PowerPoint, OpenDocument) mit Textausschnitt; optionale Texterkennung per Tesseract - Rollen-Ausschluss für das ganze Modul, Pflegerecht qm.manage, Zielgruppen je Kategorie - Vorbereitet: Wiedervorlage, Verantwortliche, Lesebestätigungen - Abhängigkeit smalot/pdfparser Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
f78cc96be7
commit
b3a057e27c
218 changed files with 13478 additions and 358 deletions
73
plugins-core/qm/src/Models/QmFolder.php
Normal file
73
plugins-core/qm/src/Models/QmFolder.php
Normal file
|
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
|
||||
namespace Inhaus\Plugins\Qm\Models;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Database\Eloquent\Attributes\Fillable;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsToMany;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Inhaus\Plugins\Qm\QmTree;
|
||||
|
||||
#[Fillable(['category_id', 'parent_id', 'name', 'color', 'icon', 'icon_path', 'icon_mono', 'intro', 'sort', 'created_by'])]
|
||||
class QmFolder extends Model
|
||||
{
|
||||
protected static function booted(): void
|
||||
{
|
||||
static::saved(fn () => QmTree::flush());
|
||||
static::deleted(function (QmFolder $folder) {
|
||||
if ($folder->icon_path) {
|
||||
Storage::disk('uploads')->delete($folder->icon_path);
|
||||
}
|
||||
|
||||
QmTree::flush();
|
||||
});
|
||||
}
|
||||
|
||||
protected function casts(): array
|
||||
{
|
||||
return ['icon_mono' => 'boolean'];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsTo<QmCategory, $this>
|
||||
*/
|
||||
public function category(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(QmCategory::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsTo<QmFolder, $this>
|
||||
*/
|
||||
public function parent(): BelongsTo
|
||||
{
|
||||
return $this->belongsTo(self::class, 'parent_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return HasMany<QmFolder, $this>
|
||||
*/
|
||||
public function children(): HasMany
|
||||
{
|
||||
return $this->hasMany(self::class, 'parent_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return HasMany<QmEntry, $this>
|
||||
*/
|
||||
public function entries(): HasMany
|
||||
{
|
||||
return $this->hasMany(QmEntry::class, 'folder_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return BelongsToMany<User, $this>
|
||||
*/
|
||||
public function contacts(): BelongsToMany
|
||||
{
|
||||
return $this->belongsToMany(User::class, 'qm_folder_contacts', 'folder_id', 'user_id')->withPivot('sort')->orderByPivot('sort');
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue