diff --git a/entity/ClassificationAdmin_entity/ClassificationAdmin_entity.aod b/entity/ClassificationAdmin_entity/ClassificationAdmin_entity.aod index 23f1c3e8b3980608fb0da5a806ead9a48a54335d..50832393a42e0ccb91f71e3946cb435fd76c68fc 100644 --- a/entity/ClassificationAdmin_entity/ClassificationAdmin_entity.aod +++ b/entity/ClassificationAdmin_entity/ClassificationAdmin_entity.aod @@ -136,10 +136,12 @@ <textInputAllowed v="true" /> <stateProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/classificationgroupdisplayvalue/stateProcess.js</stateProcess> <valueProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/classificationgroupdisplayvalue/valueProcess.js</valueProcess> + <onValueChange>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/classificationgroupdisplayvalue/onValueChange.js</onValueChange> </entityField> <entityField> <name>SCOREPOINTS</name> <title>Max Points</title> + <contentType>NUMBER</contentType> <mandatory v="true" /> <mandatoryProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/scorepoints/mandatoryProcess.js</mandatoryProcess> <stateProcess>%aditoprj%/entity/ClassificationAdmin_entity/entityfields/scorepoints/stateProcess.js</stateProcess> diff --git a/entity/ClassificationAdmin_entity/entityfields/classificationgroupdisplayvalue/onValueChange.js b/entity/ClassificationAdmin_entity/entityfields/classificationgroupdisplayvalue/onValueChange.js new file mode 100644 index 0000000000000000000000000000000000000000..ea41f9b73265437d01ee5d12218b4aa8a358f74b --- /dev/null +++ b/entity/ClassificationAdmin_entity/entityfields/classificationgroupdisplayvalue/onValueChange.js @@ -0,0 +1,16 @@ +import("system.neon"); +import("system.vars"); +import("Sql_lib"); + +if(vars.get("$sys.operatingstate") == neon.OPERATINGSTATE_NEW) +{ + var sorting = newSelect("CLASSIFICATIONGROUP.SORTING") + .from("CLASSIFICATIONGROUP") + .where("CLASSIFICATIONGROUP.CLASSIFICATIONGROUPID", vars.get("$this.value")) + .cell(); + + if(sorting) + { + neon.setFieldValue("$field.SORTING", sorting) + } +} \ No newline at end of file diff --git a/entity/ClassificationAdmin_entity/entityfields/sorting/stateProcess.js b/entity/ClassificationAdmin_entity/entityfields/sorting/stateProcess.js index 2cd13f04b8ed1f8cd3f762168f0b3208ada7cf1e..759b36de7c39c4a53ea6baa74cd5298958b6a0ee 100644 --- a/entity/ClassificationAdmin_entity/entityfields/sorting/stateProcess.js +++ b/entity/ClassificationAdmin_entity/entityfields/sorting/stateProcess.js @@ -9,7 +9,7 @@ var recordCategory = vars.get("$field.recordCategory"); if(recordCategory == $ClassificationRecordCategories.CLASSIFICATION_CLASSIFICATION_TYPE()) state = neon.COMPONENTSTATE_INVISIBLE; else if(recordCategory == $ClassificationRecordCategories.CLASSIFICATION_GROUP_EXISTS()) - state = neon.COMPONENTSTATE_DISABLED; + state = neon.COMPONENTSTATE_EDITABLE; else state = neon.COMPONENTSTATE_EDITABLE; diff --git a/entity/ClassificationAdmin_entity/entityfields/sorting/valueProcess.js b/entity/ClassificationAdmin_entity/entityfields/sorting/valueProcess.js index c59d575fa674c2fcbe2d4702f0257f71cfd040c0..2a00907372cd2e3b236bcae2b2b04410c1e710ef 100644 --- a/entity/ClassificationAdmin_entity/entityfields/sorting/valueProcess.js +++ b/entity/ClassificationAdmin_entity/entityfields/sorting/valueProcess.js @@ -1,3 +1,4 @@ +import("Classification_lib"); import("system.neon"); import("system.vars"); import("system.result"); @@ -33,7 +34,16 @@ var sorting = newSelect("CLASSIFICATIONGROUP.SORTING") .from("CLASSIFICATIONGROUP") .where("CLASSIFICATIONGROUP.CLASSIFICATIONGROUPID", id) .cell(); -if(sorting) +var fieldValue = vars.get("$this.value"); +if((!fieldValue || fieldValue == "") && sorting) +{ result.string(sorting); +} +else if(fieldValue) +{ + result.string(fieldValue); +} else +{ result.string("1"); +} diff --git a/entity/ClassificationGrading_entity/entityfields/minpercent/onValidation.js b/entity/ClassificationGrading_entity/entityfields/minpercent/onValidation.js index 01fcc4024cec17d06442e711165ac20ec5ae7014..244e89b04334f17b16492a9f55c8061849536b86 100644 --- a/entity/ClassificationGrading_entity/entityfields/minpercent/onValidation.js +++ b/entity/ClassificationGrading_entity/entityfields/minpercent/onValidation.js @@ -1,3 +1,4 @@ +import("system.translate"); import("system.result"); import("system.vars"); @@ -6,10 +7,16 @@ if(val) { var res; if(!Number.isInteger(Number(val))) - res = "Only Integers allowed"; + { + res = translate.text("Only Integers allowed"); + } else if(val < 0 || val > 100) - res = "The Value has to be in the 0-100% range"; - + { + res = translate.text("The Value has to be in the 0-100% range"); + } + if(res) + { result.string(res); + } } \ No newline at end of file diff --git a/entity/ClassificationScore_entity/ClassificationScore_entity.aod b/entity/ClassificationScore_entity/ClassificationScore_entity.aod index 2ae55fb56295b7ab782a5e201f73abe4d092f29b..6867a2f6dd62f0d18357cc637c858485a10276e5 100644 --- a/entity/ClassificationScore_entity/ClassificationScore_entity.aod +++ b/entity/ClassificationScore_entity/ClassificationScore_entity.aod @@ -86,6 +86,7 @@ <name>SCOREPERCENT</name> <title>Percent</title> <contentType>NUMBER</contentType> + <onValidation>%aditoprj%/entity/ClassificationScore_entity/entityfields/scorepercent/onValidation.js</onValidation> </entityField> <entityField> <name>scoreInPoints</name> diff --git a/entity/ClassificationScore_entity/entityfields/scorepercent/onValidation.js b/entity/ClassificationScore_entity/entityfields/scorepercent/onValidation.js new file mode 100644 index 0000000000000000000000000000000000000000..fe95642377c3e90c2afc43a33106075ac9be622f --- /dev/null +++ b/entity/ClassificationScore_entity/entityfields/scorepercent/onValidation.js @@ -0,0 +1,10 @@ +import("system.translate"); +import("system.result"); +import("system.vars"); + +var val = vars.get("$this.value"); +if(val) +{ + if(val < 0 || val > 100) + result.string(translate.text("The Value has to be in the 0-100% range")); +} \ No newline at end of file diff --git a/entity/Classification_entity/recordcontainers/jdito/contentProcess.js b/entity/Classification_entity/recordcontainers/jdito/contentProcess.js index f9ef4620aaacf66e7fadb9917ba6bb6a017692ca..9012ad499cb17403800936f7ad257cca37b1d91b 100644 --- a/entity/Classification_entity/recordcontainers/jdito/contentProcess.js +++ b/entity/Classification_entity/recordcontainers/jdito/contentProcess.js @@ -534,8 +534,8 @@ function _buildTreeFromPersistetData() achievedGroupScoresObj[groupId] = 0 classificationGroups.push(groupId) } - if(classificationScorePoints != undefined) - achievedGroupScoresObj[groupId] = eMath.addInt(Number(achievedGroupScoresObj[groupId]), Number(classificationScorePoints)); + if(classificationScorePoints != undefined || classificationScorePoints != "") + achievedGroupScoresObj[groupId] = eMath.addDec(Number(achievedGroupScoresObj[groupId]), Number(classificationScorePoints)); treeBuilt = true; resultSet.push([uid, typeId, classificationId, groupId, classificationGroupTitle, classificationTypeScoreType, diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index acd7ec56c73f132b1a9cfe7042b8b943ea727a75..e0641a04f188de206d99ecd360badc9e89355645 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -10128,6 +10128,14 @@ Bitte Datumseingabe prüfen</value> <key>Filter set</key> <value>Filter gesetzt</value> </entry> + <entry> + <key>The Value has to be in the 0-100% range</key> + <value>Der Wert muss sich zwischen 0 und 100% liegen</value> + </entry> + <entry> + <key>Only Integers allowed</key> + <value>Nur ganze Zahlen erlaubt</value> + </entry> <entry> <key>Sent Offers</key> </entry>