Commit 3eca54d9 authored by Boxiang Sun's avatar Boxiang Sun

erp5_officejs_support_request_ui: Fix the field_listbox_begin_from can not found issue

This issue was reported by Nicolas. When embedding the
support request application in other App. The `options`
parameter in the `render` function is undefined, so the
`field_listbox_begin_from` can not be found. Use
`getUrlParameter` to retrieve it from URL.
parent a50f42b5
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
// Acquired methods // Acquired methods
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
.declareAcquiredMethod("jio_getAttachment", "jio_getAttachment") .declareAcquiredMethod("jio_getAttachment", "jio_getAttachment")
.declareAcquiredMethod("getUrlParameter", "getUrlParameter")
.declareAcquiredMethod("translateHtml", "translateHtml") .declareAcquiredMethod("translateHtml", "translateHtml")
.declareAcquiredMethod("redirect", "redirect") .declareAcquiredMethod("redirect", "redirect")
.declareAcquiredMethod("updateHeader", "updateHeader") .declareAcquiredMethod("updateHeader", "updateHeader")
...@@ -80,15 +81,18 @@ ...@@ -80,15 +81,18 @@
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
// declared methods // declared methods
///////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////
.declareMethod("render", function (options) { .declareMethod("render", function () {
var gadget = this; var gadget = this;
return gadget.changeState({ return gadget.changeState({
render: true render: true
}) })
.push(function () { .push(function () {
return gadget.getUrlParameter('field_listbox_begin_from');
})
.push(function (field_listbox_begin_from) {
return gadget.changeState({ return gadget.changeState({
field_listbox_begin_from: options.field_listbox_begin_from field_listbox_begin_from: field_listbox_begin_from
}); });
}) })
.push(function () { .push(function () {
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>962.1253.58085.39031</string> </value> <value> <string>962.1258.50557.40021</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -254,7 +254,7 @@ ...@@ -254,7 +254,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1505136646.23</float> <float>1505136885.5</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