Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Impact/Embodied/AbstractEmbodiedImpact.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function evaluateItem(): bool
Session::addMessageAfterRedirect(__('Connection to Boavizta failed.', 'carbon'), false, ERROR);
return false;
} catch (\RuntimeException $e) {
Session::addMessageAfterRedirect(__('Embodied impact evaluation valuation falied.', 'carbon'), false, ERROR);
Session::addMessageAfterRedirect(__('Embodied impact evaluation falied.', 'carbon'), false, ERROR);
return false;
}

Expand Down
7 changes: 4 additions & 3 deletions src/Impact/Embodied/Internal/Computer.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
use Computer as GlpiComputer;
use GlpiPlugin\Carbon\DataTracking\TrackedFloat;
use ComputerModel as GlpiComputerModel;
use GlpiPlugin\Carbon\ComputerModel;
use GlpiPlugin\Carbon\Impact\Type;

/**
Expand All @@ -46,13 +47,13 @@ class Computer extends AbstractAsset

protected function doEvaluation(): ?array
{
if (GlpiComputerModel::isNewID($this->item->fields['networkequipmentmodels_id'])) {
if (GlpiComputerModel::isNewID($this->item->fields['computermodels_id'])) {
return [];
}

$model = new GlpiComputerModel();
$model = new ComputerModel();
$model->getFromDBByCrit([
'networkequipmentmodels_id' => $this->item->fields['networkequipmentmodels_id']
'computermodels_id' => $this->item->fields['computermodels_id']
]);
if ($model->isNewItem()) {
return [];
Expand Down
7 changes: 4 additions & 3 deletions src/Impact/Embodied/Internal/Monitor.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
use GlpiPlugin\Carbon\DataTracking\TrackedFloat;
use MonitorModel as GlpiMonitorModel;
use GlpiPlugin\Carbon\Impact\Type;
use GlpiPlugin\Carbon\MonitorModel;

/**
* This embodied impact
Expand All @@ -47,13 +48,13 @@ class Monitor extends AbstractAsset

protected function doEvaluation(): ?array
{
if (GlpiMonitorModel::isNewID($this->item->fields['networkequipmentmodels_id'])) {
if (GlpiMonitorModel::isNewID($this->item->fields['monitormodels_id'])) {
return [];
}

$model = new GlpiMonitorModel();
$model = new MonitorModel();
$model->getFromDBByCrit([
'networkequipmentmodels_id' => $this->item->fields['networkequipmentmodels_id']
'monitormodels_id' => $this->item->fields['monitormodels_id']
]);
if ($model->isNewItem()) {
return [];
Expand Down