Commit 03626609 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_web_renderjs_ui: fix broken gadget

parent 2b419857
......@@ -244,10 +244,9 @@
\n
gadget.props.jelement.panel("toggle");\n
\n
return gadget.redirect({jio_key: options.jio_key,\n
"extended_search": query, "domain_tree": domain_tree_query,\n
"sort_list": options.form_definition.sort_list || "",\n
"hide_item": options.form_definition.hide_item || ""});\n
return gadget.redirect({command: \'change\', options:{\n
"extended_search": query,\n
"domain_tree": domain_tree_query}});\n
\n
}\n
\n
......@@ -794,7 +793,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>946.27361.45605.54152</string> </value>
<value> <string>946.46249.31868.4846</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -812,7 +811,7 @@
</tuple>
<state>
<tuple>
<float>1444825245.7</float>
<float>1445963748.44</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -157,6 +157,7 @@
document_table = gadget.props.element.querySelector(\'.document_table\'),\n
th,\n
tmp,\n
sort_list,\n
length_table = field_json.column_list.length,\n
j,\n
i;\n
......@@ -169,7 +170,8 @@
gadget.props.hide_item = options.hide_item;\n
gadget.props.sort_list = [];\n
if (options.sort_list) {\n
gadget.props.sort_list = Object.keys(options.sort_list).map(function (key) {return options.sort_list[key]; });\n
sort_list = JSON.parse(options.sort_list);\n
gadget.props.sort_list = Object.keys(sort_list).map(function (key) {return sort_list[key]; });\n
}\n
\n
if (field_json.show_anchor) {\n
......@@ -292,7 +294,6 @@
}\n
\n
select_list.push("uid");\n
return gadget.jio_allDocs({\n
// XXX Not jIO compatible, but until a better api is found...\n
"list_method_template": field_json.list_method_template,\n
......@@ -417,13 +418,10 @@
prev_param[gadget.props.field_json.key + \'_begin_from\'] = begin_from - lines;\n
setNext();\n
}\n
\n
return RSVP.all([\n
gadget.getUrlFor({command: \'change\', options: {jio_key: gadget.props.jio_key, "extended_search": gadget.props.extended_search || "",\n
"domain_tree": gadget.props.domain_tree || "", "sort_list": gadget.props.sort_list || "",\n
"begin_from":prev_param.begin_from}}),\n
gadget.getUrlFor({command: \'change\', options: {jio_key: gadget.props.jio_key, "extended_search": gadget.props.extended_search || "",\n
"domain_tree": gadget.props.domain_tree || "", "sort_list": gadget.props.sort_list || "",\n
"begin_from":next_param.begin_from}})\n
gadget.getUrlFor({command: \'change\', options: prev_param}),\n
gadget.getUrlFor({command: \'change\', options: next_param})\n
]);\n
\n
}).push(function (url_list) {\n
......@@ -551,10 +549,8 @@
//if nothing is selected, show all\n
if (hide_form_elements.length === 0) {\n
colspan.setAttribute("colspan", parseInt(colspan.getAttribute("colspan"), 10) - 1);\n
return gadget.redirect({jio_key: gadget.props.jio_key,\n
"extended_search": gadget.props.extended_search || "",\n
"domain_tree": gadget.props.domain_tree || "",\n
"sort_list": gadget.props.sort_list || ""});\n
return gadget.redirect({command: \'change\', options: {\n
"domain_tree": gadget.props.domain_tree || ""}});\n
}\n
\n
//all selected\n
......@@ -582,11 +578,8 @@
type: "complex"\n
});\n
\n
return gadget.redirect({jio_key: gadget.props.jio_key,\n
"extended_search": gadget.props.extended_search || "",\n
"domain_tree": gadget.props.domain_tree || "",\n
"sort_list": gadget.props.sort_list || "",\n
"hide_item": Query.objectToSearchText(selected_uid_query)});\n
return gadget.redirect({command: \'change\', options: {\n
"hide_item": Query.objectToSearchText(selected_uid_query)}});\n
}\n
\n
hide_show_all.setAttribute("type", "submit");\n
......@@ -610,10 +603,8 @@
"submit",\n
false,\n
function () {\n
return gadget.redirect({jio_key: gadget.props.jio_key,\n
"extended_search": gadget.props.extended_search || "",\n
"domain_tree": gadget.props.domain_tree || "",\n
"sort_list": gadget.props.sort_list || ""});\n
return gadget.redirect({command: \'change\', options: {\n
"hide_item": ""}});\n
}\n
);\n
thead_tr.insertBefore(th, thead_tr.firstChild);\n
......@@ -806,7 +797,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>946.5879.32028.47257</string> </value>
<value> <string>946.46337.55165.55125</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -824,7 +815,7 @@
</tuple>
<state>
<tuple>
<float>1444722552.95</float>
<float>1445963866.42</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -215,7 +215,7 @@
gadget.getDeclaredGadget("erp5_form"),\n
gadget.getUrlFor({command: \'change\', options: {page: "breadcrumb"}}),\n
new_content_action,\n
gadget.getUrlFor({command: \'change\', options: {page: "action"}})\n
gadget.getUrlFor({command: \'change\', options: {page: "action"}}),\n
gadget.getDeclaredGadget("filterEditor"),\n
gadget.getDeclaredGadget("sortEditor")\n
]);\n
......@@ -398,7 +398,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>946.4414.7934.44748</string> </value>
<value> <string>946.46100.61365.28740</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -416,7 +416,7 @@
</tuple>
<state>
<tuple>
<float>1444816468.81</float>
<float>1445950207.32</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -125,7 +125,7 @@
<div class="ui-field-contain">\n
<div class="bottom">\n
<div class="ui-input-text ui-body-{{theme}} ui-input-has-icon ui-corner-all ui-shadow-inset ui-input-has-clear {{status_class}} {{css_class}}">\n
<form class="save_form document_form">\n
<form class="save_form">\n
<input type="text" data-enhanced="true" value="{{widget_value}}" name="search" {{widget_status_attribute}} />\n
<div class="ui-btn ui-input-clear ui-input-btn ui-corner-all ui-icon-search ui-btn-icon-notext" data-i18n="[node]{{search_i18n}}">\n
{{search_i18n}}<input tabindex="-1" data-role="button" data-enhanced="true" type="submit" data-i18n="[value]{{search_i18n}}" value=" "/>\n
......@@ -290,7 +290,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>946.26055.51865.42035</string> </value>
<value> <string>946.46365.63113.6638</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -308,7 +308,7 @@
</tuple>
<state>
<tuple>
<float>1444746743.09</float>
<float>1445965410.12</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -174,7 +174,6 @@
.push(function (my_translated_html) {\n
search_gadget.props.element.querySelector(".container").innerHTML =\n
my_translated_html;\n
return search_gadget;\n
});\n
})\n
.declareMethod("showQueryError", function (param) {\n
......@@ -244,7 +243,7 @@
type: "complex"\n
});\n
}\n
return gadget.redirect({jio_key: gadget.props.jio_key,\n
return gadget.redirect({command: \'change\', options: {\n
"extended_search": Query.objectToSearchText(new ComplexQuery({\n
operator: search_query.operator || "AND",\n
query_list: query_list,\n
......@@ -252,10 +251,10 @@
})),\n
"domain_tree": domain_tree_query ? Query.objectToSearchText(domain_tree_query) : "",\n
"hide_item": hide_query ? Query.objectToSearchText(hide_query) : ""\n
});\n
}});\n
}\n
return gadget.redirect({jio_key: gadget.props.jio_key,\n
"extended_search": "", "domain_tree": "", "hide_item": ""});\n
return gadget.redirect({command: \'change\', options:{\n
"extended_search": "", "domain_tree": "", "hide_item": ""}});\n
});\n
}\n
// Listen to form submit\n
......@@ -265,6 +264,7 @@
false,\n
formSubmit\n
);\n
\n
loopEventListener(\n
gadget.props.element.querySelector(\'.filter_form\'),\n
\'submit\',\n
......@@ -396,7 +396,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>romain</string> </value>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -410,7 +410,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>946.27251.38084.62685</string> </value>
<value> <string>946.46366.4373.50670</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -428,7 +428,7 @@
</tuple>
<state>
<tuple>
<float>1444824166.86</float>
<float>1445965368.84</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -276,12 +276,16 @@
})\n
.push(function (result) {\n
var key,\n
sort_list = {},\n
queue = new RSVP.Queue();\n
if (options.form_definition.sort_list) {\n
sort_list = JSON.parse(options.form_definition.sort_list);\n
}\n
gadget.props.column_list = result._embedded._view.listbox.column_list;\n
for (key in options.form_definition.sort_list) {\n
if (options.form_definition.sort_list.hasOwnProperty(key)) {\n
if (options.form_definition.sort_list[key] !== "") {\n
queue.push(createTranslatedItem(gadget, options.form_definition.sort_list[key]));\n
for (key in sort_list) {\n
if (sort_list.hasOwnProperty(key)) {\n
if (sort_list[key] !== "") {\n
queue.push(createTranslatedItem(gadget, sort_list[key]));\n
}\n
}\n
}\n
......@@ -315,24 +319,21 @@
false,\n
function () {\n
var sort_list = gadget.props.element.querySelectorAll(".sortForm"),\n
sort_query = [],\n
sort_query = {},\n
sort_item,\n
sort_item_query,\n
i;\n
for (i = 0; i < sort_list.length; i += 1) {\n
sort_item = sort_list[i];\n
sort_item_query = sort_item[0][sort_item[0].selectedIndex].value + "," + sort_item[1][sort_item[1].selectedIndex].value + ",";\n
sort_query.push(sort_item_query);\n
sort_query[i] = sort_item_query;\n
}\n
sort_query.push("");\n
sort_query[i] = "";\n
return new RSVP.Queue()\n
.push(function () {\n
gadget.props.jelement.panel("toggle");\n
return gadget.redirect({jio_key: gadget.props.options.jio_key,\n
"extended_search": gadget.props.options.form_definition.extended_search || "",\n
"domain_tree": gadget.props.options.form_definition.domain_tree || "",\n
"sort_list": sort_query,\n
"hide_item": gadget.props.options.form_definition.hide_item || ""});\n
return gadget.redirect({command: \'change\', options: {\n
"sort_list": JSON.stringify(sort_query)}});\n
});\n
}\n
);\n
......@@ -475,7 +476,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>946.6000.3675.35362</string> </value>
<value> <string>946.46298.51121.25531</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -493,7 +494,7 @@
</tuple>
<state>
<tuple>
<float>1443629882.33</float>
<float>1445963800.7</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