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
a3425dc2
Commit
a3425dc2
authored
Feb 11, 2018
by
Alina Habibulina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+ week score
parent
aa9953c1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
2 deletions
+34
-2
src/main/webapp/js/Player.js
src/main/webapp/js/Player.js
+34
-2
No files found.
src/main/webapp/js/Player.js
View file @
a3425dc2
...
...
@@ -133,6 +133,8 @@ var portal = {
return
;
}
countingScore
();
var
data
=
portal
.
player
.
model
.
asfDataId
;
portal
.
player
.
saveFormData
(
function
(
data
){
if
(
_
.
isUndefined
(
data
)){
...
...
@@ -152,8 +154,38 @@ var portal = {
var
StrSunday
=
period
.
substring
(
11
);
portal
.
player
.
model
.
getModelWithId
(
"
ts_period_date_from
"
).
setValue
(
StrMonday
);
portal
.
player
.
model
.
getModelWithId
(
"
ts_period_date_to
"
).
setValue
(
StrSunday
);
}
}
};
function
countingScore
(){
////Расчет итогового количества часов
////in the "table" variable - array with the all data
//// 10 columns in row, 1st row - table headers
//// if we have only 1 full row - we have 20 values in array, every extra row - +10 value in array
/////first 3 columns - project and ect;
///// last 7 colums is what we need - the value of hours in day
var
table
=
portal
.
player
.
model
.
getModelWithId
(
"
ts_timesheet_table
"
).
getAsfData
().
findElement
().
data
;
var
score
=
0
,
monday
=
0
,
tuesday
=
0
,
wednesday
=
0
,
thursday
=
0
,
friday
=
0
,
saturday
=
0
,
sunday
=
0
;
for
(
var
i
=
10
;
i
<
table
.
length
;
i
++
){
var
row
=
Number
.
parseInt
(
i
/
10
);
if
(
table
[
i
].
id
==
(
"
project-b
"
+
row
)
||
table
[
i
].
id
==
(
"
task-b
"
+
row
)
||
table
[
i
].
id
==
(
"
result-b
"
+
row
))
{
continue
;
}
else
if
(
table
[
i
].
id
==
(
"
monday-b
"
+
row
))
{
monday
=
table
[
i
].
value
;
score
=
Number
.
parseFloat
(
score
)
+
Number
.
parseFloat
(
monday
);}
else
if
(
table
[
i
].
id
==
(
"
tuesday-b
"
+
row
))
{
tuesday
=
table
[
i
].
value
;
score
=
Number
.
parseFloat
(
score
)
+
Number
.
parseFloat
(
tuesday
);}
else
if
(
table
[
i
].
id
==
(
"
wednesday-b
"
+
row
))
{
wednesday
=
table
[
i
].
value
;
score
=
Number
.
parseFloat
(
score
)
+
Number
.
parseFloat
(
wednesday
);}
else
if
(
table
[
i
].
id
==
(
"
thursday-b
"
+
row
))
{
thursday
=
table
[
i
].
value
;
score
=
Number
.
parseFloat
(
score
)
+
Number
.
parseFloat
(
thursday
);}
else
if
(
table
[
i
].
id
==
(
"
friday-b
"
+
row
))
{
friday
=
table
[
i
].
value
;
score
=
Number
.
parseFloat
(
score
)
+
Number
.
parseFloat
(
friday
);}
else
if
(
table
[
i
].
id
==
(
"
saturday-b
"
+
row
))
{
saturday
=
table
[
i
].
value
;
score
=
Number
.
parseFloat
(
score
)
+
Number
.
parseFloat
(
saturday
);}
else
if
(
table
[
i
].
id
==
(
"
sunday-b
"
+
row
))
{
sunday
=
table
[
i
].
value
;
score
=
Number
.
parseFloat
(
score
)
+
Number
.
parseFloat
(
sunday
);}
}
portal
.
player
.
model
.
getModelWithId
(
"
ts_total_hours
"
).
setValue
(
score
.
toString
());
ShowMessage
(
score
);
};
function
timeComputing
(
serverDateTime
){
function
zeroCheck
(
num
){
...
...
@@ -161,7 +193,7 @@ function timeComputing(serverDateTime){
return
num
;
};
var
WeekDay
=
new
Date
(
serverDateTime
);
WeekDay
=
WeekDay
.
getDay
();
WeekDay
=
WeekDay
.
getDay
()
+
1
;
var
shift
=
7
-
WeekDay
;
var
sunday
=
new
Date
(
serverDateTime
);
sunday
.
setDate
(
sunday
.
getDate
()
+
shift
);
...
...
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