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

RecordContainer fix: Comm_entity

parent 664a85ee
No related branches found
No related tags found
No related merge requests found
...@@ -7,6 +7,15 @@ ...@@ -7,6 +7,15 @@
<alias>Data_alias</alias> <alias>Data_alias</alias>
<conditionProcess>%aditoprj%/entity/Comm_entity/conditionProcess.js</conditionProcess> <conditionProcess>%aditoprj%/entity/Comm_entity/conditionProcess.js</conditionProcess>
<orderClauseProcess>%aditoprj%/entity/Comm_entity/orderClauseProcess.js</orderClauseProcess> <orderClauseProcess>%aditoprj%/entity/Comm_entity/orderClauseProcess.js</orderClauseProcess>
<recordContainer>db</recordContainer>
<linkInformation>
<linkInformation>
<name>54875441-f1b0-47d1-9fa6-c1927863f3e3</name>
<tableName>COMM</tableName>
<primaryKey>COMMID</primaryKey>
<isUIDTable v="true" />
</linkInformation>
</linkInformation>
<entityFields> <entityFields>
<entityField> <entityField>
<name>ADDR</name> <name>ADDR</name>
...@@ -94,12 +103,59 @@ So, for only showing telephone-types you&amp;apos;ve to specify this parameter w ...@@ -94,12 +103,59 @@ So, for only showing telephone-types you&amp;apos;ve to specify this parameter w
<description>PARAMETER</description> <description>PARAMETER</description>
</entityParameter> </entityParameter>
</entityFields> </entityFields>
<linkInformation> <recordContainers>
<linkInformation> <dbRecordContainer>
<name>54875441-f1b0-47d1-9fa6-c1927863f3e3</name> <name>db</name>
<tableName>COMM</tableName> <alias>Data_alias</alias>
<primaryKey>COMMID</primaryKey> <conditionProcess>%aditoprj%/entity/Comm_entity/recordcontainers/db/conditionProcess.js</conditionProcess>
<isUIDTable v="true" /> <orderClauseProcess>%aditoprj%/entity/Comm_entity/recordcontainers/db/orderClauseProcess.js</orderClauseProcess>
</linkInformation> <linkInformation>
</linkInformation> <linkInformation>
<name>e3567770-187a-4366-bb87-fb22ff7ff257</name>
<tableName>COMM</tableName>
<primaryKey>COMMID</primaryKey>
<isUIDTable v="true" />
<readonly v="false" />
</linkInformation>
</linkInformation>
<recordFieldMappings>
<dbRecordFieldMapping>
<name>ADDR.value</name>
<value>COMM.ADDR</value>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>MEDIUM_ID.value</name>
<value>COMM.MEDIUM_ID</value>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>COMMID.value</name>
<value>COMM.COMMID</value>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>RELATION_ID.value</name>
<value>COMM.RELATION_ID</value>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>DATE_EDIT.value</name>
<value>COMM.DATE_EDIT</value>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>STANDARD.value</name>
<value>COMM.STANDARD</value>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>DATE_NEW.value</name>
<value>COMM.DATE_NEW</value>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>USER_EDIT.value</name>
<value>COMM.USER_EDIT</value>
</dbRecordFieldMapping>
<dbRecordFieldMapping>
<name>USER_NEW.value</name>
<value>COMM.USER_NEW</value>
</dbRecordFieldMapping>
</recordFieldMappings>
</dbRecordContainer>
</recordContainers>
</entity> </entity>
import("system.db");
import("system.result");
import("Sql_lib");
import("Keyword_lib");
var relId, cond;
cond = new SqlCondition();
cond.andPrepareVars("COMM.RELATION_ID", "$param.RelId_param");
if (vars.exists("$param.MediumCategoriesFilter_param")){
mediumCategories = vars.get("$param.MediumCategoriesFilter_param");
if (mediumCategories != null && mediumCategories != "") {
mediumCategories = text.decodeMS(mediumCategories);
var kwd = KeywordUtils.createKeyword("COMM.MEDIUM");
kwd.filter(function(id, name, customs){
return mediumCategories.indexOf(customs.category) > -1;
});
mediumIds = kwd.toArray("id");
if (mediumIds.length == 0)
throw new Error();//TODO: add message
cond.and("COMM.MEDIUM_ID in (" + mediumIds.join(", ") + ")");
}
}
result.string(db.translateCondition([cond.toString("1 = 2"), cond.preparedValues]));
\ No newline at end of file
import("system.result");
import("system.db");
result.object({
"COMM.MEDIUM_ID": db.ASCENDING
});
\ No newline at end of file
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