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
a0a78de1
Commit
a0a78de1
authored
4 years ago
by
Johannes Goderbauer
Browse files
Options
Downloads
Patches
Plain Diff
Organisation_entity: Index bugfix: standard phone and standard email stored too much values
parent
89406e86
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
entity/Organisation_entity/Organisation_entity.aod
+2
-2
2 additions, 2 deletions
entity/Organisation_entity/Organisation_entity.aod
entity/Organisation_entity/recordcontainers/index/query.js
+19
-10
19 additions, 10 deletions
entity/Organisation_entity/recordcontainers/index/query.js
with
21 additions
and
12 deletions
entity/Organisation_entity/Organisation_entity.aod
+
2
−
2
View file @
a0a78de1
...
...
@@ -1601,7 +1601,7 @@
<additionalFieldNameAliases>
<element>
email
</element>
</additionalFieldNameAliases>
<isMultiValued
v=
"
tru
e"
/>
<isMultiValued
v=
"
fals
e"
/>
</indexRecordFieldMapping>
<indexRecordFieldMapping>
<name>
STANDARD_PHONE_COMMUNICATION.value
</name>
...
...
@@ -1609,7 +1609,7 @@
<additionalFieldNameAliases>
<element>
phone
</element>
</additionalFieldNameAliases>
<isMultiValued
v=
"
tru
e"
/>
<isMultiValued
v=
"
fals
e"
/>
</indexRecordFieldMapping>
<indexRecordFieldMapping>
<name>
ADDRESS_ID.displayValue
</name>
...
...
This diff is collapsed.
Click to expand it.
entity/Organisation_entity/recordcontainers/index/query.js
+
19
−
10
View file @
a0a78de1
...
...
@@ -15,17 +15,18 @@ You may want to check out if your change affects other modules. However adding m
*/
var
commMediumPhoneIds
=
CommUtil
.
getMediumIdsByCategory
(
"
PHONE
"
);
var
commMediumMailIds
=
CommUtil
.
getMediumIdsByCategory
(
"
EMAIL
"
);
var
sqlHelper
=
new
SqlMaskingUtils
();
var
querySelect
=
newSelect
([
"
CONTACT.CONTACTID
"
,
sqlHelper
.
concat
([
"
ORGANISATION.NAME
"
,
"
'|'
"
,
"
ORGANISATION.CUSTOMERCODE
"
]),
sqlHelper
.
concat
([
sqlHelper
.
concat
([
"
default
Address.ADDRESS
"
,
"
default
Address.BUILDINGNO
"
,
"
'-'
"
,
"
default
Address.COUNTRY
"
,
"
default
Address.ZIP
"
,
"
default
Address.CITY
"
]),
sqlHelper
.
concat
([
"
standard
Address.ADDRESS
"
,
"
standard
Address.BUILDINGNO
"
,
"
'-'
"
,
"
standard
Address.COUNTRY
"
,
"
standard
Address.ZIP
"
,
"
standard
Address.CITY
"
]),
sqlHelper
.
concat
([
"
'
"
+
translate
.
text
(
"
Phone
"
)
+
"
:'
"
,
"
(
"
+
CommUtil
.
getStandardSubSqlPhone
()
+
"
)
"
]),
sqlHelper
.
concat
([
"
'
"
+
translate
.
text
(
"
Email
"
)
+
"
:'
"
,
"
(
"
+
CommUtil
.
getStandardSubSqlMail
()
+
"
)
"
])
],
"
|
"
),
sqlHelper
.
concat
([
sqlHelper
.
cast
(
"
default
Address.LAT
"
,
SQLTYPES
.
VARCHAR
,
16
),
sqlHelper
.
cast
(
"
default
Address.LON
"
,
SQLTYPES
.
VARCHAR
,
16
)],
"
,
"
),
sqlHelper
.
concat
([
sqlHelper
.
cast
(
"
standard
Address.LAT
"
,
SQLTYPES
.
VARCHAR
,
16
),
sqlHelper
.
cast
(
"
standard
Address.LON
"
,
SQLTYPES
.
VARCHAR
,
16
)],
"
,
"
),
//additional indexed fields
"
ORGANISATION.NAME
"
,
sqlHelper
.
trim
(
"
ORGANISATION.ORGANISATIONID
"
),
//trim to enable filter patterns like: >> -organisationid_value:0<<
...
...
@@ -35,19 +36,27 @@ var querySelect = newSelect([
"
ADDRESS.COUNTRY
"
,
"
ADDRESS.ZIP
"
,
"
ADDRESS.CITY
"
,
"
COMMUNICATION
.ADDR
"
,
"
PHONE
.ADDR
"
,
sqlHelper
.
concat
([
sqlHelper
.
concat
([
"
default
Address.ADDRESS
"
,
"
default
Address.BUILDINGNO
"
])
,
sqlHelper
.
concat
([
"
default
Address.COUNTRY
"
,
"
default
Address.ZIP
"
,
"
default
Address.CITY
"
])
"
standardEmail
.ADDR
"
,
"
standardPhone
.ADDR
"
,
sqlHelper
.
concat
([
sqlHelper
.
concat
([
"
standard
Address.ADDRESS
"
,
"
standard
Address.BUILDINGNO
"
])
,
sqlHelper
.
concat
([
"
standard
Address.COUNTRY
"
,
"
standard
Address.ZIP
"
,
"
standard
Address.CITY
"
])
],
"
-
"
)
])
.
from
(
"
ORGANISATION
"
)
.
join
(
"
CONTACT
"
,
"
CONTACT.ORGANISATION_ID = ORGANISATION.ORGANISATIONID and CONTACT.PERSON_ID is null
"
)
.
leftJoin
(
"
ADDRESS
"
,
"
default
Address.ADDRESSID = CONTACT.ADDRESS_ID
"
,
"
default
Address
"
)
.
leftJoin
(
"
ADDRESS
"
,
"
standard
Address.ADDRESSID = CONTACT.ADDRESS_ID
"
,
"
standard
Address
"
)
.
leftJoin
(
"
ADDRESS
"
,
"
ADDRESS.CONTACT_ID = CONTACT.CONTACTID
"
)
.
leftJoin
(
"
COMMUNICATION
"
,
"
COMMUNICATION.CONTACT_ID = CONTACT.CONTACTID
"
)
.
leftJoin
(
"
COMMUNICATION
"
,
newWhere
(
"
phone.CONTACT_ID = CONTACT.CONTACTID
"
)
.
and
([
"
COMMUNICATION
"
,
"
MEDIUM_ID
"
,
"
phone
"
],
commMediumPhoneIds
,
SqlBuilder
.
IN
()),
"
phone
"
)
//standardMail is not multi valued and can only old one value (the standard email address)
.
leftJoin
(
"
COMMUNICATION
"
,
newWhere
(
"
standardEmail.CONTACT_ID = CONTACT.CONTACTID
"
)
.
and
([
"
COMMUNICATION
"
,
"
MEDIUM_ID
"
,
"
standardEmail
"
],
commMediumMailIds
,
SqlBuilder
.
IN
())
.
and
([
"
COMMUNICATION
"
,
"
ISSTANDARD
"
,
"
standardEmail
"
],
"
1
"
)
,
"
standardEmail
"
)
//standardPhone is not multi valued and can only old one value (the standard phone number)
.
leftJoin
(
"
COMMUNICATION
"
,
newWhere
(
"
standardPhone.CONTACT_ID = CONTACT.CONTACTID
"
)
.
and
([
"
COMMUNICATION
"
,
"
MEDIUM_ID
"
,
"
standardPhone
"
],
commMediumPhoneIds
,
SqlBuilder
.
IN
())
.
and
([
"
COMMUNICATION
"
,
"
ISSTANDARD
"
,
"
standardPhone
"
],
"
1
"
)
,
"
standardPhone
"
)
.
where
(
"
CONTACT.STATUS
"
,
$KeywordRegistry
.
contactStatus
$inactive
(),
SqlBuilder
.
NOT_EQUAL
());
if
(
vars
.
exists
(
"
$local.idvalue
"
)
&&
vars
.
get
(
"
$local.idvalue
"
)
&&
vars
.
get
(
"
$local.idvalue
"
).
length
>
0
)
...
...
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