Skip to content
Snippets Groups Projects
Commit 09954603 authored by S.Listl's avatar S.Listl
Browse files

Merge origin/master

parents 4f2025b7 1bfe552a
No related branches found
No related tags found
No related merge requests found
Showing
with 145 additions and 37 deletions
......@@ -44,7 +44,7 @@
<name>SORTING</name>
<documentation>%aditoprj%/entity/KeywordEntry_entity/entityfields/sorting/documentation.adoc</documentation>
<title>Sorting</title>
<mandatory v="true" />
<mandatory v="false" />
<state>AUTO</state>
</entityField>
<entityField>
......
......@@ -2,5 +2,6 @@ Used for sorting keyword-entries within a keyword-container.
[NOTE]
====
Currently this cannot be set (it's *READONLY*) - the value is generated automatically. Reserved for future use.
Currently this field can be edited - the value is generated automatically on save if the value has not been set by the user.
For future implementations this behavior may change (sorting may be done by drag and drop or similar)
====
......@@ -211,8 +211,8 @@
<entityProvider>
<name>AnyObject</name>
<fieldType>DEPENDENCY_IN</fieldType>
<targetContextField>AnyTargetType</targetContextField>
<targetIdField>AnyTargetRowid</targetIdField>
<targetContextField>AnyObjectType</targetContextField>
<targetIdField>AnyObjectRowid</targetIdField>
<documentation>%aditoprj%/entity/ObjectRelation_entity/entityfields/anyobject/documentation.adoc</documentation>
<recordContainer>db</recordContainer>
<dependencies>
......@@ -311,15 +311,17 @@
</children>
</entityConsumer>
<entityField>
<name>AnyTargetRowid</name>
<valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/anytargetrowid/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/anytargetrowid/displayValueProcess.js</displayValueProcess>
<name>AnyObjectRowid</name>
<documentation>%aditoprj%/entity/ObjectRelation_entity/entityfields/anyobjectrowid/documentation.adoc</documentation>
<valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/anyobjectrowid/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/anyobjectrowid/displayValueProcess.js</displayValueProcess>
</entityField>
<entityField>
<name>AnyTargetType</name>
<name>AnyObjectType</name>
<documentation>%aditoprj%/entity/ObjectRelation_entity/entityfields/anyobjecttype/documentation.adoc</documentation>
<groupable v="true" />
<valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/anytargettype/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/anytargettype/displayValueProcess.js</displayValueProcess>
<valueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/anyobjecttype/valueProcess.js</valueProcess>
<displayValueProcess>%aditoprj%/entity/ObjectRelation_entity/entityfields/anyobjecttype/displayValueProcess.js</displayValueProcess>
</entityField>
</entityFields>
<recordContainers>
......
......@@ -3,7 +3,7 @@ import("system.result");
import("system.vars");
import("Context_lib");
if (vars.exists("$field.AnyTargetType") && vars.get("$field.AnyTargetType") && vars.exists("$field.AnyTargetRowid") && vars.get("$field.AnyTargetRowid"))
if (vars.exists("$field.AnyObjectType") && vars.get("$field.AnyObjectType") && vars.exists("$field.AnyObjectRowid") && vars.get("$field.AnyObjectRowid"))
{
result.string(db.cell(ContextUtils.getNameSql(vars.get("$field.AnyTargetType"), vars.get("$field.AnyTargetRowid"))));
result.string(db.cell(ContextUtils.getNameSql(vars.get("$field.AnyObjectType"), vars.get("$field.AnyObjectRowid"))));
}
This field is only filled when using the AnyObject Provider.
Calculates the opposite side of the given AnyObject parameters.
......@@ -2,7 +2,7 @@ import("system.project");
import("system.result");
import("system.vars");
if (vars.exists("$field.AnyTargetType") && vars.get("$field.AnyTargetType"))
if (vars.exists("$field.AnyObjectType") && vars.get("$field.AnyObjectType"))
{
result.string(project.getDataModel(project.DATAMODEL_KIND_CONTEXT, vars.get("$field.AnyTargetType"))[1]);
result.string(project.getDataModel(project.DATAMODEL_KIND_CONTEXT, vars.get("$field.AnyObjectType"))[1]);
}
\ No newline at end of file
This field is only filled when using the AnyObject Provider.
Calculates the opposite side of the given AnyObject parameters.
\ No newline at end of file
import("system.db");
import("system.result");
import("system.vars");
import("Sql_lib");
if(vars.exists("$param.ProductId_param") && vars.get("$param.ProductId_param") != "")
result.string("PRODUCTPRICE.PRODUCT_ID = ('" + vars.get("$param.ProductId_param") + "')");
else if(vars.exists("$param.ContactId_param") && vars.get("$param.ContactId_param") != "")
result.string("PRODUCTPRICE.CONTACT_ID = ('" + vars.get("$param.ContactId_param") + "')");
else
result.string("1 = 2");
\ No newline at end of file
var cond = SqlCondition.begin()
.andPrepareVars("PRODUCTPRICE.PRODUCT_ID", "$param.ProductId_param")
.andPrepareVars("PRODUCTPRICE.CONTACT_ID", "$param.ContactId_param");
//TODO: use a preparedCondition when available #1030812 #1034026
result.string(db.translateCondition(cond.build("1 = 2")));
\ No newline at end of file
......@@ -38,8 +38,8 @@
<treetableViewTemplate>
<name>AnyObjectRelations</name>
<favoriteActionGroup2></favoriteActionGroup2>
<titleField>AnyTargetType</titleField>
<descriptionField>AnyTargetRowid</descriptionField>
<titleField>AnyObjectType</titleField>
<descriptionField>AnyObjectRowid</descriptionField>
<entityField>#ENTITY</entityField>
</treetableViewTemplate>
</children>
......
......@@ -10,8 +10,8 @@
<children>
<treetableViewTemplate>
<name>AnyObjectRelations</name>
<parentField>AnyTargetType</parentField>
<titleField>AnyTargetRowid</titleField>
<parentField>AnyObjectType</parentField>
<titleField>AnyObjectRowid</titleField>
<entityField>#ENTITY</entityField>
<title></title>
</treetableViewTemplate>
......
......@@ -13,6 +13,10 @@
<editMode v="true" />
<entityField>#ENTITY</entityField>
<fields>
<entityFieldLink>
<name>7d74c495-1af7-4e00-8a78-5787e544e101</name>
<entityField>BINDATA_UPLOAD</entityField>
</entityFieldLink>
<entityFieldLink>
<name>91d96ac4-d838-4f92-90e7-954166b57288</name>
<entityField>NAME</entityField>
......@@ -25,10 +29,6 @@
<name>d3265f22-18dd-468b-8316-6a11fab662c3</name>
<entityField>IS_MAIN_DOCUMENT</entityField>
</entityFieldLink>
<entityFieldLink>
<name>7d74c495-1af7-4e00-8a78-5787e544e101</name>
<entityField>BINDATA_UPLOAD</entityField>
</entityFieldLink>
</fields>
</genericViewTemplate>
</children>
......
......@@ -4,8 +4,19 @@ import("system.vars");
////when available: this should be outsourced within the Address_entity
//till then: keep entity specific Code here
/**
* Methods used by the AddressEntity.
* Do not create an instance of this!
*
* @class
*/
function AddressEntityValidation(){}
/**
* check if the field, this function is called in is a mandatory field of the country
*
* @return {Boolean}
*/
AddressEntityValidation.isMandatoryField = function()
{
var fieldName = vars.get("$this.name").replace(/^\$?field\./, "");
......@@ -17,6 +28,11 @@ AddressEntityValidation.isMandatoryField = function()
return isMandatory;
};
/**
* return the shorthand for an field name
*
* @return {String} ADDRESS: A, CITY: C, STATE: S, ZIP: Z
*/
AddressEntityValidation.mapFieldToShorthand = function(fieldName)
{
var fieldCode;
......
......@@ -117,6 +117,8 @@ AttributeUtil.setAttribute = function ()
* easier. You probaly won't need this for anything else.
*
* @param {String} pAttrId the id of the attribute
*
* @class
*/
function AttributeHandler (pAttrId) //TODO: find out if this class is necessary, maybe there is a more elegant solution, this could also be static
{
......@@ -124,6 +126,9 @@ function AttributeHandler (pAttrId) //TODO: find out if this class is necessar
this._attributeType = null;
}
/**
* Returns a new AttributeHandler for the given Attribute
*/
AttributeHandler.begin = function (pAttrId)
{
return new AttributeHandler(pAttrId);
......@@ -168,6 +173,13 @@ AttributeHandler.prototype.getAttributeContentType = function ()
return $AttributeTypes.getContentType(this.getAttributeType());
}
/**
* Sets the value to the AttributeField and also return s the value again.
*
* @param pValue the value
*
* @return {Any} the value
*/
AttributeHandler.prototype.setAttributeValue = function (pValue)
{
var field = "$field." + this.getAttributeField();
......
......@@ -236,7 +236,7 @@ ItemUtils.prototype.roundPrice = function(price) {
* @param {String} productId req UID of root product (selected product)
* @param {String} assignedTo opt UID of parent item
* @param {String} currency opt currency for price list to use
* @param {String} relationId opt contactid for price list to use (custom price list)
* @param {String} contactId opt contactid for price list to use (custom price list)
* @param {String[][]} additionalProductInfo additional product info, which has to be copied from the product. (e.g. INFO field is only used by offer)
* has to be in the form: [["DESTINATION-DB-FIELD", "PRODUCT-DB-FIELD"], ...]
*
......@@ -244,7 +244,7 @@ ItemUtils.prototype.roundPrice = function(price) {
*
* @abstract
*/
ItemUtils.prototype.insertPartsList = function(columns, productId, assignedTo, currency, relationId, additionalProductInfo) {
ItemUtils.prototype.insertPartsList = function(columns, productId, assignedTo, currency, contactId, additionalProductInfo) {
if (additionalProductInfo == undefined) { additionalProductInfo = [] }
var insertedItemIds = [];
......@@ -256,8 +256,8 @@ ItemUtils.prototype.insertPartsList = function(columns, productId, assignedTo, c
assignedTo = "";
if (currency == undefined)
currency = "";
if (relationId == undefined)
relationId = "";
if (contactId == undefined)
contactId = "";
var rootProdId = productId;
if (rootProdId != "") {
......@@ -269,7 +269,7 @@ ItemUtils.prototype.insertPartsList = function(columns, productId, assignedTo, c
columns = columns.concat(additionalProductInfo.map(function(item) {return item[0]}));
var colTypes = db.getColumnTypes(table, columns);
// partsList[rootProdId] = root node
__itemInsertStatement(partsList[rootProdId], assignedTo, currency, relationId);
__itemInsertStatement(partsList[rootProdId], assignedTo, currency, contactId);
if (statements.length > 0)
db.inserts(statements);
......@@ -278,7 +278,7 @@ ItemUtils.prototype.insertPartsList = function(columns, productId, assignedTo, c
return insertedItemIds;
//recursive function for building item insert statements
function __itemInsertStatement(partsListObj, assignedTo, currency, relationId) {
function __itemInsertStatement(partsListObj, assignedTo, currency, contactId) {
for (var i = 0; i < partsListObj.ids.length; i++) {
var newid = util.getNewUUID();
self._appendNode(newid, assignedTo);
......@@ -290,7 +290,7 @@ ItemUtils.prototype.insertPartsList = function(columns, productId, assignedTo, c
var prodid = partsList[p2pid].sourceid;
var ProductDetails = ProductUtils.getProductDetails(
prodid,
{ currency: currency, quantity: P2pObject.quantity, relationId: relationId },
{ currency: currency, quantity: P2pObject.quantity, relationId: contactId },
additionalProductInfo.map(function(item) {return item[1]}));
var price = "";
......
......@@ -315,27 +315,45 @@ function OfferItemUtils(pOfferId) {
OfferItemUtils.prototype.constructor = OfferItemUtils;
}
/**
* For documentation, see class ItemUtils.
*/
OfferItemUtils.prototype.getNetAndVat = function(offeritemIdsToDel) {
return ItemUtils.prototype.getNetAndVat.apply(this, [offeritemIdsToDel]);
}
/**
* For documentation, see class ItemUtils.
*/
OfferItemUtils.prototype.initItemTree = function() {
ItemUtils.prototype.initItemTree.apply(this);
}
/**
* For documentation, see class ItemUtils.
*/
OfferItemUtils.prototype.getItemSum = function(pQuantity, pPrice, pDiscount, pOptional) {
return ItemUtils.prototype.getItemSum.apply(this, [pQuantity, pPrice, pDiscount, pOptional]);
}
/**
* For documentation, see class ItemUtils.
*/
OfferItemUtils.prototype.getItemVAT = function(pQuantity, pPrice, pDiscount, pVAT, pOptional) {
return ItemUtils.prototype.getItemVAT.apply(this, [pQuantity, pPrice, pDiscount, pVAT, pOptional]);
}
/**
* For documentation, see class ItemUtils.
*/
OfferItemUtils.prototype.roundPrice = function(pPrice) {
return ItemUtils.prototype.roundPrice.apply(this, [pPrice]);
}
OfferItemUtils.prototype.insertPartsList = function(pProductId, pAssignedTo, pCurrency, pRelationId) {
/**
* For documentation, see class ItemUtils.
*/
OfferItemUtils.prototype.insertPartsList = function(pProductId, pAssignedTo, pCurrency, pContactId) {
this.initItemTree();
var cols = ["OFFERITEMID"
......@@ -352,27 +370,39 @@ OfferItemUtils.prototype.insertPartsList = function(pProductId, pAssignedTo, pCu
, "ITEMPOSITION"
, "ITEMSORT"];
return ItemUtils.prototype.insertPartsList.apply(this, [cols, pProductId, pAssignedTo, pCurrency, pRelationId, [["INFO", "INFO"]]]);
return ItemUtils.prototype.insertPartsList.apply(this, [cols, pProductId, pAssignedTo, pCurrency, pContactId, [["INFO", "INFO"]]]);
}
/**
* For documentation, see class ItemUtils.
*/
OfferItemUtils.prototype.deletePartsList = function(pItemId) {
this.initItemTree();
return ItemUtils.prototype.deletePartsList.apply(this, [pItemId]);
}
/**
* For documentation, see class ItemUtils.
*/
OfferItemUtils.prototype.getNextItemSort = function(pIds) {
this.initItemTree();
return ItemUtils.prototype.getNextItemSort.apply(this, [pIds]);
}
/**
* For documentation, see class ItemUtils.
*/
OfferItemUtils.prototype.getNextItemPosition = function(pAssignedTo, pTree, pIds) {
this.initItemTree();
return ItemUtils.prototype.getNextItemPosition.apply(this, [pAssignedTo, pTree, pIds]);
}
/**
* For documentation, see class ItemUtils.
*/
OfferItemUtils.prototype.reOrgItems = function() {
this.initItemTree();
......
......@@ -170,27 +170,45 @@ function OrderItemUtils(pOrderId) {
OrderItemUtils.prototype.constructor = OrderItemUtils;
}
/**
* For documentation, see class ItemUtils.
*/
OrderItemUtils.prototype.getNetAndVat = function(orderitemIdsToDel) {
return ItemUtils.prototype.getNetAndVat.apply(this, [orderitemIdsToDel]);
}
/**
* For documentation, see class ItemUtils.
*/
OrderItemUtils.prototype.initItemTree = function() {
ItemUtils.prototype.initItemTree.apply(this);
}
/**
* For documentation, see class ItemUtils.
*/
OrderItemUtils.prototype.getItemSum = function(pQuantity, pPrice, pDiscount, pOptional) {
return ItemUtils.prototype.getItemSum.apply(this, [pQuantity, pPrice, pDiscount, pOptional]);
}
/**
* For documentation, see class ItemUtils.
*/
OrderItemUtils.prototype.getItemVAT = function(pQuantity, pPrice, pDiscount, pVAT, pOptional) {
return ItemUtils.prototype.getItemVAT.apply(this, [pQuantity, pPrice, pDiscount, pVAT, pOptional]);
}
/**
* For documentation, see class ItemUtils.
*/
OrderItemUtils.prototype.roundPrice = function(pPrice) {
return ItemUtils.prototype.roundPrice.apply(this, [pPrice]);
}
OrderItemUtils.prototype.insertPartsList = function(pProductId, pAssignedTo, pCurrency, pRelationId) {
/**
* For documentation, see class ItemUtils.
*/
OrderItemUtils.prototype.insertPartsList = function(pProductId, pAssignedTo, pCurrency, pContactId) {
this.initItemTree();
var cols = ["SALESORDERITEMID"
......@@ -207,27 +225,39 @@ OrderItemUtils.prototype.insertPartsList = function(pProductId, pAssignedTo, pCu
, "ITEMPOSITION"
, "ITEMSORT"];
return ItemUtils.prototype.insertPartsList.apply(this, [cols, pProductId, pAssignedTo, pCurrency, pRelationId]);
return ItemUtils.prototype.insertPartsList.apply(this, [cols, pProductId, pAssignedTo, pCurrency, pContactId]);
}
/**
* For documentation, see class ItemUtils.
*/
OrderItemUtils.prototype.deletePartsList = function(pItemId) {
this.initItemTree();
return ItemUtils.prototype.deletePartsList.apply(this, [pItemId]);
}
/**
* For documentation, see class ItemUtils.
*/
OrderItemUtils.prototype.getNextItemSort = function(pIds) {
this.initItemTree();
return ItemUtils.prototype.getNextItemSort.apply(this, [pIds]);
}
/**
* For documentation, see class ItemUtils.
*/
OrderItemUtils.prototype.getNextItemPosition = function(pAssignedTo, pTree, pIds) {
this.initItemTree();
return ItemUtils.prototype.getNextItemPosition.apply(this, [pAssignedTo, pTree, pIds]);
}
/**
* For documentation, see class ItemUtils.
*/
OrderItemUtils.prototype.reOrgItems = function() {
this.initItemTree();
......
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