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
88a12aab
Commit
88a12aab
authored
Apr 16, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: preparing custom js code in configuration side
- new post module action temporarily removed
parent
321a90cf
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
53 additions
and
24 deletions
+53
-24
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_discussion_tool_appcache.xml
..._page_module/gadget_officejs_discussion_tool_appcache.xml
+3
-3
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_discussion_tool_configuration.xml
..._module/gadget_officejs_discussion_tool_configuration.xml
+3
-3
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
+11
-2
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
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_offline_js.js
...web_page_module/gadget_officejs_page_action_offline_js.js
+11
-3
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_offline_js.xml
...eb_page_module/gadget_officejs_page_action_offline_js.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.js
.../web_page_module/gadget_officejs_page_handle_action_js.js
+19
-7
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.xml
...web_page_module/gadget_officejs_page_handle_action_js.xml
+2
-2
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_discussion_tool_appcache.xml
View file @
88a12aab
...
...
@@ -254,7 +254,7 @@ hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_o
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FHTML%20Post%2F1&view=view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FHTML%20Post%2F2&view=view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FHTML%20Post%2F3&view=view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FPost%20Module%2F2&view=view&appcache=1\n
#
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FPost%20Module%2F2&view=view&appcache=1\n
\n
gadget_erp5_field_listbox.html\n
gadget_erp5_field_listbox.js\n
...
...
@@ -741,7 +741,7 @@ NETWORK:\n
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
97
4.64716.44616.5683
2
</string>
</value>
<value>
<string>
97
5.4607.38713.1674
2
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -759,7 +759,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>
1555
095850.49
</float>
<float>
1555
421020.18
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_discussion_tool_configuration.xml
View file @
88a12aab
...
...
@@ -121,7 +121,7 @@ hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_o
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FHTML%20Post%2F1&view=view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FHTML%20Post%2F2&view=view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FHTML%20Post%2F3&view=view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FPost%20Module%2F2&view=view&appcache=1\n
#
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FPost%20Module%2F2&view=view&appcache=1\n
\n
NETWORK:\n
*
...
...
@@ -267,7 +267,7 @@ NETWORK:\n
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.
50440.27268.56285
</string>
</value>
<value>
<string>
974.
64630.63649.43178
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -285,7 +285,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>
1555
088098.27
</float>
<float>
1555
418535.58
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_post_list_js.js
View file @
88a12aab
...
...
@@ -20,7 +20,16 @@
.
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)
// get these (portal_type, etc) from getSettings
action_info
=
{
page
:
"
handle_action
"
,
action
:
"
new
"
,
action_type
:
"
object_jio_js_script
"
,
portal_type
:
"
HTML Post
"
,
parent_portal_type
:
"
Post Module
"
,
my_source_reference
:
fake_thread_uid
},
//hardcoded form_definition (this should come from erp5 form)
form_definition
=
{
_debug
:
"
traverse
"
,
pt
:
"
form_view
"
,
...
...
@@ -53,7 +62,7 @@
},
action
:
"
Base_edit
"
,
update_action
:
""
,
_links
:
{
"
type
"
:
{
name
:
""
},
"
action_object_new_content_action
"
:
{
page
:
"
handle_action
"
,
action
:
"
new
"
,
my_source_reference
:
fake_thread_uid
}
}
_links
:
{
"
type
"
:
{
name
:
""
},
"
action_object_new_content_action
"
:
action_info
}
},
form_json
=
{
erp5_document
:
{
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_post_list_js.xml
View file @
88a12aab
...
...
@@ -269,7 +269,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
97
4.64716.929.1945
</string>
</value>
<value>
<string>
97
5.4587.35735.7611
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>
1555
093212.0
</float>
<float>
1555
417799.99
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_offline_js.js
View file @
88a12aab
...
...
@@ -55,11 +55,12 @@
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
gadget
=
this
,
action_info_list
=
[],
document_title
;
document_title
,
portal_type
;
return
gadget
.
jio_get
(
options
.
jio_key
)
.
push
(
function
(
document
)
{
var
parent
=
"
portal_types/
"
+
document
.
portal_type
,
query
=
'
portal_type: "Action Information" AND parent_relative_url: "
'
+
parent
+
'
"
'
;
portal_type
=
document
.
portal_type
;
document_title
=
document
.
title
;
return
gadget
.
jio_allDocs
({
query
:
query
});
})
...
...
@@ -74,7 +75,7 @@
})
.
push
(
function
(
action_document_list
)
{
var
url_for_parameter_list
=
[],
i
=
0
,
page
,
action_key
,
action_doc
;
page
,
action_key
,
action_doc
,
action_settings
;
for
(
action_key
in
action_document_list
)
{
if
(
action_document_list
.
hasOwnProperty
(
action_key
))
{
page
=
"
handle_action
"
;
...
...
@@ -82,7 +83,14 @@
if
(
action_doc
.
reference
===
"
view
"
||
action_doc
.
reference
===
"
jio_view
"
)
{
page
=
"
ojs_controller
"
;
}
url_for_parameter_list
.
push
({
command
:
'
change
'
,
options
:
{
page
:
page
,
action
:
action_doc
.
reference
}});
action_settings
=
{
page
:
page
,
action
:
action_doc
.
reference
,
action_type
:
action_doc
.
action_type
,
parent_portal_type
:
portal_type
,
portal_type
:
portal_type
};
url_for_parameter_list
.
push
({
command
:
'
change
'
,
options
:
action_settings
});
action_info_list
[
i
]
=
{
reference
:
action_doc
.
reference
,
title
:
action_doc
.
title
};
i
+=
1
;
}
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_offline_js.xml
View file @
88a12aab
...
...
@@ -228,7 +228,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
97
4.63448.18577.4829
</string>
</value>
<value>
<string>
97
5.4589.24119.47394
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>
1555
096738.2
</float>
<float>
1555
418496.64
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.js
View file @
88a12aab
/*global window, rJS, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3 */
/*jslint evil: true */
(
function
(
document
,
window
,
rJS
,
RSVP
)
{
"
use strict
"
;
...
...
@@ -25,12 +26,15 @@
var
gadget
=
this
,
child_gadget_url
=
'
gadget_erp5_pt_form_view_editable.html
'
,
portal_type
,
parent_portal_type
,
parent_relative_url
,
form_definition
;
parent_relative_url
,
form_definition
,
action_type
;
return
RSVP
.
Queue
()
.
push
(
function
()
{
return
RSVP
.
all
([
gadget
.
getUrlParameter
(
"
action
"
),
//maybe these settings should come as url parameters too
gadget
.
getUrlParameter
(
"
action_type
"
),
gadget
.
getUrlParameter
(
"
portal_type
"
),
gadget
.
getUrlParameter
(
"
parent_portal_type
"
),
gadget
.
getUrlParameter
(
"
parent_relative_url
"
),
gadget
.
getSetting
(
'
portal_type
'
),
gadget
.
getSetting
(
'
parent_relative_url
'
),
gadget
.
getSetting
(
'
parent_portal_type
'
),
...
...
@@ -39,18 +43,26 @@
})
.
push
(
function
(
result
)
{
action_reference
=
result
[
0
];
portal_type
=
result
[
1
];
parent_relative_url
=
result
[
2
];
parent_portal_type
=
result
[
3
];
gadget_utils
=
result
[
4
];
action_type
=
result
[
1
];
portal_type
=
result
[
2
]
||
result
[
5
];
parent_portal_type
=
result
[
3
]
||
result
[
6
];
parent_relative_url
=
result
[
4
]
||
result
[
7
];
gadget_utils
=
result
[
8
];
// This is the custom code to handle each specific action
if
(
action_reference
===
"
new
"
)
{
var
doc_options
=
{};
doc_options
.
portal_type
=
portal_type
;
doc_options
.
parent_relative_url
=
parent_relative_url
;
return
gadget_utils
.
getFormDefinition
(
parent_portal_type
,
action_reference
)
// Temporarily hardcoded until new action in post module is fixed
return
gadget_utils
.
getFormDefinition
(
"
HTML Post
"
,
"
jio_view
"
)
//parent_portal_type, action_reference)
.
push
(
function
(
result
)
{
form_definition
=
result
;
// custom code will come from configuration side (action form)
if
(
action_type
===
"
object_jio_js_script
"
)
{
if
(
form_definition
.
fields_raw_properties
.
hasOwnProperty
(
"
gadget_field_action_js_script
"
))
{
eval
(
form_definition
.
fields_raw_properties
.
gadget_field_action_js_script
.
values
.
renderjs_extra
[
0
][
0
]);
}
}
return
gadget_utils
.
createDocument
(
doc_options
);
})
.
push
(
function
(
jio_key
)
{
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.xml
View file @
88a12aab
...
...
@@ -269,7 +269,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
97
4.64758.23503.51456
</string>
</value>
<value>
<string>
97
5.4605.37710.17527
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>
1555
096705.62
</float>
<float>
1555
418811.51
</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