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
4049e733
Commit
4049e733
authored
Feb 19, 2018
by
Valentin Skripnikov
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'a.habibulina-dev' into 'a.habibulina'
A.habibulina dev See merge request
!41
parents
2d4774f4
8717250d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
81 additions
and
23 deletions
+81
-23
src/main/webapp/css/beau.css
src/main/webapp/css/beau.css
+1
-0
src/main/webapp/js/Player.js
src/main/webapp/js/Player.js
+80
-23
No files found.
src/main/webapp/css/beau.css
View file @
4049e733
...
@@ -67,6 +67,7 @@
...
@@ -67,6 +67,7 @@
background-color
:
#49b785
;
background-color
:
#49b785
;
border-color
:
#49b785
;
border-color
:
#49b785
;
color
:
#ffffff
;
color
:
#ffffff
;
left
:
40%
;
}
}
.container
{
.container
{
...
...
src/main/webapp/js/Player.js
View file @
4049e733
...
@@ -69,7 +69,9 @@ function ShowMessage(message){
...
@@ -69,7 +69,9 @@ function ShowMessage(message){
},
3000
);
},
3000
);
};
};
var
user
;
var
portal
=
{
var
portal
=
{
player
:
null
,
player
:
null
,
clearPlayer
:
function
()
{
clearPlayer
:
function
()
{
...
@@ -88,20 +90,41 @@ var portal = {
...
@@ -88,20 +90,41 @@ var portal = {
});
});
}
}
});
});
AS
.
FORMS
.
ApiUtils
.
simpleAsyncGet
(
'
rest/api/registry/create_doc?registryCode=registry_timesheets
'
,
function
(
result
){
if
(
result
.
errorCode
!=
"
0
"
)
{
var
formExistance
;
AS
.
SERVICES
.
hideWaitWindow
();
////формирование Пн и Вскр для формирования поискового запроса по форме
ShowMessage
(
"
Ошибка во время создания документа..
"
);
var
cur_date
=
new
Date
();
return
;
var
StrPeriod
=
timeComputing
(
cur_date
);
//строка Пнд+" "+Вскр
}
else
{
var
StrMonday
=
StrPeriod
.
substring
(
0
,
10
);
var
StrSunday
=
StrPeriod
.
substring
(
11
);
AS
.
FORMS
.
ApiUtils
.
simpleAsyncGet
(
"
rest/api/person/auth
"
,
function
(
userData
){
AS
.
FORMS
.
ApiUtils
.
simpleAsyncGet
(
"
rest/api/asforms/search?modifiedFrom=
"
+
StrMonday
+
"
&modifiedTo=
"
+
StrSunday
+
"
&formCode=timesheet&field=ts_author&type=partial&recordsCount=1&search=
"
+
userData
.
lastname
,
function
(
success
){
AS
.
SERVICES
.
hideWaitWindow
();
AS
.
SERVICES
.
hideWaitWindow
();
ShowMessage
(
"
Документ успешно создан!
"
);
portal
.
player
.
view
.
setEditable
(
true
);
portal
.
player
.
view
.
setEditable
(
true
);
portal
.
player
.
showFormData
(
result
.
documentID
,
0
,
result
.
dataUUID
);
portal
.
player
.
showFormData
(
"
097a00e2-430c-436d-92e5-c2ea8edc5b30
"
,
1
,
success
);
portal
.
player
.
view
.
appendTo
(
$
(
'
#form_player_div
'
));
portal
.
player
.
view
.
appendTo
(
$
(
'
#form_player_div
'
));
ShowMessage
(
"
Документ успешно открыт!
"
);
var
formExistance
=
true
;
},
'
json
'
,
function
(){
formExistance
=
false
;});
if
(
formExistance
)
{
AS
.
FORMS
.
ApiUtils
.
simpleAsyncGet
(
'
rest/api/registry/create_doc?registryCode=registry_timesheets
'
,
function
(
result
){
if
(
result
.
errorCode
!=
"
0
"
)
{
AS
.
SERVICES
.
hideWaitWindow
();
ShowMessage
(
"
Ошибка во время создания документа..
"
);
return
;
}
else
{
AS
.
SERVICES
.
hideWaitWindow
();
portal
.
player
.
view
.
setEditable
(
true
);
portal
.
player
.
showFormData
(
result
.
documentID
,
0
,
result
.
dataUUID
);
portal
.
player
.
view
.
appendTo
(
$
(
'
#form_player_div
'
));
ShowMessage
(
"
Документ успешно создан!
"
);
}
},
'
json
'
);
}
}
},
'
json
'
);
});
},
},
saveData
:
function
(){
saveData
:
function
(){
...
@@ -125,28 +148,63 @@ var portal = {
...
@@ -125,28 +148,63 @@ var portal = {
},
},
main
:
function
(
view
,
model
)
{
main
:
function
(
view
,
model
)
{
var
serverDateTime
=
portal
.
player
.
model
.
getModelWithId
(
"
ts_date_created
"
).
value
;
var
period
=
timeComputing
(
serverDateTime
);
var
StrMonday
=
period
.
substring
(
0
,
10
);
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
zeroCheck
(
num
){
portal
.
player
.
model
.
on
(
"
valueChange
"
,
function
(){
if
(
num
<
10
)
{
num
=
"
0
"
+
num
;}
countingScore
();
return
num
;
});
};
}
};
function
countingScore
(){
////Расчет итогового количества часов происходит при нажатии кнопки сохранения
var
tsTable
=
portal
.
player
.
model
.
playerModel
.
getModelWithId
(
'
ts_timesheet_table
'
);
var
thModel
=
portal
.
player
.
model
.
playerModel
.
getModelWithId
(
'
ts_total_hours
'
);
var
days
=
{
'
monday
'
:
0
,
'
tuesday
'
:
0
,
'
wednesday
'
:
0
,
'
thursday
'
:
0
,
'
friday
'
:
0
,
'
saturday
'
:
0
,
'
sunday
'
:
0
};;
for
(
var
i
in
days
)
{
tsTable
.
modelBlocks
.
forEach
(
function
(
modelBlock
)
{
modelBlock
.
forEach
(
function
(
m
)
{
if
(
m
.
asfProperty
.
id
===
i
)
{
var
n
=
parseFloat
(
m
.
getValue
());
if
(
_
.
isNaN
(
n
)){
n
=
0
;
}
days
[
i
]
=
days
[
i
]
+
n
;
}
});
});
}
var
totalHours
=
0
;
for
(
var
n
in
days
)
{
totalHours
+=
days
[
n
];
jQuery
(
'
#ts_timesheet_table_total_
'
+
n
).
text
(
days
[
n
]);
}
thModel
.
setValue
(
totalHours
.
toString
());
};
var
serverDateTime
=
portal
.
player
.
model
.
getModelWithId
(
"
ts_date_created
"
).
value
;
function
timeComputing
(
serverDateTime
){
function
zeroCheck
(
num
){
if
(
num
<=
9
)
{
num
=
"
0
"
+
num
;}
return
num
;
};
var
WeekDay
=
new
Date
(
serverDateTime
);
var
WeekDay
=
new
Date
(
serverDateTime
);
WeekDay
=
WeekDay
.
getDay
();
WeekDay
=
WeekDay
.
getDay
();
var
shift
=
7
-
WeekDay
;
var
shift
=
7
-
WeekDay
;
var
sunday
=
new
Date
(
serverDateTime
);
var
sunday
=
new
Date
(
serverDateTime
);
sunday
.
setDate
(
sunday
.
getDate
()
+
shift
);
sunday
.
setDate
(
sunday
.
getDate
()
+
shift
);
var
monday
=
new
Date
(
serverDateTime
);
var
monday
=
new
Date
(
serverDateTime
);
monday
.
setDate
(
sunday
.
getDate
()
-
6
);
monday
.
setDate
(
sunday
.
getDate
()
-
6
);
var
StrSunday
=
sunday
.
getFullYear
()
+
"
-
"
+
zeroCheck
(
sunday
.
getMonth
()
+
1
)
+
"
-
"
+
zeroCheck
(
sunday
.
getDate
());
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
());
var
StrMonday
=
monday
.
getFullYear
()
+
"
-
"
+
zeroCheck
(
monday
.
getMonth
()
+
1
)
+
"
-
"
+
zeroCheck
(
monday
.
getDate
());
portal
.
player
.
model
.
getModelWithId
(
"
ts_period_date_from
"
).
setValue
(
StrMonday
);
return
StrMonday
+
"
"
+
StrSunday
;
}
};
};
//переменные для WaitCircles();
//переменные для WaitCircles();
...
@@ -227,6 +285,5 @@ $(document).ready(function(){
...
@@ -227,6 +285,5 @@ $(document).ready(function(){
$
(
"
.saveBtn
"
).
on
(
"
click
"
,
function
(
event
){
$
(
"
.saveBtn
"
).
on
(
"
click
"
,
function
(
event
){
AS
.
SERVICES
.
showWaitWindow
();
AS
.
SERVICES
.
showWaitWindow
();
portal
.
saveData
();
portal
.
saveData
();
});
});
});
});
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