Commit b3c075f1 authored by Roque's avatar Roque

erp5_officejs: fix error in header rendering

- add notify parameters on controller
- fix form_view custom submit handling
parent 18e9c69a
...@@ -104,7 +104,9 @@ ...@@ -104,7 +104,9 @@
form_definition: form_definition, form_definition: form_definition,
form_type: form_definition.form_type, form_type: form_definition.form_type,
view: options.view || app_view, view: options.view || app_view,
view_action_dict: view_action_dict view_action_dict: view_action_dict,
notify_type: options.notify_type,
notify_msg: options.notify_msg
}); });
}, function (error) { }, function (error) {
// jio not found error // jio not found error
...@@ -144,6 +146,14 @@ ...@@ -144,6 +146,14 @@
return gadget.updatePanel({ return gadget.updatePanel({
view_action_dict: gadget.state.view_action_dict view_action_dict: gadget.state.view_action_dict
}); });
})
.push(function () {
if (gadget.state.notify_msg && gadget.state.notify_type) {
return gadget.notifySubmitted({
message: gadget.state.notify_msg,
status: gadget.state.notify_type
});
}
}); });
}) })
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1015.46091.52896.5922</string> </value> <value> <string>1018.11989.25920.31300</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -256,7 +256,7 @@ ...@@ -256,7 +256,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1712343165.23</float> <float>1721922124.11</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -254,10 +254,18 @@ ...@@ -254,10 +254,18 @@
.declareMethod("triggerSubmit", function (argument_list) { .declareMethod("triggerSubmit", function (argument_list) {
var gadget = this, child_gadget, content_dict; var gadget = this, child_gadget, content_dict;
if (gadget.state.form_definition.portal_type_dict.custom_submit) { if (gadget.state.form_definition.portal_type_dict.custom_submit) {
return gadget.getDeclaredGadget('erp5_pt_gadget')
.push(function (result) {
child_gadget = result;
return child_gadget.getContent();
})
.push(function (result) {
content_dict = result;
return gadget.declareGadget(gadget.state.form_definition return gadget.declareGadget(gadget.state.form_definition
.portal_type_dict.custom_submit) .portal_type_dict.custom_submit)
})
.push(function (submit_gadget) { .push(function (submit_gadget) {
return submit_gadget.handle_submit(argument_list, gadget.state); return submit_gadget.handle_submit(argument_list, gadget.state, content_dict);
}); });
} }
return gadget.getDeclaredGadget('erp5_pt_gadget') return gadget.getDeclaredGadget('erp5_pt_gadget')
...@@ -434,16 +442,16 @@ ...@@ -434,16 +442,16 @@
} }
} }
} }
if (portal_type_dict.custom_header) {
return gadget.declareGadget(portal_type_dict.custom_header); return gadget.declareGadget(portal_type_dict.custom_header);
}
return;
}) })
.push(function (header_gadget) { .push(function (header_gadget) {
if (header_gadget) {
return header_gadget.getOptions(portal_type_dict, options, header_dict); return header_gadget.getOptions(portal_type_dict, options, header_dict);
}, function (error) {
if (!portal_type_dict.custom_header) {
return header_dict;
} else {
throw error;
} }
return header_dict;
}) })
.push(function (header_options) { .push(function (header_options) {
return gadget.updateHeader(header_options); return gadget.updateHeader(header_options);
......
...@@ -258,7 +258,7 @@ ...@@ -258,7 +258,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>1016.46538.50454.1467</string> </value> <value> <string>1019.37331.10633.54664</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -278,7 +278,7 @@ ...@@ -278,7 +278,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1716222503.85</float> <float>1727373462.24</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