Commit a3532c60 authored by Roque's avatar Roque

erp5_officejs: better handling of editable views

parent 1651c8f9
...@@ -89,7 +89,7 @@ ...@@ -89,7 +89,7 @@
return has_more_dict; return has_more_dict;
}) })
.declareMethod("getFormDefinition", function (portal_type, action_reference, source_reference) { .declareMethod("getFormDefinition", function (portal_type, action_reference) {
var gadget = this, var gadget = this,
query, query,
action_type, action_type,
......
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>976.1341.45833.19848</string> </value> <value> <string>976.19490.13565.24388</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -287,7 +287,7 @@ ...@@ -287,7 +287,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1559144323.98</float> <float>1560157575.92</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -73,8 +73,7 @@ ...@@ -73,8 +73,7 @@
child_gadget_url: child_gadget_url, child_gadget_url: child_gadget_url,
form_definition: form_definition, form_definition: form_definition,
form_type: form_type, form_type: form_type,
//TODO editable should come from getFormInfo(form_definition) editable: options.editable,
editable: true,
view: options.view || default_view, view: options.view || default_view,
front_page: front_page front_page: front_page
}); });
......
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>976.1354.15427.27101</string> </value> <value> <string>976.19489.33473.10973</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1559069474.12</float> <float>1560166424.01</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -198,7 +198,7 @@ ...@@ -198,7 +198,7 @@
if (options.form_definition.has_more_views) { if (options.form_definition.has_more_views) {
header_dict.tab_url = url_list[0]; header_dict.tab_url = url_list[0];
} }
if (options.editable) { if (options.editable === "true") {
header_dict.save_action = true; header_dict.save_action = true;
} }
} }
......
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>976.15215.11185.17510</string> </value> <value> <string>976.19636.24453.35276</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -287,7 +287,7 @@ ...@@ -287,7 +287,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1559901212.98</float> <float>1560166356.4</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
/*global window, document, rJS, RSVP */ /*global window, document, rJS */
/*jslint nomen: true, indent: 2, maxerr: 3 */ /*jslint nomen: true, indent: 2, maxerr: 13 */
(function (window, document, rJS, RSVP) { (function (window, document, rJS) {
"use strict"; "use strict";
rJS(window) rJS(window)
...@@ -39,8 +39,6 @@ ...@@ -39,8 +39,6 @@
.push(function (portal_type_result) { .push(function (portal_type_result) {
portal_type = portal_type_result; portal_type = portal_type_result;
// TODO: somehow (a generic action?) get the path string:${object_url}/Base_viewNewContentDialog // 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"); return gadget.jio_get("portal_skins/erp5_hal_json_style/Base_viewNewContentDialog");
}) })
.push(function (form_result) { .push(function (form_result) {
...@@ -91,4 +89,4 @@ ...@@ -91,4 +89,4 @@
}); });
}); });
}(window, document, rJS, RSVP)); }(window, document, rJS));
\ No newline at end of file \ No newline at end of file
...@@ -228,7 +228,7 @@ ...@@ -228,7 +228,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>976.15382.16949.153</string> </value> <value> <string>976.19418.14997.64017</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -246,7 +246,7 @@ ...@@ -246,7 +246,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1559912998.35</float> <float>1560156475.0</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -141,7 +141,7 @@ ...@@ -141,7 +141,7 @@
command: 'display', command: 'display',
options: { options: {
jio_key: jio_key, jio_key: jio_key,
editable: true editable: gadget.state.view === "edit"
} }
}); });
}); });
......
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>975.61078.33779.341</string> </value> <value> <string>976.19632.7478.53504</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -287,7 +287,7 @@ ...@@ -287,7 +287,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1559051938.53</float> <float>1560166193.19</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </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