diff --git a/entity/Classification_entity/Classification_entity.aod b/entity/Classification_entity/Classification_entity.aod index ce16a9a80461f72c42b1c4447f9be2aee94ca93a..0934836f181842f38e69f2df623a6991680f64c1 100644 --- a/entity/Classification_entity/Classification_entity.aod +++ b/entity/Classification_entity/Classification_entity.aod @@ -155,6 +155,19 @@ <entityField> <name>DISPLAYVALUE</name> </entityField> + <entityActionGroup> + <name>fitlerviewActionGroup</name> + <title>Action</title> + <children> + <entityActionField> + <name>refreshClassificationsOfThisDataset</name> + <title>refresh classifications</title> + <onActionProcess>%aditoprj%/entity/Classification_entity/entityfields/fitlerviewactiongroup/children/refreshclassificationsofthisdataset/onActionProcess.js</onActionProcess> + <isObjectAction v="false" /> + <iconId>VAADIN:REFRESH</iconId> + </entityActionField> + </children> + </entityActionGroup> </entityFields> <recordContainers> <jDitoRecordContainer> diff --git a/entity/Classification_entity/entityfields/fitlerviewactiongroup/children/refreshclassificationsofthisdataset/onActionProcess.js b/entity/Classification_entity/entityfields/fitlerviewactiongroup/children/refreshclassificationsofthisdataset/onActionProcess.js new file mode 100644 index 0000000000000000000000000000000000000000..10cfa6bda238dca910902b0b1a731d2e483336eb --- /dev/null +++ b/entity/Classification_entity/entityfields/fitlerviewactiongroup/children/refreshclassificationsofthisdataset/onActionProcess.js @@ -0,0 +1,18 @@ +import("system.process"); +import("system.util"); +import("system.vars"); + +var params = { + "refreshSingleRecord_param" : true, + "ObjectRowid_param" : vars.get("$param.ObjectRowid_param"), + "ObjectType_param" : vars.get("$param.ObjectType_param")} + +var processConfig = process.createStartAsyncConfig() + .setName("updateClassifications_serverProcess") + .setUser( vars.get("$sys.user")) + .setThreadPriority(process.THREADPRIORITY_LOW) + .setTimerType(process.TIMERTYPE_SERVER) + .setLocalVariables(params); + + +process.startAsync(processConfig); \ No newline at end of file diff --git a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod index 7fa0a491479853217397c7fe7879dbc6f5136d5b..f87e5055cc16d669731c5ebe1aba4f160b6c7d1a 100644 --- a/language/_____LANGUAGE_de/_____LANGUAGE_de.aod +++ b/language/_____LANGUAGE_de/_____LANGUAGE_de.aod @@ -10596,6 +10596,10 @@ Bitte Datumseingabe prüfen</value> <key>Sorting by</key> <value>Sortieren nach</value> </entry> + <entry> + <key>refresh classifications</key> + <value>Klassifizierungen neuberechnen</value> + </entry> </keyValueMap> <font name="Dialog" style="0" size="11" /> </language> diff --git a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod index ffbf8f4ba43ca77f362cd65a7289533cd0accc8b..afab4e7e0398549820a78e7ea1b6c6226d7fc952 100644 --- a/language/_____LANGUAGE_en/_____LANGUAGE_en.aod +++ b/language/_____LANGUAGE_en/_____LANGUAGE_en.aod @@ -7350,6 +7350,36 @@ <entry> <key>Probability in %</key> </entry> + <entry> + <key>Created from</key> + </entry> + <entry> + <key>12 Months</key> + </entry> + <entry> + <key>6 Months</key> + </entry> + <entry> + <key>1 Month</key> + </entry> + <entry> + <key>2 Weeks</key> + </entry> + <entry> + <key>Calendar week</key> + </entry> + <entry> + <key>Weekplan already exists!</key> + </entry> + <entry> + <key>Weekplan Info</key> + </entry> + <entry> + <key>requested</key> + </entry> + <entry> + <key>Status Appointment</key> + </entry> <entry> <key>Standard City</key> </entry> @@ -7680,105 +7710,12 @@ <entry> <key>Filter set</key> </entry> - <entry> - <key>Marketing Workflow</key> - </entry> - <entry> - <key>Traits</key> - </entry> - <entry> - <key>Salesproject Phase</key> - </entry> - <entry> - <key>Document template</key> - </entry> - <entry> - <key>Kontext</key> - </entry> - <entry> - <key>Checklist</key> - </entry> - <entry> - <key>Trait</key> - </entry> - <entry> - <key>Salesproject phase</key> - </entry> - <entry> - <key>Status: \"won\"</key> - </entry> - <entry> - <key>Project team roles</key> - </entry> - <entry> - <key>Offer sent</key> - </entry> - <entry> - <key>Classification fields</key> - </entry> - <entry> - <key>Project start within next 12 months</key> - </entry> - <entry> - <key>Project team: \"Internal distribution\"</key> - </entry> - <entry> - <key>Probablity: 100%</key> - </entry> - <entry> - <key>Project team: \"Project manager\"</key> - </entry> - <entry> - <key>Offer exists</key> - </entry> - <entry> - <key>Its not allowed to step over some salesproject phases.</key> - </entry> - <entry> - <key>Salesproject phases</key> - </entry> - <entry> - <key>Not all prerequisites are fulfilled.</key> - </entry> - <entry> - <key>To skip a salesproject phase isn't allowed.</key> - </entry> <entry> <key>The team must have at least one owner</key> </entry> <entry> <key>Delete this Function</key> </entry> - <entry> - <key>Automatically</key> - </entry> - <entry> - <key>Checklist entries</key> - </entry> - <entry> - <key>Communication strategy designed</key> - </entry> - <entry> - <key>Probability checked and eventually readjusted</key> - </entry> - <entry> - <key>Contract have been signed</key> - </entry> - <entry> - <key>Communication strategy introduced</key> - </entry> - <entry> - <key>Workshop for project-realization planned</key> - </entry> - <entry> - <key>Risk audit performed</key> - </entry> - <entry> - <key>Appointment for offer-agreement occured</key> - </entry> - <entry> - <key>Follow-up appointment(s) exists (e.g.: for workshops..)</key> - </entry> <entry> <key>Subtotal</key> </entry> @@ -7798,13 +7735,13 @@ <key>The selected Contact doesn't have an address set.</key> </entry> <entry> - <key>Set completed</key> + <key>Sent offers</key> </entry> <entry> - <key>without Vat</key> + <key>Salesproject phases</key> </entry> <entry> - <key>Checklist entry</key> + <key>without Vat</key> </entry> <entry> <key>Object Filter</key> diff --git a/neonView/ClassificationTree_view/ClassificationTree_view.aod b/neonView/ClassificationTree_view/ClassificationTree_view.aod index d716cc7ddad99a078168f38f67b53ae66dde236e..4d7d91c696787b2329a89ee872308fea857c45f7 100644 --- a/neonView/ClassificationTree_view/ClassificationTree_view.aod +++ b/neonView/ClassificationTree_view/ClassificationTree_view.aod @@ -10,9 +10,9 @@ <children> <treeTableViewTemplate> <name>ClassificationTreeTable</name> - <hideActions v="true" /> <showChildrenCount v="false" /> <entityField>#ENTITY</entityField> + <favoriteActionGroup1>fitlerviewActionGroup</favoriteActionGroup1> <linkedColumns /> <defaultGroupFields> <element>CLASSIFICATIONGROUP</element> diff --git a/process/updateClassifications_serverProcess/process.js b/process/updateClassifications_serverProcess/process.js index db4ab9c27872d6cafb239be8b3f848e9dbaad65e..4bcfa2bb2214469b5deeb45b9d371eef7fe66865 100644 --- a/process/updateClassifications_serverProcess/process.js +++ b/process/updateClassifications_serverProcess/process.js @@ -1,3 +1,4 @@ +import("system.vars"); import("Context_lib"); import("system.util"); import("Util_lib"); @@ -50,12 +51,26 @@ achievedScoresStmt, position, bestPossibleScoreStmt, storedClassificationFlag, d var table = "CLASSIFICATIONSTORAGE"; var column = ["CLASSIFICATIONVALUE"]; var runUpdating = 0; - +var singleRefresh = false; +if(vars.exists("$local.refreshSingleRecord_param") && vars.get("$local.refreshSingleRecord_param")) +{ + singleRefresh = vars.get("$local.refreshSingleRecord_param"); +} //all classificationgroups and their object_type that have atleast one classificationtype with the outdated flag set -outdatedGroupsAndObjectTypes = newSelect("CLASSIFICATIONTYPE.OBJECT_TYPE, CLASSIFICATIONTYPE.CLASSIFICATIONGROUP_ID, CLASSIFICATIONTYPE.CLASSIFICATIONTYPEID, CLASSIFICATIONTYPE.FILTER") +if(!singleRefresh) +{ + outdatedGroupsAndObjectTypes = newSelect("CLASSIFICATIONTYPE.OBJECT_TYPE, CLASSIFICATIONTYPE.CLASSIFICATIONGROUP_ID, CLASSIFICATIONTYPE.CLASSIFICATIONTYPEID, CLASSIFICATIONTYPE.FILTER") .from("CLASSIFICATIONTYPE") .where("CLASSIFICATIONTYPE.OUTDATED", 1) .table(); +} +else +{ + outdatedGroupsAndObjectTypes = newSelect("CLASSIFICATIONTYPE.OBJECT_TYPE, CLASSIFICATIONTYPE.CLASSIFICATIONGROUP_ID, CLASSIFICATIONTYPE.CLASSIFICATIONTYPEID, CLASSIFICATIONTYPE.FILTER") + .from("CLASSIFICATIONTYPE") + .where("CLASSIFICATIONTYPE.OBJECT_TYPE", vars.get("$local.ObjectType_param")) + .table(); +} objectTypesThatNeedUpdate = []; for (i = 0; i < outdatedGroupsAndObjectTypes.length; i++) @@ -95,41 +110,42 @@ for (i = 0; i < outdatedGroupsAndObjectTypes.length; i++) helperObject[classificationTypeId] = ""; } } - -//object_type, object_rowId, classificationstorageId and the classificationstring (e.g. "ACB") of the classificationStorage datasets that habe the outdated flag set -outdatedStoredClassifications = newSelect("CLASSIFICATIONSTORAGE.OBJECT_TYPE, CLASSIFICATIONSTORAGE.OBJECT_ROWID, \n\ - CLASSIFICATIONSTORAGE.CLASSIFICATIONSTORAGEID, CLASSIFICATIONSTORAGE.CLASSIFICATIONVALUE") - .from("CLASSIFICATIONSTORAGE") - .where("CLASSIFICATIONSTORAGE.OUTDATED", 1) - .orderBy("OBJECT_TYPE") - .table(); -helperObject = {}; -if(outdatedStoredClassifications) +if(!singleRefresh) { - //build classificationStorageObject out of outdatedStoredClassifications - for (i = 0; i < outdatedStoredClassifications.length; i++) + //object_type, object_rowId, classificationstorageId and the classificationstring (e.g. "ACB") of the classificationStorage datasets that habe the outdated flag set + outdatedStoredClassifications = newSelect("CLASSIFICATIONSTORAGE.OBJECT_TYPE, CLASSIFICATIONSTORAGE.OBJECT_ROWID, \n\ + CLASSIFICATIONSTORAGE.CLASSIFICATIONSTORAGEID, CLASSIFICATIONSTORAGE.CLASSIFICATIONVALUE") + .from("CLASSIFICATIONSTORAGE") + .where("CLASSIFICATIONSTORAGE.OUTDATED", 1) + .orderBy("OBJECT_TYPE") + .table(); + helperObject = {}; + if(outdatedStoredClassifications) { - for (ii = 0; ii < outdatedStoredClassifications[i].length; ii++) + //build classificationStorageObject out of outdatedStoredClassifications + for (i = 0; i < outdatedStoredClassifications.length; i++) { - [object_type, object_rowId, classificationStorageId, classificationScore] = outdatedStoredClassifications[i]; - - if(!helperObject.hasOwnProperty(object_type)) //objectType + for (ii = 0; ii < outdatedStoredClassifications[i].length; ii++) { - classificationStorageObject[object_type] = {}; //puts objectType in classificationStorageObject and already initializes the object that later get's filled with the groups and their types - helperObject[object_type] = ""; - objectTypes.push(object_type); //also push all the objectTypes in an Array for later (the updating happens one objectType at a time) + [object_type, object_rowId, classificationStorageId, classificationScore] = outdatedStoredClassifications[i]; - } - if(!helperObject.hasOwnProperty(object_rowId)) //objectRowId - { - classificationStorageObject[object_type][object_rowId] = [classificationStorageId, classificationScore]; //same logic as before - helperObject[object_rowId] = ""; - objectRowIdArray.push(object_rowId); //also push all the objectTypes in an Array for later + if(!helperObject.hasOwnProperty(object_type)) //objectType + { + classificationStorageObject[object_type] = {}; //puts objectType in classificationStorageObject and already initializes the object that later get's filled with the groups and their types + helperObject[object_type] = ""; + objectTypes.push(object_type); //also push all the objectTypes in an Array for later (the updating happens one objectType at a time) + + } + if(!helperObject.hasOwnProperty(object_rowId)) //objectRowId + { + classificationStorageObject[object_type][object_rowId] = [classificationStorageId, classificationScore]; //same logic as before + helperObject[object_rowId] = ""; + objectRowIdArray.push(object_rowId); //also push all the objectTypes in an Array for later + } } } } -} - +} if(outdatedStoredClassifications.length > 0) { storedClassificationFlag = true; //this variable can easily be checked to see what we are updating @@ -225,8 +241,14 @@ for (xyz = 0; xyz < runUpdating; xyz++) } if(!storedClassificationFlag) // we already habe the classificationStorageObject if we are updating for the outdated classificationStorage { + let condIfSingle; + if(vars.exists("$local.ObjectRowid_param") && vars.get("$local.ObjectRowid_param")) + { + condIfSingle = newWhere("CLASSIFICATIONSTORAGE.OBJECT_ROWID", vars.get("$local.ObjectRowid_param")); + } classificationStorageArray = newSelect("OBJECT_TYPE, OBJECT_ROWID, CLASSIFICATIONSTORAGEID, CLASSIFICATIONVALUE") .from("CLASSIFICATIONSTORAGE") + .whereIfSet(condIfSingle) .orderBy("OBJECT_TYPE") .table(); helperObject = {}; //resets the helper object @@ -479,14 +501,17 @@ for (xyz = 0; xyz < runUpdating; xyz++) } } } - - if(!storedClassificationFlag) + if(singleRefresh) { - correctCondition = newWhere("CLASSIFICATIONTYPE.CLASSIFICATIONGROUP_ID", groupsThatNeedUpdate, SqlBuilder.IN()) + correctCondition = newWhere(currentObjectColumn, vars.get("$local.ObjectRowid_param")); + } + else if(!storedClassificationFlag) + { + correctCondition = newWhere("CLASSIFICATIONTYPE.CLASSIFICATIONGROUP_ID", groupsThatNeedUpdate, SqlBuilder.IN()); } else { - correctCondition = newWhere(currentObjectColumn, objectRowIdArray, SqlBuilder.IN()) + correctCondition = newWhere(currentObjectColumn, objectRowIdArray, SqlBuilder.IN()); } achievedScoresStmt = newSelect(currentObjectColumn + ", CLASSIFICATIONTYPE.CLASSIFICATIONGROUP_ID, \n\ @@ -632,7 +657,7 @@ for (xyz = 0; xyz < runUpdating; xyz++) } } - if(!storedClassificationFlag) + if(!storedClassificationFlag && !singleRefresh) { for (i = 0; i < scoreArray.length; i++) { let cond = newWhere("CLASSIFICATIONTYPE.CLASSIFICATIONTYPEID", scoreArray[i][2]); @@ -809,10 +834,18 @@ function _buildBestPossibleScoresGroupObjFn(pBatchData, pBatchNum) function _insertPersistendClassificationDataIfNeeded() { - var objectsWithClassification = newSelect("distinct CLASSIFICATION.OBJECT_ROWID") + var objectsWithClassification; + if(singleRefresh) + { + objectsWithClassification = [vars.get("$local.ObjectRowid_param")]; + } + else + { + objectsWithClassification = newSelect("distinct CLASSIFICATION.OBJECT_ROWID") .from("CLASSIFICATION") .where("CLASSIFICATION.OBJECT_TYPE", objectTypes[i]) .arrayColumn(); + } for (z = 0; z < objectsWithClassification.length; z++) { uid = objectsWithClassification[z];