Commit ee320069 authored by Romain Courteaud's avatar Romain Courteaud

[erp5storage] Remove one not needed queue

parent 86970117
...@@ -73,59 +73,56 @@ ...@@ -73,59 +73,56 @@
}; };
function extractPropertyFromFormJSON(json) { function extractPropertyFromFormJSON(json) {
return new RSVP.Queue() var form = json._embedded._view,
.push(function () { converted_json = {
var form = json._embedded._view, portal_type: json._links.type.name
converted_json = { },
portal_type: json._links.type.name form_data_json = {},
}, field,
form_data_json = {}, key,
field, prefix_length,
key, result;
prefix_length,
result; if (json._links.hasOwnProperty('parent')) {
converted_json.parent_relative_url =
new URI(json._links.parent.href).segment(2);
}
if (json._links.hasOwnProperty('parent')) { form_data_json.form_id = {
converted_json.parent_relative_url = "key": [form.form_id.key],
new URI(json._links.parent.href).segment(2); "default": form.form_id["default"]
};
// XXX How to store datetime
for (key in form) {
if (form.hasOwnProperty(key)) {
field = form[key];
prefix_length = 0;
if (key.indexOf('my_') === 0 && field.editable) {
prefix_length = 3;
} }
if (key.indexOf('your_') === 0) {
form_data_json.form_id = { prefix_length = 5;
"key": [form.form_id.key],
"default": form.form_id["default"]
};
// XXX How to store datetime
for (key in form) {
if (form.hasOwnProperty(key)) {
field = form[key];
prefix_length = 0;
if (key.indexOf('my_') === 0 && field.editable) {
prefix_length = 3;
}
if (key.indexOf('your_') === 0) {
prefix_length = 5;
}
if ((prefix_length !== 0) &&
(allowed_field_dict.hasOwnProperty(field.type))) {
form_data_json[key.substring(prefix_length)] = {
"default": field["default"],
"key": field.key
};
converted_json[key.substring(prefix_length)] = field["default"];
}
}
} }
if ((prefix_length !== 0) &&
result = { (allowed_field_dict.hasOwnProperty(field.type))) {
data: converted_json, form_data_json[key.substring(prefix_length)] = {
form_data: form_data_json "default": field["default"],
}; "key": field.key
if (form.hasOwnProperty('_actions') && };
form._actions.hasOwnProperty('put')) { converted_json[key.substring(prefix_length)] = field["default"];
result.action_href = form._actions.put.href;
} }
return result; }
}); }
result = {
data: converted_json,
form_data: form_data_json
};
if (form.hasOwnProperty('_actions') &&
form._actions.hasOwnProperty('put')) {
result.action_href = form._actions.put.href;
}
return result;
} }
function extractPropertyFromForm(context, id) { function extractPropertyFromForm(context, id) {
......
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