|
@ -68,6 +68,8 @@ openerp.bi_view_editor = function (instance, local) { |
|
|
icons += "<span class='fa fa-bars' title='Row'></span> "; |
|
|
icons += "<span class='fa fa-bars' title='Row'></span> "; |
|
|
if(field.measure) |
|
|
if(field.measure) |
|
|
icons += "<span class='fa fa-bar-chart-o' title='Measure'></span> "; |
|
|
icons += "<span class='fa fa-bar-chart-o' title='Measure'></span> "; |
|
|
|
|
|
if(field.list) |
|
|
|
|
|
icons += "<span class='fa fa-list' title='List'></span> "; |
|
|
|
|
|
|
|
|
return icons; |
|
|
return icons; |
|
|
}, |
|
|
}, |
|
@ -165,15 +167,19 @@ openerp.bi_view_editor = function (instance, local) { |
|
|
_contextMenu.find(identifier).attr('checked', false); |
|
|
_contextMenu.find(identifier).attr('checked', false); |
|
|
}, |
|
|
}, |
|
|
_false_if_undefined: function(to_check) { |
|
|
_false_if_undefined: function(to_check) { |
|
|
if (typeof check === 'undefined') return false; |
|
|
|
|
|
return check; |
|
|
|
|
|
|
|
|
if (typeof to_check === 'undefined') return false; |
|
|
|
|
|
return to_check; |
|
|
|
|
|
}, |
|
|
|
|
|
_true_if_undefined: function(to_check) { |
|
|
|
|
|
if (typeof to_check === 'undefined') return true; |
|
|
|
|
|
return to_check; |
|
|
}, |
|
|
}, |
|
|
add_field_to_table: function(data, options) { |
|
|
add_field_to_table: function(data, options) { |
|
|
var self = this; |
|
|
var self = this; |
|
|
|
|
|
|
|
|
data.row = self._false_if_undefined(data.row); |
|
|
data.row = self._false_if_undefined(data.row); |
|
|
data.column = self._false_if_undefined(data.column); |
|
|
data.column = self._false_if_undefined(data.column); |
|
|
data.measure = self._false_if_undefined(data.measure); |
|
|
data.measure = self._false_if_undefined(data.measure); |
|
|
|
|
|
data.list = self._true_if_undefined(data.list); |
|
|
|
|
|
|
|
|
var n = 1; |
|
|
var n = 1; |
|
|
var name = data.name; |
|
|
var name = data.name; |
|
@ -220,10 +226,11 @@ openerp.bi_view_editor = function (instance, local) { |
|
|
self.set_checkbox(currentFieldData.column, '#column-checkbox', contextMenu); |
|
|
self.set_checkbox(currentFieldData.column, '#column-checkbox', contextMenu); |
|
|
self.set_checkbox(currentFieldData.row, '#row-checkbox', contextMenu); |
|
|
self.set_checkbox(currentFieldData.row, '#row-checkbox', contextMenu); |
|
|
self.set_checkbox(currentFieldData.measure, '#measure-checkbox', contextMenu); |
|
|
self.set_checkbox(currentFieldData.measure, '#measure-checkbox', contextMenu); |
|
|
|
|
|
self.set_checkbox(currentFieldData.list, '#list-checkbox', contextMenu); |
|
|
|
|
|
|
|
|
var to_disable = false; |
|
|
var to_disable = false; |
|
|
if(currentFieldData.type === "float" || currentFieldData.type === "integer" || currentFieldData.type === "monetary") to_disable = true; |
|
|
if(currentFieldData.type === "float" || currentFieldData.type === "integer" || currentFieldData.type === "monetary") to_disable = true; |
|
|
var identifiers = [['#column-checkbox', 'column', to_disable], ['#row-checkbox', 'row', to_disable], ['#measure-checkbox', 'measure', !to_disable]]; |
|
|
|
|
|
|
|
|
var identifiers = [['#column-checkbox', 'column', to_disable], ['#row-checkbox', 'row', to_disable], ['#measure-checkbox', 'measure', !to_disable], ['#list-checkbox', 'list', false]]; |
|
|
identifiers.forEach(function (element) { |
|
|
identifiers.forEach(function (element) { |
|
|
contextMenu.find(element[0]).attr('disabled', element[2]); |
|
|
contextMenu.find(element[0]).attr('disabled', element[2]); |
|
|
}); |
|
|
}); |
|
|