Commit 3fdc0c82 authored by Roque's avatar Roque

erp5_officejs: layout configuration for header Add button

parent 995a37d4
...@@ -191,7 +191,8 @@ ...@@ -191,7 +191,8 @@
form_definition, form_definition,
query_type, query_type,
query_parent, query_parent,
query_reference; query_reference,
hide_add_button;
query_reference = new SimpleQuery({ query_reference = new SimpleQuery({
key: "reference", key: "reference",
operator: "", operator: "",
...@@ -246,6 +247,10 @@ ...@@ -246,6 +247,10 @@
.push(function (actions_views_dict) { .push(function (actions_views_dict) {
form_definition.has_more_views = Object.keys(actions_views_dict.views).length > 1; form_definition.has_more_views = Object.keys(actions_views_dict.views).length > 1;
form_definition.has_more_actions = Object.keys(actions_views_dict.actions).length > 0; form_definition.has_more_actions = Object.keys(actions_views_dict.actions).length > 0;
return gadget.getSetting('hide_header_add_button');
})
.push(function (hide_add_button_setting) {
form_definition.hide_add_button = hide_add_button_setting === "1";
return form_definition; return form_definition;
}); });
}); });
......
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>976.32757.54510.63163</string> </value> <value> <string>976.34276.53444.54016</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -287,7 +287,7 @@ ...@@ -287,7 +287,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1560953642.79</float> <float>1561044808.85</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -198,7 +198,9 @@ ...@@ -198,7 +198,9 @@
page_title = options.doc.title; page_title = options.doc.title;
} }
erp5_document = form_json.erp5_document; erp5_document = form_json.erp5_document;
if (form_json.form_definition.allowed_sub_types_list && form_json.form_definition.allowed_sub_types_list.length > 0) { if (form_json.form_definition.allowed_sub_types_list &&
form_json.form_definition.allowed_sub_types_list.length > 0 &&
! form_json.form_definition.hide_add_button) {
url_for_parameter_list.push({command: 'change', options: {page: "create_document", jio_key: options.jio_key, portal_type: options.portal_type, allowed_sub_types_list: form_json.form_definition.allowed_sub_types_list}}); url_for_parameter_list.push({command: 'change', options: {page: "create_document", jio_key: options.jio_key, portal_type: options.portal_type, allowed_sub_types_list: form_json.form_definition.allowed_sub_types_list}});
add_url = true; add_url = true;
} }
......
...@@ -269,7 +269,7 @@ ...@@ -269,7 +269,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>976.29933.16046.63863</string> </value> <value> <string>976.34270.16303.42564</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -287,7 +287,7 @@ ...@@ -287,7 +287,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1560784206.19</float> <float>1561044820.12</float>
<string>UTC</string> <string>UTC</string>
</tuple> </tuple>
</state> </state>
......
...@@ -385,6 +385,16 @@ ...@@ -385,6 +385,16 @@
<value> <string>lines</string> </value> <value> <string>lines</string> </value>
</item> </item>
</dictionary> </dictionary>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>configuration_hide_header_add_button</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>int</string> </value>
</item>
</dictionary>
</tuple> </tuple>
</value> </value>
</item> </item>
...@@ -472,6 +482,10 @@ ...@@ -472,6 +482,10 @@
<key> <string>configuration_header_jump_button</string> </key> <key> <string>configuration_header_jump_button</string> </key>
<value> <int>0</int> </value> <value> <int>0</int> </value>
</item> </item>
<item>
<key> <string>configuration_hide_header_add_button</string> </key>
<value> <int>1</int> </value>
</item>
<item> <item>
<key> <string>configuration_jio_gadget_url</string> </key> <key> <string>configuration_jio_gadget_url</string> </key>
<value> <string>gadget_ojs_local_jio.html</string> </value> <value> <string>gadget_ojs_local_jio.html</string> </value>
...@@ -773,7 +787,7 @@ ...@@ -773,7 +787,7 @@
</item> </item>
<item> <item>
<key> <string>serial</string> </key> <key> <string>serial</string> </key>
<value> <string>976.32636.4663.31641</string> </value> <value> <string>976.34272.58294.24337</string> </value>
</item> </item>
<item> <item>
<key> <string>state</string> </key> <key> <string>state</string> </key>
...@@ -791,7 +805,7 @@ ...@@ -791,7 +805,7 @@
</tuple> </tuple>
<state> <state>
<tuple> <tuple>
<float>1560946399.88</float> <float>1561044558.86</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