Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
basic
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
xrm
basic
Commits
fe1ed902
Commit
fe1ed902
authored
6 years ago
by
S.Listl
Browse files
Options
Downloads
Patches
Plain Diff
[Projekt: Entwicklung - Neon][TicketNr.: 1026286][Kundenstammblatt - Übernahme aus Basic Swing]
parent
43d85cbb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
process/Org_lib/process.js
+48
-26
48 additions, 26 deletions
process/Org_lib/process.js
with
48 additions
and
26 deletions
process/Org_lib/process.js
+
48
−
26
View file @
fe1ed902
...
...
@@ -65,11 +65,12 @@ OrgUtils.openOrgReport = function(pOrgId)
.
buildSelect
(
"
select ORG.INFO from ORG
"
));
//communication data of the organization
var
commS
elect
=
"
select MEDIUM_ID, ADDR from COMM
"
;
var
commCond
=
SqlCondition
.
begin
()
var
commS
ql
=
"
select MEDIUM_ID, ADDR from COMM
"
;
commSql
=
SqlCondition
.
begin
()
.
andPrepare
(
"
COMM.RELATION_ID
"
,
relationId
)
.
and
(
"
STANDARD = 1
"
);
var
commData
=
db
.
table
(
commCond
.
buildSelect
(
commSelect
));
.
and
(
"
STANDARD = 1
"
)
.
buildSelect
(
commSql
);
var
commData
=
db
.
table
(
commSql
);
//resolve keyword
commData
.
forEach
(
function
(
row
)
...
...
@@ -80,13 +81,15 @@ OrgUtils.openOrgReport = function(pOrgId)
//select people from the organization
//TODO: Position und Abteilung fehlen noch
var
persS
elect
=
"
select SALUTATION, TITLE, FIRSTNAME, LASTNAME, '', '', '', ORG_ID, RELATIONID
"
var
persS
ql
=
"
select SALUTATION, TITLE, FIRSTNAME, LASTNAME, '', '', '', ORG_ID, RELATIONID
"
+
"
from PERS join RELATION on PERSID = PERS_ID
"
;
var
persCond
=
SqlCondition
.
begin
()
persSql
=
SqlCondition
.
begin
()
.
andPrepare
(
"
RELATION.ORG_ID
"
,
pOrgId
)
.
and
(
"
RELATION.STATUS = 1
"
);
var
persData
=
db
.
table
(
persCond
.
buildSelect
(
persSelect
,
""
,
"
order by PERS.LASTNAME asc
"
));
.
and
(
"
RELATION.STATUS = 1
"
)
.
buildSelect
(
persSql
,
""
,
"
order by PERS.LASTNAME asc
"
);
var
persData
=
db
.
table
(
persSql
);
//TODO: get the keywords in another way when keywords are entitys
var
mediumIds
=
[];
var
mediums
=
KeywordUtils
.
getStandardArrayProps
(
"
COMM.MEDIUM
"
);
for
(
let
i
=
0
;
i
<
mediums
.
length
;
i
++
)
...
...
@@ -96,14 +99,18 @@ OrgUtils.openOrgReport = function(pOrgId)
for
(
let
i
=
0
;
i
<
persData
.
length
;
i
++
)
{
_joinArrayVals
(
persData
[
i
],
0
,
4
);
var
persCommSelect
=
"
select MEDIUM_ID, ADDR from COMM
"
;
var
persCommCond
=
SqlCondition
.
begin
()
_joinArrayVals
(
persData
[
i
],
0
,
4
);
//join the full name together
//select the contact info for every person for phone and mail
var
persCommSql
=
"
select MEDIUM_ID, ADDR from COMM
"
;
persCommSql
=
SqlCondition
.
begin
()
.
andPrepare
(
"
COMM.RELATION_ID
"
,
persData
[
i
][
5
])
.
and
(
"
MEDIUM_ID in (
"
+
mediumIds
+
"
)
"
)
.
and
(
"
STANDARD = 1
"
);
var
persDataComm
=
db
.
table
(
persCommCond
.
buildSelect
(
persCommSelect
));
.
and
(
"
STANDARD = 1
"
)
.
buildSelect
(
persCommSql
);
var
persDataComm
=
db
.
table
(
persCommSql
);
//resolve keyword
persData
[
i
][
3
]
=
persDataComm
.
map
(
function
(
row
)
{
return
KeywordUtils
.
getViewValue
(
"
COMM.MEDIUM
"
,
row
[
0
])
+
"
:
"
+
row
[
1
];
...
...
@@ -112,12 +119,14 @@ OrgUtils.openOrgReport = function(pOrgId)
}
persData
=
ReportData
.
begin
([
"
PERSNAMECOMPLETE
"
,
"
PERSFUNCTION
"
,
"
PERSDEPARTMENT
"
,
"
PERSCOMM
"
,
"
ORG_ID
"
,
"
RELATION_ID
"
]).
add
(
persData
);
var
histS
elect
=
"
select ENTRYDATE, CATEGORY, FIRSTNAME, LASTNAME, INFO from ACTIVITY
"
var
histS
ql
=
"
select ENTRYDATE, CATEGORY, FIRSTNAME, LASTNAME, INFO from ACTIVITY
"
+
"
join ACTIVITYLINK on ACTIVITYLINK.ACTIVITY_ID = ACTIVITYID
"
+
"
join RELATION on ACTIVITYLINK.ROW_ID = RELATIONID
"
+
"
left join PERS on RELATION.PERS_ID = PERSID
"
;
var
histCond
=
SqlCondition
.
begin
().
andPrepare
(
"
RELATION.ORG_ID
"
,
pOrgId
);
var
histData
=
db
.
table
(
histCond
.
buildSelect
(
histSelect
,
""
,
"
order by ENTRYDATE desc
"
));
histSql
=
SqlCondition
.
begin
()
.
andPrepare
(
"
RELATION.ORG_ID
"
,
pOrgId
)
//= all activities linked to the organization or an employee
.
buildSelect
(
histSql
,
""
,
"
order by ENTRYDATE desc
"
);
var
histData
=
db
.
table
(
histSql
);
var
dateFormat
=
translate
.
text
(
"
dd.MM.yyyy
"
);
histData
.
forEach
(
function
(
row
)
...
...
@@ -129,18 +138,31 @@ OrgUtils.openOrgReport = function(pOrgId)
histData
=
ReportData
.
begin
([
"
ENTRYDATE
"
,
"
MEDIUM
"
,
"
LOGIN
"
,
"
INFO
"
]).
add
(
histData
);
var
attr
=
""
;
//TODO: this should be a string with the attributes
var
taskData
=
ReportData
.
begin
([
"
SUBJECT
"
,
"
INFOTEXT
"
,
"
STATUS
"
,
"
RESPONSIBLE
"
]).
add
([]);
//TODO: get tasks for this org
//tasks
var
taskSql
=
"
select TASK.SUBJECT, TASK.DESCRIPTION, TASK.STATUS, FIRSTNAME, LASTNAME from TASK
"
+
"
join RELATION on EDITOR_RELATION_ID = RELATIONID
"
+
"
left join PERS on RELATION.PERS_ID = PERSID
"
;
taskSql
=
SqlCondition
.
begin
()
.
andPrepare
(
"
RELATION.ORG_ID
"
,
pOrgId
)
.
buildSelect
(
taskSql
);
var
taskData
=
db
.
table
(
taskSql
);
taskData
.
forEach
(
function
(
row
)
{
row
[
2
]
=
KeywordUtils
.
getViewValue
(
"
TASK.STATUS
"
,
row
[
2
]);
_joinArrayVals
(
row
,
3
,
2
);
//join FIRSTNAME and LASTNAME together
});
taskData
=
ReportData
.
begin
([
"
SUBJECT
"
,
"
INFOTEXT
"
,
"
STATUS
"
,
"
RESPONSIBLE
"
]).
add
(
taskData
);
var
params
=
{
"
ORGAddr
"
:
AddressUtils
.
getAddress
(
relationId
).
toString
(),
//TODO: use new address logic when available
"
ORGAttr
"
:
attr
,
"
RELID
"
:
relationId
,
"
ORGID
"
:
pOrgId
,
"
INFO
"
:
info
};
var
orgReport
=
new
Report
(
"
RPTJ_ORG
"
);
var
orgReport
=
new
Report
(
"
RPTJ_ORG
"
,
params
);
//add subreport data
orgReport
.
addSubReportData
(
"
subdataComm
"
,
commData
);
...
...
@@ -157,11 +179,11 @@ OrgUtils.openOrgReport = function(pOrgId)
params
[
"
myAddr
"
]
=
imgData
[
0
];
orgReport
.
addImage
(
"
myLogo
"
,
imgData
[
1
]);
orgReport
.
addReportParams
(
params
);
orgReport
.
setReportData
(
ReportData
.
begin
([
"
e
"
]).
add
([[
"
d
"
]]));
orgReport
.
openReport
();
/*
* merges multiple columns in an two-dimensional array into one
*/
function
_joinArrayVals
(
pArr
,
pIndex
,
pHowMany
)
{
pArr
.
splice
(
pIndex
,
pHowMany
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment