Commit 50504c85 authored by Xiaowu Zhang's avatar Xiaowu Zhang

erp5_web_renderjs_ui: improve filter editor and add sort editor.

1. use QueryFactory to process query in filter editor and listbox
2. add draft support for sort editor
3. add layout for hide rows functionality in listbox
parent 1662cbe4
......@@ -73,13 +73,14 @@ return context.ERP5Document_getHateoas(\n
default_param_json=default_param_json,\n
form_relative_url=form_relative_url,\n
bulk_list=bulk_list,\n
sort_on=sort_on,\n
restricted=1\n
)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>REQUEST=None, response=None, view=None, mode=\'root\', query=None, select_list=None, limit=10, form=None, relative_url=None, list_method=None, default_param_json=None, form_relative_url=None, bulk_list="[]"</string> </value>
<value> <string>REQUEST=None, response=None, view=None, mode=\'root\', query=None, select_list=None, limit=10, form=None, relative_url=None, list_method=None, default_param_json=None, form_relative_url=None, bulk_list="[]", sort_on=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -75,18 +75,18 @@ url_template_dict = {\n
"traverse_template": "%(root_url)s/%(script_id)s?mode=traverse" + \\\n
"{&relative_url,view}",\n
"search_template": "%(root_url)s/%(script_id)s?mode=search" + \\\n
"{&query,select_list*,limit*}",\n
"{&query,select_list*,limit*,sort_on*}",\n
"custom_search_template": "%(root_url)s/%(script_id)s?mode=search" + \\\n
"&relative_url=%(relative_url)s" \\\n
"&form_relative_url=%(form_relative_url)s" \\\n
"&list_method=%(list_method)s" \\\n
"&default_param_json=%(default_param_json)s" \\\n
"{&query,select_list*,limit*}",\n
"{&query,select_list*,limit*,sort_on*}",\n
"custom_search_template_no_editable": "%(root_url)s/%(script_id)s?mode=search" + \\\n
"&relative_url=%(relative_url)s" \\\n
"&list_method=%(list_method)s" \\\n
"&default_param_json=%(default_param_json)s" \\\n
"{&query,select_list*,limit*}",\n
"{&query,select_list*,limit*,sort_on*}",\n
"new_content_action": "%(root_url)s/%(script_id)s?mode=newContent",\n
"bulk_action": "%(root_url)s/%(script_id)s?mode=bulk",\n
# XXX View is set by default to empty\n
......@@ -103,9 +103,9 @@ def getAllSubCategoriesAsMap(root):\n
sub_categories_list = root.objectValues()\n
if len(sub_categories_list) != 0:\n
for grain in sub_categories_list:\n
result[grain.getTitle()] = {"sub_categories": getAllSubCategoriesAsMap(grain),\n
"id": grain.getId(),\n
"uid": grain.getUid()}\n
result[grain.getId()] = {"sub_categories": getAllSubCategoriesAsMap(grain),\n
"title": grain.getTitle(),\n
"uid": grain.getUid()}\n
\n
return result\n
\n
......@@ -392,8 +392,8 @@ def renderField(traversed_document, field, form_relative_url, value=None, meta_t
domain_tree = field.get_value("domain_root_list")\n
for tree in domain_tree:\n
if hasattr(portal_categories, tree[0]):\n
domain_tree_map[tree[1]] = {"sub_categories":getAllSubCategoriesAsMap(portal_categories[tree[0]]),\n
"id": tree[0],\n
domain_tree_map[tree[0]] = {"sub_categories":getAllSubCategoriesAsMap(portal_categories[tree[0]]),\n
"title": tree[1],\n
"uid": portal_categories[tree[0]].getUid()}\n
\n
result = {\n
......@@ -921,11 +921,18 @@ def calculateHateoas(is_portal=None, is_site_root=None, traversed_document=None,
callable_list_method = portal.portal_catalog\n
else:\n
callable_list_method = getattr(traversed_document, list_method)\n
\n
tmp_sort_on = ()\n
if sort_on is not None:\n
for grain in sort_on:\n
if grain != "":\n
tmp_sort_on += (tuple([x for x in grain.split(",")]),)\n
\n
if query:\n
sql_list = callable_list_method(full_text=query, limit=limit, **catalog_kw)\n
sql_list = callable_list_method(full_text=query, limit=limit, sort_on=tmp_sort_on, **catalog_kw)\n
else:\n
sql_list = callable_list_method(limit=limit, **catalog_kw)\n
\n
sql_list = callable_list_method(limit=limit, sort_on=tmp_sort_on, **catalog_kw)\n
\n
result_list = []\n
\n
# if (select_list is None):\n
......@@ -1081,7 +1088,7 @@ else:\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>REQUEST=None, response=None, view=None, mode=\'root\', query=None, select_list=None, limit=10, form=None, relative_url=None, restricted=0, list_method=None, default_param_json=None, form_relative_url=None, bulk_list="[]"</string> </value>
<value> <string>REQUEST=None, response=None, view=None, mode=\'root\', query=None, select_list=None, limit=10, form=None, relative_url=None, restricted=0, list_method=None, default_param_json=None, form_relative_url=None, bulk_list="[]", sort_on=()</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -137,6 +137,10 @@
<option selected="selected" data-i18n="{{text}}" value="{{value}}">{{text}}</option>\n
</script>\n
\n
\n
\n
\n
\n
<script id="filter-template" type="text/x-handlebars-template">\n
<div class="ui-panel-inner">\n
\n
......@@ -153,7 +157,7 @@
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-right">\n
<div class="ui-controlgroup-controls">\n
<form class="submit">\n
<button data-rel="save" type="submit" class="submit responsive ui-last-child ui-btn ui-btn-icon-right ui-icon-check">Save</button>\n
<button data-rel="save" type="submit" class="submit responsive ui-last-child ui-btn ui-btn-icon-left ui-icon-check">Save</button>\n
</form>\n
</div>\n
</div>\n
......@@ -345,7 +349,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>945.22508.10889.31197</string> </value>
<value> <string>945.37783.58290.59204</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -363,7 +367,7 @@
</tuple>
<state>
<tuple>
<float>1440760242.27</float>
<float>1442309257.72</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -102,10 +102,9 @@
<value> <string encoding="cdata"><![CDATA[
/*jslint nomen: true, indent: 2, maxerr: 3 */\n
/*global window, rJS, Handlebars, jQuery, RSVP, loopEventListener, document */\n
/*global window, rJS, Handlebars, jQuery, RSVP, loopEventListener, document, QueryFactory */\n
(function (window, rJS, Handlebars, $, RSVP, loopEventListener) {\n
"use strict";\n
\n
/////////////////////////////////////////////////////////////////\n
// templates\n
/////////////////////////////////////////////////////////////////\n
......@@ -147,7 +146,7 @@
if (select === "keyword" && filterforms[i][0][filterforms[i][0].selectedIndex].value !== "Searchable Text") {\n
value = "%" + value + "%";\n
} else {\n
value = select + " " + value;\n
value = select + value;\n
}\n
if (filterforms[i][0][filterforms[i][0].selectedIndex].value === "Searchable Text") {\n
query += value;\n
......@@ -170,10 +169,13 @@
query += gadget.props.tree_path[i];\n
}\n
if (gadget.props.tree_path[gadget.props.tree_path.length - 1] !== \'--\') {\n
query += "/" + gadget.props.tree_path[gadget.props.tree_path.length - 1];\n
if (gadget.props.tree_path.length === 1) {\n
query += gadget.props.tree_path[0];\n
} else {\n
query += "/" + gadget.props.tree_path[gadget.props.tree_path.length - 1];\n
}\n
}\n
}\n
\n
return new RSVP.Queue()\n
.push(function () {\n
return gadget.pleasePublishMyState({\n
......@@ -235,12 +237,12 @@
if (key === selected_value) {\n
tmp += selected_option_template({\n
value: key,\n
text: key\n
text: domain_tree_map[key].title\n
});\n
} else {\n
tmp += option_template({\n
value: key,\n
text: key\n
text: domain_tree_map[key].title\n
});\n
}\n
}\n
......@@ -263,7 +265,7 @@
}\n
\n
\n
function createFilterItem(gadget, select, input_value) {\n
function createFilterItem(gadget, select, input_value, operator) {\n
var div = document.createElement("div"),\n
container = document.createElement("form"),\n
minus_button = document.createElement("input"),\n
......@@ -273,7 +275,6 @@
default_select = "Searchable Text",\n
select_options,\n
select_options_value,\n
value_list = ["", ""],\n
options_map = {\n
"date_float": ["Equals To", "Greater Than", "Less Than", "Not Greater Than", "Not Less Than"],\n
"date_float_value": ["", ">", "<", "<=", ">="],\n
......@@ -296,16 +297,13 @@
function createSelectOperator(event) {\n
var html = "",\n
j;\n
if (input_value !== undefined) {\n
value_list = input_value.split(" ");\n
}\n
if (event.target.value.indexOf(\'date\') !== -1) {\n
text.setAttribute("type", "date");\n
value_list[value_list.length - 1] = value_list[value_list.length - 1].replace(/\\//g, "-");\n
input_value = input_value ? input_value.replace(/\\//g, "-") : "";\n
} else {\n
text.setAttribute("type", "text");\n
}\n
text.setAttribute("value", value_list[value_list.length - 1] || "");\n
text.setAttribute("value", input_value || "");\n
if (event.target.value.indexOf(\'date\') !== -1 ||\n
event.target.value.indexOf(\'quantity\') !== -1 ||\n
event.target.value.indexOf(\'price\') !== -1) {\n
......@@ -320,7 +318,7 @@
}\n
\n
for (j = 0; j < select_options.length; j += 1) {\n
if (value_list[0] === select_options_value[j]) {\n
if (operator === select_options_value[j]) {\n
html += selected_option_template({\n
value: select_options_value[j],\n
text: select_options[j]\n
......@@ -468,8 +466,7 @@
item,\n
and = gadget.props.element.querySelector(".and"),\n
or = gadget.props.element.querySelector(".or"),\n
select_list,\n
query;\n
query = "";\n
while (container.firstChild !== container.lastChild) {\n
container.removeChild(container.firstChild);\n
}\n
......@@ -478,21 +475,71 @@
}\n
\n
this.props.options = options;\n
if (options.filterEditor !== undefined || options.pg !== undefined) {\n
if (options.filterEditor !== undefined || options.pg !== undefined || options.sortEditor) {\n
gadget.props.tree_path = [];\n
query = options.filterEditor ? options.filterEditor.extended_search : options.pg.fg.erp5_searchfield.extended_search;\n
if (options.filterEditor) {\n
query = options.filterEditor.extended_search;\n
} else if (options.sortEditor) {\n
query = options.sortEditor.extended_search;\n
} else if (options.pg.fg.erp5_searchfield) {\n
query = options.pg.fg.erp5_searchfield.extended_search;\n
}\n
if (query === undefined) {\n
query = "";\n
}\n
return new RSVP.Queue()\n
.push(function () {\n
return gadget.jio_getAttachment({"_id": options.jio_key, "_attachment": options.view});\n
})\n
.push(function (result) {\n
var query_list = QueryFactory.create(query),\n
j = 0,\n
key,\n
domain_tree_map = result.data._embedded._view.listbox.domain_tree_map,\n
domain_tree_list;\n
gadget.props.options = result.data._embedded._view.listbox.column_list;\n
gadget.props.domain_tree_map = result.data._embedded._view.listbox.domain_tree_map;\n
if (query_list.operator === "OR") {\n
or.checked = true;\n
or.parentElement.children[0].setAttribute("class", "ui-btn ui-corner-all ui-btn-inherit ui-btn-icon-left ui-radio-on");\n
} else {\n
and.checked = true;\n
and.parentElement.children[0].setAttribute("class", "ui-btn ui-corner-all ui-btn-inherit ui-btn-icon-left ui-radio-on");\n
}\n
query_list = query_list.query_list || [query_list];\n
for (i = 0; i < query_list.length; i += 1) {\n
key = query_list[i].key;\n
if (key !== "Domain") {\n
if (key === undefined) {\n
item = createFilterItem(gadget, "Searchable Text", query_list[i].value);\n
} else {\n
item = createFilterItem(gadget, key, query_list[i].value, query_list[i].operator);\n
}\n
container.insertBefore(item, container.lastChild);\n
} else {\n
domain_tree_list = query_list[i].value.split("/");\n
createDomainTree(gadget, domain_tree_map, domain_tree_list[0]);\n
for (j = 0; j < domain_tree_list.length; j += 1) {\n
domain_tree_map = domain_tree_map[domain_tree_list[j]].sub_categories;\n
if (Object.keys(domain_tree_map).length !== 0) {\n
createDomainTree(gadget, domain_tree_map, domain_tree_list[j + 1]);\n
}\n
}\n
}\n
}\n
if (gadget.props.element.querySelector(".filterForm") === null) {\n
container.insertBefore(createFilterItem(gadget), container.lastChild);\n
}\n
if (gadget.props.element.querySelector(".domain_tree") === null) {\n
createDomainTree(gadget);\n
}\n
/*\n
var query_list = query.split(" OR "),\n
j = 0,\n
domain_tree_map = result.data._embedded._view.listbox.domain_tree_map,\n
domain_tree_list;\n
gadget.props.options = result.data._embedded._view.listbox.column_list;\n
gadget.props.domain_tree_map = result.data._embedded._view.listbox.domain_tree_map;\n
\n
if (query_list.length === 1) {\n
query_list = query.split(" AND ");\n
and.checked = true;\n
......@@ -527,7 +574,8 @@
}\n
if (gadget.props.element.querySelector(".domain_tree") === null) {\n
createDomainTree(gadget);\n
}\n
}*/\n
\n
});\n
}\n
})\n
......@@ -536,26 +584,22 @@
// declared services\n
/////////////////////////////////////////////////////////////////\n
.declareService(function () {\n
var gadget = this;\n
var gadget = this,\n
item;\n
function closeFilterEditor() {\n
gadget.props.jelement.panel("toggle");\n
}\n
function plusItem() {\n
return new RSVP.Queue()\n
.push(function () {\n
return createFilterItem(gadget);\n
})\n
.push(function (item) {\n
var container = gadget.props.element.querySelector(".filter_item_container");\n
container.insertBefore(item, container.lastChild);\n
});\n
}\n
\n
\n
loopEventListener(\n
gadget.props.element.querySelector(".plus"),\n
"submit",\n
false,\n
plusItem\n
function () {\n
var container = gadget.props.element.querySelector(".filter_item_container");\n
item = createFilterItem(gadget);\n
container.insertBefore(item, container.lastChild);\n
}\n
);\n
loopEventListener(\n
gadget.props.element.querySelector(".delete"),\n
......@@ -710,7 +754,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>945.28374.52028.3822</string> </value>
<value> <string>945.49499.52520.15308</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -728,7 +772,7 @@
</tuple>
<state>
<tuple>
<float>1441041247.46</float>
<float>1442307606.31</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -221,6 +221,9 @@
if (form_definition.extended_search) {\n
suboption_dict.extended_search = form_definition.extended_search;\n
}\n
if (form_definition.extended_sort_list) {\n
suboption_dict.extended_sort_list = form_definition.extended_sort_list;\n
}\n
\n
form_gadget.props.gadget_list = [];\n
form_gadget.props.id = erp5_document._id;\n
......@@ -500,7 +503,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>xiaowu</string> </value>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -514,7 +517,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>944.22467.53128.26641</string> </value>
<value> <string>945.49324.9572.9676</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -532,8 +535,8 @@
</tuple>
<state>
<tuple>
<float>1436753892.36</float>
<string>GMT+2</string>
<float>1442309628.83</float>
<string>UTC</string>
</tuple>
</state>
</object>
......
......@@ -163,6 +163,10 @@
<div data-gadget-url="gadget_erp5_filter_editor.html"\n
data-gadget-scope="filterEditor"\n
data-gadget-sandbox="public"></div>\n
\n
<div data-gadget-url="gadget_erp5_sort_editor.html"\n
data-gadget-scope="sortEditor"\n
data-gadget-sandbox="public"></div>\n
\n
<div role="main" class="ui-content gadget-content"></div>\n
......@@ -310,7 +314,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>945.18332.59164.9181</string> </value>
<value> <string>945.49198.46948.13260</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -328,7 +332,7 @@
</tuple>
<state>
<tuple>
<float>1440437597.42</float>
<float>1442309444.67</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -498,6 +498,9 @@
.allowPublicAcquisition(\'triggerFilterEditor\', function () {\n
return route(this, "filterEditor", "toggle");\n
})\n
.allowPublicAcquisition("triggleSortEditor", function () {\n
return route(this, "sortEditor", "toggle");\n
})\n
\n
.allowPublicAcquisition("jio_allDocs", function (param_list) {\n
return callJioGadget(this, "allDocs", param_list);\n
......
......@@ -120,22 +120,26 @@
\n
<!-- custom script -->\n
<script src="gadget_erp5_field_listbox.js" type="text/javascript"></script>\n
\n
\n
</head>\n
<body>\n
\n
<!-- XXX must set a theme here -->\n
<section class="document_table">\n
<div class="ui-table-header ui-header ui-bar-c ui-corner-all">\n
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-left">\n
<div class="ui-controlgroup-controls">\n
<a data-i18n="hide" class="ui-responsive ui-btn ui-btn-icon-left ui-icon-eye ui-first-child ui-override-theme ui-disabled" href="#">Hide Rows</a>\n
<form class="hide_form">\n
<button data-rel="hide" type="submit" class="submit responsive ui-last-child ui-btn ui-icon-eye ui-btn-icon-left">Hide Rows</button>\n
</form>\n
</div>\n
</div>\n
<h1 data-i18n="selected" class="ui-title ui-override-theme">0 items selected</h1>\n
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-right">\n
<div class="ui-controlgroup-controls">\n
<a data-i18n="sort" class="ui-responsive ui-btn ui-btn-icon-left ui-icon-sort-amount-desc ui-last-child ui-override-theme ui-disabled" href="#">Sort</a>\n
<form class="sort_form">\n
<button data-rel="Sort" type="submit" class="submit responsive ui-last-child ui-btn ui-icon-sort-amount-desc ui-btn-icon-left">Sort</button>\n
</form>\n
</div>\n
</div>\n
</div>\n
......@@ -269,7 +273,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>super_sven</string> </value>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -283,7 +287,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>939.51034.42464.64273</string> </value>
<value> <string>945.49220.61498.30600</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -301,8 +305,8 @@
</tuple>
<state>
<tuple>
<float>1419418783.77</float>
<string>GMT</string>
<float>1442307840.51</float>
<string>UTC</string>
</tuple>
</state>
</object>
......
......@@ -108,9 +108,11 @@
<value> <string encoding="cdata"><![CDATA[
/*jslint indent: 2, maxerr: 3, nomen: true */\n
/*global window, document, rJS, URI, RSVP, UriTemplate */\n
/*global window, document, rJS, URI, RSVP, UriTemplate, QueryFactory, loopEventListener */\n
(function (window, document, rJS, URI, RSVP, UriTemplate) {\n
"use strict";\n
\n
\n
\n
rJS(window)\n
/////////////////////////////////////////////////////////////////\n
......@@ -131,6 +133,7 @@
g.props.element = element;\n
});\n
})\n
\n
\n
//////////////////////////////////////////////\n
// acquired method\n
......@@ -140,6 +143,7 @@
.declareAcquiredMethod("getUrlFor", "getUrlFor")\n
.declareAcquiredMethod("getUrlParameter", "getUrlParameter")\n
.declareAcquiredMethod("getFieldTypeGadgetUrl", "getFieldTypeGadgetUrl")\n
.declareAcquiredMethod("triggleSortEditor", "triggleSortEditor")\n
//////////////////////////////////////////////\n
// initialize the gadget content\n
//////////////////////////////////////////////\n
......@@ -155,6 +159,9 @@
\n
gadget.props.field_json = field_json;\n
gadget.props.extended_search = options.extended_search;\n
if (options.extended_sort_list) {\n
gadget.props.extended_sort_list = Object.keys(options.extended_sort_list).map(function (key) {return options.extended_sort_list[key]; });\n
}\n
if (field_json.show_anchor) {\n
th = document.createElement("th");\n
th.textContent = "Jump";\n
......@@ -188,13 +195,14 @@
//////////////////////////////////////////////\n
// render the listbox in an asynchronous way\n
//////////////////////////////////////////////\n
.declareService(function () {\n
.declareMethod(\'createListboxItem\', function (options) {\n
var gadget = this,\n
props = gadget.props,\n
field_json = props.field_json,\n
begin_from = props.begin_from,\n
table = props.element.querySelector(\'table\'),\n
original_tfoot = props.element.querySelector(\'tfoot\'),\n
original_tbody = props.element.querySelector(\'tbody\'),\n
tbody = document.createElement("tbody"),\n
url_query = props.extended_search,\n
query_string = "",\n
......@@ -206,8 +214,10 @@
tmp_query,\n
domain_query,\n
domain_tree_map,\n
sort_list = options.sort_list || [],\n
operator,\n
i,\n
j,\n
list_method_promise = function () {\n
return gadget.jio_allDocs.apply(gadget, arguments);\n
};\n
......@@ -219,43 +229,42 @@
// return previous + next[0] + \':= "\' + url_query + \'" OR \';\n
// }\n
//rebuild query\n
//don\'t know a good idea\n
if (url_query) {\n
domain_tree_map = props.field_json.domain_tree_map;\n
tmp_query = url_query.split(" OR ");\n
operator = " OR ";\n
if (tmp_query.length === 1) {\n
tmp_query = url_query.split(" AND ");\n
operator = " AND ";\n
}\n
tmp_query = QueryFactory.create(url_query);\n
operator = tmp_query.operator ? " " + tmp_query.operator + " " : " AND ";\n
tmp_query = tmp_query.query_list || [tmp_query];\n
\n
url_query = "";\n
for (i = 0; i < tmp_query.length; i += 1) {\n
if (i !== 0) {\n
url_query += operator;\n
}\n
if (tmp_query[i].indexOf("Domain:") !== -1) {\n
domain_query = tmp_query[i].split(":")[1].split("/");\n
if (tmp_query[i].key === "Domain") {\n
domain_query = tmp_query[i].value.split("/");\n
if (domain_query[0] !== "--") {\n
url_query += "category.base_category_uid: " + domain_tree_map[domain_query[0]].uid;\n
domain_tree_map = domain_tree_map[domain_query[0]].sub_categories;\n
for (i = 1; i < domain_query.length - 1; i += 1) {\n
last_uid = domain_tree_map[domain_query[i]].uid;\n
domain_tree_map = domain_tree_map[domain_query[i]].sub_categories;\n
for (j = 1; j < domain_query.length - 1; j += 1) {\n
last_uid = domain_tree_map[domain_query[j]].uid;\n
domain_tree_map = domain_tree_map[domain_query[j]].sub_categories;\n
}\n
if (i < domain_query.length && domain_query[i] !== "--") {\n
if (j < domain_query.length && domain_query[j] !== "--") {\n
url_query += operator;\n
url_query += "category.category_uid: " + domain_tree_map[domain_query[i]].uid;\n
} else if (i !== 1) {\n
url_query += "category.category_uid: " + domain_tree_map[domain_query[j]].uid;\n
} else if (j !== 1) {\n
url_query += operator;\n
url_query += "category.category_uid: " + last_uid;\n
}\n
}\n
} else {\n
url_query += tmp_query[i];\n
if (tmp_query[i].operator) {\n
url_query += tmp_query[i].key + ":" + tmp_query[i].operator + tmp_query[i].value;\n
} else {\n
url_query += tmp_query[i].key + ":" + tmp_query[i].value;\n
}\n
}\n
}\n
\n
\n
//query_string = field_json.column_list.reduce(buildQueryString, \' AND (\').replace(new RegExp("OR " + \'$\'), \')\');\n
if (field_json.list_method_template === undefined) {\n
query_string = \' AND \' + url_query;\n
......@@ -268,12 +277,15 @@
select_list.push(field_json.column_list[i][0]);\n
}\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
"query": new URI(field_json.query).query(true).query + query_string,\n
"limit": [begin_from, lines + 1],\n
"select_list": select_list\n
"select_list": select_list,\n
"sort_on": sort_list\n
}).push(function (result) {\n
var promise_list = [result];\n
counter = Math.min(result.data.total_rows, lines);\n
......@@ -293,8 +305,7 @@
return RSVP.all(promise_list);\n
\n
}).push(function (result_list) {\n
var j,\n
tr,\n
var tr,\n
th,\n
a,\n
result = result_list[0],\n
......@@ -322,6 +333,7 @@
dataset = result;\n
for (i = 0; i < counter; i += 1) {\n
tr = document.createElement("tr");\n
tr.setAttribute("value", result.data.rows[i].value.uid);\n
tmp_url = result_list[i + 1];\n
\n
if (field_json.show_anchor) {\n
......@@ -456,7 +468,7 @@
fragment.appendChild(tbody);\n
fragment.appendChild(tfoot);\n
\n
for (len = table.children.length; len > 0; len -= 1) {\n
for (len = table.children.length; len > 1; len -= 1) {\n
table.removeChild(table.lastChild);\n
}\n
// NOTE: for passing translations, temp must contain a table\n
......@@ -471,8 +483,58 @@
table.appendChild(temp);\n
});\n
})\n
.declareService(function () {\n
var gadget = this;\n
return gadget.createListboxItem({"sort_list": gadget.props.extended_sort_list});\n
})\n
.declareService(function () {\n
var gadget = this,\n
sort_form = gadget.props.element.querySelector(".sort_form");\n
loopEventListener(\n
sort_form,\n
"submit",\n
false,\n
function () {\n
gadget.triggleSortEditor();\n
}\n
);\n
})\n
.declareService(function () {\n
var gadget = this,\n
hide_form = gadget.props.element.querySelector(".hide_form");\n
/* hide form */\n
loopEventListener(\n
hide_form,\n
"submit",\n
false,\n
function () {\n
var tr_list = gadget.props.element.querySelector("tbody").querySelectorAll("tr"),\n
thead_tr = gadget.props.element.querySelector("thead").querySelector("tr"),\n
i,\n
th,\n
hide_form_elements,\n
checkbox;\n
\n
hide_form_elements = gadget.props.element.querySelectorAll(".hide_form_element");\n
if (hide_form_elements.length > 0) {\n
for (i = 0; i < hide_form_elements.length; i += 1) {\n
hide_form_elements[i].parentElement.removeChild(hide_form_elements[i]);\n
}\n
return;\n
}\n
th = document.createElement("th");\n
\n
th.setAttribute("class", "hide_form_element");\n
thead_tr.insertBefore(th, thead_tr.firstChild);\n
for (i = 0; i < tr_list.length; i += 1) {\n
checkbox = document.createElement("input");\n
checkbox.setAttribute("type", "checkbox");\n
checkbox.setAttribute("class", "hide_form_element");\n
tr_list[i].insertBefore(checkbox, tr_list[i].firstChild);\n
}\n
}\n
);\n
})\n
.declareMethod("getContent", function () {\n
var form_gadget = this,\n
k,\n
......@@ -651,7 +713,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>945.28372.10785.47223</string> </value>
<value> <string>945.49507.40992.33228</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -669,7 +731,7 @@
</tuple>
<state>
<tuple>
<float>1441041243.42</float>
<float>1442308372.06</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -139,6 +139,12 @@
\n
form_options.erp5_document = options.erp5_document;\n
form_options.form_definition = options.form_definition;\n
// XXX not generic, fix later\n
if (options.erp5_searchfield) {\n
form_options.form_definition.extended_search = options.erp5_searchfield.extended_search;\n
form_options.form_definition.extended_sort_list = options.erp5_searchfield.sort_list;\n
search_options.extended_search = options.erp5_searchfield.extended_search;\n
}\n
form_options.view = options.view;\n
\n
return new RSVP.Queue()\n
......@@ -342,7 +348,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>946.44927.40202.16725</string> </value>
<value> <string>945.49301.25010.20189</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -360,7 +366,7 @@
</tuple>
<state>
<tuple>
<float>1445939450.54</float>
<float>1442309537.27</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -174,8 +174,12 @@
var sub_options = options.fg;\n
if (sub_options === undefined) {\n
sub_options = {};\n
if(options.filterEditor) {\n
if (options.filterEditor) {\n
sub_options.erp5_searchfield = options.filterEditor;\n
} else {\n
if (options.sortEditor) {\n
sub_options.erp5_searchfield = options.sortEditor;\n
}\n
}\n
}\n
sub_options.erp5_document = erp5_document;\n
......@@ -337,7 +341,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>945.12418.34036.47547</string> </value>
<value> <string>945.49277.33497.32034</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -355,7 +359,7 @@
</tuple>
<state>
<tuple>
<float>1440083034.81</float>
<float>1442308423.62</float>
<string>UTC</string>
</tuple>
</state>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Page" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>content_type</string> </key>
<value> <string>text/html</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_sort_editor.html</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_erp5_sorteditor_html</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Page</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
<!DOCTYPE html>\n
<html>\n
<head>\n
<meta charset="utf-8" />\n
<meta name="viewport" content="width=device-width, user-scalable=no" />\n
<title>ERP5 Sort Editor</title>\n
\n
<!-- renderjs -->\n
<script src="rsvp.js"></script>\n
<script src="renderjs.js"></script>\n
<script src="handlebars.js"></script>\n
\n
<!-- custom script -->\n
<script src="gadget_erp5_sort_editor.js"></script>\n
\n
\n
\n
<script id="option-template" type="text/x-handlebars-template">\n
<option value="{{value}}" data-i18n="{{text}}">{{text}}</option>\n
</script>\n
\n
<script id="selected-option-template" type="text/x-handlebars-template">\n
<option selected="selected" data-i18n="{{text}}" value="{{value}}">{{text}}</option>\n
</script>\n
\n
<script id="sort-template" type="text/x-handlebars-template">\n
<div class="ui-panel-inner">\n
<div data-role="header" role="banner" class="ui-header ui-bar-inherit">\n
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-left">\n
<div class="ui-controlgroup-controls">\n
<form class="delete">\n
<button data-rel="close" type="submit" class="close responsive ui-first-child ui-btn ui-btn-icon-left ui-icon-times">Close</button>\n
</form>\n
</div>\n
</div>\n
\n
<h1 class="ui-title" role="heading" aria-level="1">Sort Editor</h1>\n
<div class="ui-controlgroup ui-controlgroup-horizontal ui-btn-right">\n
<div class="ui-controlgroup-controls">\n
<form class="submit">\n
<button data-rel="save" type="submit" class="submit responsive ui-last-child ui-btn ui-btn-icon-left ui-icon-check">Save</button>\n
</form>\n
</div>\n
</div>\n
</div>\n
<section class="ui-body-c ui-content-section">\n
<div class="sort_item_container">\n
<div></div>\n
<div></div>\n
</div>\n
<form class="plus">\n
<button type="submit" class="plus ui-btn-c ui-override-theme ui-btn ui-icon-plus ui-btn-icon-notext"></button>\n
</form>\n
</section>\n
</script>\n
</head>\n
<body>\n
<div class="jqm-navmenu-panel"></div>\n
</body>\n
</html>
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget Erp5 Sort Editor</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>test</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1442288947.85</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>test</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>945.49372.46702.47957</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1442299971.28</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>test</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>empty</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1442288588.68</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Web Script" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Change_local_roles_Permission</string> </key>
<value>
<tuple>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Anonymous</string>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>content_md5</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>gadget_erp5_sort_editor.js</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>rjs_gadget_erp5_sorteditor_js</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value> <string>en</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Web Script</string> </value>
</item>
<item>
<key> <string>short_title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
/*jslint indent: 2, maxerr: 3, nomen: true */\n
/*global window, document, rJS, URI, RSVP, UriTemplate, Handlebars, $, loopEventListener */\n
(function (window, document, rJS, RSVP) {\n
"use strict";\n
var gadget_klass = rJS(window),\n
option_source = gadget_klass.__template_element\n
.getElementById("option-template")\n
.innerHTML,\n
option_template = Handlebars.compile(option_source),\n
selected_option_source = gadget_klass.__template_element\n
.getElementById("selected-option-template")\n
.innerHTML,\n
selected_option_template = Handlebars.compile(selected_option_source),\n
sort_source = gadget_klass.__template_element\n
.getElementById("sort-template")\n
.innerHTML,\n
sort_template = Handlebars.compile(sort_source);\n
\n
\n
function createSortItem(gadget, sort_value) {\n
var div = document.createElement("div"),\n
container = document.createElement("form"),\n
minus_button = document.createElement("input"),\n
column_list = gadget.props.column_list,\n
select_reference = document.createElement("select"),\n
select_operator = document.createElement("select"),\n
sort_value_list = [],\n
i,\n
tmp = "";\n
if (sort_value) {\n
sort_value_list = sort_value.split(",");\n
}\n
minus_button.setAttribute("type", "button");\n
container.appendChild(select_reference);\n
container.appendChild(select_operator);\n
container.appendChild(minus_button);\n
container.setAttribute("class", "sortForm");\n
div.appendChild(container);\n
for (i = 0; i < column_list.length; i += 1) {\n
if (column_list[i][0] === sort_value_list[0]) {\n
tmp += selected_option_template({\n
value: column_list[i][0],\n
text: column_list[i][1]\n
});\n
} else {\n
tmp += option_template({\n
value: column_list[i][0],\n
text: column_list[i][1]\n
});\n
}\n
}\n
select_reference.innerHTML = tmp;\n
$(select_reference).selectmenu();\n
tmp = "";\n
if (sort_value_list[1] === "ascending") {\n
tmp += selected_option_template({\n
value: "ascending",\n
text: "ascending"\n
});\n
} else {\n
tmp += option_template({\n
value: "ascending",\n
text: "ascending"\n
});\n
}\n
\n
if (sort_value_list[1] === "descending") {\n
tmp += selected_option_template({\n
value: "descending",\n
text: "descending"\n
});\n
} else {\n
tmp += option_template({\n
value: "descending",\n
text: "descending"\n
});\n
}\n
\n
select_operator.innerHTML = tmp;\n
$(select_operator).selectmenu();\n
\n
loopEventListener(\n
minus_button,\n
"click",\n
false,\n
function () {\n
container.parentElement.removeChild(container);\n
}\n
);\n
return div;\n
}\n
\n
\n
\n
rJS(window)\n
/////////////////////////////////////////////////////////////////\n
// ready\n
/////////////////////////////////////////////////////////////////\n
// Init local properties\n
.ready(function (g) {\n
g.props = {};\n
})\n
.ready(function (g) {\n
return g.getElement()\n
.push(function (element) {\n
g.props.element = element;\n
g.props.jelement = $(element.querySelector(".jqm-navmenu-panel"));\n
});\n
})\n
.ready(function (g) {\n
g.props.jelement.panel({\n
display: "overlay",\n
position: "right",\n
theme: "c"\n
});\n
})\n
.ready(function (g) {\n
return new RSVP.Queue()\n
.push(function () {\n
var tmp = sort_template();\n
return g.translateHtml(tmp);\n
})\n
.push(function (translated_html) {\n
g.props.jelement.html(translated_html);\n
g.props.jelement.trigger("create");\n
});\n
})\n
\n
\n
//////////////////////////////////////////////\n
// acquired method\n
//////////////////////////////////////////////\n
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")\n
.declareAcquiredMethod("translateHtml", "translateHtml")\n
.declareAcquiredMethod("pleasePublishMyState", "pleasePublishMyState")\n
.declareAcquiredMethod("pleaseRedirectMyHash", "pleaseRedirectMyHash")\n
.declareMethod(\'toggle\', function () {\n
var gadget = this,\n
options = gadget.props.options;\n
this.props.jelement.panel("toggle");\n
if (gadget.props.column_list === "") {\n
return new RSVP.Queue()\n
.push(function () {\n
return gadget.jio_getAttachment({"_id": options.jio_key, "_attachment": options.view});\n
})\n
.push(function (result) {\n
gadget.props.column_list = result.data._embedded._view.listbox.column_list;\n
});\n
}\n
})\n
//////////////////////////////////////////////\n
// initialize the gadget content\n
//////////////////////////////////////////////\n
.declareMethod(\'render\', function (options) {\n
var gadget = this,\n
i,\n
container = gadget.props.element.querySelector(".sort_item_container"),\n
sort_form_list;\n
sort_form_list = gadget.props.element.querySelectorAll(".sortForm");\n
for (i = 0; i < sort_form_list.length; i += 1) {\n
sort_form_list[i].parentElement.removeChild(sort_form_list[i]);\n
}\n
gadget.props.options = options;\n
gadget.props.column_list = "";\n
if (options.sortEditor) {\n
return new RSVP.Queue()\n
.push(function () {\n
return gadget.jio_getAttachment({"_id": options.jio_key, "_attachment": options.view});\n
})\n
.push(function (result) {\n
var key;\n
gadget.props.column_list = result.data._embedded._view.listbox.column_list;\n
for (key in options.sortEditor.sort_list) {\n
if (options.sortEditor.sort_list.hasOwnProperty(key)) {\n
if (options.sortEditor.sort_list[key] !== "") {\n
container.insertBefore(createSortItem(gadget, options.sortEditor.sort_list[key]), container.lastChild);\n
}\n
}\n
}\n
});\n
}\n
})\n
//////////////////////////////////////////////\n
.declareService(function () {\n
var gadget = this;\n
function plusItem() {\n
var container = gadget.props.element.querySelector(".sort_item_container");\n
container.insertBefore(createSortItem(gadget), container.lastChild);\n
}\n
loopEventListener(\n
gadget.props.element.querySelector(".plus"),\n
"submit",\n
false,\n
plusItem\n
);\n
\n
loopEventListener(\n
gadget.props.element.querySelector(".delete"),\n
"submit",\n
false,\n
function () {\n
gadget.props.jelement.panel("toggle");\n
}\n
);\n
\n
loopEventListener(\n
gadget.props.element.querySelector(".submit"),\n
"submit",\n
false,\n
function () {\n
var sort_list = gadget.props.element.querySelectorAll(".sortForm"),\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
}\n
sort_query.push("");\n
return new RSVP.Queue()\n
.push(function () {\n
if (gadget.props.options.filterEditor) {\n
return gadget.pleasePublishMyState({\n
"extended_search": gadget.props.options.filterEditor.extended_search || "",\n
"sort_list": sort_query\n
});\n
}\n
if (gadget.props.options.sortEditor) {\n
return gadget.pleasePublishMyState({\n
"extended_search": gadget.props.options.sortEditor.extended_search || "",\n
"sort_list": sort_query\n
});\n
}\n
return gadget.pleasePublishMyState({\n
"sort_list": sort_query\n
});\n
})\n
.push(function (url) {\n
gadget.props.jelement.panel("toggle");\n
return gadget.pleaseRedirectMyHash(url);\n
});\n
}\n
);\n
});\n
\n
}(window, document, rJS, RSVP));
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Gadget Erp5 Sort Editor JS</string> </value>
</item>
<item>
<key> <string>version</string> </key>
<value> <string>001</string> </value>
</item>
<item>
<key> <string>workflow_history</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>document_publication_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>edit_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>processing_status_workflow</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>publish_alive</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>test</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1442289048.29</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
<item>
<key> <string>validation_state</string> </key>
<value> <string>published_alive</string> </value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value> <string>edit</string> </value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>945.49555.29942.44322</string> </value>
</item>
<item>
<key> <string>state</string> </key>
<value> <string>current</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1442311229.21</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="WorkflowHistoryList" module="Products.ERP5Type.patches.WorkflowTool"/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key> <string>action</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>test</string> </value>
</item>
<item>
<key> <string>comment</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>error_message</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_processing_state</string> </key>
<value> <string>empty</string> </value>
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>0.0.0.0</string> </value>
</item>
<item>
<key> <string>time</string> </key>
<value>
<object>
<klass>
<global name="DateTime" module="DateTime.DateTime"/>
</klass>
<tuple>
<none/>
</tuple>
<state>
<tuple>
<float>1442289000.01</float>
<string>UTC</string>
</tuple>
</state>
</object>
</value>
</item>
</dictionary>
</list>
</tuple>
</pickle>
</record>
</ZopeData>
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