Commit e41236ef authored by Alain Takoudjou's avatar Alain Takoudjou

erp5_web_mynij_search: redirect to search page after load a source json file

parent 42f85155
......@@ -10,6 +10,7 @@
.declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("getUrlParameter", "getUrlParameter")
.declareAcquiredMethod("getSetting", "getSetting")
.declareAcquiredMethod("setSetting", "setSetting")
.declareAcquiredMethod("notifySubmitted", "notifySubmitted")
.ready(function () {
......@@ -31,7 +32,7 @@
return new RSVP.Queue()
.push(function () {
return gadget.updateHeader({
page_title: "Torrent Source import"
page_title: "JSON Source import"
});
});
})
......@@ -89,15 +90,30 @@
})
.push(function (result) {
var count = result.length;
return gadget.notifySubmitted({
message: count + " Source(s) correctly imported!",
status: "success"
return gadget.getSetting("build_dict", {})
.push(function (build_dict) {
var i;
for (i = 0; i < result.length; i += 1) {
build_dict[result[i]] = {
links: source_list[i].links,
index_name: source_list[i].title,
jio_key: result[i],
id: Date.now()
};
}
return gadget.setSetting("build_dict", build_dict);
})
.push(function () {
var options = {page : "ojs_local_controller"};
if (count > 0) {
options.jio_key = result[0];
}
return gadget.notifySubmitted({
message: count + " Source(s) correctly imported!\n" +
"Build of imported source(s) will start!",
status: "success"
});
})
.push(function () {
var options = {page : "mynij_search"};
return gadget.redirect({command: 'display', options: options});
});
});
......
......@@ -242,7 +242,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>994.43703.49451.32375</string> </value>
<value> <string>994.55525.49822.47940</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -260,7 +260,7 @@
</tuple>
<state>
<tuple>
<float>1631197348.88</float>
<float>1632233519.34</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