Commit 373858b2 authored by Papa Tamsir Kane's avatar Papa Tamsir Kane

erp5_officejs: Bookmark Manager: fix migration code

* Migrate all documents instead of just the first one
* Modify dropbox configurator to use query setting if available
parent e17b6482
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
</head> </head>
<body> <body>
<script data-renderjs-configuration="portal_type" type="text/x-renderjs-configuration">Url</script> <script data-renderjs-configuration="portal_type" type="text/x-renderjs-configuration">Url</script>
<script data-renderjs-configuration="query" type="text/x-renderjs-configuration">portal_type: "Url" OR portal_type: "Bookmark"</script>
<script data-renderjs-configuration="parent_relative_url" type="text/x-renderjs-configuration">url_module</script> <script data-renderjs-configuration="parent_relative_url" type="text/x-renderjs-configuration">url_module</script>
<script data-renderjs-configuration="document_title" type="text/x-renderjs-configuration">Bookmark</script> <script data-renderjs-configuration="document_title" type="text/x-renderjs-configuration">Bookmark</script>
<script data-renderjs-configuration="document_title_plural" type="text/x-renderjs-configuration">Bookmarks</script> <script data-renderjs-configuration="document_title_plural" type="text/x-renderjs-configuration">Bookmarks</script>
......
...@@ -275,7 +275,7 @@ ...@@ -275,7 +275,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>961.49448.1356.36437</string> </value> <value> <string>962.6954.11325.44800</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -293,7 +293,7 @@ ...@@ -293,7 +293,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1504096072.75</float> <float>1505480827.65</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -41,10 +41,10 @@ ...@@ -41,10 +41,10 @@
promises_list.push(gadget.jio_put(query_result.data.rows[i].id, row_value)); promises_list.push(gadget.jio_put(query_result.data.rows[i].id, row_value));
} }
} }
data = query_result;
promises_list.push(gadget.setSetting('migrated', true));
return RSVP.all(promises_list);
} }
promises_list.push(gadget.setSetting('migrated', true));
data = query_result;
return RSVP.all(promises_list);
} else { } else {
data = query_result; data = query_result;
} }
...@@ -96,8 +96,7 @@ ...@@ -96,8 +96,7 @@
"key": "field_listbox", "key": "field_listbox",
"lines": 30, "lines": 30,
"list_method": "portal_catalog", "list_method": "portal_catalog",
"query": "urn:jio:allDocs?query=portal_type%3A%22" + "query": 'portal_type: "Url" OR portal_type: "Bookmark"',
result[1] + "%22",
"portal_type": [], "portal_type": [],
"search_column_list": column_list, "search_column_list": column_list,
"sort_column_list": column_list, "sort_column_list": column_list,
......
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>962.5348.11380.64921</string> </value> <value> <string>962.6982.53259.45892</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1505382104.85</float> <float>1505481207.55</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -8,16 +8,20 @@ ...@@ -8,16 +8,20 @@
.push(function () { .push(function () {
return RSVP.all([ return RSVP.all([
gadget.getSetting("portal_type"), gadget.getSetting("portal_type"),
gadget.getSetting("erp5_attachment_synchro", "") gadget.getSetting("erp5_attachment_synchro", ""),
gadget.getSetting("query", null)
]); ]);
}) })
.push(function (setting) { .push(function (setting) {
if (setting[2] === null) {
setting[2] = setting[0];
}
var configuration = {}, var configuration = {},
attachment_synchro = setting[1] !== ""; attachment_synchro = setting[1] !== "";
configuration = { configuration = {
type: "replicate", type: "replicate",
query: { query: {
query: 'portal_type:"' + setting[0] + '" ', query: setting[2],
limit: [0, 100], limit: [0, 100],
sort_on: [["modification_date", "descending"]] sort_on: [["modification_date", "descending"]]
}, },
......
...@@ -242,7 +242,7 @@ ...@@ -242,7 +242,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>961.26184.18077.10393</string> </value> <value> <string>962.6956.19499.59221</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -260,7 +260,7 @@ ...@@ -260,7 +260,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1502716653.05</float> <float>1505479600.23</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