Commit 598bb3fe authored by Romain Courteaud's avatar Romain Courteaud

[erp5_web_renderjs_ui] Display the modification date on search list

parent d176729a
...@@ -10,10 +10,43 @@ ...@@ -10,10 +10,43 @@
.declareAcquiredMethod("updateHeader", "updateHeader") .declareAcquiredMethod("updateHeader", "updateHeader")
.declareAcquiredMethod("getUrlParameter", "getUrlParameter") .declareAcquiredMethod("getUrlParameter", "getUrlParameter")
.declareAcquiredMethod("getUrlFor", "getUrlFor") .declareAcquiredMethod("getUrlFor", "getUrlFor")
.declareAcquiredMethod("jio_allDocs", "jio_allDocs")
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// declared methods // declared methods
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
.allowPublicAcquisition("jio_allDocs", function (param_list) {
var gadget = this;
return gadget.jio_allDocs(param_list[0])
.push(function (result) {
var i, date, len = result.data.total_rows;
for (i = 0; i < len; i += 1) {
if (result.data.rows[i].value.hasOwnProperty("modification_date")) {
date = new Date(result.data.rows[i].value.modification_date);
result.data.rows[i].value.modification_date = {
field_gadget_param: {
allow_empty_time: 0,
ampm_time_style: 0,
css_class: "date_field",
date_only: true,
description: "The Date",
editable: 1,
hidden: 0,
hidden_day_is_last_day: 0,
"default": date.toUTCString(),
key: "modification_date",
required: 0,
timezone_style: 0,
title: "Modification Date",
type: "DateTimeField"
}
};
}
}
return result;
});
})
.allowPublicAcquisition('updateHeader', function () { .allowPublicAcquisition('updateHeader', function () {
return; return;
}) })
...@@ -65,11 +98,11 @@ ...@@ -65,11 +98,11 @@
.push(function (form_gadget) { .push(function (form_gadget) {
var column_list = [ var column_list = [
['translated_portal_type', 'Type'], ['translated_portal_type', 'Type'],
['modification_date', 'Modification Date'],
['title', 'Title'], ['title', 'Title'],
['reference', 'Reference'], ['reference', 'Reference'],
['description', 'Description'], ['description', 'Description'],
['translated_validation_state_title', 'State'] ['translated_validation_state_title', 'State']
// ['modification_date', 'Modification Date']
]; ];
return form_gadget.render({ return form_gadget.render({
erp5_document: {"_embedded": {"_view": { erp5_document: {"_embedded": {"_view": {
...@@ -88,12 +121,6 @@ ...@@ -88,12 +121,6 @@
"sort_column_list": column_list, "sort_column_list": column_list,
"title": "Documents", "title": "Documents",
"type": "ListBox" "type": "ListBox"
},
"listbox_modification_date": {
"date_only": true,
"title": "Modification Date",
"type": "DateTimeField",
"editable": 1
} }
}}, }},
"_links": { "_links": {
......
...@@ -230,7 +230,7 @@ ...@@ -230,7 +230,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>965.31874.35241.45806</string> </value> <value> <string>968.24003.31720.11707</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>1518597351.54</float> <float>1529576061.63</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