Commit e80c5b63 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_web_renderjs_ui: add custom form action checking

parent 0d731701
...@@ -158,7 +158,7 @@ ...@@ -158,7 +158,7 @@
form_gadget.props.editable = options.editable;\n form_gadget.props.editable = options.editable;\n
form_gadget.props.action = erp5_document._embedded._view._actions.put;\n form_gadget.props.action = erp5_document._embedded._view._actions.put;\n
form_gadget.props.form_id = erp5_document._embedded._view.form_id;\n form_gadget.props.form_id = erp5_document._embedded._view.form_id;\n
\n form_gadget.props.form_action = options.form_definition.action;\n
\n \n
return form_gadget.getDeclaredGadget("erp5_form")\n return form_gadget.getDeclaredGadget("erp5_form")\n
\n \n
...@@ -231,7 +231,11 @@ ...@@ -231,7 +231,11 @@
\n \n
\n \n
.declareService(function () {\n .declareService(function () {\n
var form_gadget = this;\n var form_gadget = this,\n
is_custom_dialog = false,\n
tmp,\n
generic_dialog_id_list = ["Base_configureUI", "Base_configureSortOn", "Workflow_statusModify",\n
"Base_editRelation", "Base_createRelation", "Folder_delete"];\n
\n \n
function formSubmit() {\n function formSubmit() {\n
return form_gadget.notifySubmitting()\n return form_gadget.notifySubmitting()\n
...@@ -250,9 +254,16 @@ ...@@ -250,9 +254,16 @@
// XXX Hardcoded\n // XXX Hardcoded\n
data.dialog_id =\n data.dialog_id =\n
form_gadget.props.form_id[\'default\'];\n form_gadget.props.form_id[\'default\'];\n
if (generic_dialog_id_list.indexOf(form_gadget.props.form_action) === -1) {\n
is_custom_dialog = true;\n
}\n
for (key in content_dict) {\n for (key in content_dict) {\n
if (content_dict.hasOwnProperty(key)) {\n if (content_dict.hasOwnProperty(key)) {\n
data[key] = content_dict[key];\n tmp = key;\n
if (is_custom_dialog && (key.indexOf("field_your") === 0 || key.indexOf("field_my") === 0)) {\n
tmp = key.split("_")[2];\n
}\n
data[tmp] = content_dict[key];\n
}\n }\n
}\n }\n
\n \n
...@@ -411,7 +422,7 @@ ...@@ -411,7 +422,7 @@
</item> </item>
<item> <item>
<key> <string>actor</string> </key> <key> <string>actor</string> </key>
<value> <string>romain</string> </value> <value> <string>xiaowu</string> </value>
</item> </item>
<item> <item>
<key> <string>comment</string> </key> <key> <string>comment</string> </key>
...@@ -425,7 +436,7 @@ ...@@ -425,7 +436,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>940.49292.16784.61849</string> </value> <value> <string>942.35941.31227.49152</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -443,8 +454,8 @@ ...@@ -443,8 +454,8 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1423066365.58</float> <float>1429870719.03</float>
<string>GMT</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
</object> </object>
......
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