feat: improve notiz column UI and fix memory exhaustion

Notiz column now has max 5 lines with expand/collapse animation and auto-resizing edit textarea. Moved raw SQL query to WorkorderModel::getPreorderIdsByCampaigns() to fix OOM in archiveWorkorders().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-02-27 15:35:17 +01:00
parent a53ff3912c
commit 6593e921ee
5 changed files with 116 additions and 21 deletions

View File

@@ -253,12 +253,8 @@ class WorkorderBaseController extends TTCrud
$statusesToCheck = ['new', 'assigned', 'scheduled', 'in_progress', 'correction_requested', 'intervention_required', 'civil_engineering_required', 'civil_engineering_completed', 'problem_solved'];
// Get ALL preorders for tenant (including deleted/cancelled) to ensure their workorders get archived
// Note: Not passing 'deleted' filter means all preorders are returned regardless of deleted status
$allTenantPreorders = PreorderModel::search(['preordercampaign_id' => $tenantCampaignIds]);
if(empty($allTenantPreorders)) continue;
$allTenantPreorderIds = array_map(fn($p) => $p->id, $allTenantPreorders);
$allTenantPreorderIds = WorkorderModel::getPreorderIdsByCampaigns($tenantCampaignIds);
if (empty($allTenantPreorderIds)) continue;
$workordersToCheck = WorkorderModel::getAll([
'status' => $statusesToCheck,