Meine Aufgaben (0.53.0)
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Failing after 7m6s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Failing after 13s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Failing after 7m24s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Failing after 8m34s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 9m51s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 10m39s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 9m4s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 47s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m9s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 8m42s

Tasks-Registry mit Anbietern aus QM, Umfragen und Redaktion; Kachel auf der
Startseite und Seite /aufgaben.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Friederich Loheide 2026-09-29 19:42:53 +00:00
parent 63f50f691a
commit c11cf4e0c4
146 changed files with 731 additions and 353 deletions

View file

@ -8,6 +8,7 @@ use App\Plugins\Plugin;
use App\Search\GlobalSearch;
use App\Support\Abilities;
use App\Support\Navigation;
use App\Tasks\Tasks;
use Illuminate\Support\Facades\Schedule;
use Inhaus\Plugins\Qm\Models\QmCategory;
use Inhaus\Plugins\Qm\Text\Ocr;
@ -36,6 +37,17 @@ class QmPlugin extends Plugin
])->values(), 'total' => $open->count(), 'url' => route('qm.index').'#bestaetigen'];
});
// Meine Aufgaben: jede offene Lesebestätigung einzeln
if (class_exists(Tasks::class)) {
$this->app->make(Tasks::class)->add('qm', fn (User $user) => $this->app->make(Acknowledgements::class)->outstanding($user)
->map(fn ($entry) => [
'title' => '„'.$entry->title.'“ lesen und bestätigen',
'meta' => 'Qualitätsmanagement'.($entry->version ? ' · Version '.$entry->version : ''),
'url' => route('qm.view', $entry),
'icon' => 'file-check-2',
])->all(), sort: 10);
}
$abilities = $this->app->make(Abilities::class);
$abilities->define('qm.manage', 'Qualitätsmanagement pflegen (Ordner, Dokumente, Einstellungen)', 'Qualitätsmanagement');
$abilities->resourceType('qm_category', 'QM-Kategorie', fn () => QmCategory::query()->orderBy('sort')->pluck('name', 'id')->all());

View file

@ -12,6 +12,7 @@ use App\Pagebuilder\Field;
use App\Plugins\Plugin;
use App\Support\Abilities;
use App\Support\Navigation;
use App\Tasks\Tasks;
use Illuminate\Support\Facades\Schedule;
use Inhaus\Plugins\Umfragen\Models\Poll;
@ -48,6 +49,19 @@ class UmfragenPlugin extends Plugin
return $polls->isEmpty() ? null : ['polls' => $polls->map(fn (Poll $poll) => Presenter::card($poll))->values()->all()];
}, label: 'Offene Umfragen', mobileSort: 35);
// Meine Aufgaben: offene Umfragen, bei denen die Person noch nicht abgestimmt hat
if (class_exists(Tasks::class)) {
$this->app->make(Tasks::class)->add('umfragen', fn (User $user) => Poll::query()->open()->visibleTo($user)->latest('published_at')->limit(20)->get()
->reject(fn (Poll $poll) => $poll->hasVoted($user))
->map(fn (Poll $poll) => [
'title' => 'Umfrage: '.$poll->title,
'meta' => $poll->closes_at ? 'Abstimmen bis '.$poll->closes_at->translatedFormat('j. F') : 'Umfragen',
'url' => route('polls.show', $poll),
'icon' => 'vote',
'due' => $poll->closes_at?->toDateString(),
])->values()->all(), sort: 30);
}
// Baustein: Umfrage direkt in Seite oder Beitrag
$this->app->make(Blocks::class)->add(BlockType::make('umfragen.poll', 'Umfrage', 'vote', 'dynamic', 'umfragen::PollBlock')
->description('Eine Umfrage direkt auf der Seite beantworten lassen.')