diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.js b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.js index 1dfd845187bc71b92863a74f459a8ab778fdcaf0..02cd645184f4e142035eb124c51e745701667b9e 100644 --- a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.js +++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.js @@ -68,7 +68,8 @@ return gadget.getSearchCriteria(params[0][0], params[0][1]) .push(function (result) { - return gadget.redirect({command: 'change', options: {extended_search: result}}); + return gadget.redirect({command: 'change', options: {extended_search: result, + field_listbox_begin_from: undefined}}); }) .push(undefined, function (error) { if (error instanceof RSVP.CancellationError) { @@ -233,6 +234,16 @@ }); }); }) + .declareJob("renderRestoreButton", function () { + var gadget = this, + restore = document.getElementById('restoreButton'); + return gadget.getUrlParameter('extended_search') + .push(function (result) { + if (result !== undefined) { + restore.removeAttribute("disabled"); + } + }); + }) .onStateChange(function () { var gadget = this, queue = new RSVP.Queue(); @@ -264,6 +275,7 @@ if (last_href === undefined) { throw new Error('Cant find the list document view'); } + gadget.property_dict.option_dict = { graph_gadget: "unsafe/gadget_field_graph_echarts.html", listbox_gadget: last_href, @@ -273,6 +285,7 @@ return RSVP.all([ result_list[1].render(), + gadget.renderRestoreButton(), gadget.renderGraph() //Launched as service, not blocking ]); }); @@ -312,14 +325,8 @@ if (event.target.id === "restoreButton") { restore.setAttribute("disabled", "disabled"); - return gadget.getDeclaredGadget("last") - .push(function (listbox) { - return listbox.render({ - jio_key: gadget.property_dict.option_dict.listbox_jio_key, - view: gadget.property_dict.option_dict.listbox_gadget, - extended_search: null - }); - }); + return gadget.redirect({command: 'change', options: {extended_search: undefined, + field_listbox_begin_from: undefined}}); } if (event.target.id === "generateRSS") { @@ -376,4 +383,4 @@ }); }); -}(window, rJS, RSVP)); +}(window, rJS, RSVP)); \ No newline at end of file diff --git a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.xml b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.xml index 3ed8855eb0b71e4f594b7208ac692693a69e4346..fca68633d6f8e3f9a8d1da242fb7f8873acd771e 100644 --- a/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.xml +++ b/bt5/erp5_officejs_support_request_ui/PathTemplateItem/web_page_module/gadget_supportrequest_homepage_js.xml @@ -236,7 +236,7 @@ </item> <item> <key> <string>serial</string> </key> - <value> <string>962.23501.9134.29371</string> </value> + <value> <string>962.25742.4974.61781</string> </value> </item> <item> <key> <string>state</string> </key> @@ -254,7 +254,7 @@ </tuple> <state> <tuple> - <float>1506471192.27</float> + <float>1506605728.66</float> <string>UTC</string> </tuple> </state>