Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
internship
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Valentin Skripnikov
internship
Commits
2d4774f4
Commit
2d4774f4
authored
Feb 09, 2018
by
Valentin Skripnikov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'a.habibulina-dev' into 'a.habibulina'
+ time period See merge request
!39
parents
fa2d3497
a06f1446
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
1 deletion
+34
-1
src/main/webapp/js/Player.js
src/main/webapp/js/Player.js
+34
-1
No files found.
src/main/webapp/js/Player.js
View file @
2d4774f4
...
@@ -81,6 +81,13 @@ var portal = {
...
@@ -81,6 +81,13 @@ var portal = {
createPlayer
:
function
(){
createPlayer
:
function
(){
portal
.
clearPlayer
();
portal
.
clearPlayer
();
portal
.
player
=
AS
.
FORMS
.
createPlayer
();
portal
.
player
=
AS
.
FORMS
.
createPlayer
();
AS
.
FORMS
.
bus
.
on
(
AS
.
FORMS
.
EVENT_TYPE
.
formShow
,
function
(
event
,
model
,
view
)
{
if
(
model
.
formCode
===
"
timesheet
"
)
{
model
.
on
(
AS
.
FORMS
.
EVENT_TYPE
.
dataLoad
,
function
()
{
portal
.
main
(
portal
.
player
.
view
.
getViewWithId
(
"
main_script
"
),
portal
.
player
.
model
.
getModelWithId
(
"
main_script
"
));
});
}
});
AS
.
FORMS
.
ApiUtils
.
simpleAsyncGet
(
'
rest/api/registry/create_doc?registryCode=registry_timesheets
'
,
function
(
result
){
AS
.
FORMS
.
ApiUtils
.
simpleAsyncGet
(
'
rest/api/registry/create_doc?registryCode=registry_timesheets
'
,
function
(
result
){
if
(
result
.
errorCode
!=
"
0
"
)
{
if
(
result
.
errorCode
!=
"
0
"
)
{
AS
.
SERVICES
.
hideWaitWindow
();
AS
.
SERVICES
.
hideWaitWindow
();
...
@@ -92,7 +99,9 @@ var portal = {
...
@@ -92,7 +99,9 @@ var portal = {
portal
.
player
.
view
.
setEditable
(
true
);
portal
.
player
.
view
.
setEditable
(
true
);
portal
.
player
.
showFormData
(
result
.
documentID
,
0
,
result
.
dataUUID
);
portal
.
player
.
showFormData
(
result
.
documentID
,
0
,
result
.
dataUUID
);
portal
.
player
.
view
.
appendTo
(
$
(
'
#form_player_div
'
));
portal
.
player
.
view
.
appendTo
(
$
(
'
#form_player_div
'
));
}},
'
json
'
);
}
},
'
json
'
);
},
},
saveData
:
function
(){
saveData
:
function
(){
...
@@ -113,6 +122,30 @@ var portal = {
...
@@ -113,6 +122,30 @@ var portal = {
ShowMessage
(
"
Данные сохранены
"
);
ShowMessage
(
"
Данные сохранены
"
);
}
}
});
});
},
main
:
function
(
view
,
model
)
{
function
zeroCheck
(
num
){
if
(
num
<
10
)
{
num
=
"
0
"
+
num
;}
return
num
;
};
var
serverDateTime
=
portal
.
player
.
model
.
getModelWithId
(
"
ts_date_created
"
).
value
;
var
WeekDay
=
new
Date
(
serverDateTime
);
WeekDay
=
WeekDay
.
getDay
();
var
shift
=
7
-
WeekDay
;
var
sunday
=
new
Date
(
serverDateTime
);
sunday
.
setDate
(
sunday
.
getDate
()
+
shift
);
var
monday
=
new
Date
(
serverDateTime
);
monday
.
setDate
(
sunday
.
getDate
()
-
6
);
var
StrSunday
=
sunday
.
getFullYear
()
+
"
-
"
+
zeroCheck
(
sunday
.
getMonth
()
+
1
)
+
"
-
"
+
zeroCheck
(
sunday
.
getDate
());
portal
.
player
.
model
.
getModelWithId
(
"
ts_period_date_to
"
).
setValue
(
StrSunday
);
var
StrMonday
=
monday
.
getFullYear
()
+
"
-
"
+
zeroCheck
(
monday
.
getMonth
()
+
1
)
+
"
-
"
+
zeroCheck
(
monday
.
getDate
());
portal
.
player
.
model
.
getModelWithId
(
"
ts_period_date_from
"
).
setValue
(
StrMonday
);
}
}
};
};
...
...
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