Commit 6712435f authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] RelationField: transmit document UID id known

parent 40a3804e
......@@ -108,7 +108,7 @@
<value> <string encoding="cdata"><![CDATA[
CACHE MANIFEST\n
# generated on Wed, 03 Nov 2016 16:00:00 GMT\n
# generated on Mon, 07 Nov 2016 10:00:00 GMT\n
# XXX + fonts\n
# images/ajax-loader.gif\n
CACHE:\n
......@@ -366,7 +366,7 @@ NETWORK:\n
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>955.2249.38182.56985</string> </value>
<value> <string>955.7684.22445.34560</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -384,7 +384,7 @@ NETWORK:\n
</tuple>
<state>
<tuple>
<float>1478191304.27</float>
<float>1478515550.48</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -206,6 +206,9 @@
if (input_result.value_portal_type) {
result[gadget.state.relation_field_id + '_' + k] =
"_newContent_" + input_result.value_portal_type;
} else if (input_result.value_uid) {
result[gadget.state.relation_field_id + '_' + k] =
input_result.value_uid;
}
result[gadget.state.key].push(input_result.value_text);
}
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>954.57674.49472.38673</string> </value>
<value> <string>954.57699.3960.12356</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1477584183.47</float>
<float>1478513065.68</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -31,7 +31,7 @@
{{#if list.length}}
<!--li class="ui-autocomplete ui-li ui-li-divider ui-bar-inherit ui-first-child" role="heading">Select from the {{list.length}} Search Results</li-->
{{#each list}}
<li class="ui-li-static ui-body-inherit ui-icon-mail-forward ui-btn-icon-right" data-relative-url={{id}} >{{value}}</li>
<li class="ui-li-static ui-body-inherit ui-icon-mail-forward ui-btn-icon-right" data-relative-url="{{id}}" data-uid="{{uid}}">{{value}}</li>
{{/each}}
{{#each type}}
<li class="ui-li-static ui-body-inherit ui-bar-inherit ui-icon-plus ui-btn-icon-right" data-create-object="{{this}}" name="{{this}}">Create New {{this}}: {{../value}}</li>
......
......@@ -234,7 +234,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>954.54399.20164.63317</string> </value>
<value> <string>955.7622.39581.2525</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -252,7 +252,7 @@
</tuple>
<state>
<tuple>
<float>1477475951.1</float>
<float>1478511768.91</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -142,7 +142,7 @@
// uid is known
// User selected a document from a listbox
if (gadget.state.value_uid) {
if ((gadget.state.value_uid) && (!gadget.state.value_text)) {
plane.className = SEARCHING_CLASS_STR;
return gadget.jio_allDocs({
"query": Query.objectToSearchText(new SimpleQuery({
......@@ -155,8 +155,7 @@
.push(function (result) {
return gadget.changeState({
value_text: result.data.rows[0]
.value[gadget.state.catalog_index],
value_uid: null
.value[gadget.state.catalog_index]
});
});
}
......@@ -230,7 +229,7 @@
]
})),
limit: [0, 10],
select_list: [gadget.state.catalog_index]
select_list: [gadget.state.catalog_index, "uid"]
});
})
.push(function (result) {
......@@ -245,7 +244,8 @@
for (i = 0; i < result.data.rows.length; i += 1) {
list.push({
id: result.data.rows[i].id,
value: result.data.rows[i].value[gadget.state.catalog_index]
value: result.data.rows[i].value[gadget.state.catalog_index],
uid: result.data.rows[i].value.uid
});
}
plane.className = JUMP_UNKNOWN_CLASS_STR;
......@@ -268,7 +268,8 @@
result = {
value_relative_url: gadget.state.value_relative_url,
value_text: gadget.state.value_text,
value_portal_type: gadget.state.value_portal_type
value_portal_type: gadget.state.value_portal_type,
value_uid: gadget.state.value_uid
};
}
return result;
......@@ -310,6 +311,7 @@
// Check which 'li' element was clicked
var li = event.target,
data_relative_url = li.getAttribute("data-relative-url"),
data_uid = li.getAttribute("data-uid"),
data_portal_type = li.getAttribute("data-create-object"),
data_explore = li.getAttribute("data-explore");
......@@ -323,6 +325,7 @@
if (data_relative_url) {
new_state.value_text = li.textContent;
new_state.value_relative_url = data_relative_url;
new_state.value_uid = data_uid;
return gadget.changeState(new_state);
}
......
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>954.57692.7289.25070</string> </value>
<value> <string>955.7686.33333.9745</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -254,7 +254,7 @@
</tuple>
<state>
<tuple>
<float>1477583820.22</float>
<float>1478515602.79</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -67,6 +67,9 @@
if (input_result.value_portal_type) {
result[gadget.state.relation_field_id] =
"_newContent_" + input_result.value_portal_type;
} else if (input_result.value_uid) {
result[gadget.state.relation_field_id] =
input_result.value_uid;
}
result[gadget.state.key] = input_result.value_text;
} else {
......
......@@ -230,7 +230,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>954.57675.64427.52462</string> </value>
<value> <string>955.7640.34748.48025</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -248,7 +248,7 @@
</tuple>
<state>
<tuple>
<float>1477582815.99</float>
<float>1478512986.68</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