Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
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
Roque
erp5
Commits
5df13c14
Commit
5df13c14
authored
Apr 09, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: add post gadget becomes generic
- wip: change name to add document
parent
a5397a63
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
48 deletions
+56
-48
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_post_js.js
..._page_module/gadget_officejs_erp5_page_ojs_add_post_js.js
+10
-4
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_post_js.xml
...page_module/gadget_officejs_erp5_page_ojs_add_post_js.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_post_list_js.js
...web_page_module/gadget_officejs_erp5_page_post_list_js.js
+42
-40
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_post_list_js.xml
...eb_page_module/gadget_officejs_erp5_page_post_list_js.xml
+2
-2
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_post_js.js
View file @
5df13c14
...
...
@@ -16,7 +16,7 @@
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
render
"
,
function
()
{
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
gadget
=
this
,
doc_id
;
return
RSVP
.
Queue
()
.
push
(
function
()
{
...
...
@@ -28,11 +28,17 @@
.
push
(
function
(
result
)
{
var
doc
=
{
title
:
"
Untitled Document
"
,
//TODO: this must be the parent thread reference (or 'base' post ref?)
source_reference
:
"
some-fake-thread-id
"
,
portal_type
:
result
[
0
],
parent_relative_url
:
result
[
1
]
};
},
key
,
doc_key
;
for
(
key
in
options
)
{
if
(
options
.
hasOwnProperty
(
key
))
{
if
(
key
.
startsWith
(
"
my_
"
))
{
doc_key
=
key
.
replace
(
"
my_
"
,
""
);
doc
[
doc_key
]
=
options
[
key
];
}
}
}
return
gadget
.
jio_post
(
doc
);
})
.
push
(
function
(
id
)
{
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_ojs_add_post_js.xml
View file @
5df13c14
...
...
@@ -269,7 +269,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.
53018.33015.5589
3
</string>
</value>
<value>
<string>
974.
60313.36900.2104
3
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>
1554
392914.44
</float>
<float>
1554
829075.96
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_post_list_js.js
View file @
5df13c14
...
...
@@ -18,8 +18,10 @@
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
generateJsonRenderForm
"
,
function
(
gadget
)
{
//this will be the id of the thread that contains this post list
var
fake_thread_uid
=
"
thread-
"
+
(
"
0000
"
+
((
Math
.
random
()
*
Math
.
pow
(
36
,
4
))
|
0
).
toString
(
36
)).
slice
(
-
4
),
//hardcoded form_definition (this should come from erp5 form)
var
form_definition
=
{
form_definition
=
{
_debug
:
"
traverse
"
,
pt
:
"
form_view
"
,
title
:
"
Post
"
,
...
...
@@ -51,7 +53,7 @@
},
action
:
"
Base_edit
"
,
update_action
:
""
,
_links
:
{
"
type
"
:
{
name
:
""
},
"
action_object_new_content_action
"
:
{
"
page
"
:
"
ojs_add_post
"
}
}
_links
:
{
"
type
"
:
{
name
:
""
},
"
action_object_new_content_action
"
:
{
page
:
"
ojs_add_post
"
,
my_source_reference
:
fake_thread_uid
}
}
},
form_json
=
{
erp5_document
:
{
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_post_list_js.xml
View file @
5df13c14
...
...
@@ -269,7 +269,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.
59028.6381.42171
</string>
</value>
<value>
<string>
974.
60320.21280.62788
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>
1554
752043.96
</float>
<float>
1554
829461.22
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
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