Commit 12d527d3 authored by Roque's avatar Roque

erp5_officejs: controller handles submit of editable pages

parent 2f99b0d9
......@@ -86,7 +86,8 @@
child_gadget_url: child_gadget_url,
form_definition: form_definition,
form_type: form_type,
editable: false,
//TODO editable should come from getFormInfo(form_definition)
editable: true,
view: options.view || default_view,
front_page: front_page
});
......@@ -107,6 +108,31 @@
});
})
.allowPublicAcquisition('notifySubmit', function () {
return this.triggerSubmit();
})
.allowPublicAcquisition('submitContent', function (param_list) {
var gadget = this,
//target_url = options[1],
content_dict = param_list[2];
return gadget.jio_get(gadget.state.jio_key)
.push(function (doc) {
var property;
for (property in content_dict) {
if (content_dict.hasOwnProperty(property)) {
doc[property] = content_dict[property];
}
}
return gadget.jio_put(gadget.state.jio_key, doc);
})
.push(function () {
return gadget.notifySubmitting();
})
.push(function () {
return gadget.notifySubmitted({message: 'Data Updated', status: 'success'});
});
})
.declareMethod("triggerSubmit", function () {
var argument_list = arguments;
return this.getDeclaredGadget('form_view')
......
......@@ -225,7 +225,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>975.40671.20077.18653</string> </value>
<value> <string>975.46576.23122.6860</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -243,7 +243,7 @@
</tuple>
<state>
<tuple>
<float>1557758029.57</float>
<float>1557850628.35</float>
<string>UTC</string>
</tuple>
</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