Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
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
Arnaud Véron
slapos.core
Commits
bd01371a
Commit
bd01371a
authored
Jun 30, 2022
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_jio: Fixup add related event
Change to use the proper API from ticket_slap_interface_workflow.
parent
0bfe0d03
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
121 additions
and
75 deletions
+121
-75
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_add_related_event_html.html
...ule/rjs_gadget_erp5_page_slap_add_related_event_html.html
+1
-5
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_add_related_event_html.xml
...dule/rjs_gadget_erp5_page_slap_add_related_event_html.xml
+2
-2
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_add_related_event_js.js
..._module/rjs_gadget_erp5_page_slap_add_related_event_js.js
+32
-66
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_add_related_event_js.xml
...module/rjs_gadget_erp5_page_slap_add_related_event_js.xml
+2
-2
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Ticket_requestEvent.py
...portal_skins/slapos_hal_json_style/Ticket_requestEvent.py
+22
-0
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Ticket_requestEvent.xml
...ortal_skins/slapos_hal_json_style/Ticket_requestEvent.xml
+62
-0
No files found.
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_add_related_event_html.html
View file @
bd01371a
...
@@ -5,12 +5,8 @@
...
@@ -5,12 +5,8 @@
data-i18n=Title
data-i18n=Title
data-i18n=Include your message
data-i18n=Include your message
data-i18n=Your Message
data-i18n=Your Message
data-i18n=Source
data-i18n=Follow up
data-i18n=Portal Type
data-i18n=Web Message
data-i18n=Parent Relative Url
data-i18n=New Message
data-i18n=New Message
data-i18n=New Message created.
-->
-->
<head>
<head>
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_add_related_event_html.xml
View file @
bd01371a
...
@@ -283,7 +283,7 @@
...
@@ -283,7 +283,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
982.16656.9604.44475
</string>
</value>
<value>
<string>
1001.17455.63633.53794
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -301,7 +301,7 @@
...
@@ -301,7 +301,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
1
583924073.29
</float>
<float>
1
656611535.78
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_add_related_event_js.js
View file @
bd01371a
...
@@ -16,6 +16,8 @@
...
@@ -16,6 +16,8 @@
.
declareAcquiredMethod
(
"
jio_putAttachment
"
,
"
jio_putAttachment
"
)
.
declareAcquiredMethod
(
"
jio_putAttachment
"
,
"
jio_putAttachment
"
)
.
declareAcquiredMethod
(
"
jio_get
"
,
"
jio_get
"
)
.
declareAcquiredMethod
(
"
jio_get
"
,
"
jio_get
"
)
.
declareAcquiredMethod
(
"
getTranslationList
"
,
"
getTranslationList
"
)
.
declareAcquiredMethod
(
"
getTranslationList
"
,
"
getTranslationList
"
)
.
declareAcquiredMethod
(
"
notifySubmitting
"
,
"
notifySubmitting
"
)
.
declareAcquiredMethod
(
"
notifySubmitted
"
,
"
notifySubmitted
"
)
/////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// declared methods
// declared methods
...
@@ -26,17 +28,35 @@
...
@@ -26,17 +28,35 @@
.
onEvent
(
'
submit
'
,
function
()
{
.
onEvent
(
'
submit
'
,
function
()
{
var
gadget
=
this
;
var
gadget
=
this
;
return
gadget
.
getDeclaredGadget
(
'
form_view
'
)
return
gadget
.
notifySubmitting
()
.
push
(
function
()
{
return
gadget
.
getDeclaredGadget
(
'
form_view
'
);
})
.
push
(
function
(
form_gadget
)
{
.
push
(
function
(
form_gadget
)
{
return
form_gadget
.
getContent
();
return
RSVP
.
all
([
form_gadget
.
getContent
(),
gadget
.
getSetting
(
'
hateoas_url
'
)]);
})
})
.
push
(
function
(
doc
)
{
.
push
(
function
(
result
)
{
return
gadget
.
jio_post
(
doc
);
var
doc
=
result
[
0
],
url
=
result
[
1
];
return
gadget
.
jio_putAttachment
(
gadget
.
state
.
jio_key
,
url
+
gadget
.
state
.
jio_key
+
"
/Ticket_requestEvent
"
,
{
title
:
doc
.
title
,
text_content
:
doc
.
text_content
});
})
})
/*.push(function (attachment) {
return jIO.util.readBlobAsText(attachment.target.response);
})
.push(function (response) {
return JSON.parse(response.target.result);
})*/
.
push
(
function
()
{
return
gadget
.
notifySubmitted
({
message
:
gadget
.
message_translation
,
status
:
'
success
'
})
.
push
(
function
()
{
.
push
(
function
()
{
// Workaround, find a way to open document without break gadget.
return
gadget
.
redirect
({
"
command
"
:
"
change
"
,
return
gadget
.
redirect
({
"
command
"
:
"
change
"
,
"
options
"
:
{
"
jio_key
"
:
gadget
.
state
.
jio_key
,
"
options
"
:
{
"
jio_key
"
:
gadget
.
state
.
jio_key
,
"
page
"
:
"
slap_controller
"
}});
"
page
"
:
"
slap_controller
"
}
});
});
});
});
})
})
...
@@ -52,12 +72,8 @@
...
@@ -52,12 +72,8 @@
"
Title
"
,
"
Title
"
,
"
Include your message
"
,
"
Include your message
"
,
"
Your Message
"
,
"
Your Message
"
,
"
Source
"
,
"
New Message
"
,
"
Follow up
"
,
"
New Message created.
"
"
Portal Type
"
,
"
Web Message
"
,
"
Parent Relative Url
"
,
"
New Message
"
];
];
gadget
.
state
.
jio_key
=
options
.
jio_key
;
gadget
.
state
.
jio_key
=
options
.
jio_key
;
...
@@ -71,7 +87,8 @@
...
@@ -71,7 +87,8 @@
]);
]);
})
})
.
push
(
function
(
result
)
{
.
push
(
function
(
result
)
{
page_title_translation
=
result
[
3
][
9
];
page_title_translation
=
result
[
3
][
4
];
gadget
.
message_translation
=
result
[
3
][
5
];
return
result
[
0
].
render
({
return
result
[
0
].
render
({
erp5_document
:
{
erp5_document
:
{
"
_embedded
"
:
{
"
_view
"
:
{
"
_embedded
"
:
{
"
_view
"
:
{
...
@@ -96,50 +113,6 @@
...
@@ -96,50 +113,6 @@
"
key
"
:
"
text_content
"
,
"
key
"
:
"
text_content
"
,
"
hidden
"
:
0
,
"
hidden
"
:
0
,
"
type
"
:
"
TextAreaField
"
"
type
"
:
"
TextAreaField
"
},
"
my_source
"
:
{
"
description
"
:
""
,
"
title
"
:
result
[
3
][
4
],
"
default
"
:
result
[
1
],
"
css_class
"
:
""
,
"
required
"
:
1
,
"
editable
"
:
1
,
"
key
"
:
"
source
"
,
"
hidden
"
:
1
,
"
type
"
:
"
StringField
"
},
"
my_follow_up
"
:
{
"
description
"
:
""
,
"
title
"
:
result
[
3
][
5
],
"
default
"
:
gadget
.
state
.
jio_key
,
"
css_class
"
:
""
,
"
required
"
:
1
,
"
editable
"
:
1
,
"
key
"
:
"
follow_up
"
,
"
hidden
"
:
1
,
"
type
"
:
"
StringField
"
},
"
my_portal_type
"
:
{
"
description
"
:
result
[
3
][
0
],
"
title
"
:
result
[
3
][
6
],
"
default
"
:
"
Web Message
"
,
"
css_class
"
:
""
,
"
required
"
:
1
,
"
editable
"
:
1
,
"
key
"
:
"
portal_type
"
,
"
hidden
"
:
1
,
"
type
"
:
"
StringField
"
},
"
my_parent_relative_url
"
:
{
"
description
"
:
""
,
"
title
"
:
result
[
3
][
8
],
"
default
"
:
"
event_module
"
,
"
css_class
"
:
""
,
"
required
"
:
1
,
"
editable
"
:
1
,
"
key
"
:
"
parent_relative_url
"
,
"
hidden
"
:
1
,
"
type
"
:
"
StringField
"
}
}
}},
}},
"
_links
"
:
{
"
_links
"
:
{
...
@@ -152,18 +125,11 @@
...
@@ -152,18 +125,11 @@
form_definition
:
{
form_definition
:
{
group_list
:
[[
group_list
:
[[
"
center
"
,
"
center
"
,
[[
"
my_title
"
],
[
"
my_text_content
"
],
[
"
my_follow_up
"
],
[[
"
my_title
"
],
[
"
my_text_content
"
]]
[
"
my_portal_type
"
],
[
"
my_parent_relative_url
"
],
[
"
my_follow_up
"
],
[
"
my_source
"
]]
]]
]]
}
}
});
});
})
})
.
push
(
function
()
{
return
gadget
.
updatePanel
({
jio_key
:
"
support_request_module
"
});
})
.
push
(
function
()
{
.
push
(
function
()
{
return
RSVP
.
all
([
return
RSVP
.
all
([
gadget
.
getUrlFor
({
command
:
'
history_previous
'
})
gadget
.
getUrlFor
({
command
:
'
history_previous
'
})
...
...
master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_add_related_event_js.xml
View file @
bd01371a
...
@@ -290,7 +290,7 @@
...
@@ -290,7 +290,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
serial
</string>
</key>
<key>
<string>
serial
</string>
</key>
<value>
<string>
987.11837.51741.39355
</string>
</value>
<value>
<string>
1001.17558.20370.27699
</string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
state
</string>
</key>
<key>
<string>
state
</string>
</key>
...
@@ -308,7 +308,7 @@
...
@@ -308,7 +308,7 @@
</tuple>
</tuple>
<state>
<state>
<tuple>
<tuple>
<float>
16
02260993.65
</float>
<float>
16
56617846.12
</float>
<string>
UTC
</string>
<string>
UTC
</string>
</tuple>
</tuple>
</state>
</state>
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Ticket_requestEvent.py
0 → 100644
View file @
bd01371a
import
json
portal
=
context
.
getPortalObject
()
person
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
request
=
context
.
REQUEST
response
=
request
.
RESPONSE
if
person
is
None
:
response
.
setStatus
(
403
)
else
:
request_kw
=
{
"event_title"
:
title
,
"event_content"
:
text_content
,
"event_source"
:
person
.
getRelativeUrl
()
}
context
.
requestEvent
(
**
request_kw
)
event_relative_url
=
request
.
get
(
'event_relative_url'
)
response
.
setHeader
(
'Content-Type'
,
"application/json"
)
return
json
.
dumps
({
"relative_url"
:
event_relative_url
})
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Ticket_requestEvent.xml
0 → 100644
View file @
bd01371a
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
title, text_content
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Ticket_requestEvent
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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