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
f0bbda2f
Commit
f0bbda2f
authored
May 31, 2019
by
Roque
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
erp5_officejs: fill document type list field in create document gadget
parent
8488d7b7
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
61 additions
and
36 deletions
+61
-36
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_discussion_tool_appcache.xml
..._page_module/gadget_officejs_discussion_tool_appcache.xml
+3
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_discussion_tool_configuration.xml
..._module/gadget_officejs_discussion_tool_configuration.xml
+3
-1
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_form_view_js.js
...plateItem/web_page_module/gadget_officejs_form_view_js.js
+13
-5
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_form_view_js.xml
...lateItem/web_page_module/gadget_officejs_form_view_js.xml
+2
-2
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_create_document_js.js
...eb_page_module/gadget_officejs_page_create_document_js.js
+38
-24
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_create_document_js.xml
...b_page_module/gadget_officejs_page_create_document_js.xml
+2
-2
No files found.
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_discussion_tool_appcache.xml
View file @
f0bbda2f
...
...
@@ -262,6 +262,7 @@ officejs_logo.png\n
jio_appcachestorage.js\n
\n
#configuration resources\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_hal_json_style%2FBase_viewNewContentDialog&view=jio_view&appcache=1\n
\n
#discussion tool\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_officejs_jio_connector%2FHTMLPost_viewAsJio&view=jio_view&appcache=1\n
...
...
@@ -770,7 +771,7 @@ NETWORK:\n
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
976.
2798.32101.13585
</string>
</value>
<value>
<string>
976.
5449.107.50432
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -788,7 +789,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>
1559
156188.36
</float>
<float>
1559
327609.48
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_discussion_tool_configuration.xml
View file @
f0bbda2f
...
...
@@ -115,6 +115,8 @@ CACHE MANIFEST\n
# generated on Thu, 14 Jan 2019 11:55:33 +0000\n
CACHE:\n
\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_hal_json_style%2FBase_viewNewContentDialog&view=jio_view&appcache=1\n
\n
#discussion tool\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_officejs_jio_connector%2FHTMLPost_viewAsJio&view=jio_view&appcache=1\n
hateoas/ERP5Document_getHateoas?mode=traverse&relative_url=portal_skins%2Ferp5_officejs_jio_connector%2FHTMLPost_viewReplyDialog&view=jio_view&appcache=1\n
...
...
@@ -301,7 +303,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>
1559
155949.19
</float>
<float>
1559
314986.76
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_form_view_js.js
View file @
f0bbda2f
/*global document, window, rJS, RSVP */
/*global document, window, rJS, RSVP
, ensureArray
*/
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
document
,
window
,
rJS
,
RSVP
)
{
(
function
(
document
,
window
,
rJS
,
RSVP
,
ensureArray
)
{
"
use strict
"
;
function
renderField
(
field_id
,
field_definition
,
document
)
{
...
...
@@ -36,7 +36,15 @@
result
.
type
=
field_definition
.
type
;
result
.
key
=
field_id
;
if
(
document
&&
document
.
hasOwnProperty
(
field_id
))
{
result
[
"
default
"
]
=
document
[
field_id
];
if
(
field_definition
.
type
===
"
ListField
"
)
{
var
item_list
=
ensureArray
(
document
[
field_id
]).
map
(
function
(
item
)
{
if
(
Array
.
isArray
(
item
))
{
return
item
;
}
return
[
item
,
item
];
});
result
.
items
=
item_list
;
}
else
{
result
[
"
default
"
]
=
document
[
field_id
];
}
}
return
result
;
}
...
...
@@ -148,7 +156,7 @@
page_title
=
options
.
doc
.
title
;
}
erp5_document
=
form_json
.
erp5_document
;
if
(
form_json
.
form_definition
.
allowed_sub_types_list
.
length
>
0
)
{
if
(
form_json
.
form_definition
.
allowed_sub_types_list
&&
form_json
.
form_definition
.
allowed_sub_types_list
.
length
>
0
)
{
url_for_parameter_list
.
push
({
command
:
'
change
'
,
options
:
{
page
:
"
create_document
"
,
jio_key
:
options
.
jio_key
,
portal_type
:
options
.
portal_type
,
allowed_sub_types_list
:
form_json
.
form_definition
.
allowed_sub_types_list
}});
add_url
=
true
;
}
...
...
@@ -212,4 +220,4 @@
});
});
}(
document
,
window
,
rJS
,
RSVP
));
}(
document
,
window
,
rJS
,
RSVP
,
ensureArray
));
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_form_view_js.xml
View file @
f0bbda2f
...
...
@@ -269,7 +269,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
976.
2523.47706.38553
</string>
</value>
<value>
<string>
976.
5655.16835.17186
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>
1559
144299.92
</float>
<float>
1559
327478.46
</float>
<string>
UTC
</string>
</tuple>
</state>
...
...
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_create_document_js.js
View file @
f0bbda2f
/*global window, rJS, RSVP, Handlebars */
/*global window,
document,
rJS, RSVP, Handlebars */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(
function
(
window
,
rJS
,
RSVP
,
Handlebars
)
{
(
function
(
window
,
document
,
rJS
,
RSVP
,
Handlebars
)
{
"
use strict
"
;
/////////////////////////////////////////////////////////////////
...
...
@@ -77,6 +77,7 @@
.
declareMethod
(
"
render
"
,
function
(
options
)
{
var
gadget
=
this
,
allowed_sub_types_list
=
options
.
allowed_sub_types_list
.
split
(
"
,
"
),
portal_type
,
document_title
;
return
gadget
.
jio_get
(
options
.
jio_key
)
.
push
(
function
(
document
)
{
...
...
@@ -86,32 +87,45 @@
document_title
=
options
.
portal_type
;
return
options
.
portal_type
;
})
// TODO: this gadget must load the form dialog to select the type of document
// somehow (a generic action?) get the path string:${object_url}/Base_viewNewContentDialog
// get corresponding form definition (only contains a select field)
// fill select field with allowed_sub_types_list
.
push
(
function
(
portal_type
)
{
return
gadget
.
getHTMLElementList
(
allowed_sub_types_list
,
options
.
jio_key
,
portal_type
);
})
.
push
(
function
(
all_html_elements
)
{
return
RSVP
.
all
([
renderLinkList
(
gadget
,
"
Create Document
"
,
"
file
"
,
all_html_elements
)
]);
.
push
(
function
(
portal_type_result
)
{
portal_type
=
portal_type_result
;
// TODO: somehow (a generic action?) get the path string:${object_url}/Base_viewNewContentDialog
// for now hardcoded
// get corresponding form definition (only contains a select field)
return
gadget
.
jio_get
(
"
portal_skins/erp5_hal_json_style/Base_viewNewContentDialog
"
);
})
.
push
(
function
(
translated_html_link_list
)
{
gadget
.
element
.
innerHTML
=
translated_html_link_list
.
join
(
"
\n
"
);
return
gadget
.
getUrlFor
({
command
:
'
change
'
,
options
:
{
page
:
undefined
}});
})
.
push
(
function
(
back_url
)
{
return
gadget
.
updateHeader
({
page_title
:
document_title
,
back_url
:
back_url
.
push
(
function
(
form_result
)
{
form_result
.
form_definition
.
title
=
"
Create Document
"
;
return
gadget
.
changeState
({
doc
:
{
title
:
document_title
,
portal_type
:
allowed_sub_types_list
},
action_options
:
options
,
child_gadget_url
:
'
gadget_erp5_pt_form_dialog.html
'
,
form_type
:
'
dialog
'
,
form_definition
:
form_result
.
form_definition
,
view
:
"
view
"
});
});
})
.
declareMethod
(
"
triggerSubmit
"
,
function
()
{
return
;
.
onStateChange
(
function
()
{
var
fragment
=
document
.
createElement
(
'
div
'
),
gadget
=
this
;
while
(
this
.
element
.
firstChild
)
{
this
.
element
.
removeChild
(
this
.
element
.
firstChild
);
}
this
.
element
.
appendChild
(
fragment
);
return
gadget
.
declareGadget
(
"
gadget_officejs_form_view.html
"
,
{
element
:
fragment
,
scope
:
'
fg
'
})
.
push
(
function
(
form_view_gadget
)
{
return
form_view_gadget
.
render
(
gadget
.
state
);
});
})
.
declareMethod
(
'
triggerSubmit
'
,
function
()
{
return
this
.
getDeclaredGadget
(
'
fg
'
)
.
push
(
function
(
gadget
)
{
return
gadget
.
triggerSubmit
();
});
});
}(
window
,
rJS
,
RSVP
,
Handlebars
));
\ No newline at end of file
}(
window
,
document
,
rJS
,
RSVP
,
Handlebars
));
\ No newline at end of file
bt5/erp5_officejs/PathTemplateItem/web_page_module/gadget_officejs_page_create_document_js.xml
View file @
f0bbda2f
...
...
@@ -228,7 +228,7 @@
</item>
<item>
<key>
<string>
serial
</string>
</key>
<value>
<string>
976.
2629.49630.2032
6
</string>
</value>
<value>
<string>
976.
5677.14251.2160
6
</string>
</value>
</item>
<item>
<key>
<string>
state
</string>
</key>
...
...
@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>
1559
147821.67
</float>
<float>
1559
329004.84
</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