//set avatar title for members.
_.each($(this.$element).find('.project_avatar'),function(avatar){
var dataset = new openerp.web.DataSetSearch(this, 'res.users', self.session.context, [['id','=',avatar.id]]);
- dataset.read_slice([]).then(function(result){
- avatar.setAttribute("title",result[0].name)
+ dataset.read_slice([]).then(function(result){
+ avatar.setAttribute("title",result[0].name)
});
});
- //if task is true , then open the task when clickd on the anywhere in the box.
+ //if task is true , then open the task when click on the anywhere in the box.
if(this.record.task.raw_value)$(this.$element).find('.click_button').attr('data-name','open_tasks');
if(!this.record.task.raw_value)$(this.$element).find('.click_button').attr('data-name','dummy');
};
bind_events: function() {
self = this;
self._super();
- console.log(self);
if(this.view.dataset.model == 'project.project') {
if(this.record.task.raw_value && this.record.issues.raw_value)$(this.$element).find('.click_button').attr('data-name','open_tasks');
if(!this.record.task.raw_value && this.record.issues.raw_value)$(this.$element).find('.click_button').attr('data-name','open_issues');
self = this;
self._super();
if(this.view.dataset.model == 'project.project') {
- if(this.record.task.raw_value && this.record.issues.raw_value && this.record.timesheets.raw_value)$(this.$element).find('.click_button').attr('data-name','open_tasks');
- if(!this.record.task.raw_value && !this.record.issues.raw_value && this.record.timesheets.raw_value)$(this.$element).find('.click_button').attr('data-name','open_timesheets');
+ function include(arr, obj) {
+ for(var i=0; i<arr.length; i++) {
+ if (arr[i] == obj) return true;
+ }
+ }
+ if(include(this.view.fields_keys,"issues"))
+ {
+ if(!this.record.task.raw_value && !this.record.issues.raw_value && this.record.timesheets.raw_value)$(this.$element).find('.click_button').attr('data-name','open_timesheets');
//if(!this.record.task.raw_value)$(this.$element).find('.click_button').attr('data-name','dummy');
+ };
+ if(this.record.task.raw_value && this.record.timesheets.raw_value)$(this.$element).find('.click_button').attr('data-name','open_tasks');
};
}
});