Skip to content
Snippets Groups Projects
Commit 768daa15 authored by Mohamed Mansour's avatar Mohamed Mansour
Browse files

merged origin/master into Receipt

parents 84da275e 49f60b1c
No related branches found
No related tags found
No related merge requests found
Showing
with 130 additions and 90 deletions
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<include relativeToChangelogFile="true" file="update_attribute_Ticket_Support_Product.xml"/>
</databaseChangeLog>
<?xml version="1.1" encoding="UTF-8" standalone="no"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd">
<changeSet id="8fc5d294-43b5-4b1c-af5f-cded38dee6f0" author="a.loreth">
<update tableName="AB_ATTRIBUTE">
<column name="DROPDOWNDEFINITION" value="Product_entity" />
<where>AB_ATTRIBUTEID = ?</where>
<whereParams>
<param value="af312508-8a9b-4b8f-88f3-6b98005c749e" />
</whereParams>
</update>
<rollback>
<update tableName="AB_ATTRIBUTE">
<column name="DROPDOWNDEFINITION" value="Product" />
<where>AB_ATTRIBUTEID = ?</where>
<whereParams>
<param value="af312508-8a9b-4b8f-88f3-6b98005c749e" />
</whereParams>
</update>
</rollback>
</changeSet>
</databaseChangeLog>
......@@ -2,6 +2,7 @@
<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">
<include relativeToChangelogFile="true" file="basic/init/init.xml"/>
<include relativeToChangelogFile="true" file="basic/2019.1.4/changelog.xml"/>
<include relativeToChangelogFile="true" file="basic/2019.2.1/changelog.xml"/>
<include relativeToChangelogFile="true" file="basic/_demoData/changelog.xml" context="example"/>
</databaseChangeLog>
\ No newline at end of file
......@@ -165,6 +165,7 @@
<name>Group</name>
<kind v="123" />
<title>Service</title>
<icon>VAADIN:CHAT</icon>
<childNodes>
<entityNode>
<name>Group6</name>
......
......@@ -41,6 +41,7 @@
<title>Description</title>
<contentType>HTML</contentType>
<mandatory v="false" />
<valueProcess>%aditoprj%/entity/Activity_entity/entityfields/info/valueProcess.js</valueProcess>
</entityField>
<entityField>
<name>CATEGORY</name>
......@@ -56,6 +57,7 @@
<title>Subject</title>
<groupable v="false" />
<mandatory v="true" />
<valueProcess>%aditoprj%/entity/Activity_entity/entityfields/subject/valueProcess.js</valueProcess>
</entityField>
<entityParameter>
<name>RowId_param</name>
......@@ -472,6 +474,14 @@
<name>Direction_param</name>
<expose v="true" />
</entityParameter>
<entityParameter>
<name>Info_param</name>
<expose v="true" />
</entityParameter>
<entityParameter>
<name>Subject_param</name>
<expose v="true" />
</entityParameter>
</entityFields>
<recordContainers>
<dbRecordContainer>
......
import("system.neon");
import("system.vars");
import("system.result");
if (vars.get("$this.value") == null && vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.Info_param"))
result.string(vars.get("$param.Info_param"));
\ No newline at end of file
import("system.neon");
import("system.vars");
import("system.result");
if (vars.get("$this.value") == null && vars.get("$sys.recordstate") == neon.OPERATINGSTATE_NEW && vars.exists("$param.Subject_param"))
result.string(vars.get("$param.Subject_param"));
\ No newline at end of file
......@@ -5,24 +5,17 @@ import("system.vars");
import("DocumentTemplate_lib");
var upload = vars.get("$field.BINDATA");
var contentType, type, filename, template;
var type;
if (upload)
{
filename = DocumentUtil.getFilenameFromUpload(upload);
type = DocumentUtil.getFileExtensionFromUpload(filename);
contentType = ({
"txt" : "LONG_TEXT",
"html" : "HTML",
"htm" : "HTML",
"eml" : "HTML"
})[type] || "LONG_TEXT";
type = DocumentUtil.getMimeTypeFromUpload(upload);
type = DocumentTemplate.types.fromMimeType(type);
}
else
{
template = BulkMailUtils.getBulkMailTemplate(vars.get("$field.BULKMAILID"), vars.get("$field.DOCUMENTTEMPLATE_ID"));
let template = BulkMailUtils.getBulkMailTemplate(vars.get("$field.BULKMAILID"), vars.get("$field.DOCUMENTTEMPLATE_ID"));
type = template.type;
contentType = type == DocumentTemplate.types.HTML || type == DocumentTemplate.types.EML
? "HTML"
: "LONG_TEXT";
}
result.string(contentType);
\ No newline at end of file
result.string(type == DocumentTemplate.types.HTML || type == DocumentTemplate.types.EML
? "HTML"
: "LONG_TEXT");
\ No newline at end of file
......@@ -14,9 +14,8 @@ if (vars.get("$this.value") == null && vars.get("$sys.viewmode") == neon.FRAME_V
if (upload)
{
var binData = DocumentUtil.getBindataFromUpload(upload);
var filename = DocumentUtil.getFilenameFromUpload(upload);
var type = DocumentUtil.getFileExtensionFromUpload(filename);
template = new DocumentTemplate(binData, DocumentTemplate.types.fromFileExtension(type));
var type = DocumentUtil.getMimeTypeFromUpload(upload);
template = new DocumentTemplate(binData, DocumentTemplate.types.fromMimeType(type));
}
else
{
......
......@@ -12,9 +12,8 @@ if (vars.get("$this.value") == null && vars.get("$sys.recordstate") == neon.OPER
if (upload)
{
var binData = DocumentUtil.getBindataFromUpload(upload);
var filename = DocumentUtil.getFilenameFromUpload(upload);
var type = DocumentUtil.getFileExtensionFromUpload(filename);
if (DocumentTemplate.types.fromFileExtension(type) == DocumentTemplate.types.EML)
var type = DocumentUtil.getMimeTypeFromUpload(upload);
if (DocumentTemplate.types.fromMimeType(type) == DocumentTemplate.types.EML)
result.string(Email.fromRFC(binData).subject);
}
}
\ No newline at end of file
......@@ -34,6 +34,17 @@
<name>ContactId_param</name>
<expose v="true" />
</entityParameter>
<entityField>
<name>bindata</name>
<contentType>FILE</contentType>
</entityField>
<entityActionField>
<name>downloadTemplate</name>
<title>Download template</title>
<onActionProcess>%aditoprj%/entity/Letter_entity/entityfields/downloadtemplate/onActionProcess.js</onActionProcess>
<iconId>VAADIN:DOWNLOAD_ALT</iconId>
<stateProcess>%aditoprj%/entity/Letter_entity/entityfields/downloadtemplate/stateProcess.js</stateProcess>
</entityActionField>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
......
import("system.neon");
import("DocumentTemplate_lib");
import("system.vars");
var templateId = vars.get("$field.DOCUMENT_TEMPLATE");
var template = DocumentTemplate.loadTemplate(templateId);
if (template.content)
neon.download(template.content, template.filename);
\ No newline at end of file
import("system.neon");
import("system.vars");
import("system.result");
if (vars.get("$field.DOCUMENT_TEMPLATE"))
result.string(neon.COMPONENTSTATE_EDITABLE);
else
result.string(neon.COMPONENTSTATE_DISABLED);
\ No newline at end of file
import("system.translate");
import("Contact_lib");
import("ActivityTask_lib");
import("system.neon");
import("system.vars");
import("system.text");
import("DocumentTemplate_lib");
import("KeywordRegistry_basic");
......@@ -18,4 +20,4 @@ if (contactId)
links.push([context, contactId]);
}
ActivityUtils.createNewActivity(null, links, null, null, [[template.filename, content, false]], $KeywordRegistry.activityDirection$outgoing());
ActivityUtils.createNewActivity(null, links, null, null, translate.text("Letter"), text.parseDocument(content), $KeywordRegistry.activityDirection$outgoing(), [[template.filename, content, false]]);
......@@ -3,6 +3,7 @@
<name>PermissionAction_entity</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<title>Action</title>
<onValidation>%aditoprj%/entity/PermissionAction_entity/onValidation.js</onValidation>
<titlePlural>Actions</titlePlural>
<recordContainer>jDito</recordContainer>
<entityFields>
......@@ -47,6 +48,10 @@
<name>AccessType_param</name>
<expose v="true" />
</entityParameter>
<entityParameter>
<name>PermissionCondition_param</name>
<expose v="true" />
</entityParameter>
</entityFields>
<recordContainers>
<jDitoRecordContainer>
......
......@@ -25,71 +25,4 @@ switch (accesstype) {
]
}
result.object(actions);
//#############################################################################
//################only show actions which are not yet in the DB################
//##########################not done yet#######################################
//#############################################################################
//import("system.logging");
//import("Permission_lib");
//import("system.vars");
//import("system.result");
//
//var permisson = vars.get("$param.PermissionId_param");
//var actionIdsInDb = PermissionUtil.getPermissionAction(permisson);
//var actionsInDb = [];
//for each (var actionId in actionIdsInDb) {
// actionsInDb.push(PermissionUtil.resolvePermissionActionId(actionId));
//}
//
//var entityActions = ["view", "create"];
//var recordActions = ["read", "update", "delete"];
//var fieldActions = ["read", "update"];
//var diff;
//
//var accesstype = vars.get("$param.AccessType_param");
//var actions = [];
//
//switch (accesstype) {
// case "E":
// diff = arrDiff(actionsInDb, entityActions);
// break;
// case "R":
// diff = arrDiff(actionsInDb, recordActions);
// break;
// case "F":
// diff = arrDiff(actionsInDb, fieldActions);
// break;
//}
//
//for each (let entry in diff) {
// actions.push([entry, entry]);
//}
//
//result.object(actions);
//
//// arrDiff calculates different elements of two arrays and returns them as array, otherwise empty array
//function arrDiff (arr1, arr2) {
// var helperArr = [], diff = [];
//
// for (let i = 0; i < arr1.length; i++) {
// helperArr[arr1[i]] = true;
// }
//
// for (let i = 0; i < arr2.length; i++) {
// if (helperArr[arr2[i]]) {
// delete helperArr[arr2[i]];
// }
// else {
// helperArr[arr2[i]] = true;
// }
// }
//
// for (var k in helperArr) {
// diff.push(k);
// }
//
// return diff;
//}
\ No newline at end of file
result.object(actions);
\ No newline at end of file
import("system.db");
import("system.vars");
import("system.translate");
import("system.result");
import("Permission_lib");
var alias = "_____SYSTEMALIAS";
var actionTitle = vars.get("$field.ACTION");
var permissionId = vars.get("$param.PermissionId_param");
var permCondInput = vars.get("$param.PermissionCondition_param");
if (PermissionUtil.existsPermission(permissionId)) {
// existing permission
// check if action is already in DB
var actionsInDb = PermissionUtil.getPermissionAction(permissionId);
var sqlStr = "select COND from ASYS_PERMISSION where ASYS_PERMISSIONID='" + permissionId + "'";
var permCondDb = db.cell(sqlStr, alias);
for each (var action in actionsInDb) {
if (PermissionUtil.resolvePermissionActionId(action) == actionTitle && permCondInput == permCondDb) {
result.string(translate.text("Action '" + actionTitle + "' already linked to this permission!"));
break;
}
}
}
\ No newline at end of file
import("system.logging");
import("system.db");
import("system.tools");
import("system.result");
......
......@@ -188,6 +188,10 @@
<name>AccessType_param</name>
<valueProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/permissionactions/children/accesstype_param/valueProcess.js</valueProcess>
</entityParameter>
<entityParameter>
<name>PermissionCondition_param</name>
<valueProcess>%aditoprj%/entity/PermissionDetail_entity/entityfields/permissionactions/children/permissioncondition_param/valueProcess.js</valueProcess>
</entityParameter>
</children>
</entityConsumer>
</entityFields>
......
import("system.vars");
import("system.result");
result.string(vars.get("$field.CONDITION"));
\ 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