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
aa9953c1
Commit
aa9953c1
authored
Feb 10, 2018
by
Alina Habibulina
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
+ open existance form
parent
a06f1446
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
25 deletions
+48
-25
src/main/webapp/js/Player.js
src/main/webapp/js/Player.js
+48
-25
No files found.
src/main/webapp/js/Player.js
View file @
aa9953c1
...
...
@@ -70,6 +70,7 @@ function ShowMessage(message){
};
var
portal
=
{
player
:
null
,
clearPlayer
:
function
()
{
...
...
@@ -88,6 +89,26 @@ 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/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
();
...
...
@@ -101,7 +122,7 @@ var portal = {
portal
.
player
.
view
.
appendTo
(
$
(
'
#form_player_div
'
));
}
},
'
json
'
);
}
},
saveData
:
function
(){
...
...
@@ -125,28 +146,30 @@ var portal = {
},
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
timeComputing
(
serverDateTime
){
function
zeroCheck
(
num
){
if
(
num
<
10
)
{
num
=
"
0
"
+
num
;}
return
num
;
};
var
serverDateTime
=
portal
.
player
.
model
.
getModelWithId
(
"
ts_date_created
"
).
value
;
var
WeekDay
=
new
Date
(
serverDateTime
);
WeekDay
=
WeekDay
.
getDay
();
var
shift
=
7
-
WeekDay
;
var
sunday
=
new
Date
(
serverDateTime
);
sunday
.
setDate
(
sunday
.
getDate
()
+
shift
);
var
monday
=
new
Date
(
serverDateTime
);
monday
.
setDate
(
sunday
.
getDate
()
-
6
);
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
());
portal
.
player
.
model
.
getModelWithId
(
"
ts_period_date_from
"
).
setValue
(
StrMonday
);
}
return
StrMonday
+
"
"
+
StrSunday
;
};
//переменные для WaitCircles();
...
...
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