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