Skip to content
Snippets Groups Projects
Commit 16153e86 authored by Johannes Hörmann's avatar Johannes Hörmann
Browse files

refactor documentation

parent ea682d6a
No related branches found
No related tags found
No related merge requests found
<?xml version="1.0" encoding="UTF-8"?>
<neonContext xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.0.0" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/neonContext/1.0.0">
<name>SalesprojectCycle_context</name>
<description>Milestones of a salesproject</description>
<majorModelMode>DISTRIBUTED</majorModelMode>
<filterview>SalesprojectCycleFilter_view</filterview>
<editview>SalesprojectCycleEdit_view</editview>
......
......@@ -3,6 +3,7 @@
<name>Salesproject_context</name>
<title>Salesproject</title>
<majorModelMode>DISTRIBUTED</majorModelMode>
<documentation>%aditoprj%/neonContext/Salesproject_context/documentation.adoc</documentation>
<mainview>SalesprojectMain_view</mainview>
<filterview>SalesprojectFilter_view</filterview>
<editview>SalesprojectEdit_view</editview>
......
Salesproject
============
== Overview ==
A salesproject consists of some modules:
- Salesproject itself
- Activity (former History)
- Milestones
- Competition
- Source
- Offer
- Member
- Classification
- Forecast
- Timetracking
== Information ==
Milestones are currently inserted on each change of Phase and State.
(with the processes db.onDBUpdate, db.onDBInsert)
\ No newline at end of file
......@@ -14,7 +14,7 @@ import("Report_lib");
import("Context_lib");
/**
* Methods used by Offer.
* Methods used by for activities (former history).
* Do not create an instance of this!
*
* @class
......
<?xml version="1.0" encoding="UTF-8"?>
<process xmlns="http://www.adito.de/2018/ao/Model" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" VERSION="1.1.7" xsi:schemaLocation="http://www.adito.de/2018/ao/Model adito://models/xsd/process/1.1.7">
<name>Address_lib</name>
<majorModelMode>DISTRIBUTED</majorModelMode>
<process>%aditoprj%/process/Address_lib/process.js</process>
</process>
import("system.logging");
import("Relation_lib");
import("Sql_lib");
import("system.db");
/**
* Methods for adresses.
* Todo: evtl. übernahme / anpassung der Adresslib aus altem Basic. 1030856
*
* Do not create an instance of this!
*
* @class
*/
function AddressUtils() {}
/**
* Returns the formatted standard address for the relation.
*
* TODO: Dummy method! Übernahme der Adresslib aus altem Basic
*
* @return {String}
*/
AddressUtils.getAddress = function(pRelationId) {
var address = db.array(db.ROW, SqlCondition.begin().andPrepare("RELATION.RELATIONID", pRelationId).buildSelect('select RELATIONID, ADDRESS, BUILDINGNO, ZIP, CITY, "NAME", FIRSTNAME, LASTNAME, TITLE from' + RelationUtils.getFullRelationFromString(), "1=0"));
// TODO: currently there are some relations without standard address. Use Hardcoded one.
if (!address[1]) {
var dummyAddress = db.array(db.ROW, SqlCondition.begin().andPrepare("ADDRESS.ADDRESSID", '97d37aea-d7f8-4436-bb31-875439f5f7f1').buildSelect('select ADDRESS, BUILDINGNO, ZIP, CITY from ADDRESS', "1=0"));
address[1] = dummyAddress[0];
address[2] = dummyAddress[1];
address[3] = dummyAddress[2];
address[4] = dummyAddress[3];
}
var type = RelationUtils.getRelationTypeByRelation(pRelationId);
var resultAddr = "";
// 1 if organisation <br>
// 2 if privat person <br>
// 3 if person of an organisation <br>*/
switch (type)
{
case 1:
resultAddr = address[5] + "\n" + address[1] + " " + address[2] + "\n" + address[3] + " " + address[4];
break;
case 2:
resultAddr = address[8] + " " + address[6] + " " + address[7] + "\n" + address[1] + " " + address[2] + "\n" + address[3] + " " + address[4];
break;
case 3:
resultAddr = address[5] + "\n" + address[6] + " " + address[7] + "\n" + address[1] + " " + address[2] + "\n" + address[3] + " " + address[4];
break;
}
return resultAddr;
}
/**
* Returns a letter salutation.
*
* TODO: Dummy method! Übernahme der Adresslib aus altem Basic
*
* @return {String}
*/
AddressUtils.getLetterSalutation = function() {
return "Sehr geehrte Damen und Herren";
}
\ No newline at end of file
......@@ -12,7 +12,7 @@ import("system.text");
function AppointmentUtils() {}
/**
* Sets the partstat of the current users as given param state
* Sets the participant stats of the current users as given param state
* @param {String} currentUserUri
* @param {String} attendees encoded as multistring
* @param {String} newState partstat
......@@ -54,7 +54,7 @@ AppointmentUtils.setPartStat = function (currentUserUri, attendees, newState) {
{
if (text.decodeMS(attendeesDecodedArray[x])[0] == currentUserUri)
{
newAttendees.push(text.encodeMS( updated))
newAttendees.push(text.encodeMS(updated))
}
else
{
......
......@@ -8,7 +8,7 @@ import("system.cti");
import("Sql_lib");
/**
* provides static methods for miscellaneous tasks
* provides static methods for Comm
* do not create an instance of this
*
* @class
......
......@@ -56,7 +56,7 @@ DateUtils.getDateIncrementedByYears = function(pDate, pYears) {
*
* @result {String} translated name
*/
DateUtils.getDateIncrementedByYears = function(pDate, pYears) {
DateUtils.getMonthName = function(pMonth) {
var monthNames = [
translate.text("January"),
translate.text("February"),
......@@ -73,5 +73,5 @@ DateUtils.getDateIncrementedByYears = function(pDate, pYears) {
];
return
return monthNames[pMonth];
}
\ No newline at end of file
import("system.logging");
import("system.result");
import("system.neon");
import("system.vars");
......@@ -25,14 +24,9 @@ function ProcessHandlingUtils() {}
ProcessHandlingUtils.getOnValidationValue = function(fieldValue) {
if (fieldValue == undefined) {
fieldValue = vars.get("$this.value");
logging.log("$this.value " + fieldValue)
}
if (vars.exists("$local.value")) {
logging.log("$local.value " + vars.get("$local.value"))
}
return (vars.exists("$local.value") && vars.get("$local.value") != null) ? vars.get("$local.value") : fieldValue;
return (vars.exists("$local.value") && vars.get("$local.value") != null) ? vars.get("$local.value") : fieldValue;
}
/**
......@@ -53,19 +47,57 @@ ProcessHandlingUtils.initialParamToResult = function(pParamVarName)
}
//TODO: comment
/**
* Workaround for detecting field changes of fields not managed by record containers.
* Should be fixed in the future: Ticket 1030023
*
* How to use:
* 1. put this into the onValueChange of the field
* FieldChanges.setChange("$field.MY_FIELD");
*
* 2. you may have to change onValueChangeTypes if it is called too often.
*
* 3. use this in the record container: onDBUpdate / onDBInsert / onDBDelete
* FieldChanges.assimilateChangeAndDispose("$field.MY_FIELD", function(state, value) {
* // check the state like this:
* if (state == FieldChanges.STATE_CHANGED())
* // do something
* PersUtils.setImage(vars.get("$field.PERSID"), value);
* else
* // do something else
* PersUtils.removeImage(vars.get("$field.PERSID"));
* });
*
* do not create an instance of this
*
* @class
*/
function FieldChanges(){}
/**
* State if nothing changed
*/
FieldChanges.STATE_NO_CHANGE = function (){
return "NO_CHANGE"
};
};
/**
* State if field was changed
*/
FieldChanges.STATE_CHANGED = function (){
return "CHANGED"
};
};
/**
* State if field was deleted (set to false, null, "" etc.)
*/
FieldChanges.STATE_DELETED = function (){
return "DELETED"
};
};
/**
* check if the state was changed. Calls the pAssimilatorFn with the parameters state and value
*/
FieldChanges.assimilateChangeAndDispose = function (pFieldName, pAssimilatorFn)
{
var allChanges = FieldChanges._getStorage();
......@@ -82,6 +114,9 @@ FieldChanges.assimilateChangeAndDispose = function (pFieldName, pAssimilatorFn)
return res;
};
/**
* Call this if the field changed.
*/
FieldChanges.setChange = function(pFieldName)
{
var allChanges = FieldChanges._getStorage();
......@@ -97,6 +132,10 @@ FieldChanges.setChange = function(pFieldName)
FieldChanges._setStorage(allChanges);
};
/**
* get the changes from a image variable
* @ignore
*/
FieldChanges._getStorage = function()
{
if (!vars.exists("$image.FieldChanges"))
......@@ -104,6 +143,10 @@ FieldChanges._getStorage = function()
return vars.get("$image.FieldChanges");
};
/**
* save the field changes in a image variable
* @ignore
*/
FieldChanges._setStorage = function(pAllChanges)
{
return vars.set("$image.FieldChanges", pAllChanges);
......
import("system.vars");
import("system.datetime");
import("system.util");
import("system.db");
import("system.project");
import("system.neon");
/**
* Class containing utility functions for copying modules
* do not create an instance of this
......
......@@ -12,7 +12,7 @@ import("Keyword_lib");
import("Product_lib");
import("Report_lib");
import("OfferOrder_lib");
import("Address_lib");
import("PostalAddress_lib");
/**
* Methods used by Offer.
......
import("system.db");
import("Sql_lib");
/**
* Methods for addresses.
* Todo: evtl. übernahme / anpassung der Adresslib aus altem Basic. 1030856
*
* Do not create an instance of this!
*
* @class
*/
function AddressUtils(){}
/**
* format the Address in one line
*
* @param {String} pCountry
* @param {String} pAddressLine
* @param {String} pBuildingNo
* @param {String} pZipCode
* @param {String} pCity
*
* @return {String}
*/
AddressUtils.formatOneline = function (pCountry, pAddressLine, pBuildingNo, pZipCode, pCity)
{
var country = pCountry || "";
......@@ -18,6 +37,65 @@ AddressUtils.formatOneline = function (pCountry, pAddressLine, pBuildingNo, pZip
.join(", ");
};
/**
* Returns the formatted standard address for the relation.
*
* TODO: Dummy method! Übernahme der Adresslib aus altem Basic
*
* @return {String}
*/
AddressUtils.getAddress = function(pRelationId) {
var address = db.array(db.ROW, SqlCondition.begin().andPrepare("RELATION.RELATIONID", pRelationId).buildSelect('select RELATIONID, ADDRESS, BUILDINGNO, ZIP, CITY, "NAME", FIRSTNAME, LASTNAME, TITLE from' + RelationUtils.getFullRelationFromString(), "1=0"));
// TODO: currently there are some relations without standard address. Use Hardcoded one.
if (!address[1]) {
var dummyAddress = db.array(db.ROW, SqlCondition.begin().andPrepare("ADDRESS.ADDRESSID", '97d37aea-d7f8-4436-bb31-875439f5f7f1').buildSelect('select ADDRESS, BUILDINGNO, ZIP, CITY from ADDRESS', "1=0"));
address[1] = dummyAddress[0];
address[2] = dummyAddress[1];
address[3] = dummyAddress[2];
address[4] = dummyAddress[3];
}
var type = RelationUtils.getRelationTypeByRelation(pRelationId);
var resultAddr = "";
// 1 if organisation <br>
// 2 if privat person <br>
// 3 if person of an organisation <br>*/
switch (type)
{
case 1:
resultAddr = address[5] + "\n" + address[1] + " " + address[2] + "\n" + address[3] + " " + address[4];
break;
case 2:
resultAddr = address[8] + " " + address[6] + " " + address[7] + "\n" + address[1] + " " + address[2] + "\n" + address[3] + " " + address[4];
break;
case 3:
resultAddr = address[5] + "\n" + address[6] + " " + address[7] + "\n" + address[1] + " " + address[2] + "\n" + address[3] + " " + address[4];
break;
}
return resultAddr;
}
/**
* Returns a letter salutation.
*
* TODO: Dummy method! Übernahme der Adresslib aus altem Basic
*
* @return {String}
*/
AddressUtils.getLetterSalutation = function() {
return "Sehr geehrte Damen und Herren";
}
/**
* Methods for validating addresses.
*
* Do not create an instance of this!
*
* @class
*/
function AddressValidationUtils(){}
AddressValidationUtils._getRequiredFields = function(countryCode)
......
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