From 3b9daeb23869d803a3f004ba920df674f5c22d46 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 3 Mar 2026 20:41:30 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20System-Tabs=20f=C3=BCr=20Mein=20Betrieb?= =?UTF-8?q?,=20Produkt/Zubeh=C3=B6r=20f=C3=BCr=20Kunden+Kontakte?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - werkzeuge.php: Multi-System mit System-Tabs (nicht mehr nur WERKZEUG) - Systeme hinzufügen/entfernen wie bei Kunden-Anlagen - Alle URLs mit system-Parameter versehen - Steuerungs-Buttons in System-Tab-Wrapper integriert - tabs/anlagen.php + tabs/contact_anlagen.php: - Produkt-Zuordnung im Create/Edit-Formular (Autocomplete) - Produkt-Anzeige in der Detailansicht - Zubehör-Liste mit Hinzufügen/Löschen - Lieferantenbestellung aus Zubehör - fk_product in add/update-Actions aufgenommen Co-Authored-By: Claude Opus 4.6 --- tabs/anlagen.php | 266 +++++++++++++++++++++++++++++++++++++++ tabs/contact_anlagen.php | 259 ++++++++++++++++++++++++++++++++++++++ werkzeuge.php | 255 ++++++++++++++++++++++++++++--------- 3 files changed, 720 insertions(+), 60 deletions(-) diff --git a/tabs/anlagen.php b/tabs/anlagen.php index 28f6656..f3d72f9 100755 --- a/tabs/anlagen.php +++ b/tabs/anlagen.php @@ -29,6 +29,7 @@ dol_include_once('/kundenkarte/class/anlagefile.class.php'); dol_include_once('/kundenkarte/class/equipmentpanel.class.php'); dol_include_once('/kundenkarte/class/equipmentcarrier.class.php'); dol_include_once('/kundenkarte/class/equipment.class.php'); +dol_include_once('/kundenkarte/class/anlageaccessory.class.php'); dol_include_once('/kundenkarte/lib/kundenkarte.lib.php'); // Load translation files @@ -177,6 +178,7 @@ if ($action == 'add' && $permissiontoadd) { $anlage->fk_anlage_type = GETPOSTINT('fk_anlage_type'); $anlage->fk_parent = GETPOSTINT('fk_parent'); $anlage->fk_system = $systemId; + $anlage->fk_product = GETPOSTINT('fk_product') > 0 ? GETPOSTINT('fk_product') : null; $anlage->note_private = isset($_POST['note_private']) ? $_POST['note_private'] : ''; $anlage->status = 1; @@ -219,6 +221,7 @@ if ($action == 'update' && $permissiontoadd) { $anlage->label = GETPOST('label', 'alphanohtml'); $anlage->fk_anlage_type = GETPOSTINT('fk_anlage_type'); $anlage->fk_parent = GETPOSTINT('fk_parent'); + $anlage->fk_product = GETPOSTINT('fk_product') > 0 ? GETPOSTINT('fk_product') : null; $anlage->note_private = isset($_POST['note_private']) ? $_POST['note_private'] : ''; // Get type - but keep current system for GLOBAL types (buildings) @@ -590,6 +593,21 @@ if (empty($customerSystems)) { print ''.$langs->trans('Type').''; print ''.dol_escape_htmltag($anlage->type_label).''; + // Zugeordnetes Produkt + if ($anlage->fk_product > 0) { + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + $product = new Product($db); + if ($product->fetch($anlage->fk_product) > 0) { + print ''.$langs->trans('Product').''; + print ''.dol_escape_htmltag($product->ref).''; + print ' - '.dol_escape_htmltag($product->label); + if ($product->price > 0) { + print ' ('.price($product->price).' €)'; + } + print ''; + } + } + // Dynamic fields - all fields come from type definition $fieldValues = $anlage->getFieldValues(); $typeFieldsList = $type->fetchFields(); @@ -797,6 +815,75 @@ if (empty($customerSystems)) { '; } + // Zubehör-Bereich (nur wenn Typ has_accessories hat) + if (!empty($type->has_accessories)) { + $accessoryObj = new AnlageAccessory($db); + $accessories = $accessoryObj->fetchAllByAnlage($anlageId); + + print '

'.$langs->trans('Accessories').'

'; + + if (!empty($accessories)) { + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + if ($permissiontodelete) { + print ''; + } + print ''; + foreach ($accessories as $acc) { + print ''; + print ''; + print ''; + print ''; + print ''; + if ($permissiontodelete) { + print ''; + } + print ''; + } + print '
'.$langs->trans('ProductRef').''.$langs->trans('Label').''.$langs->trans('Qty').''.$langs->trans('Note').''.$langs->trans('Action').'
'.dol_escape_htmltag($acc->product_ref).''.dol_escape_htmltag($acc->product_label).''.$acc->qty.''.dol_escape_htmltag($acc->note).'
'; + print '
'; + } else { + print '

'.$langs->trans('NoAccessories').'

'; + } + + // Zubehör hinzufügen + if ($permissiontoadd) { + print '
'; + print '
'; + print ''; + print ''; + print ''; + print ''; + print '
'; + print '
'; + } + + // Bestellfunktion + if ($permissiontoadd && !empty($accessories)) { + print '
'; + print '
'.$langs->trans('OrderAccessories').'
'; + print '
'; + print ''; + print ''; + print '
'; + print '
'; + } + } + // Action buttons print '
'; if ($permissiontoadd) { @@ -929,6 +1016,23 @@ if (empty($customerSystems)) { printTreeOptions($tree, $selectedParent, $excludeId); print ''; + // Produkt-Zuordnung + $productValue = ''; + $productId = 0; + if (($isEdit || $isCopy) && $anlage->fk_product > 0) { + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + $product = new Product($db); + if ($product->fetch($anlage->fk_product) > 0) { + $productValue = $product->ref.' - '.$product->label; + $productId = $product->id; + } + } + print ''.$langs->trans('Product').''; + print ''; + print ''; + print ''; + print ''; + // Dynamic fields will be inserted here via JavaScript print ''; @@ -1122,6 +1226,168 @@ print dol_get_fiche_end(); // Tooltip container print '
'; +// Produkt-Autocomplete + Zubehör-AJAX (nur wenn Formular oder Detailansicht aktiv) +if (in_array($action, array('create', 'edit', 'copy', 'view'))) { + print ''; + + // CSS für Autocomplete + print ''; +} + llxFooter(); $db->close(); diff --git a/tabs/contact_anlagen.php b/tabs/contact_anlagen.php index 490ddb7..1a843a7 100755 --- a/tabs/contact_anlagen.php +++ b/tabs/contact_anlagen.php @@ -29,6 +29,7 @@ dol_include_once('/kundenkarte/class/anlagefile.class.php'); dol_include_once('/kundenkarte/class/equipmentpanel.class.php'); dol_include_once('/kundenkarte/class/equipmentcarrier.class.php'); dol_include_once('/kundenkarte/class/equipment.class.php'); +dol_include_once('/kundenkarte/class/anlageaccessory.class.php'); dol_include_once('/kundenkarte/lib/kundenkarte.lib.php'); // Load translation files @@ -178,6 +179,7 @@ if ($action == 'add' && $permissiontoadd) { $anlage->fk_anlage_type = GETPOSTINT('fk_anlage_type'); $anlage->fk_parent = GETPOSTINT('fk_parent'); $anlage->fk_system = $systemId; + $anlage->fk_product = GETPOSTINT('fk_product') > 0 ? GETPOSTINT('fk_product') : null; $anlage->note_private = isset($_POST['note_private']) ? $_POST['note_private'] : ''; $anlage->status = 1; @@ -220,6 +222,7 @@ if ($action == 'update' && $permissiontoadd) { $anlage->label = GETPOST('label', 'alphanohtml'); $anlage->fk_anlage_type = GETPOSTINT('fk_anlage_type'); $anlage->fk_parent = GETPOSTINT('fk_parent'); + $anlage->fk_product = GETPOSTINT('fk_product') > 0 ? GETPOSTINT('fk_product') : null; $anlage->note_private = isset($_POST['note_private']) ? $_POST['note_private'] : ''; // Get type - but keep current system for GLOBAL types (buildings) @@ -588,6 +591,21 @@ if (empty($customerSystems)) { print ''.$langs->trans('Type').''; print ''.dol_escape_htmltag($anlage->type_label).''; + // Zugeordnetes Produkt + if ($anlage->fk_product > 0) { + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + $product = new Product($db); + if ($product->fetch($anlage->fk_product) > 0) { + print ''.$langs->trans('Product').''; + print ''.dol_escape_htmltag($product->ref).''; + print ' - '.dol_escape_htmltag($product->label); + if ($product->price > 0) { + print ' ('.price($product->price).' €)'; + } + print ''; + } + } + // Dynamic fields - all fields come from type definition $fieldValues = $anlage->getFieldValues(); $typeFieldsList = $type->fetchFields(); @@ -795,6 +813,73 @@ if (empty($customerSystems)) { '; } + // Zubehör-Bereich (nur wenn Typ has_accessories hat) + if (!empty($type->has_accessories)) { + $accessoryObj = new AnlageAccessory($db); + $accessories = $accessoryObj->fetchAllByAnlage($anlageId); + + print '

'.$langs->trans('Accessories').'

'; + + if (!empty($accessories)) { + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + if ($permissiontodelete) { + print ''; + } + print ''; + foreach ($accessories as $acc) { + print ''; + print ''; + print ''; + print ''; + print ''; + if ($permissiontodelete) { + print ''; + } + print ''; + } + print '
'.$langs->trans('ProductRef').''.$langs->trans('Label').''.$langs->trans('Qty').''.$langs->trans('Note').''.$langs->trans('Action').'
'.dol_escape_htmltag($acc->product_ref).''.dol_escape_htmltag($acc->product_label).''.$acc->qty.''.dol_escape_htmltag($acc->note).'
'; + print '
'; + } else { + print '

'.$langs->trans('NoAccessories').'

'; + } + + if ($permissiontoadd) { + print '
'; + print '
'; + print ''; + print ''; + print ''; + print ''; + print '
'; + print '
'; + } + + if ($permissiontoadd && !empty($accessories)) { + print '
'; + print '
'.$langs->trans('OrderAccessories').'
'; + print '
'; + print ''; + print ''; + print '
'; + print '
'; + } + } + // Action buttons print '
'; if ($permissiontoadd) { @@ -927,6 +1012,23 @@ if (empty($customerSystems)) { printTreeOptions($tree, $selectedParent, $excludeId); print ''; + // Produkt-Zuordnung + $productValue = ''; + $productId = 0; + if (($isEdit || $isCopy) && $anlage->fk_product > 0) { + require_once DOL_DOCUMENT_ROOT.'/product/class/product.class.php'; + $product = new Product($db); + if ($product->fetch($anlage->fk_product) > 0) { + $productValue = $product->ref.' - '.$product->label; + $productId = $product->id; + } + } + print ''.$langs->trans('Product').''; + print ''; + print ''; + print ''; + print ''; + // Dynamic fields will be inserted here via JavaScript print ''; @@ -1120,6 +1222,163 @@ print dol_get_fiche_end(); // Tooltip container print '
'; +// Produkt-Autocomplete + Zubehör-AJAX (nur wenn Formular oder Detailansicht aktiv) +if (in_array($action, array('create', 'edit', 'copy', 'view'))) { + print ''; + + print ''; +} + llxFooter(); $db->close(); diff --git a/werkzeuge.php b/werkzeuge.php index bb597bf..5409941 100644 --- a/werkzeuge.php +++ b/werkzeuge.php @@ -1,8 +1,8 @@ hasRight('kundenkarte', 'delete'); $action = GETPOST('action', 'aZ09'); $confirm = GETPOST('confirm', 'alpha'); +$systemId = GETPOSTINT('system'); $anlageId = GETPOSTINT('anlage_id'); $parentId = GETPOSTINT('parent_id'); -// Virtuelle Firma-ID für Werkzeuge - braucht keinen echten Societe-Eintrag +// Virtuelle Firma-ID für "Mein Betrieb" - braucht keinen echten Societe-Eintrag // Die Anlage-Tabelle verwendet diese ID nur als Gruppierung $socId = 99999999; -// WERKZEUG-System ermitteln -$werkzeugSystemId = 0; -$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."c_kundenkarte_anlage_system WHERE code = 'WERKZEUG' AND active = 1"; +// ALLE verfügbaren Systeme laden +$allSystems = array(); +$sql = "SELECT rowid, code, label, picto, color FROM ".MAIN_DB_PREFIX."c_kundenkarte_anlage_system WHERE active = 1 ORDER BY position ASC"; $resql = $db->query($sql); -if ($resql && $db->num_rows($resql) > 0) { - $obj = $db->fetch_object($resql); - $werkzeugSystemId = $obj->rowid; +if ($resql) { + while ($obj = $db->fetch_object($resql)) { + $allSystems[$obj->rowid] = $obj; + } } -if ($werkzeugSystemId <= 0) { - setEventMessages('System WERKZEUG nicht gefunden. Bitte Modul deaktivieren und wieder aktivieren.', null, 'errors'); - llxHeader('', 'Firmen-Werkzeuge'); - llxFooter(); - exit; +// Für diesen virtuellen Betrieb aktivierte Systeme laden +$customerSystems = array(); +$sql = "SELECT ss.rowid, ss.fk_system, s.code, s.label, s.picto, s.color"; +$sql .= " FROM ".MAIN_DB_PREFIX."kundenkarte_societe_system ss"; +$sql .= " JOIN ".MAIN_DB_PREFIX."c_kundenkarte_anlage_system s ON s.rowid = ss.fk_system"; +$sql .= " WHERE ss.fk_soc = ".((int) $socId)." AND (ss.fk_contact IS NULL OR ss.fk_contact = 0) AND ss.active = 1 AND s.active = 1"; +$sql .= " AND s.code != 'GLOBAL'"; +$sql .= " ORDER BY s.position ASC"; +$resql = $db->query($sql); +if ($resql) { + while ($obj = $db->fetch_object($resql)) { + $customerSystems[$obj->fk_system] = $obj; + } } -$systemId = $werkzeugSystemId; - -// Sicherstellen dass WERKZEUG für eigene Firma aktiviert ist -$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."kundenkarte_societe_system"; -$sql .= " WHERE fk_soc = ".((int) $socId)." AND fk_system = ".((int) $systemId); -$sql .= " AND (fk_contact IS NULL OR fk_contact = 0) AND active = 1"; -$resql = $db->query($sql); -if (!$resql || $db->num_rows($resql) == 0) { - // Automatisch aktivieren - $sql = "INSERT INTO ".MAIN_DB_PREFIX."kundenkarte_societe_system"; - $sql .= " (entity, fk_soc, fk_contact, fk_system, date_creation, fk_user_creat, active)"; - $sql .= " VALUES (".$conf->entity.", ".((int) $socId).", 0, ".((int) $systemId).", NOW(), ".((int) $user->id).", 1)"; - $db->query($sql); +// Standard: Erstes aktiviertes System falls nicht angegeben +if (empty($systemId) && !empty($customerSystems)) { + $systemId = array_key_first($customerSystems); } // Objekte initialisieren @@ -79,6 +79,53 @@ $anlageType = new AnlageType($db); * Actions */ +// System hinzufügen +if ($action == 'add_system' && $permissiontoadd) { + $newSystemId = GETPOSTINT('new_system_id'); + if ($newSystemId > 0 && !isset($customerSystems[$newSystemId])) { + $sql = "INSERT INTO ".MAIN_DB_PREFIX."kundenkarte_societe_system"; + $sql .= " (entity, fk_soc, fk_contact, fk_system, date_creation, fk_user_creat, active)"; + $sql .= " VALUES (".$conf->entity.", ".((int) $socId).", 0, ".((int) $newSystemId).", NOW(), ".((int) $user->id).", 1)"; + $result = $db->query($sql); + if ($result) { + setEventMessages($langs->trans('SystemAdded'), null, 'mesgs'); + header('Location: '.$_SERVER['PHP_SELF'].'?system='.$newSystemId); + exit; + } else { + setEventMessages($db->lasterror(), null, 'errors'); + } + } + $action = ''; +} + +// System entfernen +if ($action == 'confirm_remove_system' && $confirm == 'yes' && $permissiontodelete) { + $removeSystemId = GETPOSTINT('remove_system_id'); + if ($removeSystemId > 0) { + // Prüfen ob System noch Elemente hat + $sql = "SELECT COUNT(*) as cnt FROM ".MAIN_DB_PREFIX."kundenkarte_anlage WHERE fk_soc = ".((int) $socId)." AND (fk_contact IS NULL OR fk_contact = 0) AND fk_system = ".((int) $removeSystemId); + $resql = $db->query($sql); + $obj = $db->fetch_object($resql); + + if ($obj->cnt > 0) { + setEventMessages($langs->trans('ErrorSystemHasElements'), null, 'errors'); + } else { + $sql = "DELETE FROM ".MAIN_DB_PREFIX."kundenkarte_societe_system WHERE fk_soc = ".((int) $socId)." AND (fk_contact IS NULL OR fk_contact = 0) AND fk_system = ".((int) $removeSystemId); + $db->query($sql); + setEventMessages($langs->trans('SystemRemoved'), null, 'mesgs'); + + unset($customerSystems[$removeSystemId]); + if (!empty($customerSystems)) { + $systemId = array_key_first($customerSystems); + } else { + $systemId = 0; + } + } + } + header('Location: '.$_SERVER['PHP_SELF'].($systemId ? '?system='.$systemId : '')); + exit; +} + if ($action == 'add' && $permissiontoadd) { $anlage->label = GETPOST('label', 'alphanohtml'); $anlage->fk_soc = $socId; @@ -107,7 +154,7 @@ if ($action == 'add' && $permissiontoadd) { $result = $anlage->create($user); if ($result > 0) { setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); - header('Location: '.$_SERVER['PHP_SELF']); + header('Location: '.$_SERVER['PHP_SELF'].'?system='.$systemId); exit; } else { setEventMessages($anlage->error, $anlage->errors, 'errors'); @@ -141,7 +188,7 @@ if ($action == 'update' && $permissiontoadd) { $result = $anlage->update($user); if ($result > 0) { setEventMessages($langs->trans('RecordSaved'), null, 'mesgs'); - header('Location: '.$_SERVER['PHP_SELF']); + header('Location: '.$_SERVER['PHP_SELF'].'?system='.$systemId); exit; } else { setEventMessages($anlage->error, $anlage->errors, 'errors'); @@ -175,10 +222,10 @@ print load_fiche_titre($title, '', 'fa-wrench'); print '
'; -// Bestätigungsdialog +// Bestätigungsdialoge if ($action == 'delete') { print $form->formconfirm( - $_SERVER['PHP_SELF'].'?anlage_id='.$anlageId, + $_SERVER['PHP_SELF'].'?system='.$systemId.'&anlage_id='.$anlageId, $langs->trans('DeleteElement'), $langs->trans('ConfirmDeleteElement'), 'confirm_delete', @@ -188,8 +235,109 @@ if ($action == 'delete') { ); } -// Typen für WERKZEUG-System laden -$types = $anlageType->fetchAllBySystem($systemId, 1, 1); // excludeGlobal=1, nur WERKZEUG-Typen +if ($action == 'remove_system') { + $removeSystemId = GETPOSTINT('remove_system_id'); + $sysLabel = isset($customerSystems[$removeSystemId]) ? $customerSystems[$removeSystemId]->label : ''; + print $form->formconfirm( + $_SERVER['PHP_SELF'].'?remove_system_id='.$removeSystemId, + $langs->trans('RemoveSystem'), + $langs->trans('ConfirmRemoveSystem', $sysLabel), + 'confirm_remove_system', + '', + 'yes', + 1 + ); +} + +// System-Tabs +print '
'; +print '
'; +foreach ($customerSystems as $sysId => $sys) { + $activeClass = ($sysId == $systemId) ? ' active' : ''; + print '
'; + print ''; + if ($sys->picto) { + print ''.kundenkarte_render_icon($sys->picto).''; + } + print ''.dol_escape_htmltag($sys->label).''; + print ''; + // Entfernen-Button (nur beim aktiven Tab) + if ($permissiontodelete && $sysId == $systemId) { + print ' '; + } + print '
'; +} + +// System hinzufügen Button +if ($permissiontoadd) { + $availableSystems = array_diff_key($allSystems, $customerSystems); + // GLOBAL ausschließen + foreach ($availableSystems as $k => $v) { + if ($v->code === 'GLOBAL') unset($availableSystems[$k]); + } + if (!empty($availableSystems)) { + print ''; + } +} +print '
'; + +// Steuerungs-Buttons (nur in Baumansicht) +$isTreeView = !in_array($action, array('create', 'edit', 'view')); +if ($isTreeView && $systemId > 0) { + print '
'; + print ''; + print ''; + print ''; + print ''; + print '
'; +} + +print '
'; // End system-tabs-wrapper + +// System-Hinzufügen-Formular (versteckt) +if ($permissiontoadd && !empty($availableSystems)) { + print ''; +} + +// Prüfen ob Systeme konfiguriert sind +if (empty($customerSystems)) { + print '
'; + print '
'; + print $langs->trans('NoSystemsConfigured').'

'; + if ($permissiontoadd && !empty($allSystems)) { + print $langs->trans('ClickAddSystemToStart'); + } else { + print $langs->trans('ContactAdminToAddSystems'); + } + print '
'; +} elseif ($systemId > 0) { + +// Typen für ausgewähltes System laden +$types = $anlageType->fetchAllBySystem($systemId, 1, 1); if (in_array($action, array('create', 'edit', 'view'))) { // Formular oder Detail-Ansicht @@ -337,12 +485,12 @@ if (in_array($action, array('create', 'edit', 'view'))) { // Aktions-Buttons print '
'; if ($permissiontoadd) { - print ''.$langs->trans('Modify').''; + print ''.$langs->trans('Modify').''; } if ($permissiontodelete) { - print ''.$langs->trans('Delete').''; + print ''.$langs->trans('Delete').''; } - print ''.$langs->trans('Back').''; + print ''.$langs->trans('Back').''; print '
'; } else { @@ -350,9 +498,10 @@ if (in_array($action, array('create', 'edit', 'view'))) { $isEdit = ($action == 'edit'); $formAction = $isEdit ? 'update' : 'add'; - print '
'; + print ''; print ''; print ''; + print ''; if ($isEdit) { print ''; } @@ -417,7 +566,7 @@ if (in_array($action, array('create', 'edit', 'view'))) { print '
'; print ''; - print ' '.$langs->trans('Cancel').''; + print ' '.$langs->trans('Cancel').''; print '
'; print '
'; @@ -430,28 +579,12 @@ if (in_array($action, array('create', 'edit', 'view'))) { if ($permissiontoadd) { print ''; } - // Steuerungs-Buttons - print '
'; - print ''; - print ''; - print ''; - print ''; - print '
'; - // Baum laden $tree = $anlage->fetchTree($socId, $systemId); @@ -478,12 +611,14 @@ if (in_array($action, array('create', 'edit', 'view'))) { print '
'; print $langs->trans('NoToolsYet').'

'; if ($permissiontoadd) { - print ' '.$langs->trans('AddFirstTool').''; + print ' '.$langs->trans('AddFirstTool').''; } print '
'; } } +} // Ende elseif ($systemId > 0) + print '
'; // fichecenter // Tooltip Container @@ -739,7 +874,7 @@ function werkzeuge_printTree($nodes, $socid, $systemId, $canEdit, $canDelete, $l print ''.kundenkarte_render_icon($picto).''; // Label - $viewUrl = $_SERVER['PHP_SELF'].'?action=view&anlage_id='.$node->id; + $viewUrl = $_SERVER['PHP_SELF'].'?system='.$systemId.'&action=view&anlage_id='.$node->id; print ''.dol_escape_htmltag($node->label); if (!empty($treeInfoParentheses)) { $infoValues = array(); @@ -790,14 +925,14 @@ function werkzeuge_printTree($nodes, $socid, $systemId, $canEdit, $canDelete, $l print ''; print ''; if ($canEdit) { - print ''; - print ''; + print ''; + print ''; $decommLabel = $node->decommissioned ? $langs->trans('Recommission') : $langs->trans('Decommission'); $decommIcon = $node->decommissioned ? 'fa-plug' : 'fa-power-off'; print ''; } if ($canDelete) { - print ''; + print ''; } print '';