Commit 0e5c376c authored by Roque's avatar Roque

erp5_officejs: allow dev user to set custom header options

parent 91a9e528
......@@ -22,6 +22,7 @@
.getElementById("panel-template-body-desktop")
.innerHTML);
//TODO this is the same in action_officejs page, move to common
function getElementList(gadget, element_list) {
var i = 0,
element_info_list = [],
......
......@@ -219,7 +219,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -233,7 +233,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1001.57742.17876.27579</string> </value>
<value> <string>1014.1943.59170.64648</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -253,7 +253,7 @@
</tuple>
<state>
<tuple>
<float>1658943108.94</float>
<float>1713536268.81</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -315,7 +315,7 @@
.declareMethod("renderSubGadget", function (options, subgadget, form_json) {
var gadget = this, erp5_document = form_json.erp5_document,
portal_type_dict = form_json.form_definition.portal_type_dict,
page_title = '';
page_title = '', header_dict;
if (options.doc && options.doc.title) {
page_title = options.doc.title;
} else if (options.doc && options.doc.header_title) {
......@@ -367,7 +367,7 @@
return gadget.getUrlForList(url_for_parameter_list);
})
.push(function (url_list) {
var header_dict = { "page_title": page_title };
header_dict = { "page_title": page_title };
if (options.form_type === 'dialog') {
//TODO: find correct url
header_dict.cancel_url = url_list[6];
......@@ -406,7 +406,19 @@
}
}
}
return gadget.updateHeader(header_dict);
return gadget.declareGadget(portal_type_dict.custom_header);
})
.push(function (header_gadget) {
return header_gadget.getOptions(portal_type_dict, options, header_dict);
}, function (error) {
if (!portal_type_dict.custom_header) {
return header_dict;
} else {
throw error;
}
})
.push(function (header_options) {
return gadget.updateHeader(header_options);
});
});
......
......@@ -258,7 +258,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>1015.54474.36356.6365</string> </value>
<value> <string>1015.64633.24396.51677</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -278,7 +278,7 @@
</tuple>
<state>
<tuple>
<float>1712846175.79</float>
<float>1713455747.66</float>
<string>UTC</string>
</tuple>
</state>
......
......@@ -36,6 +36,7 @@
);
}
//TODO this is the same in ojs_panel, move to common
function getHTMLElementList(gadget, element_list) {
var i = 0,
element_info_list = [],
......
......@@ -222,7 +222,7 @@
</item>
<item>
<key> <string>actor</string> </key>
<value> <string>zope</string> </value>
<value> <unicode>zope</unicode> </value>
</item>
<item>
<key> <string>comment</string> </key>
......@@ -236,7 +236,7 @@
</item>
<item>
<key> <string>serial</string> </key>
<value> <string>979.63524.32203.29269</string> </value>
<value> <string>1015.45957.31009.8925</string> </value>
</item>
<item>
<key> <string>state</string> </key>
......@@ -256,7 +256,7 @@
</tuple>
<state>
<tuple>
<float>1574423701.42</float>
<float>1713536281.01</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