Rml workorder/update new stuff

This commit is contained in:
Luca Haid
2025-08-07 14:12:34 +00:00
parent ee9ff0b93d
commit 17e099e487
9 changed files with 55 additions and 28 deletions

View File

@@ -8,10 +8,11 @@ class RMLWorkorderAdminController extends TTCrud
protected array $permissionCheck = ['RMLAdmin'];
protected array $columns = [
['key' => 'id', 'text' => 'Auftrag-Nr.', 'table' => ['sortable' => true]],
['key' => 'preorderInfo', 'text' => 'Kunde / Projekt', 'modal' => false, 'table' => ['sortable' => false, 'filter' => 'search']],
// ['key' => 'id', 'text' => 'Auftrag-Nr.', 'table' => ['sortable' => true]],
['key' => 'preordercampaign_id', 'text' => 'Cluster', 'modal' => false, 'table' => ['filter' => 'select']],
['key' => 'companyName', 'text' => 'Zuständige Firma', 'modal' => false, 'table' => ['filter' => 'search']],
['key' => 'preorderInfo', 'text' => 'Kunde / Projekt', 'modal' => false, 'table' => ['sortable' => false]],
['key' => 'rimo_fcp_name', 'text' => 'FCP', 'modal' => false, 'table' => ['sortable' => false]],
['key' => 'companyName', 'text' => 'Zuständige Firma', 'modal' => false],
['key' => 'status', 'text' => 'Status', 'modal' => false, 'table' => ['filter' => 'iconSelect', 'filterOptions' => [
['value' => 'new', 'text' => 'Neu', 'icon' => 'fas fa-star text-primary'],
['value' => 'assigned', 'text' => 'Zugewiesen', 'icon' => 'fas fa-user-check text-info'],
@@ -63,23 +64,10 @@ class RMLWorkorderAdminController extends TTCrud
$rows = array_map(function($workorder) {
$row = (array)$workorder;
$anschlussadresse = "{$row['street']} {$row['hausnummer']}";
if ($row['stiege']) $anschlussadresse .= "/{$row['stiege']}";
if ($row['apartment']) $anschlussadresse .= " / WE: {$row['apartment']}";
$anschlussadresse .= ", {$row['plz']} {$row['city']}";
$kunde = $row['customerCompany'] ?: $row['customerName'];
$row['preorderInfo'] = "<strong>Kunde:</strong> {$kunde}<br>" .
"<strong>Anschluss:</strong> {$anschlussadresse}<br>" .
"<strong>OAID:</strong> <span class='text-pink'>{$row['oaid']}</span>";
$row['companyName'] ??= 'Nicht zugewiesen';
$row['deadlineDateFormatted'] = $row['deadlineDate'] ? date('d.m.Y', $row['deadlineDate']) : 'Keine Deadline';
$row['daysUntilDeadline'] = $row['deadlineDate'] ? ceil(($row['deadlineDate'] - time()) / (60 * 60 * 24)) : null;
unset($row['customerName'], $row['customerCompany'], $row['street'], $row['hausnummer'], $row['stiege'], $row['oaid'], $row['apartment'], $row['plz'], $row['city']);
return $row;
}, $workorders);