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
088145dd
Commit
088145dd
authored
Feb 13, 2018
by
Alina Habibulina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+ week score v2
parent
4f417583
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
25 deletions
+27
-25
src/main/webapp/js/Player.js
src/main/webapp/js/Player.js
+27
-25
No files found.
src/main/webapp/js/Player.js
View file @
088145dd
...
...
@@ -69,6 +69,7 @@ function ShowMessage(message){
},
3000
);
};
var
user
;
var
portal
=
{
player
:
null
,
...
...
@@ -98,31 +99,33 @@ var portal = {
var
StrMonday
=
StrPeriod
.
substring
(
0
,
10
);
var
StrSunday
=
StrPeriod
.
substring
(
11
);
AS
.
FORMS
.
ApiUtils
.
simpleAsyncGet
(
"
rest/api/asforms/search
"
,
function
(
success
){
AS
.
SERVICES
.
hideWaitWindow
();
portal
.
player
.
view
.
setEditable
(
true
);
portal
.
player
.
showFormData
(
"
6af6bf3d-a093-4a33-990c-2ec98c15423a
"
,
1
,
success
);
portal
.
player
.
view
.
appendTo
(
$
(
'
#form_player_div
'
));
ShowMessage
(
"
Документ успешно открыт!
"
);
var
formExistance
=
true
;
},
'
json
'
,
{
'
modifiedFrom
'
:
StrMonday
,
'
modifiedTo
'
:
StrSunday
,
'
formCode
'
:
'
timesheet
'
,
'
recordsCount
'
:
1
,
'
sortDir
'
:
'
desc
'
},
function
(){
formExistance
=
false
;});
if
(
formExistance
==
false
)
{
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
.
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
){
////rest/api/asforms/search?modifiedFrom=2018-02-12&modifiedTo=2018-02-18&formCode=timesheet&field=ts_author&type=partial&recordsCount=1&search=Хабибулина
AS
.
SERVICES
.
hideWaitWindow
();
ShowMessage
(
"
Документ успешно создан!
"
);
portal
.
player
.
view
.
setEditable
(
true
);
portal
.
player
.
showFormData
(
result
.
documentID
,
0
,
result
.
dataUUID
);
portal
.
player
.
showFormData
(
"
6af6bf3d-a093-4a33-990c-2ec98c15423a
"
,
1
,
success
);
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
();
ShowMessage
(
"
Документ успешно создан!
"
);
portal
.
player
.
view
.
setEditable
(
true
);
portal
.
player
.
showFormData
(
result
.
documentID
,
0
,
result
.
dataUUID
);
portal
.
player
.
view
.
appendTo
(
$
(
'
#form_player_div
'
));
}
},
'
json
'
);
}
},
'
json
'
);
}
});
},
saveData
:
function
(){
...
...
@@ -179,11 +182,11 @@ function countingScore(){
function
timeComputing
(
serverDateTime
){
function
zeroCheck
(
num
){
if
(
num
<
10
)
{
num
=
"
0
"
+
num
;}
if
(
num
<
=
9
)
{
num
=
"
0
"
+
num
;}
return
num
;
};
var
WeekDay
=
new
Date
(
serverDateTime
);
WeekDay
=
WeekDay
.
getDay
()
+
1
;
WeekDay
=
WeekDay
.
getDay
();
var
shift
=
7
-
WeekDay
;
var
sunday
=
new
Date
(
serverDateTime
);
sunday
.
setDate
(
sunday
.
getDate
()
+
shift
);
...
...
@@ -248,7 +251,7 @@ var authFunc = function(){
AS
.
SERVICES
.
showWaitWindow
();
AS
.
OPTIONS
.
login
=
$
(
"
input#login
"
).
val
();
AS
.
OPTIONS
.
password
=
$
(
"
input#password
"
).
val
();
portal
.
createPlayer
();
portal
.
createPlayer
(
user
);
$
(
"
.form_player_container
"
).
show
();
$
(
"
.login-form
"
).
remove
();
$
(
"
.saveBtn
"
).
show
();
...
...
@@ -274,4 +277,3 @@ $(document).ready(function(){
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