Commit a3532c60 authored by Roque's avatar Roque

erp5_officejs: better handling of editable views

parent 1651c8f9
......@@ -89,7 +89,7 @@
return has_more_dict;
})
.declareMethod("getFormDefinition", function (portal_type, action_reference, source_reference) {
.declareMethod("getFormDefinition", function (portal_type, action_reference) {
var gadget = this,
query,
action_type,
......
......@@ -269,7 +269,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>976.1341.45833.19848</string> </value>
<value> <string>976.19490.13565.24388</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>1559144323.98</float>
<float>1560157575.92</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -73,8 +73,7 @@
child_gadget_url: child_gadget_url,
form_definition: form_definition,
form_type: form_type,
//TODO editable should come from getFormInfo(form_definition)
editable: true,
editable: options.editable,
view: options.view || default_view,
front_page: front_page
});
......
......@@ -228,7 +228,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>976.1354.15427.27101</string> </value>
<value> <string>976.19489.33473.10973</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>1559069474.12</float>
<float>1560166424.01</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -198,7 +198,7 @@
if (options.form_definition.has_more_views) {
header_dict.tab_url = url_list[0];
}
if (options.editable) {
if (options.editable === "true") {
header_dict.save_action = true;
}
}
......
......@@ -269,7 +269,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>976.15215.11185.17510</string> </value>
<value> <string>976.19636.24453.35276</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>1559901212.98</float>
<float>1560166356.4</float>
<string>UTC</string>
</tuple>
</state>
......
/*global window, document, rJS, RSVP */
/*jslint nomen: true, indent: 2, maxerr: 3 */
(function (window, document, rJS, RSVP) {
/*global window, document, rJS */
/*jslint nomen: true, indent: 2, maxerr: 13 */
(function (window, document, rJS) {
"use strict";
rJS(window)
......@@ -39,8 +39,6 @@
.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 (form_result) {
......@@ -91,4 +89,4 @@
});
});
}(window, document, rJS, RSVP));
\ No newline at end of file
}(window, document, rJS));
\ No newline at end of file
......@@ -228,7 +228,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>976.15382.16949.153</string> </value>
<value> <string>976.19418.14997.64017</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -246,7 +246,7 @@
</tuple>
<state>
<tuple>
<float>1559912998.35</float>
<float>1560156475.0</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -141,7 +141,7 @@
command: 'display',
options: {
jio_key: jio_key,
editable: true
editable: gadget.state.view === "edit"
}
});
});
......
......@@ -269,7 +269,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>975.61078.33779.341</string> </value>
<value> <string>976.19632.7478.53504</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -287,7 +287,7 @@
</tuple>
<state>
<tuple>
<float>1559051938.53</float>
<float>1560166193.19</float>
<string>UTC</string>
</tuple>
</state>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment