Skip to content
Snippets Groups Projects
Commit ceb4beaf authored by Johannes Goderbauer's avatar Johannes Goderbauer
Browse files

Classification bugfix: groups

parent d2173e62
No related branches found
No related tags found
No related merge requests found
Showing
with 50 additions and 45 deletions
import("system.neon");
neon.setFieldValue("$field.CLASSIFICATIONGROUP", "");
neon.refresh("$field.CLASSIFICATIONGROUP")
\ No newline at end of file
neon.setFieldValue("$field.CLASSIFICATIONGROUP", "");
\ No newline at end of file
......@@ -2,21 +2,19 @@ import("system.translate");
import("Sql_lib");
import("system.result");
import("system.vars");
import("system.logging");
logging.log("classificationgroup_filter.groupQueryProcess");
var isCount = vars.get("$local.count"); // TRUE if the count of the records is needed
var columns = vars.get("$local.columnlist"); // The column, expected from the querry, see also AttributeFilter_lib
var condition = vars.get("$local.condition"); // The Condition that's beeing used, includes the grouphirachy
var groupedColumns = vars.get("$local.groupedlist") // The coloumns, used for grouping
var order = vars.get("$local.order"); // The order of the result
var classificationId = vars.get("$local.name");
classificationId = classificationId.slice(classificationId.lastIndexOf(".") + 1, classificationId.length);
var name = vars.get("$local.name");
var stmt = newSelect(isCount ? groupedColumns : columns)
.from("ORGANISATION")
.join("CONTACT", "ORGANISATIONID = ORGANISATION_ID and PERSON_ID is null")
.leftJoin("CLASSIFICATIONSTORAGE", "CLASSIFICATIONSTORAGE.OBJECT_ROWID = CONTACT.CONTACTID and OBJECT_TYPE = 'Organisation'")
.where(condition)
.whereIfSet(condition)
.groupBy(groupedColumns)
.toString();
......
......@@ -666,26 +666,6 @@
</entityParameter>
</children>
</entityConsumer>
<entityConsumer>
<name>ClassificationGroups</name>
<dependency>
<name>dependency</name>
</dependency>
<children>
<entityParameter>
<name>ClassificationType_param</name>
<valueProcess>%aditoprj%/entity/Salesproject_entity/entityfields/classificationgroups/children/classificationtype_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>ObjectRowid_param</name>
<valueProcess>%aditoprj%/entity/Salesproject_entity/entityfields/classificationgroups/children/objectrowid_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>ObjectType_param</name>
<valueProcess>%aditoprj%/entity/Salesproject_entity/entityfields/classificationgroups/children/objecttype_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
<entityField>
<name>PHASEINFO</name>
<title>phase information</title>
......@@ -939,6 +919,7 @@
<filterValuesProcess>%aditoprj%/entity/Salesproject_entity/recordcontainers/db/filterextensions/classificationgroup_filter/filterValuesProcess.js</filterValuesProcess>
<filterConditionProcess>%aditoprj%/entity/Salesproject_entity/recordcontainers/db/filterextensions/classificationgroup_filter/filterConditionProcess.js</filterConditionProcess>
<isGroupable v="true" />
<groupQueryProcess>%aditoprj%/entity/Salesproject_entity/recordcontainers/db/filterextensions/classificationgroup_filter/groupQueryProcess.js</groupQueryProcess>
<filtertype>BASIC</filtertype>
</filterExtensionSet>
</filterExtensions>
......
import("KeywordRegistry_basic");
import("system.result");
result.string($KeywordRegistry.classificationType$salesproject());
\ No newline at end of file
import("system.vars");
import("system.result");
result.string(vars.get("$sys.uid"));
\ No newline at end of file
import("system.result");
import("Context_lib");
result.string(ContextUtils.getCurrentContextId());
\ No newline at end of file
import("system.vars");
import("system.result");
import("ClassificationFilter_lib");
var sqlCond = ClassificationGroupFilterUtils.makeFilterConditionSql(vars.get("$sys.currentcontextname"));
var sqlCond = ClassificationGroupFilterUtils.makeFilterConditionSql();
result.string(sqlCond);
\ No newline at end of file
import("system.vars");
import("system.result");
import("ClassificationFilter_lib");
//this filterExtensionSet is for the Classifications (ClassificationGroups, e.g. 1. Target Group, Customer Value...)
var fields = ClassificationTypeFilterUtils.getFilterFieldsGroup(vars.get("$sys.currentcontextname"));
var fields = ClassificationGroupFilterUtils.makeFilterFields();
result.string(fields);
\ No newline at end of file
import("system.vars");
import("system.result");
import("ClassificationFilter_lib");
var values = ClassificationGroupFilterUtils.makeFilterValues(vars.get("$sys.currentcontextname"));
var values = ClassificationGroupFilterUtils.makeFilterValues();
result.object(values);
\ No newline at end of file
import("system.translate");
import("Sql_lib");
import("system.result");
import("system.vars");
function Scp(){
}
Scp.makeDefaultGroupQuery = function()
{
var isCount = vars.get("$local.count"); // TRUE if the count of the records is needed
var columns = vars.get("$local.columnlist"); // The column, expected from the querry, see also AttributeFilter_lib
var condition = vars.get("$local.condition"); // The Condition that's beeing used, includes the grouphirachy
var groupedColumns = vars.get("$local.groupedlist") // The coloumns, used for grouping
var order = vars.get("$local.order"); // The order of the result
var name = vars.get("$local.name");
return Scp.getDefaultGroupQuery(isCount, columns, condition, groupedColumns, order, name);
};
Scp.getDefaultGroupQuery = function(pIsCount, pColumns, pCondition, pGroupedColumns, pOrder, pName)
{
var stmt = newSelect(pIsCount ? pGroupedColumns : pColumns)
.from("SALESPROJECT")
.leftJoin("CLASSIFICATIONSTORAGE", "CLASSIFICATIONSTORAGE.OBJECT_ROWID = SALESPROJECT.SALESPROJECTID and OBJECT_TYPE = 'Salesproject'");
if (pCondition)
{
var condition = pCondition.trim();
if (condition)
stmt.where(condition);
}
stmt.groupBy(pGroupedColumns);
return stmt;
};
var res = Scp.makeDefaultGroupQuery().toString();
result.string(res);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment