Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
W
web-apps
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
web-apps
Commits
9f4a5ce2
Commit
9f4a5ce2
authored
Aug 04, 2017
by
Julia Radzhabova
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Bug 35504.
parent
6d6b5718
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
7 deletions
+34
-7
apps/common/main/lib/controller/Comments.js
apps/common/main/lib/controller/Comments.js
+34
-7
No files found.
apps/common/main/lib/controller/Comments.js
View file @
9f4a5ce2
...
...
@@ -176,6 +176,7 @@ define([
comment
.
asc_putText
(
commentVal
);
comment
.
asc_putTime
(
this
.
utcDateToString
(
new
Date
()));
comment
.
asc_putOnlyOfficeTime
(
this
.
ooDateToString
(
new
Date
()));
comment
.
asc_putUserId
(
this
.
currentUserId
);
comment
.
asc_putUserName
(
this
.
currentUserName
);
comment
.
asc_putSolved
(
false
);
...
...
@@ -211,6 +212,7 @@ define([
ascComment
.
asc_putText
(
comment
.
get
(
'
comment
'
));
ascComment
.
asc_putQuoteText
(
comment
.
get
(
'
quote
'
));
ascComment
.
asc_putTime
(
t
.
utcDateToString
(
new
Date
(
comment
.
get
(
'
time
'
))));
ascComment
.
asc_putOnlyOfficeTime
(
t
.
ooDateToString
(
new
Date
(
comment
.
get
(
'
time
'
))));
ascComment
.
asc_putUserId
(
comment
.
get
(
'
userid
'
));
ascComment
.
asc_putUserName
(
comment
.
get
(
'
username
'
));
ascComment
.
asc_putSolved
(
!
comment
.
get
(
'
resolved
'
));
...
...
@@ -226,6 +228,7 @@ define([
if
(
addReply
)
{
addReply
.
asc_putText
(
reply
.
get
(
'
reply
'
));
addReply
.
asc_putTime
(
t
.
utcDateToString
(
new
Date
(
reply
.
get
(
'
time
'
))));
addReply
.
asc_putOnlyOfficeTime
(
t
.
ooDateToString
(
new
Date
(
reply
.
get
(
'
time
'
))));
addReply
.
asc_putUserId
(
reply
.
get
(
'
userid
'
));
addReply
.
asc_putUserName
(
reply
.
get
(
'
username
'
));
...
...
@@ -299,6 +302,7 @@ define([
ascComment
.
asc_putText
(
commentVal
);
ascComment
.
asc_putQuoteText
(
comment
.
get
(
'
quote
'
));
ascComment
.
asc_putTime
(
t
.
utcDateToString
(
new
Date
(
comment
.
get
(
'
time
'
))));
ascComment
.
asc_putOnlyOfficeTime
(
t
.
ooDateToString
(
new
Date
(
comment
.
get
(
'
time
'
))));
ascComment
.
asc_putUserId
(
t
.
currentUserId
);
ascComment
.
asc_putUserName
(
t
.
currentUserName
);
ascComment
.
asc_putSolved
(
comment
.
get
(
'
resolved
'
));
...
...
@@ -325,6 +329,7 @@ define([
if
(
addReply
)
{
addReply
.
asc_putText
(
reply
.
get
(
'
reply
'
));
addReply
.
asc_putTime
(
t
.
utcDateToString
(
new
Date
(
reply
.
get
(
'
time
'
))));
addReply
.
asc_putOnlyOfficeTime
(
t
.
ooDateToString
(
new
Date
(
reply
.
get
(
'
time
'
))));
addReply
.
asc_putUserId
(
reply
.
get
(
'
userid
'
));
addReply
.
asc_putUserName
(
reply
.
get
(
'
username
'
));
...
...
@@ -353,6 +358,7 @@ define([
ascComment
.
asc_putText
(
comment
.
get
(
'
comment
'
));
ascComment
.
asc_putQuoteText
(
comment
.
get
(
'
quote
'
));
ascComment
.
asc_putTime
(
me
.
utcDateToString
(
new
Date
(
comment
.
get
(
'
time
'
))));
ascComment
.
asc_putOnlyOfficeTime
(
me
.
ooDateToString
(
new
Date
(
comment
.
get
(
'
time
'
))));
ascComment
.
asc_putUserId
(
comment
.
get
(
'
userid
'
));
ascComment
.
asc_putUserName
(
comment
.
get
(
'
username
'
));
ascComment
.
asc_putSolved
(
comment
.
get
(
'
resolved
'
));
...
...
@@ -378,6 +384,7 @@ define([
}
addReply
.
asc_putTime
(
me
.
utcDateToString
(
new
Date
(
reply
.
get
(
'
time
'
))));
addReply
.
asc_putOnlyOfficeTime
(
me
.
ooDateToString
(
new
Date
(
reply
.
get
(
'
time
'
))));
ascComment
.
asc_addReply
(
addReply
);
}
...
...
@@ -413,6 +420,7 @@ define([
ascComment
.
asc_putText
(
comment
.
get
(
'
comment
'
));
ascComment
.
asc_putQuoteText
(
comment
.
get
(
'
quote
'
));
ascComment
.
asc_putTime
(
me
.
utcDateToString
(
new
Date
(
comment
.
get
(
'
time
'
))));
ascComment
.
asc_putOnlyOfficeTime
(
me
.
ooDateToString
(
new
Date
(
comment
.
get
(
'
time
'
))));
ascComment
.
asc_putUserId
(
comment
.
get
(
'
userid
'
));
ascComment
.
asc_putUserName
(
comment
.
get
(
'
username
'
));
ascComment
.
asc_putSolved
(
comment
.
get
(
'
resolved
'
));
...
...
@@ -429,6 +437,7 @@ define([
if
(
addReply
)
{
addReply
.
asc_putText
(
reply
.
get
(
'
reply
'
));
addReply
.
asc_putTime
(
me
.
utcDateToString
(
new
Date
(
reply
.
get
(
'
time
'
))));
addReply
.
asc_putOnlyOfficeTime
(
me
.
ooDateToString
(
new
Date
(
reply
.
get
(
'
time
'
))));
addReply
.
asc_putUserId
(
reply
.
get
(
'
userid
'
));
addReply
.
asc_putUserName
(
reply
.
get
(
'
username
'
));
...
...
@@ -441,6 +450,7 @@ define([
if
(
addReply
)
{
addReply
.
asc_putText
(
replyVal
);
addReply
.
asc_putTime
(
me
.
utcDateToString
(
new
Date
()));
addReply
.
asc_putOnlyOfficeTime
(
me
.
ooDateToString
(
new
Date
()));
addReply
.
asc_putUserId
(
me
.
currentUserId
);
addReply
.
asc_putUserName
(
me
.
currentUserName
);
...
...
@@ -467,6 +477,7 @@ define([
ascComment
.
asc_putText
(
comment
.
get
(
'
comment
'
));
ascComment
.
asc_putQuoteText
(
comment
.
get
(
'
quote
'
));
ascComment
.
asc_putTime
(
me
.
utcDateToString
(
new
Date
(
comment
.
get
(
'
time
'
))));
ascComment
.
asc_putOnlyOfficeTime
(
me
.
ooDateToString
(
new
Date
(
comment
.
get
(
'
time
'
))));
ascComment
.
asc_putUserId
(
comment
.
get
(
'
userid
'
));
ascComment
.
asc_putUserName
(
comment
.
get
(
'
username
'
));
ascComment
.
asc_putSolved
(
comment
.
get
(
'
resolved
'
));
...
...
@@ -483,6 +494,7 @@ define([
if
(
addReply
)
{
addReply
.
asc_putText
(
reply
.
get
(
'
reply
'
));
addReply
.
asc_putTime
(
me
.
utcDateToString
(
new
Date
(
reply
.
get
(
'
time
'
))));
addReply
.
asc_putOnlyOfficeTime
(
me
.
ooDateToString
(
new
Date
(
reply
.
get
(
'
time
'
))));
addReply
.
asc_putUserId
(
reply
.
get
(
'
userid
'
));
addReply
.
asc_putUserName
(
reply
.
get
(
'
username
'
));
...
...
@@ -661,8 +673,8 @@ define([
if
(
comment
)
{
t
=
this
;
date
=
(
data
.
asc_get
Time
()
==
''
)
?
new
Date
()
:
new
Date
(
this
.
stringUtcToLocalDate
(
data
.
asc_getTime
(
)));
date
=
(
data
.
asc_get
OnlyOfficeTime
())
?
new
Date
(
this
.
stringOOToLocalDate
(
data
.
asc_getOnlyOfficeTime
()))
:
((
data
.
asc_getTime
()
==
''
)
?
new
Date
()
:
new
Date
(
this
.
stringUtcToLocalDate
(
data
.
asc_getTime
()
)));
comment
.
set
(
'
comment
'
,
data
.
asc_getText
());
comment
.
set
(
'
userid
'
,
data
.
asc_getUserId
());
...
...
@@ -679,8 +691,8 @@ define([
repliesCount
=
data
.
asc_getRepliesCount
();
for
(
i
=
0
;
i
<
repliesCount
;
++
i
)
{
dateReply
=
(
data
.
asc_getReply
(
i
).
asc_get
Time
()
==
''
)
?
new
Date
()
:
new
Date
(
this
.
stringUtcToLocalDate
(
data
.
asc_getReply
(
i
).
asc_getTime
(
)));
dateReply
=
(
data
.
asc_getReply
(
i
).
asc_get
OnlyOfficeTime
())
?
new
Date
(
this
.
stringOOToLocalDate
(
data
.
asc_getReply
(
i
).
asc_getOnlyOfficeTime
()))
:
((
data
.
asc_getReply
(
i
).
asc_getTime
()
==
''
)
?
new
Date
()
:
new
Date
(
this
.
stringUtcToLocalDate
(
data
.
asc_getReply
(
i
).
asc_getTime
()
)));
replies
.
push
(
new
Common
.
Models
.
Reply
({
id
:
Common
.
UI
.
getId
(),
...
...
@@ -1025,7 +1037,8 @@ define([
// helpers
readSDKComment
:
function
(
id
,
data
)
{
var
date
=
(
data
.
asc_getTime
()
==
''
)
?
new
Date
()
:
new
Date
(
this
.
stringUtcToLocalDate
(
data
.
asc_getTime
()));
var
date
=
(
data
.
asc_getOnlyOfficeTime
())
?
new
Date
(
this
.
stringOOToLocalDate
(
data
.
asc_getOnlyOfficeTime
()))
:
((
data
.
asc_getTime
()
==
''
)
?
new
Date
()
:
new
Date
(
this
.
stringUtcToLocalDate
(
data
.
asc_getTime
())));
var
comment
=
new
Common
.
Models
.
Comment
({
uid
:
id
,
userid
:
data
.
asc_getUserId
(),
...
...
@@ -1062,8 +1075,8 @@ define([
var
repliesCount
=
data
.
asc_getRepliesCount
();
if
(
repliesCount
)
{
for
(
i
=
0
;
i
<
repliesCount
;
++
i
)
{
date
=
(
data
.
asc_getReply
(
i
).
asc_get
Time
()
==
''
)
?
new
Date
()
:
new
Date
(
this
.
stringUtcToLocalDate
(
data
.
asc_getReply
(
i
).
asc_getTime
(
)));
date
=
(
data
.
asc_getReply
(
i
).
asc_get
OnlyOfficeTime
())
?
new
Date
(
this
.
stringOOToLocalDate
(
data
.
asc_getReply
(
i
).
asc_getOnlyOfficeTime
()))
:
((
data
.
asc_getReply
(
i
).
asc_getTime
()
==
''
)
?
new
Date
()
:
new
Date
(
this
.
stringUtcToLocalDate
(
data
.
asc_getReply
(
i
).
asc_getTime
()
)));
replies
.
push
(
new
Common
.
Models
.
Reply
({
id
:
Common
.
UI
.
getId
(),
...
...
@@ -1164,6 +1177,7 @@ define([
}
comment
.
asc_putText
(
commentVal
);
comment
.
asc_putTime
(
this
.
utcDateToString
(
new
Date
()));
comment
.
asc_putOnlyOfficeTime
(
this
.
ooDateToString
(
new
Date
()));
comment
.
asc_putUserId
(
this
.
currentUserId
);
comment
.
asc_putUserName
(
this
.
currentUserName
);
comment
.
asc_putSolved
(
false
);
...
...
@@ -1270,6 +1284,19 @@ define([
timeZoneOffsetInMs
:
(
new
Date
()).
getTimezoneOffset
()
*
60000
,
stringOOToLocalDate
:
function
(
date
)
{
if
(
typeof
date
===
'
string
'
)
return
parseInt
(
date
);
return
0
;
},
ooDateToString
:
function
(
date
)
{
if
(
Object
.
prototype
.
toString
.
call
(
date
)
===
'
[object Date]
'
)
return
(
date
.
getTime
()).
toString
();
return
''
;
},
stringUtcToLocalDate
:
function
(
date
)
{
if
(
typeof
date
===
'
string
'
)
return
parseInt
(
date
)
+
this
.
timeZoneOffsetInMs
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment