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
a208b687
Commit
a208b687
authored
6 years ago
by
Johannes Goderbauer
Browse files
Options
Downloads
Patches
Plain Diff
Loghistory: bugfixes
parent
2e1b7243
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/Loghistory_lib/process.js
+14
-13
14 additions, 13 deletions
process/Loghistory_lib/process.js
with
14 additions
and
13 deletions
process/Loghistory_lib/process.js
+
14
−
13
View file @
a208b687
...
...
@@ -15,6 +15,7 @@ import("Attribute_lib");
import
(
"
Contact_lib
"
);
import
(
"
AddressEntity_lib
"
);
import
(
"
Util_lib
"
);
import
(
"
KeywordRegistry_basic
"
);
function
LogHistoryExecutor
(
pTable
,
pUser
,
pColumns
,
pNewValues
,
pOldValues
,
pTimeStamp
,
pAction
,
pIdValue
)
{
...
...
@@ -42,8 +43,7 @@ LogHistoryExecutor.prototype.execute = function ()
var
references
=
{};
var
columnStructure
=
{};
var
primaryKey
=
""
;
var
tolog
=
false
;
var
somethingTolog
=
false
;
var
structure
=
project
.
getAliasDefinitionStructure
(
this
.
structureDefinitionAlias
,
this
.
affectedTable
);
if
(
structure
)
...
...
@@ -59,11 +59,11 @@ LogHistoryExecutor.prototype.execute = function ()
if
(
columnStructure
[
column
].
primaryKey
)
primaryKey
=
column
;
if
(
columnStructure
[
column
].
log
)
t
olog
=
true
;
somethingT
olog
=
true
;
}
}
if
(
!
t
olog
)
if
(
!
somethingT
olog
)
return
null
;
var
idvalue
=
this
.
idValue
;
...
...
@@ -167,8 +167,8 @@ LogHistoryExecutor.prototype.execute = function ()
if
(
description
.
length
>
0
)
{
if
(
this
.
sqlAction
==
'
I
'
)
description
=
translate
.
withArguments
(
"
%0 added.
"
,
[
description
.
join
(
"
,
"
)],
this
.
translationLanguage
);
if
(
this
.
sqlAction
==
'
U
'
)
description
=
translate
.
withArguments
(
"
%0 modified.
"
,
[
description
.
join
(
"
,
"
)],
this
.
translationLanguage
);
if
(
this
.
sqlAction
==
'
D
'
)
description
=
translate
.
withArguments
(
"
%0 deleted.
"
,
[
description
.
join
(
"
,
"
)],
this
.
translationLanguage
);
else
if
(
this
.
sqlAction
==
'
U
'
)
description
=
translate
.
withArguments
(
"
%0 modified.
"
,
[
description
.
join
(
"
,
"
)],
this
.
translationLanguage
);
else
if
(
this
.
sqlAction
==
'
D
'
)
description
=
translate
.
withArguments
(
"
%0 deleted.
"
,
[
description
.
join
(
"
,
"
)],
this
.
translationLanguage
);
for
(
index
in
references
)
{
if
(
references
[
index
].
id
!=
""
)
...
...
@@ -223,11 +223,13 @@ LogHistoryExecutor.prototype._getDataForExtras = function(pId, pValues)
var
data
=
[];
if
(
this
.
affectedTable
==
"
AB_ATTRIBUTERELATION
"
)
{
data
[
0
]
=
AttributeUtil
.
getFullAttributeName
(
pId
);
data
[
1
]
=
AttributeRelationUtils
.
selectAttributeValue
(
pId
,
pValues
,
true
);
if
(
this
.
affectedTable
==
"
COMMUNICATION
"
)
}
else
if
(
this
.
affectedTable
==
"
COMMUNICATION
"
)
{
data
[
0
]
=
KeywordUtils
.
get
ResolvedTitleSqlPart
(
"
MediumOrgPers
"
,
pId
,
false
);
data
[
0
]
=
KeywordUtils
.
get
ViewValue
(
$KeywordRegistry
.
communicationMedium
(),
pId
);
data
[
1
]
=
pValues
[
"
ADDR
"
];
}
return
data
;
...
...
@@ -278,16 +280,15 @@ LogHistoryExecutor._getFormattedValue = function (pDescription, pValue, pLocale)
else
if
(
pDescription
.
translate4Log
!=
null
&&
pDescription
.
translate4Log
!=
""
)
{
var
params
=
{
rowId
:
this
.
idValue
,
value
:
pValue
.
toString
()
,
rowId
:
this
.
idValue
,
value
:
pValue
.
toString
(),
action
:
this
.
sqlAction
};
pValue
=
process
.
executeScript
(
"
LogHistoryExecutor._getFormattedValue
"
,
pDescription
.
translate4Log
,
params
);
}
else
if
(
pDescription
.
columnType
==
String
(
SQLTYPES
.
TIMESTAMP
))
pValue
=
datetime
.
toDate
(
pValue
,
translate
.
text
(
"
dd.MM.yyyy
"
,
pLocale
),
"
Europe/Berlin
"
);
//TODO: timezone?
else
if
(
pDescription
.
columnType
==
String
(
SQLTYPES
.
TIMESTAMP
))
pValue
=
datetime
.
toDate
(
pValue
,
translate
.
text
(
"
dd.MM.yyyy
"
,
pLocale
),
"
Europe/Berlin
"
);
//TODO: timezone?
else
if
(
pDescription
.
autoMapTrueFalse4Log
)
{
switch
(
pValue
.
toLowerCase
())
...
...
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