Commit 1a67a050 authored by Roque's avatar Roque

erp5_officejs: common render form code into a officejs form view gadget

parent 8be75ebc
...@@ -213,11 +213,6 @@ gadget_officejs_setting.js\n ...@@ -213,11 +213,6 @@ gadget_officejs_setting.js\n
gadget_officejs_setting.html\n gadget_officejs_setting.html\n
\n \n
#text editor\n #text editor\n
#gadget_officejs_text_editor_router.html\n
#gadget_officejs_jio_web_page_view.html\n
#gadget_officejs_jio_web_page_view.js\n
#gadget_officejs_text_editor.json\n
#gadget_officejs_text_editor.json\n
officejs_logo_text_editor.png\n officejs_logo_text_editor.png\n
\n \n
#discussion tool\n #discussion tool\n
...@@ -230,8 +225,8 @@ gadget_erp5_page_ojs_controller.html\n ...@@ -230,8 +225,8 @@ gadget_erp5_page_ojs_controller.html\n
gadget_erp5_page_ojs_controller.js\n gadget_erp5_page_ojs_controller.js\n
gadget_erp5_page_ojs_post_list.html\n gadget_erp5_page_ojs_post_list.html\n
gadget_erp5_page_ojs_post_list.js\n gadget_erp5_page_ojs_post_list.js\n
gadget_officejs_common_utils.html\n gadget_officejs_form_view.html\n
gadget_officejs_common_utils.js\n gadget_officejs_form_view.js\n
gadget_erp5_page_handle_action.html\n gadget_erp5_page_handle_action.html\n
gadget_erp5_page_handle_action.js\n gadget_erp5_page_handle_action.js\n
\n \n
...@@ -743,7 +738,7 @@ NETWORK:\n ...@@ -743,7 +738,7 @@ NETWORK:\n
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>975.6502.43039.38980</string> </value> <value> <string>975.7925.35634.50875</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -761,7 +756,7 @@ NETWORK:\n ...@@ -761,7 +756,7 @@ NETWORK:\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1555610262.29</float> <float>1555618417.31</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -269,7 +269,7 @@ NETWORK:\n ...@@ -269,7 +269,7 @@ NETWORK:\n
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>975.6492.62515.52684</string> </value> <value> <string>975.7922.20540.53998</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -287,7 +287,7 @@ NETWORK:\n ...@@ -287,7 +287,7 @@ NETWORK:\n
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1555610260.52</float> <float>1555617928.96</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
<script src="rsvp.js"></script> <script src="rsvp.js"></script>
<script src="renderjs.js"></script> <script src="renderjs.js"></script>
<script src="gadget_officejs_common_utils.js"></script> <script src="gadget_officejs_form_view.js"></script>
</head> </head>
......
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>gadget_officejs_common_utils.html</string> </value> <value> <string>gadget_officejs_form_view.html</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>gadget_officejs_common_utils_html</string> </value> <value> <string>gadget_officejs_form_view_html</string> </value>
</item> </item>
<item> <item>
<key> <string>language</string> </key> <key> <string>language</string> </key>
...@@ -136,7 +136,7 @@ ...@@ -136,7 +136,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>OfficeJS Common Utils</string> </value> <value> <string>Gadget OfficeJS Form View</string> </value>
</item> </item>
<item> <item>
<key> <string>url_string</string> </key> <key> <string>url_string</string> </key>
...@@ -273,7 +273,7 @@ ...@@ -273,7 +273,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>974.64532.61017.11673</string> </value> <value> <string>975.7931.7412.49851</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -291,7 +291,7 @@ ...@@ -291,7 +291,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1555082263.73</float> <float>1555618284.2</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -83,7 +83,7 @@ ...@@ -83,7 +83,7 @@
</item> </item>
<item> <item>
<key> <string>default_reference</string> </key> <key> <string>default_reference</string> </key>
<value> <string>gadget_officejs_common_utils.js</string> </value> <value> <string>gadget_officejs_form_view.js</string> </value>
</item> </item>
<item> <item>
<key> <string>description</string> </key> <key> <string>description</string> </key>
...@@ -93,7 +93,7 @@ ...@@ -93,7 +93,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>gadget_officejs_common_utils_js</string> </value> <value> <string>gadget_officejs_form_view_js</string> </value>
</item> </item>
<item> <item>
<key> <string>language</string> </key> <key> <string>language</string> </key>
...@@ -132,7 +132,7 @@ ...@@ -132,7 +132,7 @@
</item> </item>
<item> <item>
<key> <string>title</string> </key> <key> <string>title</string> </key>
<value> <string>OfficeJS Common Utils JS</string> </value> <value> <string>Gadget OfficeJS Form View JS</string> </value>
</item> </item>
<item> <item>
<key> <string>url_string</string> </key> <key> <string>url_string</string> </key>
...@@ -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.7547.42369.47735</string> </value> <value> <string>975.7931.50394.10308</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>1555610328.87</float> <float>1555618316.02</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -22,9 +22,7 @@ ...@@ -22,9 +22,7 @@
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
.declareMethod("render", function (options) { .declareMethod("render", function (options) {
var gadget = this, var gadget = this, parent_portal_type, action_code;
child_gadget_url = 'gadget_erp5_pt_form_view_editable.html',
parent_portal_type, action_code;
return RSVP.Queue() return RSVP.Queue()
.push(function () { .push(function () {
return RSVP.all([ return RSVP.all([
...@@ -32,7 +30,7 @@ ...@@ -32,7 +30,7 @@
gadget.getUrlParameter("action_type"), gadget.getUrlParameter("action_type"),
gadget.getUrlParameter("parent_portal_type"), gadget.getUrlParameter("parent_portal_type"),
gadget.getSetting('parent_portal_type'), gadget.getSetting('parent_portal_type'),
gadget.declareGadget("gadget_officejs_common_utils.html") gadget.declareGadget("gadget_officejs_form_view.html")
]); ]);
}) })
.push(function (result) { .push(function (result) {
...@@ -47,9 +45,9 @@ ...@@ -47,9 +45,9 @@
action_code = form_definition.fields_raw_properties.gadget_field_action_js_script.values.renderjs_extra[0]; action_code = form_definition.fields_raw_properties.gadget_field_action_js_script.values.renderjs_extra[0];
return window.eval.call(window, '(function (gadget, gadget_utils, options,\ return window.eval.call(window, '(function (gadget, gadget_utils, options,\
action_reference, parent_portal_type,\ action_reference, parent_portal_type,\
form_definition, child_gadget_url, submit_code)\ form_definition, submit_code)\
{' + action_code[0] + '})') {' + action_code[0] + '})')
(gadget, gadget_utils, options, action_reference, parent_portal_type, form_definition, child_gadget_url, action_code[1]); (gadget, gadget_utils, options, action_reference, parent_portal_type, form_definition, action_code[1]);
} }
else { else {
throw "Field 'gadget_field_action_js_script' missing in action \ throw "Field 'gadget_field_action_js_script' missing in action \
......
...@@ -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.6480.52801.55961</string> </value> <value> <string>975.7932.44543.51438</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>1555531274.73</float> <float>1555618542.84</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