diff --git a/aliasDefinition/Data_alias/Data_alias.aod b/aliasDefinition/Data_alias/Data_alias.aod index 61811a2b9a36b4cb621761f4b9e2e284abf0ecfa..cbd4aa22e767320485f87021ad65cfb3ccbcbeaf 100644 --- a/aliasDefinition/Data_alias/Data_alias.aod +++ b/aliasDefinition/Data_alias/Data_alias.aod @@ -2641,6 +2641,11 @@ <global v="false" /> <property v="true" /> </customBooleanProperty> + <customJDitoProperty> + <name>translate4Log</name> + <global v="false" /> + <property>%aditoprj%/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/offer/entityfields/language/customproperties/translate4log/property.js</property> + </customJDitoProperty> </customProperties> </entityFieldDb> <entityFieldDb> @@ -2784,6 +2789,11 @@ <global v="false" /> <property v="true" /> </customBooleanProperty> + <customStringProperty> + <name>keyword</name> + <global v="false" /> + <property>OfferStatus</property> + </customStringProperty> </customProperties> </entityFieldDb> <entityFieldDb> diff --git a/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/offer/entityfields/contact_id/customproperties/translate4log/property.js b/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/offer/entityfields/contact_id/customproperties/translate4log/property.js index 704213fe8608ca78adce6f3503c5fa7b54d333a3..f35d37ab09f059046b3b6f3d672cf01c66fe58c4 100644 --- a/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/offer/entityfields/contact_id/customproperties/translate4log/property.js +++ b/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/offer/entityfields/contact_id/customproperties/translate4log/property.js @@ -1,6 +1,7 @@ +import("Contact_lib"); import("system.result"); -import("Address_lib"); import("Loghistory_lib"); var params = Translate4LogParams.load(); -result.string(new AddrObject(params.value).getFormattedAddress()); \ No newline at end of file +var res = ContactUtils.getFullTitleByContactId(params.value); +result.string(res); \ No newline at end of file diff --git a/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/offer/entityfields/language/customproperties/translate4log/property.js b/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/offer/entityfields/language/customproperties/translate4log/property.js new file mode 100644 index 0000000000000000000000000000000000000000..51a8cec57a7a635681f7c183f2fe3c369db8f692 --- /dev/null +++ b/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/offer/entityfields/language/customproperties/translate4log/property.js @@ -0,0 +1,7 @@ +import("system.result"); +import("Loghistory_lib"); +import("Keyword_lib"); + +var params = Translate4LogParams.load(); +var res = LanguageKeywordUtils.getViewValue(params.value, params.locale); +result.string(res); \ No newline at end of file diff --git a/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/offer/entityfields/salesproject_id/customproperties/translate4log/property.js b/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/offer/entityfields/salesproject_id/customproperties/translate4log/property.js index a179e03370a86e75e03cfd91309c06945183ec6a..e6c0e291bce1ba0d265e5577c4d8ad43ebdd6751 100644 --- a/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/offer/entityfields/salesproject_id/customproperties/translate4log/property.js +++ b/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/offer/entityfields/salesproject_id/customproperties/translate4log/property.js @@ -7,5 +7,5 @@ var params = Translate4LogParams.load(); var res = db.cell(SqlCondition.begin() .andPrepare("SALESPROJECT.SALESPROJECTID", params.value) - .buildSql("select " + concat(["PROJECTTITLE", "'/'", "cast( PROJECTNUMBER as char(5))"]) + " from SALESPROJECT")); + .buildSql("select PROJECTTITLE from SALESPROJECT")); result.string(res); \ No newline at end of file diff --git a/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/salesproject/entityfields/contact_id/customproperties/translate4log/property.js b/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/salesproject/entityfields/contact_id/customproperties/translate4log/property.js index 9e1763cfe831632e96e05e9f7427d468753aab7b..eeae5a1612d8c015ecbacf2b6c6c6d699e131fc5 100644 --- a/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/salesproject/entityfields/contact_id/customproperties/translate4log/property.js +++ b/aliasDefinition/Data_alias/aliasdefinitionsub/entitygroup/entities/salesproject/entityfields/contact_id/customproperties/translate4log/property.js @@ -1,4 +1,9 @@ -import("system.result"); +import("Contact_lib"); import("system.db"); +import("system.result"); +import("Loghistory_lib"); +import("Sql_lib"); -result.string(db.cell("select ORGNAME from RELATION left join ORG on ORG_ID = ORGID where RELATIONID = '{value}'")); \ No newline at end of file +var params = Translate4LogParams.load(); +var res = OrganisationUtils.getNameByContactId(params.value); +result.string(res); diff --git a/entity/Offer_entity/Offer_entity.aod b/entity/Offer_entity/Offer_entity.aod index 755f0ba735b73c0b96ba7f756d843f15ec9ea3d1..9178937f1f172b90d645e219dadc47dfad13c5dd 100644 --- a/entity/Offer_entity/Offer_entity.aod +++ b/entity/Offer_entity/Offer_entity.aod @@ -1,9 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <entity xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.3.2" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/entity/1.3.2"> <name>Offer_entity</name> - <title>Offer</title> <majorModelMode>DISTRIBUTED</majorModelMode> <documentation>%aditoprj%/entity/Offer_entity/documentation.adoc</documentation> + <title>Offer</title> <afterUiInit>%aditoprj%/entity/Offer_entity/afterUiInit.js</afterUiInit> <iconId>VAADIN:CART</iconId> <titleProcess>%aditoprj%/entity/Offer_entity/titleProcess.js</titleProcess> @@ -386,7 +386,7 @@ <entityParameter> <name>ContainerName_param</name> <valueProcess>%aditoprj%/entity/Offer_entity/entityfields/keywordofferstates/children/containername_param/valueProcess.js</valueProcess> - <expose v="false" /> + <expose v="true" /> </entityParameter> </children> </entityConsumer> diff --git a/neonView/OfferMain_view/OfferMain_view.aod b/neonView/OfferMain_view/OfferMain_view.aod index 47f2a91194206929a0f2c663bb747f096a09e755..fbc90aac96fcf671f11fc34626716590116430b7 100644 --- a/neonView/OfferMain_view/OfferMain_view.aod +++ b/neonView/OfferMain_view/OfferMain_view.aod @@ -44,5 +44,10 @@ <entityField>Documents</entityField> <view>DocumentFilter_view</view> </neonViewReference> + <neonViewReference> + <name>d79a0304-4106-4749-b2e1-c5ba005b4448</name> + <entityField>LogHistoryConsumer</entityField> + <view>LogHistoryFilter_view</view> + </neonViewReference> </children> </neonView> diff --git a/process/Contact_lib/process.js b/process/Contact_lib/process.js index f533b09e7c845e0beb0501277af23ea1a42e228b..e8b2c9e47b364585c196e91b6b26e6da727af6cc 100644 --- a/process/Contact_lib/process.js +++ b/process/Contact_lib/process.js @@ -21,8 +21,22 @@ OrganisationUtils.getNameByOrganisationId = function(pOrganisationId) if (pOrganisationId) { orgname = db.cell(SqlCondition.begin() - .andPrepare("ORGANISATION.ORGANISATIONID", pOrganisationId) - .buildSql("select ORGANISATION.NAME from ORGANISATION")); + .andPrepare("ORGANISATION.ORGANISATIONID", pOrganisationId) + .buildSql("select ORGANISATION.NAME from ORGANISATION")); + } + return orgname; +}; + +OrganisationUtils.getNameByContactId = function(pContactId) +{ + var orgname = ""; + if (pContactId) + { + orgname = db.cell(SqlCondition.begin() + .andPrepare("CONTACT.CONTACT", pContactId) + .buildSql("select ORGANISATION.NAME \n\ + from ORGANISATION \n\ + join CONTACT on (CONTACT.ORGANISATION_ID = ORGANISATION.ORGANISATIONID and CONTACT.PERSON_ID is null)")); } return orgname; }; diff --git a/process/Loghistory_lib/process.js b/process/Loghistory_lib/process.js index 6e2c4507661c1eb79947b74a4a8b6f0ce5a3ec03..3b5c791ae3a04a0b22b09ab9d77445acfa8843fd 100644 --- a/process/Loghistory_lib/process.js +++ b/process/Loghistory_lib/process.js @@ -173,8 +173,10 @@ LogHistoryExecutor.prototype.execute = function () var logfield = columnStructure[this.columns[i]]; if (logfield && logfield.log) { - if (this.sqlAction != 'I' && this.oldValues[i] != "") this.oldValues[i] = this._getFormattedValue(logfield, this.oldValues[i], this.translationLanguage); - if (this.sqlAction != 'D' && this.newValues[i] != "") this.newValues[i] = this._getFormattedValue(logfield, this.newValues[i], this.translationLanguage); + if (this.sqlAction != 'I' && this.oldValues[i] != "") + this.oldValues[i] = this._getFormattedValue(this.columns[i], logfield, this.oldValues[i]); + if (this.sqlAction != 'D' && this.newValues[i] != "") + this.newValues[i] = this._getFormattedValue(this.columns[i], logfield, this.newValues[i]); var logfieldTitle = (logfield.title ? translate.text(logfield.title, this.translationLanguage) : translate.text("Value", this.translationLanguage)); if (this.sqlAction == 'U' && this.oldValues[i] != this.newValues[i]) @@ -314,11 +316,12 @@ LogHistoryExecutor.prototype._getCalendarDescription = function (pIndex) * - the field is a TIMESTAMP field the raw long-value will be formatted * * @param {Object} pDescription the structureConfig of one specific field which is logged +* @param {String} pColumnName name of the column whoes value shall be formatted * @param {String} pValue raw value that shall be formatted * * @return {String} if necessary the formattedValue otherwise the original value */ -LogHistoryExecutor.prototype._getFormattedValue = function (pDescription, pValue) +LogHistoryExecutor.prototype._getFormattedValue = function (pColumnName, pDescription, pValue) { if (pDescription.keyword != null && pDescription.keyword != "") { @@ -336,7 +339,9 @@ LogHistoryExecutor.prototype._getFormattedValue = function (pDescription, pValue else if (pDescription.translate4Log != null && pDescription.translate4Log != "") { var params = Translate4LogParams.generateParams(this.idValue, pValue.toString(), this.sqlAction, this.translationLanguage); - pValue = process.executeScript("LogHistoryExecutor._getFormattedValue ", pDescription.translate4Log, params, vars.get("$sys.dbalias")); + var scriptId = "LogHistoryExecutor._getFormattedValue." + + this.structureDefinitionAlias + "." + this.affectedTable + "." + pColumnName + ".translate4Log"; + pValue = process.executeScript(scriptId, pDescription.translate4Log, params, vars.get("$sys.dbalias")); } else if (pDescription.columnType == String(SQLTYPES.TIMESTAMP)) pValue = datetime.toDate(pValue, translate.text("dd.MM.yyyy", this.translationLanguage), "Europe/Berlin");//TODO: timezone?