diff --git a/addons/web/static/src/js/chrome.js b/addons/web/static/src/js/chrome.js index 43608b20edd..9b2ad31dd4a 100644 --- a/addons/web/static/src/js/chrome.js +++ b/addons/web/static/src/js/chrome.js @@ -416,7 +416,7 @@ openerp.web.Database = openerp.web.OldWidget.extend(/** @lends openerp.web.Datab $db_list = $form.find('[name=drop_db]'), db = $db_list.val(); - if (!confirm("Do you really want to delete the database: " + db + " ?")) { + if (!db || !confirm("Do you really want to delete the database: " + db + " ?")) { return; } self.rpc("/web/database/drop", {'fields': fields}, function(result) { diff --git a/addons/web_calendar/__openerp__.py b/addons/web_calendar/__openerp__.py index 62537ba2345..e181fb837bf 100644 --- a/addons/web_calendar/__openerp__.py +++ b/addons/web_calendar/__openerp__.py @@ -9,7 +9,7 @@ "depends": ['web'], "js": [ 'static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_debug.js', - 'static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js', + 'static/lib/dhtmlxScheduler/sources/ext/ext_minical.js', 'static/src/js/calendar.js' ], "css": [ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_debug.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_debug.js index 6b2e961051c..30384b83b5c 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_debug.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/dhtmlxscheduler_debug.js @@ -3408,8 +3408,10 @@ scheduler.render_event_bar=function(ev){ var bg_color = (ev.color?("background-color:"+ev.color+";"):""); var color = (ev.textColor?("color:"+ev.textColor+";"):""); + + var title_line = scheduler.templates.event_bar_text(ev.start_date,ev.end_date,ev); - var html='
'; + var html='
'; if (ev._timed) html+=scheduler.templates.event_bar_date(ev.start_date,ev.end_date,ev); diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js index 5bf564980f9..b7b0ba1d21d 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/codebase/ext/dhtmlxscheduler_minical.js @@ -13,7 +13,7 @@ scheduler._render_calendar=function(b,c,a,d){var e=scheduler.templates,f=this._c g.innerHTML="
"+l.innerHTML+"
";g.childNodes[0].innerHTML=this.templates.calendar_month(c);if(a.navigation){var h=document.createElement("DIV");h.className="dhx_cal_prev_button";h.style.cssText="left:1px;top:2px;position:absolute;";h.innerHTML=this._mini_cal_arrows[0];g.firstChild.appendChild(h);h.onclick=function(){scheduler.updateCalendar(g,scheduler.date.add(g._date,-1,"month"));scheduler._date.getMonth()== g._date.getMonth()&&scheduler._date.getFullYear()==g._date.getFullYear()&&scheduler._markCalendarCurrentDate(g)};h=document.createElement("DIV");h.className="dhx_cal_next_button";h.style.cssText="left:auto; right:1px;top:2px;position:absolute;";h.innerHTML=this._mini_cal_arrows[1];g.firstChild.appendChild(h);h.onclick=function(){scheduler.updateCalendar(g,scheduler.date.add(g._date,1,"month"));scheduler._date.getMonth()==g._date.getMonth()&&scheduler._date.getFullYear()==g._date.getFullYear()&&scheduler._markCalendarCurrentDate(g)}}g._date= new Date(c);g.week_start=(c.getDay()-(this.config.start_on_monday?1:0)+7)%7;var u=this.date.week_start(c);this._reset_month_scale(g.childNodes[2],c,u);for(var j=g.childNodes[2].firstChild.rows,q=j.length;q<6;q++){var t=j[j.length-1];j[0].parentNode.appendChild(t.cloneNode(!0));for(var r=parseInt(t.childNodes[t.childNodes.length-1].childNodes[0].innerHTML),r=r<10?r:0,s=0;s500))b=this._def_count.firstChild;if(b&&(b.onclick=null,b.innerHTML="",b.parentNode&&b.parentNode.removeChild(b),this._def_count))this._def_count.style.top="-1000px"};scheduler.isCalendarVisible=function(){return this._def_count&&parseInt(this._def_count.style.top,10)>0?this._def_count:!1}; scheduler.attachEvent("onTemplatesReady",function(){dhtmlxEvent(document.body,"click",function(){scheduler.destroyCalendar()})});scheduler.templates.calendar_time=scheduler.date.date_to_str("%d-%m-%Y"); scheduler.form_blocks.calendar_time={render:function(){var b="",c=scheduler.config,a=this.date.date_part(new Date);c.first_hour&&a.setHours(c.first_hour);b+=" ";var f=scheduler.config.full_day;return"
"+ diff --git a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_minical.js b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_minical.js index a6a02b96445..0fa43fc3e0c 100644 --- a/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_minical.js +++ b/addons/web_calendar/static/lib/dhtmlxScheduler/sources/ext/ext_minical.js @@ -207,7 +207,7 @@ scheduler._render_calendar=function(obj,sd,conf, previous){ if (!previous) obj.appendChild(d); - d.childNodes[1].style.height = (d.childNodes[1].childNodes[0].offsetHeight-1)+"px"; // dhx_year_week should have height property so that day dates would get correct position. dhx_year_week height = height of it's child (with the day name) + d.childNodes[1].style.height = d.childNodes[1].childNodes[0].offsetHeight <= 0 ? "0px" : (d.childNodes[1].childNodes[0].offsetHeight-1)+"px"; // dhx_year_week should have height property so that day dates would get correct position. dhx_year_week height = height of it's child (with the day name) /*restore*/ this._cols=temp; this._mode = temp2; this._colsS = temp3; this._min_date=temp4; this._max_date=temp5; scheduler._date = temp6; ts.month_day=temp7; return d; diff --git a/addons/web_calendar/static/src/css/web_calendar.css b/addons/web_calendar/static/src/css/web_calendar.css index 2fefbfafbdc..313db123bb5 100644 --- a/addons/web_calendar/static/src/css/web_calendar.css +++ b/addons/web_calendar/static/src/css/web_calendar.css @@ -25,7 +25,7 @@ .openerp .dhx_cal_navline{ height:20px; position:absolute; - z-index:3; + z-index:1; width:750px; color:#2F3A48; background-color:#eee; diff --git a/addons/web_calendar/static/src/js/calendar.js b/addons/web_calendar/static/src/js/calendar.js index 1c2fb52ca74..eee6650d459 100644 --- a/addons/web_calendar/static/src/js/calendar.js +++ b/addons/web_calendar/static/src/js/calendar.js @@ -339,7 +339,7 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({ }); } }, - do_edit_event: function(event_id) { + do_edit_event: function(event_id, evt) { var self = this; var index = this.dataset.get_id_index(event_id); if (index !== null) { @@ -363,6 +363,8 @@ openerp.web_calendar.CalendarView = openerp.web.View.extend({ // I tried scheduler.editStop(event_id); but doesn't work either // After losing one hour on this, here's a quick and very dirty fix : $(".dhx_cancel_btn").click(); + } else { + scheduler.editStop($(evt.target).hasClass('icon_save')); } }, get_event_data: function(event_obj) {