Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sd-doc
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
sd-doc
Commits
64005dad
Commit
64005dad
authored
Jan 24, 2018
by
Valentin Skripnikov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
-
parent
fdea1e42
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
337 additions
and
0 deletions
+337
-0
guide/_static/html/integration/extfp-usecases/uc6/index.css
guide/_static/html/integration/extfp-usecases/uc6/index.css
+85
-0
guide/_static/html/integration/extfp-usecases/uc6/index.html
guide/_static/html/integration/extfp-usecases/uc6/index.html
+50
-0
guide/_static/html/integration/extfp-usecases/uc6/index.js
guide/_static/html/integration/extfp-usecases/uc6/index.js
+146
-0
guide/_static/html/integration/extfp-usecases/uc6/uc6.js
guide/_static/html/integration/extfp-usecases/uc6/uc6.js
+47
-0
guide/integration.rst
guide/integration.rst
+1
-0
guide/integration/extfp-usecases/uc6.rst
guide/integration/extfp-usecases/uc6.rst
+8
-0
No files found.
guide/_static/html/integration/extfp-usecases/uc6/index.css
0 → 100644
View file @
64005dad
body
,
div
,
span
,
input
,
button
{
font-family
:
"Droid Sans"
,
arial
,
serif
;
font-size
:
14px
;
box-sizing
:
border-box
;
-moz-box-sizing
:
border-box
;
-webkit-box-sizing
:
border-box
;
}
.hidden
{
display
:
none
;
}
.portal_button
{
background-color
:
#df6c6d
;
border-color
:
#df6c6d
;
color
:
#ffffff
;
padding-left
:
20px
;
padding-right
:
20px
;
height
:
30px
;
border
:
none
;
margin-left
:
10px
;
margin-right
:
10px
;
}
.portal-center
{
text-align
:
center
;
vertical-align
:
top
}
.portal-toolbar
{
padding
:
10px
;
color
:
#6e8ebd
}
#form_player_container
{
/*border: 3px solid #6e8ebd;*/
outline
:
1px
#ffffff
solid
;
margin-left
:
auto
;
margin-right
:
auto
;
width
:
1000px
;
min-height
:
400px
;
background-color
:
#ffffff
;
padding-top
:
20px
;
padding-bottom
:
60px
;
margin-bottom
:
20px
;
}
#form_player_div
{
width
:
1000px
;
min-height
:
200px
;
}
#search_input
{
background-color
:
#6e8ebd
;
border
:
1px
#6e8ebd
solid
;
height
:
30px
;
width
:
200px
;
padding-left
:
10px
}
#send_button
{
margin-left
:
auto
;
margin-right
:
auto
;
width
:
200px
;
margin-bottom
:
20px
;
}
#message
{
background-color
:
#ffffff
;
border
:
3px
solid
#df6c6d
;
outline
:
1px
#932121
solid
;
z-index
:
2
;
position
:
absolute
;
top
:
100px
;
left
:
30%
;
color
:
#303030
;
padding
:
10px
;
max-width
:
40%
;
min-width
:
40%
;
}
#message_text
{
color
:
#303030
;
}
guide/_static/html/integration/extfp-usecases/uc6/index.html
0 → 100644
View file @
64005dad
<!doctype html>
<html>
<head>
<meta
charset=
"utf-8"
>
<script>
FORM_PLAYER_URL_PREFIX
=
"
http://demoextfp.synergy.tm/Synergy/
"
;
</script>
<!-- LOCALIZATION LIBRARY -->
<script
src=
"http://demoextfp.synergy.tm/Synergy/js/i18next.min.js"
type=
"application/javascript"
></script>
<!-- JS FORMS -->
<link
rel=
"stylesheet"
href=
"http://demoextfp.synergy.tm/Synergy/js/form.player.css"
/>
<script
src=
"http://demoextfp.synergy.tm/Synergy/js/vendor.js"
type=
"text/javascript"
></script>
<script
src=
"http://demoextfp.synergy.tm/Synergy/js/form.player.js"
type=
"text/javascript"
></script>
<!-- PORTAL SCRIPTS AND STYLESHEET -->
<script
src=
"index.js"
type=
"text/javascript"
></script>
<link
href=
"index.css"
rel=
"stylesheet"
/>
<script
src=
"uc6.js"
type=
"text/javascript"
></script>
</head>
<body>
<div
style=
"z-index: 0"
class=
"portal-center"
>
<div
class=
"portal-toolbar"
id=
"portal_toolbar"
>
<span>
Введите номер заявки
</span><input
type=
"text"
id=
"search_input"
/>
<button
id=
"search_button"
class=
"portal_button search_button"
value=
"SEARCH"
onclick=
"portal.searchData()"
>
SEARCH
</button>
<button
id=
"create_button"
class=
"portal_button create_button"
value=
"CREATE"
onclick=
"portal.createPlayer()"
>
CREATE
</button>
</div>
<div
id=
"form_player_container"
>
<div
id=
"form_player_div"
>
</div>
</div>
<button
id=
"send_button"
class=
"portal_button hidden"
value=
"SEND"
onclick=
"portal.saveData()"
>
SEND
</button>
</div>
<div
id=
"message"
class=
"hidden"
>
<span
id=
"message_text"
></span>
</div>
</body>
</html>
guide/_static/html/integration/extfp-usecases/uc6/index.js
0 → 100644
View file @
64005dad
'
use strict
'
;
var
synergyURL
=
"
http://demoextfp.synergy.tm/Synergy/
"
;
var
tokenServiceURL
=
"
http://demoextfp.synergy.tm/TokenService/rest/tokenService/getToken
"
;
AS
.
OPTIONS
.
locale
=
"
ru
"
;
AS
.
OPTIONS
.
coreUrl
=
"
http://demoextfp.synergy.tm/Synergy/
"
;
var
portal
=
{
player
:
null
,
/**
* показать сообщение об ошибке
* @param{string} message
*/
showMessage
:
function
(
message
)
{
jQuery
(
"
#message_text
"
).
html
(
message
);
jQuery
(
"
#message
"
).
show
();
},
/**
* скрыть панель сообщений
*/
hideMessage
:
function
()
{
jQuery
(
"
#message
"
).
hide
();
},
/**
* очистить текущий проигрыватель форм
*/
clearPlayer
:
function
()
{
if
(
portal
.
player
)
{
portal
.
player
.
destroy
();
}
jQuery
(
"
#send_button
"
).
hide
();
portal
.
player
=
null
;
},
/**
* добавить новый проигрыватель форм
*/
createPlayer
:
function
(
dataId
)
{
portal
.
clearPlayer
();
portal
.
player
=
AS
.
FORMS
.
createPlayer
();
AS
.
FORMS
.
bus
.
on
(
AS
.
FORMS
.
EVENT_TYPE
.
formShow
,
function
(
event
,
model
,
view
)
{
model
.
on
(
AS
.
FORMS
.
EVENT_TYPE
.
dataLoad
,
function
()
{
});
if
(
view
.
editable
)
{
jQuery
(
"
#send_button
"
).
show
();
jQuery
(
"
#send_button
"
).
removeAttr
(
'
disabled
'
,
'
disabled
'
);
}
});
portal
.
player
.
view
.
setEditable
(
_
.
isUndefined
(
dataId
));
portal
.
player
.
showFormData
(
"
7dd2a298-0cb7-4ec7-ba67-ecc59c86e1aa
"
,
0
,
dataId
);
portal
.
player
.
view
.
appendTo
(
$
(
'
#form_player_div
'
));
portal
.
player
.
model
.
on
(
"
valueChange
"
,
function
()
{
portal
.
hideMessage
();
});
},
/**
* искать форму по указанному номеру
*/
searchData
:
function
()
{
var
counterValue
=
jQuery
(
"
#search_input
"
).
val
();
AS
.
FORMS
.
ApiUtils
.
simpleAsyncGet
(
"
rest/api/asforms/search?formUUID=7dd2a298-0cb7-4ec7-ba67-ecc59c86e1aa&search=
"
+
encodeURIComponent
(
counterValue
)
+
"
&field=counter&type=exact
"
,
function
(
data
)
{
if
(
data
===
null
||
!
(
data
instanceof
Array
)
||
data
.
length
===
0
)
{
portal
.
showMessage
(
"
Заявка с указанным номером не найдена
"
);
return
;
}
var
dataId
=
data
[
0
];
portal
.
createPlayer
(
dataId
);
});
},
/**
* сохранить данные, получить их, отобразить номер счетчика для дальнейшего поиска
*/
saveData
:
function
()
{
var
errors
=
portal
.
player
.
model
.
getErrors
();
if
(
errors
.
length
>
0
)
{
portal
.
showMessage
(
"
Введите все обязательные поля
"
);
return
;
}
jQuery
(
"
#send_button
"
).
attr
(
'
disabled
'
,
'
disabled
'
);
var
counterValue
=
portal
.
player
.
model
.
getModelWithId
(
'
counter
'
).
getValue
();
AS
.
FORMS
.
ApiUtils
.
simpleAsyncGet
(
"
rest/api/registry/create_doc?registryID=59ad0163-2eac-460a-af1f-c0f7c7757dec
"
,
function
(
result
)
{
if
(
result
.
errorCode
!=
0
)
{
portal
.
showMessage
(
"
Во время сохранения данных по форме произошли ошибки. Обратитесь к администратору
"
);
return
;
}
portal
.
player
.
model
.
asfDataId
=
result
.
dataUUID
;
portal
.
player
.
saveFormData
(
function
(
result
)
{
if
(
_
.
isUndefined
(
result
))
{
portal
.
showMessage
(
"
Во время сохранения данных по форме произошли ошибки. Обратитесь к администратору
"
);
return
;
}
AS
.
FORMS
.
ApiUtils
.
simpleAsyncGet
(
'
rest/api/asforms/data/
'
+
result
,
function
(
data
)
{
data
.
data
.
forEach
(
function
(
value
)
{
if
(
value
.
id
===
'
counter
'
)
{
counterValue
=
value
.
value
;
portal
.
showMessage
(
"
Ваша заявка была принята в обработку. Номер заявки -
"
+
counterValue
);
}
});
});
portal
.
clearPlayer
();
});
});
}
};
$
(
document
).
ready
(
function
()
{
jQuery
.
ajax
({
method
:
"
GET
"
,
url
:
tokenServiceURL
+
"
?url=
"
+
synergyURL
,
success
:
function
(
data
)
{
AS
.
OPTIONS
.
login
=
"
$key
"
;
AS
.
OPTIONS
.
password
=
data
;
portal
.
createPlayer
();
}
});
jQuery
(
document
).
mouseup
(
function
(
e
)
{
var
container
=
jQuery
(
"
#message
"
);
if
(
!
container
.
is
(
e
.
target
)
&&
container
.
has
(
e
.
target
).
length
===
0
)
{
container
.
hide
();
}
});
});
guide/_static/html/integration/extfp-usecases/uc6/uc6.js
0 → 100644
View file @
64005dad
/**
* Created by m.milutin on 15.08.16.
*/
AS
.
FORMS
.
bus
.
on
(
AS
.
FORMS
.
EVENT_TYPE
.
formShow
,
function
(
event
,
model
,
view
)
{
var
playerModel
=
model
playerModel
.
on
(
AS
.
FORMS
.
EVENT_TYPE
.
dataLoad
,
function
()
{
// если проигрыватель открылся в режиме чтения то ничего не делаем
if
(
!
view
.
editable
)
{
return
;
}
var
user
=
playerModel
.
getModelWithId
(
"
author
"
).
getValue
();
if
(
user
===
null
)
{
return
;
}
var
personID
=
user
.
personID
;
var
IIN
=
""
;
// some logic for getting IIN from server
var
utf8
=
unescape
(
encodeURIComponent
(
personID
));
for
(
var
i
=
0
;
i
<
utf8
.
length
;
i
++
)
{
IIN
+=
utf8
.
charCodeAt
(
i
)
+
""
;
}
playerModel
.
getModelWithId
(
"
iin
"
).
setValue
(
IIN
);
//Предзаполненный шаблон заявки на материал
var
text
=
'
Необходимых материалов для ремонта кабинетов
'
+
'
<br/>1. ГКЛ ……………………………………………………………… м2.
'
+
'
<br/>2. Фанера ……………………………………………………….… м2.
'
+
'
<br/>3. Саморезы по дереву 35×3,5 ………………………………… шт.
'
+
'
<br/>4. Дюбель саморезы 75×4 ……………………………………… шт.
'
+
'
<br/>5. Подвесной потолок в комплекте …………………………… м2.
'
playerModel
.
getModelWithId
(
"
text
"
).
setValue
(
text
);
var
regLingRecordIdentifier
=
"
3d488280-5e22-11e6-8e70-fe5400e1ce06
"
;
playerModel
.
getModelWithId
(
"
registry
"
).
setValue
(
regLingRecordIdentifier
);
playerModel
.
getModelWithId
(
"
sum1
"
).
setValue
(
"
555999.99
"
);
playerModel
.
getModelWithId
(
"
sum2
"
).
setValue
(
"
666660.99
"
);
playerModel
.
getModelWithId
(
"
sum2
"
).
setValue
(
"
666660.99
"
);
playerModel
.
getModelWithId
(
"
date1
"
).
setValue
(
"
2016-08-15 00:00:00
"
);
playerModel
.
getModelWithId
(
"
date2
"
).
setValue
(
"
2016-08-16 00:00:00
"
);
playerModel
.
getModelWithId
(
"
note
"
).
setValue
(
"
Прошу закупить товар.
"
);
});
});
guide/integration.rst
View file @
64005dad
...
@@ -945,6 +945,7 @@ ARTA Synergy при загрузке внешнего web-модуля буде
...
@@ -945,6 +945,7 @@ ARTA Synergy при загрузке внешнего web-модуля буде
integration
/
extfp
-
usecases
/
uc3
integration
/
extfp
-
usecases
/
uc3
integration
/
extfp
-
usecases
/
uc4
integration
/
extfp
-
usecases
/
uc4
integration
/
extfp
-
usecases
/
uc5
integration
/
extfp
-
usecases
/
uc5
integration
/
extfp
-
usecases
/
uc6
Ссылки
на
модули
системы
и
их
внутренние
элементы
Ссылки
на
модули
системы
и
их
внутренние
элементы
-------------------------------------------------
-------------------------------------------------
...
...
guide/integration/extfp-usecases/uc6.rst
0 → 100644
View file @
64005dad
Вариант 6. Предварительное заполнение данных формы внешним порталом
-------------------------------------------------------------------
Расширение варианта 1. Перед отображением формы ее данные предзаполняются внешним порталом.
.. raw:: html
<iframe src="../../_static/html/integration/extfp-usecases/uc6/index.html" scrolling='no' height="930px" width="100%" style="border:1px solid grey;"></iframe>
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