|
@@ -1,41 +1,41 @@
|
|
|
openerp.custom_project = function(instance) {
|
|
|
var QWeb = instance.web.qweb;
|
|
|
|
|
|
- // instance.web_calendar.CalendarView = instance.web_calendar.CalendarView.extend({
|
|
|
- // remove_event: function(id) {
|
|
|
- // var self = this;
|
|
|
- //
|
|
|
- // function do_it() {
|
|
|
- // return $.when(self.dataset.unlink([Number(id)])).then(function() {
|
|
|
- // self.$calendar.fullCalendar('removeEvents', id);
|
|
|
- // });
|
|
|
- // }
|
|
|
- //
|
|
|
- // if (this.options.confirm_on_delete) {
|
|
|
- // if (confirm(_t("Está seguro que desea eliminar esta actividad?"))) {
|
|
|
- // return do_it();
|
|
|
- // }
|
|
|
- // } else
|
|
|
- // return do_it();
|
|
|
- // },
|
|
|
- // event_data_transform: function(event) {
|
|
|
- // var res = this._super.apply(this, arguments);
|
|
|
- // //This would go off when there is no color set for hex_value. You could control this too.
|
|
|
- // if (res && res.hasOwnProperty('className')) {
|
|
|
- // //If you would uncomment the next line it would use the default colour that is set for the user. (default behaviour from Odoo calendars)
|
|
|
- // // res.className = res.className.substring(0, res.className.indexOf(' calendar_color_'));
|
|
|
- // // res.backgroundColor = '#DBDBDB';
|
|
|
- // if (res.title.indexOf('false') > -1) {
|
|
|
- // res.title = res.title.substring(0, res.title.indexOf(','));
|
|
|
- // }
|
|
|
- // }
|
|
|
- // if (event.hex_value && res.title) {
|
|
|
- // res.backgroundColor = event.hex_value;
|
|
|
- // res.title = res.title.substring(0, res.title.indexOf(', ' + event.hex_value));
|
|
|
- // }
|
|
|
- // return res;
|
|
|
- // }
|
|
|
- // });
|
|
|
+ instance.web_calendar.CalendarView = instance.web_calendar.CalendarView.extend({
|
|
|
+ remove_event: function(id) {
|
|
|
+ var self = this;
|
|
|
+
|
|
|
+ function do_it() {
|
|
|
+ return $.when(self.dataset.unlink([Number(id)])).then(function() {
|
|
|
+ self.$calendar.fullCalendar('removeEvents', id);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ if (this.options.confirm_on_delete) {
|
|
|
+ if (confirm(_t("Está seguro que desea eliminar esta actividad?"))) {
|
|
|
+ return do_it();
|
|
|
+ }
|
|
|
+ } else
|
|
|
+ return do_it();
|
|
|
+ },
|
|
|
+ event_data_transform: function(event) {
|
|
|
+ var res = this._super.apply(this, arguments);
|
|
|
+ //This would go off when there is no color set for hex_value. You could control this too.
|
|
|
+ if (res && res.hasOwnProperty('className')) {
|
|
|
+ //If you would uncomment the next line it would use the default colour that is set for the user. (default behaviour from Odoo calendars)
|
|
|
+ // res.className = res.className.substring(0, res.className.indexOf(' calendar_color_'));
|
|
|
+ // res.backgroundColor = '#DBDBDB';
|
|
|
+ if (res.title.indexOf('false') > -1) {
|
|
|
+ res.title = res.title.substring(0, res.title.indexOf(','));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (event.hex_value && res.title) {
|
|
|
+ res.backgroundColor = event.hex_value;
|
|
|
+ res.title = res.title.substring(0, res.title.indexOf(', ' + event.hex_value));
|
|
|
+ }
|
|
|
+ return res;
|
|
|
+ }
|
|
|
+ });
|
|
|
|
|
|
instance.web_kanban.KanbanRecord = instance.web_kanban.KanbanRecord.extend({
|
|
|
on_card_clicked: function() {
|