Commit 4f417583 authored by Alina Habibulina's avatar Alina Habibulina

+ week score

parent a3425dc2
...@@ -158,13 +158,7 @@ var portal = { ...@@ -158,13 +158,7 @@ var portal = {
}; };
function countingScore(){ 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 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; 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++){ for (var i = 10; i < table.length; i++){
...@@ -180,13 +174,9 @@ function countingScore(){ ...@@ -180,13 +174,9 @@ function countingScore(){
else if (table[i].id == ("saturday-b"+row)) { saturday = table[i].value; score = Number.parseFloat(score) + Number.parseFloat(saturday);} 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);} 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()); portal.player.model.getModelWithId("ts_total_hours").setValue(score.toString());
ShowMessage(score);
}; };
function timeComputing(serverDateTime){ function timeComputing(serverDateTime){
function zeroCheck(num){ function zeroCheck(num){
if (num < 10) {num = "0"+ num;} if (num < 10) {num = "0"+ num;}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment