Skip to content
Snippets Groups Projects
Commit f2bae3e7 authored by Tobias Feldmann's avatar Tobias Feldmann
Browse files

Merge branch 'master' of gitlab.adito.de:xrm/basic

parents e8db3968 db1558f9
No related branches found
No related tags found
No related merge requests found
......@@ -2,6 +2,9 @@ import("system.vars");
import("system.result");
import("Keyword_lib");
var kwdUtils;
kwdUtils = new KeywordUtils();
result.string(vars.get("$field.SUBJECT") + " (" + kwdUtils.getViewValue("HISTORY.MEDIUM", vars.get("$field.MEDIUM")) + ")");
\ No newline at end of file
var kwdUtils, histMedium;
histMedium = vars.get("$field.MEDIUM");
if (histMedium){
kwdUtils = new KeywordUtils();
result.string(vars.get("$field.SUBJECT") + " (" + kwdUtils.getViewValue("HISTORY.MEDIUM", histMedium) + ")");
}
\ No newline at end of file
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<changeSet author="j.goderbauer" id="b8adb18b-ecc9-439b-a0bd-df86e63a413f">
<insert tableName="ADDRESS">
<column name="ADDRESSID" value="97d37aea-d7f8-4436-bb31-875439f5f7f1"/>
<column name="USER_NEW" value="Raphael"/>
<column name="DATE_NEW" valueDate="2018-08-13T02:06:43"/>
<column name="RELATION_ID" value="bdb6e38a-b227-455b-ae48-f8febd622e03"/>
<column name="ADDR_TYPE" valueNumeric="1"/>
<column name="ADDRESS" value="Lille &#216;vregaten"/>
<column name="BUILDINGNO" value="9"/>
<column name="ZIP" value="5018"/>
<column name="CITY" value="Bergen"/>
<column name="COUNTRY" value="NO"/>
</insert>
<rollback>
<delete tableName="ADDRESS">
<where>ADDRESSID = ?</where>
<whereParams>
<param value="97d37aea-d7f8-4436-bb31-875439f5f7f1"/>
</whereParams>
</delete>
</rollback>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<changeSet author="j.goderbauer" id="e452c5ee-dfe5-4aee-9eec-c3a397fa2ab2">
<insert tableName="COMM">
<column name="COMMID" value="cdd02d37-845d-40be-9b8c-08f99afa985f"/>
<column name="USER_NEW" value="Raphael"/>
<column name="DATE_NEW" valueDate="2018-08-13T03:14:22"/>
<column name="RELATION_ID" value="bdb6e38a-b227-455b-ae48-f8febd622e03"/>
<column name="MEDIUM_ID" valueNumeric="3"/>
<column name="STANDARD" valueNumeric="1"/>
<column name="ADDR" value="http://www.brod-bergen.no/"/>
</insert>
<rollback>
<delete tableName="COMM">
<where>COMMID = ?</where>
<whereParams>
<param value="cdd02d37-845d-40be-9b8c-08f99afa985f"/>
</whereParams>
</delete>
</rollback>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -9,8 +9,9 @@
<include file="struct/create_address.xml"/>
<include file="struct/create_comm.xml"/>
<include file="misc/1535533490181_persChanges.xml"/>
<include file="struct/1535612802325_addressChange.xml"/>
<include file="data/example_org/ORG_privat.xml"/>
<include file="data/example_org/ORG_gfk.xml"/>
<include file="data/example_pers/PERS_pfiffig.xml"/>
<include file="data/example_pers/PERS_sommer.xml"/>
<include file="data/example_pers/PERS_sommer.xml"/>
</databaseChangeLog>
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog" xmlns:ext="http://www.liquibase.org/xml/ns/dbchangelog-ext" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<changeSet author="j.goderbauer" id="f3d4fe9a-1dff-48c7-8c30-e06c1273bdda">
<addColumn tableName="ADDRESS">
<column name="ADDR_TYPE_e007e4c0" type="SMALLINT"/>
</addColumn>
<dropColumn tableName="ADDRESS">
<column name="ADDR_TYPE" />
</dropColumn>
<renameColumn tableName="ADDRESS" oldColumnName="ADDR_TYPE_e007e4c0" newColumnName="ADDR_TYPE" columnDataType="SMALLINT"/>
<rollback>
<addColumn tableName="ADDRESS">
<column name="ADDR_TYPE_e007e4c0" type="INTEGER"/>
</addColumn>
<dropColumn tableName="ADDRESS">
<column name="ADDR_TYPE" />
</dropColumn>
<renameColumn tableName="ADDRESS" oldColumnName="ADDR_TYPE_e007e4c0" newColumnName="ADDR_TYPE" columnDataType="INTEGER"/>
</rollback>
</changeSet>
</databaseChangeLog>
\ No newline at end of file
......@@ -2,21 +2,17 @@ import("system.logging");
import("system.translate");
function KeywordUtils(){
this.getViewValue = function(keywordType, key){
var keyword = this.getStandardArray(keywordType);
for(var i = 0; i < keyword.length; i++)
if(keyword[i][0] == key)
return keyword[i][1];
return "";
}
this.getStandardArray = function(keywordType){
return this.createKeyword(keywordType).toArray();
}
this.getViewValue = function(keywordType, key){
var k = this.createKeyword(keywordType);
return k.getPropForKey(key, "name") || "";
}
this.createKeyword = function(keywordType){
var valueContainer, _toArrayFn;
var valueContainer, _toArrayFn, _getPropForKeyFn, _getPropsForKeyFn;
switch (keywordType){
case "RELATION.STATUS":
......@@ -97,24 +93,43 @@ function KeywordUtils(){
break;
}
_getPropForKeyFn = function(key, field) {
var keyObject = valueContainer[key];
if (keyObject == undefined)
return undefined;
return keyObject[field];
}
_getPropsForKeyFn = function(key, fields) {
var keyObject, i, l, currentRow, currentField;
keyObject = valueContainer[key];
if (keyObject == undefined)
return [];//TODO: throw error instead?
l = fields.length;
currentRow = [];
for (i = 0; i < l; i++){
currentField = fields[i];
//check if the passed fieldnames match the existing fieldnames (<=> properties in the object)
//to prevent errors and unexpected behaviour
if (keyObject[currentField])
currentRow.push(keyObject[currentField]);
else
currentRow.push("");
}
return currentRow;
}
_toArrayFn = function(fields){
var res, id, i, l, currentRow, currentField;
var res, id, currentRow;
res = [];
if (!fields)
fields = ["id", "name"];
l = fields.length;
for (id in valueContainer){
currentRow = [];
for (i = 0; i < l; i++){
currentField = fields[i];
//check if the passed fieldnames match the existing fieldnames (<=> properties in the object)
//to prevent errors and unexpected behaviour
if (valueContainer[id][currentField])
currentRow.push(valueContainer[id][currentField]);
else
currentRow.push("");
}
currentRow = _getPropsForKeyFn(id, fields);
res.push(currentRow);
}
return res;
......@@ -124,7 +139,9 @@ function KeywordUtils(){
/*
*test
**/
"toArray": _toArrayFn
"toArray": _toArrayFn
,"getPropForKey": _getPropForKeyFn
,"getPropsForKey": _getPropsForKeyFn
}
}
......
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