From 4d866e6bae560b5c5b130844a290b73a9509f5ca Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 14 Jul 2023 15:36:02 +0200 Subject: [PATCH] fixes and removed sight check advantage --- httpdocs/public/assets/js/my-bim-score.js | 3 +-- .../public/assets/scss/components/_basic.scss | 2 +- httpdocs/src/Controller/UserController.php | 1 - httpdocs/src/Entity/UserWorksheet.php | 21 ------------------- httpdocs/src/Service/CalculatorService.php | 2 +- .../templates/pages/risk_analysis.html.twig | 12 +++-------- .../snippets/worksheet-result.html.twig | 4 ---- 7 files changed, 6 insertions(+), 39 deletions(-) diff --git a/httpdocs/public/assets/js/my-bim-score.js b/httpdocs/public/assets/js/my-bim-score.js index 915bd73..7032b4b 100644 --- a/httpdocs/public/assets/js/my-bim-score.js +++ b/httpdocs/public/assets/js/my-bim-score.js @@ -165,10 +165,9 @@ function onCalculate() { method: "post", data: $('#form-risk').serializeArray(), success: function (data) { - console.log(data); $('#resInspection').text(data['recCycleInspection']); $('#resMaintenance').text(data['recCycleMaintenance']); - $('#resPercentage').text((data['costDiffCurRecPercentage'] * 100) + " %"); + $('#resPercentage').text((parseFloat(data['costDiffCurRecPercentage']) * 100) + " %"); let costDiff = data['costDiffCurCycleRecCycle']; let roundedCostDiff = parseFloat(costDiff).toFixed(2); $('#resEuro').text(roundedCostDiff.replace(/\./g, ",") + " €"); diff --git a/httpdocs/public/assets/scss/components/_basic.scss b/httpdocs/public/assets/scss/components/_basic.scss index b063cee..2f9c196 100644 --- a/httpdocs/public/assets/scss/components/_basic.scss +++ b/httpdocs/public/assets/scss/components/_basic.scss @@ -38,7 +38,7 @@ textarea:-ms-input-placeholder { width: 80vw; max-width: 1280px; padding: 3rem 0; - min-height: 600px; + min-height: calc(100vh - 68px - 104px); } h1 { diff --git a/httpdocs/src/Controller/UserController.php b/httpdocs/src/Controller/UserController.php index f8e0f2c..aa1aa52 100644 --- a/httpdocs/src/Controller/UserController.php +++ b/httpdocs/src/Controller/UserController.php @@ -149,7 +149,6 @@ class UserController extends AbstractController $worksheet->setFailureDamage(Utils::$riskCosts[$params['costs']][0]); $worksheet->setMaintenanceAdvantage($params['maintenance']); $worksheet->setInspectionAdvantage($params['inspection']); - $worksheet->setCheckAdvantage($params['check']); $worksheet->setUserCycleMonths($params['cycle']); $worksheet->setBandwidth($benchmark->getBandwidth()); $worksheet->setRecMaintenanceCycleMonths($calculation['recCycleMaintenance']); diff --git a/httpdocs/src/Entity/UserWorksheet.php b/httpdocs/src/Entity/UserWorksheet.php index d3e43c4..b2daf2d 100644 --- a/httpdocs/src/Entity/UserWorksheet.php +++ b/httpdocs/src/Entity/UserWorksheet.php @@ -59,11 +59,6 @@ class UserWorksheet */ protected $inspectionAdvantage; - /** - * @ORM\Column(type="boolean", nullable=true) - */ - protected $checkAdvantage; - /** * @ORM\Column(type="smallint", nullable=false, options={"unsigned" = true}) */ @@ -226,22 +221,6 @@ class UserWorksheet $this->inspectionAdvantage = $inspectionAdvantage; } - /** - * @return mixed - */ - public function getCheckAdvantage() - { - return $this->checkAdvantage; - } - - /** - * @param mixed $checkAdvantage - */ - public function setCheckAdvantage($checkAdvantage): void - { - $this->checkAdvantage = $checkAdvantage; - } - /** * @return mixed */ diff --git a/httpdocs/src/Service/CalculatorService.php b/httpdocs/src/Service/CalculatorService.php index 9f8b2d5..100b236 100644 --- a/httpdocs/src/Service/CalculatorService.php +++ b/httpdocs/src/Service/CalculatorService.php @@ -30,7 +30,7 @@ class CalculatorService $riskFactor = Utils::$riskPoints[$riskPoints]['factor']; $recCycleMaintenance = $asset->getCycleMonthsMax(); - if ((int)($params['maintenance']) === 1 || ((int)$params['check']) === 0 ) { + if ((int)($params['maintenance']) === 1) { $recCycleMaintenance = (int) ($asset->getCycleMonthsMax() * $riskFactor); if ($recCycleMaintenance < $asset->getCycleMonthsMin()) { $recCycleMaintenance = $asset->getCycleMonthsMin(); diff --git a/httpdocs/templates/pages/risk_analysis.html.twig b/httpdocs/templates/pages/risk_analysis.html.twig index 8b9e7ad..59939af 100644 --- a/httpdocs/templates/pages/risk_analysis.html.twig +++ b/httpdocs/templates/pages/risk_analysis.html.twig @@ -3,6 +3,9 @@ {% block title %}MPP-Tool{% endblock %} {% block body %} +
+ Zurück zur Übersicht +

MPP-Tool

Bitte füllen sie alle Felder aus, um eine Risikoanalyse zu erstellen.

@@ -61,15 +64,6 @@ -
-
- - -
-

Zyklus und Bandbreite

diff --git a/httpdocs/templates/snippets/worksheet-result.html.twig b/httpdocs/templates/snippets/worksheet-result.html.twig index b29de85..2f10c02 100644 --- a/httpdocs/templates/snippets/worksheet-result.html.twig +++ b/httpdocs/templates/snippets/worksheet-result.html.twig @@ -22,10 +22,6 @@ Kann durch eine Inspektion der Zustand der Anlage erkannt werden? {% if worksheet.inspectionAdvantage == 1 %}Ja{% else %}nein{% endif %} - - Genügt eine einfache Sichtkontrolle im Rahmen des regelmäßigen Rundgangs? - {% if worksheet.checkAdvantage == 1 %}Ja{% else %}nein{% endif %} -

Zyklus und Bandbreite