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
Labels
Merge Requests
138
Merge Requests
138
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
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
133113b3
Commit
133113b3
authored
Apr 08, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: portal type actions are handle in handle action gadget instead of controller
parent
c4c3a11f
Changes
11
Show whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
863 additions
and
107 deletions
+863
-107
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.js
...e_module/gadget_officejs_controller_page_controller_js.js
+5
-58
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.xml
..._module/gadget_officejs_controller_page_controller_js.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_discussion_tool_appcache.xml
..._page_module/gadget_officejs_discussion_tool_appcache.xml
+10
-9
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
+1
-1
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
+20
-33
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_html.html
..._page_module/gadget_officejs_page_handle_action_html.html
+19
-0
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_html.xml
...b_page_module/gadget_officejs_page_handle_action_html.xml
+363
-0
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.js
.../web_page_module/gadget_officejs_page_handle_action_js.js
+80
-0
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.xml
...web_page_module/gadget_officejs_page_handle_action_js.xml
+359
-0
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.js
View file @
133113b3
...
...
@@ -43,23 +43,6 @@
return
result
;
}
function
getActionReference
(
view_url_parameters
)
{
//TODO: check how to properly add a parameter to gadget render option
// and not within the view url-parameter
var
parser
=
document
.
createElement
(
'
a
'
),
urlParams
,
action_reference
;
if
(
view_url_parameters
.
indexOf
(
"
#!change?
"
)
!==
-
1
)
{
parser
.
href
=
window
.
location
.
origin
+
"
/
"
+
view_url_parameters
.
replace
(
/#!change
?
/g
,
'
change?
'
);
urlParams
=
new
URLSearchParams
(
parser
.
search
);
action_reference
=
urlParams
.
get
(
"
n.action
"
);
}
else
{
action_reference
=
view_url_parameters
;
}
if
(
action_reference
===
undefined
||
action_reference
===
null
||
action_reference
===
"
view
"
)
{
action_reference
=
default_view
;
}
return
action_reference
;
}
rJS
(
window
)
/////////////////////////////////////////////////////////////////
...
...
@@ -82,36 +65,6 @@
// declared methods
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
handleAction
"
,
function
(
key
,
document
,
view_parameters
)
{
var
gadget
=
this
,
jio_key
=
key
,
jio_document
=
document
,
action_reference
=
getActionReference
(
view_parameters
);
// This is the custom code to handle this specific reply action
// it should be somewhere else to keep the controller generic
if
(
action_reference
==
"
reply
"
)
{
var
doc
,
title
=
document
.
title
;
if
(
!
title
.
startsWith
(
"
Re:
"
))
{
title
=
"
Re:
"
+
document
.
title
;
}
doc
=
{
title
:
title
,
//thread parent: same as base post
source_reference
:
document
.
source_reference
,
portal_type
:
document
.
portal_type
,
parent_relative_url
:
document
.
parent_relative_url
};
return
gadget
.
jio_post
(
doc
)
.
push
(
function
(
id
)
{
jio_key
=
id
;
return
gadget
.
jio_get
(
jio_key
);
})
.
push
(
function
(
created_doc
)
{
jio_document
=
created_doc
;
return
[
jio_key
,
jio_document
,
action_reference
];
});
}
return
[
jio_key
,
jio_document
,
action_reference
];
})
.
declareMethod
(
"
getFormDefinition
"
,
function
(
portal_type
,
action_reference
)
{
var
gadget
=
this
,
parent
=
"
portal_types/
"
+
portal_type
,
...
...
@@ -209,24 +162,18 @@
if
(
document
.
portal_type
===
undefined
)
{
throw
new
Error
(
'
Can not display document:
'
+
options
.
jio_key
);
}
return
gadget
.
getUrlParameter
(
"
view
"
);
})
.
push
(
function
(
view_parameters
)
{
return
gadget
.
handleAction
(
options
.
jio_key
,
document
,
view_parameters
);
})
.
push
(
function
(
result_list
)
{
return
gadget
.
getFormDefinition
(
document
.
portal_type
,
result_list
[
2
])
return
gadget
.
getFormDefinition
(
document
.
portal_type
,
options
.
view
)
.
push
(
function
(
form_definition
)
{
return
gadget
.
changeState
({
jio_key
:
result_list
[
0
]
,
doc
:
result_list
[
1
]
,
jio_key
:
options
.
jio_key
,
doc
:
document
,
child_gadget_url
:
child_gadget_url
,
form_definition
:
form_definition
,
editable
:
options
.
editable
,
view
:
result_list
[
2
]
,
view
:
options
.
view
,
//HARDCODED: following fields should be indicated by the configuration
has_more_views
:
false
,
has_more_actions
:
result_list
[
2
]
==
default_view
,
has_more_actions
:
options
.
view
==
"
view
"
,
is_form_list
:
false
});
});
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_controller_page_controller_js.xml
View file @
133113b3
...
...
@@ -225,7 +225,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.5
3016.56105.24149
</string>
</value>
<value>
<string>
974.5
9024.11735.30037
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -243,7 +243,7 @@
</tuple>
<state>
<tuple>
<float>
1554
391859.64
</float>
<float>
1554
751815.26
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_discussion_tool_appcache.xml
View file @
133113b3
...
...
@@ -225,7 +225,15 @@ gadget_erp5_pt_form_view_editable.html\n
gadget_erp5_pt_form_view_editable.js\n
gadget_erp5_page_action_offline.html\n
gadget_erp5_page_action_offline.js\n
gadget_erp5_page_handle_action.html\n
gadget_erp5_page_handle_action.js\n
gadget_officejs_discussion_tool_router.html\n
gadget_erp5_page_ojs_controller.html\n
gadget_erp5_page_ojs_controller.js\n
gadget_erp5_page_ojs_post_list.html\n
gadget_erp5_page_ojs_post_list.js\n
gadget_erp5_page_ojs_add_post.html\n
gadget_erp5_page_ojs_add_post.js\n
\n
#needed for appcachestorage sync\n
/\n
...
...
@@ -247,13 +255,6 @@ hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_types%2FHTML%2
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
\n
gadget_erp5_page_ojs_controller.html\n
gadget_erp5_page_ojs_controller.js\n
gadget_erp5_page_ojs_post_list.html\n
gadget_erp5_page_ojs_post_list.js\n
gadget_erp5_page_ojs_add_post.html\n
gadget_erp5_page_ojs_add_post.js\n
\n
gadget_erp5_field_listbox.html\n
gadget_erp5_field_listbox.js\n
\n
...
...
@@ -739,7 +740,7 @@ NETWORK:\n
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.5
1832.12674.167
08
</string>
</value>
<value>
<string>
974.5
9021.18848.281
08
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -757,7 +758,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>
1554
402100.2
</float>
<float>
1554
751524.94
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_post_list_js.js
View file @
133113b3
...
...
@@ -153,7 +153,7 @@
header_dict
.
save_action
=
true
;
}
}
if
(
tru
e
)
{
//TODO: configuration must indicate if there are more actions
if
(
fals
e
)
{
//TODO: configuration must indicate if there are more actions
header_dict
.
actions_url
=
url_list
[
1
];
}
if
(
url_list
[
7
])
{
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_erp5_page_post_list_js.xml
View file @
133113b3
...
...
@@ -269,7 +269,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.
49976.5658.2780
1
</string>
</value>
<value>
<string>
974.
59028.6381.4217
1
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>
1554
208935.58
</float>
<float>
1554
752043.96
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_action_offline_js.js
View file @
133113b3
...
...
@@ -19,22 +19,6 @@
* @param {Array} command_list - array of links obtained from ERP5 HATEOAS
*/
function
renderLinkList
(
gadget
,
title
,
icon
,
erp5_link_list
)
{
return
gadget
.
getUrlParameter
(
"
extended_search
"
)
.
push
(
function
(
query
)
{
// obtain RJS links from ERP5 links
return
RSVP
.
all
(
erp5_link_list
.
map
(
function
(
erp5_link
)
{
return
gadget
.
getUrlFor
({
"
command
"
:
'
change
'
,
"
options
"
:
{
"
view
"
:
UriTemplate
.
parse
(
erp5_link
.
href
).
expand
({
query
:
query
}),
"
page
"
:
undefined
}
});
})
);
})
.
push
(
function
(
url_list
)
{
// prepare links for template (replace @href for RJS link)
return
gadget
.
translateHtml
(
table_template
({
...
...
@@ -45,12 +29,11 @@
return
{
"
title
"
:
erp5_link
.
title
,
"
i18n
"
:
erp5_link
.
title
,
"
link
"
:
url_list
[
index
]
"
link
"
:
erp5_link_list
[
index
].
href
};
})
})
);
});
}
...
...
@@ -92,10 +75,14 @@
})
.
push
(
function
(
action_document_list
)
{
var
url_for_parameter_list
=
[],
i
=
0
,
action_key
,
action_doc
;
page
,
action_key
,
action_doc
;
for
(
action_key
in
action_document_list
)
{
page
=
"
handle_action
"
;
action_doc
=
action_document_list
[
action_key
];
url_for_parameter_list
.
push
({
command
:
'
change
'
,
options
:
{
page
:
"
ojs_controller
"
,
action
:
action_doc
.
reference
}});
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_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 @
133113b3
...
...
@@ -228,7 +228,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.5
2897.57392.44646
</string>
</value>
<value>
<string>
974.5
8836.59077.24849
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>
1554
384682.86
</float>
<float>
1554
740463.74
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_html.html
0 → 100644
View file @
133113b3
<!doctype html>
<html>
<head>
<meta
charset=
"utf-8"
>
<meta
name=
"viewport"
content=
"width=device-width, initial-scale=1"
>
<title>
OfficeJS Handle Action
</title>
<script
src=
"rsvp.js"
></script>
<script
src=
"renderjs.js"
></script>
<script
src=
"gadget_erp5_page_handle_action.js"
></script>
</head>
<body>
HANDLE ACTION
</body>
</html>
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_html.xml
0 → 100644
View file @
133113b3
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Web Page"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Change_local_roles_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
content_type
</string>
</key>
<value>
<string>
text/html
</string>
</value>
</item>
<item>
<key>
<string>
creators
</string>
</key>
<value>
<tuple>
<string>
cedric.le.ninivin
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
gadget_erp5_page_handle_action.html
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
gadget_officejs_page_handle_action_html
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
modification_date
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1455284351.46
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Web Page
</string>
</value>
</item>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
OfficeJS Handle Action
</string>
</value>
</item>
<item>
<key>
<string>
url_string
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
001
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
document_publication_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
edit_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
processing_status_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAU=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_alive
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1554734926.95
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.58750.16325.27204
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1554736092.72
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"5"
aka=
"AAAAAAAAAAU="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
detect_converted_file
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
external_processing_state
</string>
</key>
<value>
<string>
converted
</string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
0.0.0.0
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1554734850.15
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.js
0 → 100644
View file @
133113b3
/*global window, rJS, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
,
Blob
)
{
"
use strict
"
;
rJS
(
window
)
/////////////////////////////////////////////////////////////////
// Acquired methods
/////////////////////////////////////////////////////////////////
.
declareAcquiredMethod
(
"
updateHeader
"
,
"
updateHeader
"
)
.
declareAcquiredMethod
(
"
getSetting
"
,
"
getSetting
"
)
.
declareAcquiredMethod
(
"
jio_putAttachment
"
,
"
jio_putAttachment
"
)
.
declareAcquiredMethod
(
"
redirect
"
,
"
redirect
"
)
.
declareAcquiredMethod
(
"
jio_get
"
,
"
jio_get
"
)
.
declareAcquiredMethod
(
"
jio_post
"
,
"
jio_post
"
)
.
declareAcquiredMethod
(
"
getUrlParameter
"
,
"
getUrlParameter
"
)
/////////////////////////////////////////////////////////////////
// declared methods
/////////////////////////////////////////////////////////////////
.
declareMethod
(
"
handleAction
"
,
function
(
jio_key
,
portal_type
)
{
var
gadget
=
this
,
jio_document
,
action_reference
;
return
gadget
.
getUrlParameter
(
"
action
"
)
.
push
(
function
(
action_parameter
)
{
action_reference
=
action_parameter
;
return
gadget
.
jio_get
(
jio_key
);
})
.
push
(
function
(
document
)
{
// This is the custom code to handle this specific reply action
if
(
action_reference
==
"
reply
"
)
{
var
doc
,
title
=
document
.
title
;
if
(
!
title
.
startsWith
(
"
Re:
"
))
{
title
=
"
Re:
"
+
document
.
title
;
}
doc
=
{
title
:
title
,
//thread parent: same as base post
source_reference
:
document
.
source_reference
,
portal_type
:
document
.
portal_type
,
parent_relative_url
:
document
.
parent_relative_url
};
return
gadget
.
jio_post
(
doc
)
.
push
(
function
(
id
)
{
jio_key
=
id
;
return
gadget
.
jio_get
(
jio_key
);
})
.
push
(
function
(
created_doc
)
{
jio_document
=
created_doc
;
return
[
jio_key
,
jio_document
,
action_reference
];
});
}
return
[
jio_key
,
jio_document
,
action_reference
];
});
})
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
gadget
=
this
,
doc_id
;
return
RSVP
.
Queue
()
.
push
(
function
()
{
return
RSVP
.
all
([
gadget
.
getSetting
(
'
portal_type
'
),
gadget
.
getSetting
(
'
parent_relative_url
'
)
]);
})
.
push
(
function
(
result
)
{
return
gadget
.
handleAction
(
options
.
jio_key
,
result
[
0
]);
})
.
push
(
function
(
action_result
)
{
return
gadget
.
redirect
({
command
:
'
change
'
,
options
:
{
page
:
undefined
,
jio_key
:
action_result
[
0
],
view
:
action_result
[
2
]
}
});
});
});
}(
window
,
rJS
,
RSVP
,
Blob
));
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_handle_action_js.xml
0 → 100644
View file @
133113b3
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Web Script"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_Access_contents_information_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Add_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Change_local_roles_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_Modify_portal_content_Permission
</string>
</key>
<value>
<tuple>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
_View_Permission
</string>
</key>
<value>
<tuple>
<string>
Anonymous
</string>
<string>
Assignee
</string>
<string>
Assignor
</string>
<string>
Associate
</string>
<string>
Auditor
</string>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
content_md5
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
creators
</string>
</key>
<value>
<tuple>
<string>
cedric.le.ninivin
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
gadget_erp5_page_handle_action.js
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
gadget_officejs_page_handle_action_js
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
modification_date
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1455284351.49
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Web Script
</string>
</value>
</item>
<item>
<key>
<string>
short_title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
OfficeJS Handle Action JS
</string>
</value>
</item>
<item>
<key>
<string>
url_string
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
001
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
document_publication_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
edit_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
processing_status_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAU=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
publish_alive
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1554736326.96
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
published_alive
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
edit
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
974.59012.7910.14933
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
<value>
<string>
current
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1554751292.19
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record
id=
"5"
aka=
"AAAAAAAAAAU="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.patches.WorkflowTool"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
detect_converted_file
</string>
</value>
</item>
<item>
<key>
<string>
actor
</string>
</key>
<value>
<string>
zope
</string>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
error_message
</string>
</key>
<value>
<string></string>
</value>
</item>
<item>
<key>
<string>
external_processing_state
</string>
</key>
<value>
<string>
converted
</string>
</value>
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
0.0.0.0
</string>
</value>
</item>
<item>
<key>
<string>
time
</string>
</key>
<value>
<object>
<klass>
<global
name=
"DateTime"
module=
"DateTime.DateTime"
/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>
1554735299.05
</float>
<string>
UTC
</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</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