From 562cf0e53cf94850ff01b42f6c524765664614ac Mon Sep 17 00:00:00 2001
From: Benjamin Ulrich <b.ulrich@adito.de>
Date: Wed, 7 Oct 2020 13:53:37 +0000
Subject: [PATCH] =?UTF-8?q?[Projekt:=20Entwicklung=20-=20Neon][TicketNr.:?=
 =?UTF-8?q?=201066768][Klassifizierung=20-=20Nachtr=C3=A4gliche=20=C3=84nd?=
 =?UTF-8?q?erung=20der=20Werte=20-=20Hardcodierte=20Texte=20werden=20nicht?=
 =?UTF-8?q?=20aktualisiert=20und=20k=C3=B6nnen=20sehr=20irritieren]?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../recordcontainers/db/onDBDelete.js              |  2 +-
 .../ClassificationType_entity.aod                  |  1 +
 .../entityfields/infofield/valueProcess.js         | 11 ++++++-----
 process/Classification_lib/process.js              | 14 +++++++++++++-
 4 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/entity/ClassificationScore_entity/recordcontainers/db/onDBDelete.js b/entity/ClassificationScore_entity/recordcontainers/db/onDBDelete.js
index 27385ec36d..f45ecc8306 100644
--- a/entity/ClassificationScore_entity/recordcontainers/db/onDBDelete.js
+++ b/entity/ClassificationScore_entity/recordcontainers/db/onDBDelete.js
@@ -21,7 +21,7 @@ try
         var table = ["CLASSIFICATIONGRADING"];
         var multiplicand = maxScore/gradingTable[0][1];
         var update = newWhere("CLASSIFICATIONGRADING.CLASSIFICATIONGRADINGID", gradingTable[0][0])
-                                .updateData(true, table, column, null, column, db.getCurrentAlias()), [maxScore]);
+                                .updateData(true, table, column, null, column, db.getCurrentAlias(), [maxScore]);
 
         for (let i = 1; i < gradingTable.length; i++) 
         {
diff --git a/entity/ClassificationType_entity/ClassificationType_entity.aod b/entity/ClassificationType_entity/ClassificationType_entity.aod
index d86c079f7b..faf8305ab8 100644
--- a/entity/ClassificationType_entity/ClassificationType_entity.aod
+++ b/entity/ClassificationType_entity/ClassificationType_entity.aod
@@ -39,6 +39,7 @@
     </entityField>
     <entityConsumer>
       <name>ClassificationScores</name>
+      <refreshParent v="true" />
       <dependency>
         <name>dependency</name>
         <entityName>ClassificationScore_entity</entityName>
diff --git a/entity/ClassificationType_entity/entityfields/infofield/valueProcess.js b/entity/ClassificationType_entity/entityfields/infofield/valueProcess.js
index 07815a1f88..1aec260db1 100644
--- a/entity/ClassificationType_entity/entityfields/infofield/valueProcess.js
+++ b/entity/ClassificationType_entity/entityfields/infofield/valueProcess.js
@@ -1,3 +1,4 @@
+import("system.neon");
 import("system.translate");
 import("Entity_lib");
 import("system.result");
@@ -16,7 +17,7 @@ var maxScore = 0;
 var i;
 var randomScoreId;
 
-result.string(translate.text("Keep in Mind that changes to the Value with the greatest score directly affect the Classification Gradings of the Classification!"))
+var res = ClassificationUtils.getTranslatedInfo();
 if(rows.length > 0)
 {
     for (i = 0; i < rows.length; i++) 
@@ -54,7 +55,7 @@ if(rows.length > 0)
                 for (i = 0; i < gradingTable.length; i++) 
                 {
                     oldToNewValueString += gradingTable[i][2] + ": " + gradingTable[i][1] + "->" + parseInt(gradingTable[i][1] * multiplicand) + "\n\
-            ";
+    ";
                 }
             }
             else 
@@ -67,9 +68,9 @@ if(rows.length > 0)
             ";
                 }
             }
-            var resString = translate.text("This is how the Classification Gradings of the Classification will get affected by these changes:") + "\n\
+            res = translate.text("This is how the Classification Gradings of the Classification will get affected by these changes:") + "\n\
     "+ oldToNewValueString;
-            result.string(resString);
         }
     }
-}
\ No newline at end of file
+}
+result.string(res);
\ No newline at end of file
diff --git a/process/Classification_lib/process.js b/process/Classification_lib/process.js
index 66105c8ae1..756e30fa53 100644
--- a/process/Classification_lib/process.js
+++ b/process/Classification_lib/process.js
@@ -440,6 +440,18 @@ ClassificationUtils.decode = function (pEncodedString)
     return res
 };
 
+/**
+ * gets the translated Info text for the ClassificationtypePreview
+ *  
+ * @return {String}                     <p/> the translated InfoText
+ * @static 
+ */
+ClassificationUtils.getTranslatedInfo = function ()
+{
+return translate.text("Keep in Mind that changes to the Value with the greatest score directly affect the Classification Gradings of the Classification!");
+};
+
+
 /*this is right now (2020-08-15) the only way to get something like a constant with 
  - a prober name
  - autocomplete support within the ADITO Designer
@@ -453,4 +465,4 @@ $ClassificationRecordCategories.CLASSIFICATION_GROUP_EXISTS =            functio
 $ClassificationRecordCategories.CLASSIFICATION_GROUP_DOESNT_EXIST =      function(){return "ClassificationGroupDoesntExist"};
 
 function $ClassificationPlaceholder(){}
-$ClassificationPlaceholder.TOPSECRETPLACEHOLDER =                       function(){return "T0PS3CR3TPL4CEH0LD3R"};
\ No newline at end of file
+$ClassificationPlaceholder.TOPSECRETPLACEHOLDER =                        function(){return "T0PS3CR3TPL4CEH0LD3R"};
-- 
GitLab