Module tasks + knowledgecenter_update aus Kundenprojekt übernehmen (bereinigt)
Beide Module wurden aus einem anderen Kundenprojekt kopiert und bereinigt:
Knowledgecenter:
- Bild-Cache (1.985 Dateien) geleert, Ordnerstruktur mit .gitkeep behalten
- Files-Gallery-Lizenzschlüssel entfernt (config.php)
- Kundenspezifische Kategorien gelöscht: Teil I/II/III QM-Struktur,
nummerierte QM-Kapitel, Gremien (Präsidium/Finanzausschuss/Landesausschuss),
Sitzungsservice-Serie, Protokoll-Abteilungen, Testeinträge
- 56 generische Kategorien bleiben (Downloads, Onboarding, Personalthemen …)
Tasks:
- Alle Betriebsdaten gelöscht (114 Tasks, 914 Submissions, 579 Assignments)
- Task-Definitionen und Verlinkungen geleert
- Kategoriestruktur bleibt (Allgemein, IT, Personal, Buchhaltung …)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 09:20:02 +02:00
|
|
|
<?php
|
|
|
|
|
declare(strict_types=1);
|
|
|
|
|
|
|
|
|
|
class TaskLookupService
|
|
|
|
|
{
|
|
|
|
|
private TaskLookupRepository $lookupRepo;
|
|
|
|
|
|
|
|
|
|
public function __construct(TaskLookupRepository $lookupRepo)
|
|
|
|
|
{
|
|
|
|
|
$this->lookupRepo = $lookupRepo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getAdminFormLookups(int $languageId): array
|
|
|
|
|
{
|
|
|
|
|
$languageId = $languageId > 0 ? $languageId : 1;
|
|
|
|
|
|
|
|
|
|
return [
|
|
|
|
|
'task_categories' => $this->safeFetch('task_categories', fn(): array => $this->lookupRepo->listTaskCategories(true)),
|
|
|
|
|
'mandants' => $this->safeFetch('mandants', fn(): array => $this->lookupRepo->listMandants()),
|
|
|
|
|
'departments' => $this->safeFetch('departments', fn(): array => $this->lookupRepo->listDepartments()),
|
|
|
|
|
'roles' => $this->safeFetch('roles', fn(): array => $this->lookupRepo->listRoles()),
|
Add Einrichtung and Fachbereich as permission/filter types (knowledgecenter + tasks)
- Create knowledgecenter_category_einricht, _fachbereich, knowledgecenter_post_einricht,
knowledgecenter_post_fachbereich tables; extend task_target_rule with main_einricht_id
and main_bereich_id columns
- Middleware: load main_einricht_id/main_bereich_id from main_contact_department,
expose $allowedEinrichts/$allowedFachbereiche globals (same pattern as existing 3 types)
- Ajax: add update_category/post_einrichts/fachbereiche functions, extend
update_category_links() and search filter query
- Views: add einricht/fachbereich LEFT JOINs and WHERE filters in all 5 query sites
(categories_posts_listform, category_posts_widget, post_announcement_listform,
post_cardform userHasAccessForPost, Ajax search)
- post_cardform_settings: add Einrichtungen/Fachbereiche tagify pickers with save/load
- Tasks: add listEinrichts/listFachbereiche to repo+service, add UI selects in task_form,
extend target-rule normalization and upsert builder, extend AssignmentResolverService
scope loading and matchesAnyRule to include einricht/fachbereich matching
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 11:03:53 +02:00
|
|
|
'einrichts' => $this->safeFetch('einrichts', fn(): array => $this->lookupRepo->listEinrichts()),
|
|
|
|
|
'fachbereiche' => $this->safeFetch('fachbereiche', fn(): array => $this->lookupRepo->listFachbereiche()),
|
Module tasks + knowledgecenter_update aus Kundenprojekt übernehmen (bereinigt)
Beide Module wurden aus einem anderen Kundenprojekt kopiert und bereinigt:
Knowledgecenter:
- Bild-Cache (1.985 Dateien) geleert, Ordnerstruktur mit .gitkeep behalten
- Files-Gallery-Lizenzschlüssel entfernt (config.php)
- Kundenspezifische Kategorien gelöscht: Teil I/II/III QM-Struktur,
nummerierte QM-Kapitel, Gremien (Präsidium/Finanzausschuss/Landesausschuss),
Sitzungsservice-Serie, Protokoll-Abteilungen, Testeinträge
- 56 generische Kategorien bleiben (Downloads, Onboarding, Personalthemen …)
Tasks:
- Alle Betriebsdaten gelöscht (114 Tasks, 914 Submissions, 579 Assignments)
- Task-Definitionen und Verlinkungen geleert
- Kategoriestruktur bleibt (Allgemein, IT, Personal, Buchhaltung …)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-22 09:20:02 +02:00
|
|
|
'contacts' => $this->safeFetch('contacts', fn(): array => $this->lookupRepo->listActiveContacts()),
|
|
|
|
|
'knowledge_posts' => $this->safeFetch('knowledge_posts', fn(): array => $this->lookupRepo->listKnowledgePosts($languageId)),
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getKnowledgePostTitleMapByIds(int $languageId, array $postIds): array
|
|
|
|
|
{
|
|
|
|
|
$languageId = $languageId > 0 ? $languageId : 1;
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
return $this->lookupRepo->mapKnowledgePostTitlesByIds($languageId, $postIds);
|
|
|
|
|
} catch (Throwable $throwable) {
|
|
|
|
|
error_log('task_cert lookup fetch failed (knowledge_post_title_map): ' . $throwable->getMessage());
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private function safeFetch(string $lookupName, callable $fetcher): array
|
|
|
|
|
{
|
|
|
|
|
try {
|
|
|
|
|
$rows = $fetcher();
|
|
|
|
|
return is_array($rows) ? $rows : [];
|
|
|
|
|
} catch (Throwable $throwable) {
|
|
|
|
|
error_log('task_cert lookup fetch failed (' . $lookupName . '): ' . $throwable->getMessage());
|
|
|
|
|
return [];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|