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
d353e507
Commit
d353e507
authored
Feb 14, 2018
by
Alina Habibulina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+ week score v3
parent
088145dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
33 deletions
+34
-33
src/main/webapp/js/Player.js
src/main/webapp/js/Player.js
+34
-33
No files found.
src/main/webapp/js/Player.js
View file @
d353e507
...
...
@@ -92,40 +92,39 @@ var portal = {
});
var
formExistance
;
////формирование Пн и Вскр для формирования поискового запроса по форме
var
cur_date
=
new
Date
();
var
StrPeriod
=
timeComputing
(
cur_date
);
//строка Пнд+" "+Вскр
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
){
////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
();
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
'
,
function
(){
formExistance
=
false
;});
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
();
portal
.
player
.
view
.
setEditable
(
true
);
portal
.
player
.
showFormData
(
"
097a00e2-430c-436d-92e5-c2ea8edc5b30
"
,
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
'
);
}
});
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
'
);
}
});
},
saveData
:
function
(){
...
...
@@ -136,8 +135,6 @@ var portal = {
return
;
}
countingScore
();
var
data
=
portal
.
player
.
model
.
asfDataId
;
portal
.
player
.
saveFormData
(
function
(
data
){
if
(
_
.
isUndefined
(
data
)){
...
...
@@ -157,12 +154,16 @@ 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
);
portal
.
player
.
model
.
on
(
"
valueChange
"
,
function
(){
countingScore
();
});
}
};
function
countingScore
(){
////Расчет итогового количества часов происходит при нажатии кнопки сохранения
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
;
for
(
var
i
=
10
;
i
<
table
.
length
;
i
++
){
var
row
=
Number
.
parseInt
(
i
/
10
);
...
...
@@ -251,7 +252,7 @@ var authFunc = function(){
AS
.
SERVICES
.
showWaitWindow
();
AS
.
OPTIONS
.
login
=
$
(
"
input#login
"
).
val
();
AS
.
OPTIONS
.
password
=
$
(
"
input#password
"
).
val
();
portal
.
createPlayer
(
user
);
portal
.
createPlayer
();
$
(
"
.form_player_container
"
).
show
();
$
(
"
.login-form
"
).
remove
();
$
(
"
.saveBtn
"
).
show
();
...
...
@@ -275,5 +276,5 @@ $(document).ready(function(){
$
(
"
.saveBtn
"
).
on
(
"
click
"
,
function
(
event
){
AS
.
SERVICES
.
showWaitWindow
();
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