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 @@
form_gadget.props.editable = options.editable;\n
form_gadget.props.action = erp5_document._embedded._view._actions.put;\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
return form_gadget.getDeclaredGadget("erp5_form")\n
\n
......@@ -231,7 +231,11 @@
\n
\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
function formSubmit() {\n
return form_gadget.notifySubmitting()\n
......@@ -250,9 +254,16 @@
// XXX Hardcoded\n
data.dialog_id =\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
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
......@@ -411,7 +422,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
<value> <string>xiaowu</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -425,7 +436,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>940.49292.16784.61849</string> </value>
<value> <string>942.35941.31227.49152</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -443,8 +454,8 @@
</tuple>
<state>
<tuple>
<float>1423066365.58</float>
<string>GMT</string>
<float>1429870719.03</float>
<string>UTC</string>
</tuple>
</state>
</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