Workorder mph/improve

This commit is contained in:
Luca Haid
2025-12-13 21:27:43 +00:00
parent 1435923200
commit 0755df5408
19 changed files with 658 additions and 122 deletions

View File

@@ -3,7 +3,7 @@
class WorkorderMphBaseController extends TTCrud
{
protected array $statusColumn = [
'key' => 'status', 'text' => 'Status', 'modal' => false, 'table' => ['filter' => 'iconSelect', 'filterOptions' => [
'key' => 'status', 'text' => 'Status', 'modal' => false, 'table' => ['filter' => 'iconSelect', 'sortable' => false, 'filterOptions' => [
['value' => 'new', 'text' => 'Neu', 'icon' => 'fas fa-star text-primary'],
['value' => 'assigned', 'text' => 'Zugewiesen', 'icon' => 'fas fa-user-check text-info'],
['value' => 'scheduled', 'text' => 'Geplant', 'icon' => 'fas fa-calendar-check text-warning'],
@@ -523,7 +523,10 @@ class WorkorderMphBaseController extends TTCrud
$newValue = $post[$field] ? 1 : 0;
if ($oldValue !== $newValue) {
$workorder->$field = $newValue;
$changes[] = "$fieldLabel: " . ($newValue ? 'ja' : 'nein');
// Only log changes where newValue is 'ja' or oldValue was 'ja' (changing from yes to no)
if ($newValue === 1 || $oldValue === 1) {
$changes[] = "$fieldLabel: " . ($newValue ? 'ja' : 'nein');
}
// Check for FTTx Location mit Leerrohr versorgt
if ($field === 'fttxLocationSupplied' && $newValue === 1) {