diff --git a/calendar/js/app.js b/calendar/js/app.js index 0e149b66a0..c792694e4d 100644 --- a/calendar/js/app.js +++ b/calendar/js/app.js @@ -40,7 +40,7 @@ * * @augments AppJS */ -app.classes.calendar = AppJS.extend( +app.classes.calendar = (function(){ "use strict"; return AppJS.extend( { /** * application name @@ -2060,7 +2060,7 @@ app.classes.calendar = AppJS.extend( // caching keys, otherwise they'll fetch & cache consolidated if(state.state.view == 'day' && state.state.owner.length < parseInt(this.egw.preference('day_consolidate','calendar'))) { - day_value = []; + var day_value = []; for(var i = 0; i < state.state.owner.length; i++) { day_value.push({ @@ -2748,7 +2748,7 @@ app.classes.calendar = AppJS.extend( this._queries_in_progress.splice(idx,1); } //console.log(data); - + // Look for any updated select options if(data.rows && data.rows.sel_options && this.sidebox_et2) { @@ -3501,7 +3501,7 @@ app.classes.calendar = AppJS.extend( return d; } } -}); +});}).call(this); jQuery.extend(app.classes.calendar,{ diff --git a/calendar/js/app.min.js b/calendar/js/app.min.js new file mode 100644 index 0000000000..d9771b0e76 --- /dev/null +++ b/calendar/js/app.min.js @@ -0,0 +1,9 @@ +/*! build Tue Mar 01 2016 17:22:26 */ + +function et2_event_action_object_impl(widget,node){var aoi=new et2_action_object_impl(widget,node);return aoi.doSetState=function(_state,_outerCall){},aoi}var et2_calendar_owner=function(){"use strict";return et2_taglist_email.extend({attributes:{autocomplete_url:{default:"calendar_owner_etemplate_widget::ajax_owner"},autocomplete_params:{name:"Autocomplete parameters",type:"any",default:{},description:"Extra parameters passed to autocomplete URL. It should be a stringified JSON object."},allowFreeEntries:{default:!1,ignore:!0},select_options:{type:"any",name:"Select options",default:{},description:"Internally used to hold the select options."}},lib_options:{autoSelect:!1,groupBy:"app",minChars:2,selectFirst:!0,toggleOnClick:!0},doLoadingFinished:function(){this._super.apply(this,arguments);var widget=this;return this._oldValue=this.taglist.getValue(),this.$taglist.on("focus",function(){widget.taglist.expand()}).on("load expand",function(){window.setTimeout(function(){widget&&widget.div&&widget.div.find(".ms-res-item-active").removeClass("ms-res-item-active")},1)}),!0},getValue:function(){return null==this.taglist?null:this.taglist.getValue()}})}.call(this);et2_register_widget(et2_calendar_owner,["calendar-owner"]);var et2_calendar_view=function(){"use strict";return et2_valueWidget.extend({createNamespace:!0,attributes:{owner:{name:"Owner",type:"any",default:[egw.user("account_id")],description:"Account ID number of the calendar owner, if not the current user"},start_date:{name:"Start date",type:"any"},end_date:{name:"End date",type:"any"}},init:function(){this._super.apply(this,arguments),this.date_helper=et2_createWidget("date-time",{},null),this.date_helper.loadingFinished(),this.loader=$j('
'),this.update_timer=null},destroy:function(){this._super.apply(this,arguments),this.date_helper.destroy(),this.date_helper=null,this.update_timer&&window.clearTimeout(this.update_timer)},doLoadingFinished:function(){this._super.apply(this,arguments),this.loader.hide(0).prependTo(this.div),this.options.owner&&this.set_owner(this.options.owner)},invalidate:function(trigger_event){},get_start_date:function(){return new Date(this.options.start_date)},get_end_date:function(){return new Date(this.options.end_date)},set_start_date:function(new_date){new_date&&null!==new_date||(new_date=new Date),"object"==typeof new_date||"string"==typeof new_date&&new_date.length>8?this.date_helper.set_value(new_date):"string"==typeof new_date&&(this.date_helper.set_year(new_date.substring(0,4)),this.date_helper.set_month(new_date.substring(4,6)),this.date_helper.set_date(new_date.substring(6,8)));var old_date=this.options.start_date;this.options.start_date=new Date(this.date_helper.getValue()),old_date!==this.options.start_date&&this.isAttached()&&this.invalidate(!0)},set_end_date:function(new_date){new_date&&null!==new_date||(new_date=new Date),"object"==typeof new_date||"string"==typeof new_date&&new_date.length>8?this.date_helper.set_value(new_date):"string"==typeof new_date&&(this.date_helper.set_year(new_date.substring(0,4)),this.date_helper.set_month(new_date.substring(4,6)),this.date_helper.set_date(new_date.substring(6,8)));var old_date=this.options.end_date;this.options.end_date=new Date(this.date_helper.getValue()),old_date!==this.options.end_date&&this.isAttached()&&this.invalidate(!0)},set_owner:function(_owner){var old=this.options.owner;"0"==_owner&&(_owner=[egw.user("account_id")]),_owner=jQuery.isArray(_owner)?jQuery.extend([],_owner):"string"==typeof _owner?_owner.split(","):[_owner],this.options.owner=_owner,old!==this.options.owner&&this.isAttached()&&this.invalidate(!0)},set_value:function(events){return"object"!=typeof events?!1:((events.length&&events.length>0||!jQuery.isEmptyObject(events))&&this.set_disabled(!1),events.id&&(this.set_id(events.id),delete events.id),events.start_date&&(this.set_start_date(events.start_date),delete events.start_date),events.end_date&&(this.set_end_date(events.end_date),delete events.end_date),events.owner&&(this.set_owner(events.owner),delete events.owner),this.value=events||{},void(this.update_timer||window.setTimeout(jQuery.proxy(function(){this.loader.hide()},this),100)))},_get_owner_name:function(user){if(0===parseInt(user)&&(user=egw.user("account_id")),isNaN(user)){var application="home-accounts";switch(user[0]){case"c":application="addressbook";break;case"r":application="resources"}user=egw.link_title(application,user.match(/\d+/)[0],function(){},this)}else{user=parseInt(user);for(var accounts=egw.accounts("both"),j=0;j1&&("day"===view&&owners.length'+this._get_timespan(event)+"
").append(''+title+""),jQuery.Color("rgba(0,0,0,0)").toRgbaString()!=jQuery.Color(this.div,"background-color").toRgbaString()&&this.div.css("border-color","calendar_calEventAllAccepted"===status_class?this.div.css("background-color"):""),this.icons.appendTo(this.title).html(this._icons()),event.whole_day_on_top)this.body.html(title);else{var start_time=jQuery.datepicker.formatTime("12"===egw.preference("timeformat")?"h:mmtt":"HH:mm",{hour:event.start_m/60,minute:event.start_m%60,seconds:0,timezone:0},{ampm:"12"===egw.preference("timeformat")}).trim();this.body.html(''+title+"").append(''+start_time+""),this.options.value.description.trim()&&this.body.append("

"+this.options.value.description+"

")}this.set_statustext(""),this._parent.div.is(":visible")&&this._small_size()},_small_size:function(){if(!this.options.value.whole_day_on_top){this.div.removeClass("calendar_calEventSmall"),this.body.css("height","auto");var line_height=parseFloat(this.div.css("line-height")),visible_lines=Math.floor(this.div.innerHeight()/line_height);this.title.height()||(visible_lines=Math.floor(egw.getHiddenDimensions(this.div).h/egw.getHiddenDimensions(this.title).h)),visible_lines=Math.max(1,visible_lines),this.div.toggleClass("calendar_calEventSmall",4>visible_lines),this.div.attr("data-visible_lines",visible_lines),this.body.height()>this.div.height()-this.title.height()&&visible_lines>=4?this.body.css("height",Math.floor((visible_lines-1)*line_height-this.title.height())+"px"):this.body.css("height","")}},_status_class:function(){var status_class="calendar_calEventAllAccepted";for(var id in this.options.value.participants){var status=this.options.value.participants[id];switch(status=et2_calendar_event.split_status(status)){case"A":case"":break;case"U":return status_class="calendar_calEventSomeUnknown";default:status_class="calendar_calEventAllAnswered"}}return status_class},_tooltip:function(){if(!this.div)return"";var border=this.div.css("borderTopColor"),bg_color=this.div.css("background-color"),header_color=this.title.css("color"),timespan=this._get_timespan(this.options.value);this._parent.date_helper.set_value(this.options.value.start.valueOf?new Date(this.options.value.start):this.options.value.start);var start=this._parent.date_helper.input_date.val();this._parent.date_helper.set_value(this.options.value.end.valueOf?new Date(this.options.value.end):this.options.value.end);var end=this._parent.date_helper.input_date.val(),times=this.options.value.multiday?''+this.egw().lang("Start")+":"+start+''+this.egw().lang("End")+":"+end:''+this.egw().lang("Time")+":"+timespan,cat_label="";if(this.options.value.category){var cat=et2_createWidget("select-cat",{readonly:!0},this);cat.set_value(this.options.value.category),cat_label=this.options.value.category.indexOf(",")<=0?cat.span.text():[],"string"!=typeof cat_label&&(cat.span.children().each(function(){cat_label.push($j(this).text())}),cat_label=cat_label.join(", ")),cat.destroy()}return'
'+timespan+""+this.icons[0].outerHTML+'

'+this.options.value.title+"
"+this.options.value.description+'

'+times+"

"+(this.options.value.location?'

'+this.egw().lang("Location")+":"+this.options.value.location+"

":"")+(cat_label?'

'+this.egw().lang("Category")+":"+cat_label+"

":"")+'

'+this.egw().lang("Participants")+":
"+(this.options.value.parts?this.options.value.parts.replace("\n","
"):"")+"

"},_icons:function(){var icons=[];if(this.options.value.is_private)icons.push('');else{"calendar"!==this.options.value.app&&icons.push(''),3==this.options.value.priority&&icons.push(''),"0"==this.options.value.public&&icons.push(''),this.options.value.recur_type&&icons.push('');var single='',multiple='';for(var uid in this.options.value.participants){if(1==Object.keys(this.options.value.participants).length&&!isNaN(uid)){icons.push(single);break}isNaN(uid)||-1!==icons.indexOf(multiple)||icons.push(multiple)}this.options.value.non_blocking&&icons.push(''),!this.options.value.alarm||jQuery.isEmptyObject(this.options.value.alarm)||this.options.value.is_private||icons.push(''),this.options.value.participants[egw.user("account_id")]&&"U"==this.options.value.participants[egw.user("account_id")][0]&&icons.push('')}return icons},_get_timespan:function(event){var timespan="";if(0===event.start_m&&event.end_m>=1439)timespan=event.end_m>1440?jQuery.datepicker.formatTime("12"===egw.preference("timeformat")?"h:mmtt":"HH:mm",{hour:event.start_m/60,minute:event.start_m%60,seconds:0,timezone:0},{ampm:"12"===egw.preference("timeformat")}).trim()+" - "+jQuery.datepicker.formatTime("12"===egw.preference("timeformat")?"h:mmtt":"HH:mm",{hour:event.end_m/60,minute:event.end_m%60,seconds:0,timezone:0},{ampm:"12"===egw.preference("timeformat")}).trim():egw.lang("Whole day");else{var duration=event.multiday?(event.end-event.start)/6e4:event.end_m-event.start_m;1439===event.end_m&&++duration,duration=Math.floor(duration/60)+this.egw().lang("h")+(duration%60?duration%60:""),timespan=jQuery.datepicker.formatTime("12"===egw.preference("timeformat")?"h:mmtt":"HH:mm",{hour:event.start_m/60,minute:event.start_m%60,seconds:0,timezone:0},{ampm:"12"===egw.preference("timeformat")}).trim(),timespan+=" "+duration}return timespan},_values_check:function(event){event.id&&(event.id=""+event.id),"object"!=typeof event.start&&(this._parent.date_helper.set_value(event.start),event.start=new Date(this._parent.date_helper.getValue())),"object"!=typeof event.end&&(this._parent.date_helper.set_value(event.end),event.end=new Date(this._parent.date_helper.getValue())),"undefined"==typeof event.start_m&&(event.start_m=60*event.start.getUTCHours()+event.start.getUTCMinutes(),event.end_m=60*event.end.getUTCHours()+event.end.getUTCMinutes()),"undefined"==typeof event.multiday&&(event.multiday=event.start.getUTCFullYear()!==event.end.getUTCFullYear()||event.start.getUTCMonth()!==event.end.getUTCMonth()||event.start.getUTCDate()!=event.end.getUTCDate()),event.start.getUTCHours()||event.start.getUTCMinutes()||23!=event.end.getUTCHours()||59!=event.end.getUTCMinutes()||(event.whole_day_on_top=event.non_blocking&&"0"!=event.non_blocking)},_sameday_check:function(event){if(!this._parent||null===event)return!1;var owner_match=!0;if(event.participants&&this._parent.options.owner){var parent_owner="object"!=typeof this._parent.options.owner?[this._parent.options.owner]:this._parent.options.owner;owner_match=!1;for(var length=parent_owner.length,i=0;length>i;i++)parseInt(parent_owner[i])<0&&egw.accountData(parent_owner[i],"account_id",!0,function(members){parent_owner=parent_owner.concat(Object.keys(members))});for(var id in event.participants)if(this._parent.options.owner==id||parent_owner.indexOf&&parent_owner.indexOf(id)>=0){owner_match=!0;break}owner_match||(owner_match=this._parent.options.owner==event.owner||parent_owner.indexOf&&parent_owner.indexOf(event.owner)>=0)}if(owner_match&&this.options.value.date&&event.date==this.options.value.date)return!0;var event_start=new Date(event.start),event_end=new Date(event.end);if(owner_match&&this._parent.date>=event_start&&this._parent.date<=event_end)return!0;this._actionObject&&(this._actionObject.clear(),this._actionObject.unregisterActions(),this._actionObject=null);var new_cache_id=app.classes.calendar._daywise_cache_id(event.date,this._parent.options.owner),new_daywise=egw.dataGetUIDdata(new_cache_id);new_daywise=new_daywise&&new_daywise.data?new_daywise.data:[];var old_cache_id=!1;if(this.options.value&&this.options.value.date&&(old_cache_id=app.classes.calendar._daywise_cache_id(this.options.value.date,this._parent.options.owner)),new_cache_id!=old_cache_id){var old_daywise=egw.dataGetUIDdata(old_cache_id);old_daywise=old_daywise&&old_daywise.data?old_daywise.data:[],old_daywise.splice(old_daywise.indexOf(this.options.value.id),1),egw.dataStoreUID(old_cache_id,old_daywise),new_daywise.indexOf(event.id)<0&&new_daywise.push(event.id),null!==new_daywise.data&&egw.dataStoreUID(new_cache_id,new_daywise)}return!1},attachToDOM:function(){this._super.apply(this,arguments),this.onclick||$j(this.node).off("click")},click:function(_ev){var result=!0;if("function"==typeof this.onclick){var args=Array.prototype.slice.call(arguments);-1==args.indexOf(this)&&args.splice(1,0,this),result=this.onclick.apply(this,args)}return result},recur_prompt:function(callback,extra_data){et2_calendar_event.recur_prompt(this.options.value,callback,extra_data)},series_split_prompt:function(callback){et2_calendar_event.series_split_prompt(this.options.value,this.options.value.recur_date,callback)},_link_actions:function(actions){if(!this._actionObject){var objectManager=this.getParent().getParent()._actionObject||egw_getAppObjectManager(!0).getObjectById(this._parent._parent._parent.id)||egw_getAppObjectManager(!0);this._actionObject=objectManager.getObjectById("calendar::"+this.options.value.row_id)}null==this._actionObject?this._actionObject=objectManager.insertObject(!1,new egwActionObject("calendar::"+this.options.value.row_id,objectManager,new et2_event_action_object_impl(this,this.getDOMNode()),this._actionManager||objectManager.manager.getActionById("calendar::"+this.options.value.row_id)||objectManager.manager)):this._actionObject.setAOI(new et2_event_action_object_impl(this,this.getDOMNode())),this._actionObject.clear(),this._actionObject.unregisterActions();var action_links=this._get_action_links(actions);action_links.push("egw_link_drag"),action_links.push("egw_link_drop"),this._actionObject.updateActionLinks(action_links)},getDetachedAttributes:function(_attrs){},getDetachedNodes:function(){return[this.getDOMNode()]},setDetachedAttributes:function(_nodes,_values){}})}.call(this);et2_register_widget(et2_calendar_event,["calendar-event"]),et2_calendar_event.recur_prompt=function(event_data,callback,extra_data){var edit_id=event_data.app_id,edit_date=event_data.start,egw=this.egw?"function"==typeof this.egw?this.egw():this.egw:(window.opener||window).egw,that=this,extra_params=extra_data&&"object"==typeof extra_data?extra_data:{};if(extra_params.date=edit_date.toJSON?edit_date.toJSON():edit_date,"function"!=typeof callback&&(callback=function(_button_id){switch(_button_id){case"exception":extra_params.exception="1",egw.open(edit_id,event_data.app||"calendar","edit",extra_params);break;case"series":case"single":egw.open(edit_id,event_data.app||"calendar","edit",extra_params);break;case"cancel":}}),parseInt(event_data.recur_type)){var buttons=[{text:egw.lang("Edit exception"),id:"exception",class:"ui-priority-primary",default:!0},{text:egw.lang("Edit series"),id:"series"},{text:egw.lang("Cancel"),id:"cancel"}];et2_dialog.show_dialog(function(button_id){callback.call(that,button_id,event_data)},(event_data.is_private?egw.lang("private"):event_data.title)+"\n"+egw.lang("Do you want to edit this event as an exception or the whole series?"),egw.lang("This event is part of a series"),{},buttons,et2_dialog.QUESTION_MESSAGE)}else callback.call(this,"single",event_data)},et2_calendar_event.series_split_prompt=function(event_data,instance_date,callback){var egw=this.egw?"function"==typeof this.egw?this.egw():this.egw:(window.opener||window).egw,that=this;"string"==typeof instance_date&&(instance_date=new Date(instance_date));var tempDate=new Date,today=new Date(tempDate.getFullYear(),tempDate.getMonth(),tempDate.getDate(),tempDate.getHours(),-tempDate.getTimezoneOffset(),tempDate.getSeconds()),termination_date=today>instance_date?egw.lang("today"):date(egw.preference("dateformat"),instance_date);parseInt(event_data.recur_type)&&et2_dialog.show_dialog(function(button_id){callback.call(that,button_id,event_data)},(event_data.is_private?egw.lang("private"):event_data.title)+"\n"+egw.lang("Do you really want to change the start of this series? If you do, the original series will be terminated as of %1 and a new series for the future reflecting your changes will be created.",termination_date),egw.lang("This event is part of a series"),{},et2_dialog.BUTTONS_OK_CANCEL,et2_dialog.WARNING_MESSAGE)},et2_calendar_event.drag_helper=function(event,ui){ui.helper.width(ui.width())},et2_calendar_event.split_status=function(status,quantity,role){quantity=1,role="REQ-PARTICIPANT";var matches=null;return"string"==typeof status&&status.length>1&&(matches=status.match(/^.([0-9]*)(.*)$/gi)),matches?(parseInt(matches[1])>0&&(quantity=parseInt(matches[1])),matches[2]&&(role=matches[2]),status=status[0]):status===!0&&(status="U"),status};var et2_calendar_daycol=function(){"use strict";return et2_valueWidget.extend([et2_IDetachedDOM,et2_IResizeable],{attributes:{date:{name:"Date",type:"any",description:"What date is this daycol for. YYYYMMDD or Date",default:et2_no_init},owner:{name:"Owner",type:"any",default:et2_no_init,description:"Account ID number of the calendar owner, if not the current user"},display_birthday_as_event:{name:"Birthdays",type:"boolean",default:!1,description:"Display birthdays as events"},display_holiday_as_event:{name:"Holidays",type:"boolean",default:!1,description:"Display holidays as events"}},init:function(){this._super.apply(this,arguments),this.div=$j(document.createElement("div")).addClass("calendar_calDayCol").css("width",this.options.width).css("left",this.options.left),this.header=$j(document.createElement("div")).addClass("calendar_calDayColHeader").css("width",this.options.width).css("left",this.options.left),this.title=$j(document.createElement("div")).appendTo(this.header),this.all_day=$j(document.createElement("div")).addClass("calendar_calDayColAllDay").appendTo(this.header),this.event_wrapper=$j(document.createElement("div")).addClass("event_wrapper").appendTo(this.div),this.setDOMNode(this.div[0]),this.date_helper=et2_createWidget("date-time",{},null),this.date_helper.loadingFinished(),this.display_settings={wd_start:540,wd_end:1020,granularity:30,rowsToDisplay:10,rowHeight:20,titleHeight:2},this.registeredUID=null},doLoadingFinished:function(){if(this._super.apply(this,arguments),this._parent&&this._parent.options.owner&&this.set_owner(this._parent.options.owner),""===this.title.text()&&this.options.date&&this._parent&&this._parent.instanceOf(et2_calendar_timegrid)){var date=this.options.date;this.options.date="",this.set_date(date)}},destroy:function(){this._super.apply(this,arguments),this.div.off(),this.header.off().remove(),this.title.off(),this.div=null,this.header=null,this.title=null,this.date_helper.destroy(),this.date_helper=null,egw.dataUnregisterUID(this.registeredUID,!1,this)},getDOMNode:function(sender){return sender&&sender!==this?sender.instanceOf&&sender.instanceOf(et2_calendar_event)?0===this.display_settings.granularity?this.event_wrapper[0]:sender.options.value.whole_day_on_top||sender.options.value.whole_day&&sender.options.value.non_blocking===!0?this.all_day[0]:this.div[0]:void 0:this.div[0]},_draw:function(){if($j(".calendar_calAddEvent",this.div).remove(),this._parent&&this._parent.instanceOf(et2_calendar_timegrid)){this.display_settings.wd_start=60*this._parent.options.day_start,this.display_settings.wd_end=60*this._parent.options.day_end,this.display_settings.granularity=this._parent.options.granularity;for(var header=this._parent.dayHeader.children(),idx=0,siblings=this._parent.getDOMNode(this).childNodes;idx0;){var node=this._children[this._children.length-1];this.removeChild(node),node.free()}this.options.date=new_date,this.day_class_holiday(),this._draw(),this.registeredUID!==cache_id&&(this.registeredUID=cache_id,egw.dataRegisterUID(this.registeredUID,this._data_callback,this,this.getInstanceManager().execId,this.id))}},set_owner:function(_owner){if(this.title.attr("data-owner",_owner),this.header.attr("data-owner",_owner),_owner!==this.options.owner&&("object"!=typeof _owner&&"object"!=typeof this.options.owner||_owner.toString()!=this.options.owner.toString())){this.options.owner="object"!=typeof _owner?[_owner]:_owner;var cache_id=app.classes.calendar._daywise_cache_id(this.options.date,_owner);this.options.date&&this.registeredUID&&cache_id!==this.registeredUID&&egw.dataUnregisterUID(this.registeredUID,!1,this),this.registeredUID!==cache_id&&(this.registeredUID=cache_id,egw.dataRegisterUID(this.registeredUID,this._data_callback,this,this.getInstanceManager().execId,this.id))}},set_class:function(classnames){this.header.removeClass(this.class),this._super.apply(this,arguments),this.header.addClass(classnames)},_data_callback:function(event_ids){var events=[];null!=event_ids&&"undefined"!=typeof event_ids.length||(event_ids=[]);for(var i=0;i0;){var node=this._children[this._children.length-1];this.removeChild(node),node.free()}events.sort(function(a,b){var start=new Date(a.start)-new Date(b.start),end=new Date(a.end)-new Date(b.end);return a.whole_day&&b.whole_day?a.app_id-b.app_id:a.whole_day||b.whole_day?a.whole_day?-1:1:start?start:end});for(var c=0;c=elemBottom&&elemTop>=docViewTop)return!1;var visible={hidden:elemTop>docViewTop?"bottom":"top",completely:!1};return visible.completely="top"==visible.hidden?docViewTop>elemBottom:elemTop>docViewBottom,visible}this.header.children(".hiddenEventBefore").remove(),this.div.children(".hiddenEventAfter").remove(),this.event_wrapper.css("overflow","visible"),this.all_day.removeClass("overflown"),$j(".calendar_calEventBody",this.div).css({"padding-top":"","margin-top":""});var timegrid=this._parent;0===this.display_settings.granularity&&this._children.length&&($j("div.calendar_calEvent",this.div).show(0),Math.ceil(this.div.height()/this._children[0].div.height())>this._children.length)||(this.all_day.toggleClass("overflown",this.all_day[0].scrollHeight-this.all_day.height()>5),this.iterateOver(function(event){if(!this.display_settings.granularity||event.options&&event.options.value&&!event.options.value.whole_day_on_top){event.title.css({top:"","background-color":""}),event.body.css({"padding-top":"","margin-top":""});var hidden=isHidden.call(this,event.div),day=this;if(hidden)if("top"!==hidden.hidden||hidden.completely)0===this.display_settings.granularity&&hidden?(0==$j(".hiddenEventAfter",this.div).length&&this.event_wrapper.css("overflow","hidden"),this._hidden_indicator(event,!1,function(){app.calendar.update_state({view:"day",date:day.date})}),event.div.hide(0)):hidden.completely&&this._hidden_indicator(event,"top"==hidden.hidden,!1);else{var title_height=event.title.outerHeight();event.title.css({top:timegrid.scrolling.scrollTop()-event.div.position().top,"background-color":"transparent"}),event.body.css({"padding-top":timegrid.scrolling.scrollTop()-event.div.position().top+title_height,"margin-top":-title_height})}}},this,et2_calendar_event))},_hidden_indicator:function(event,top,onclick){var indicator="",day=this,timegrid=this._parent,fixed_height=timegrid.div.hasClass("calendar_calTimeGridFixed");if(top)0===$j(".hiddenEventBefore",this.header).length?(indicator=$j('
').appendTo(this.header).attr("data-hidden_count",1),fixed_height||indicator.text(event.options.value.title).on("click","function"==typeof onclick?onclick:function(){return $j(".calendar_calEvent",day.div).first()[0].scrollIntoView(),!1})):(indicator=$j(".hiddenEventBefore",this.header),indicator.attr("data-hidden_count",parseInt(indicator.attr("data-hidden_count"))+1),fixed_height||indicator.text(day.egw().lang("%1 event(s) %2",indicator.attr("data-hidden_count"),"")));else{indicator=$j(".hiddenEventAfter",this.div),0===indicator.length&&(indicator=$j('
').attr("data-hidden_count",0).appendTo(this.div),fixed_height?indicator.on("mouseover",function(){indicator.css({height:1.2*indicator.attr("data-hidden_count")+"em","margin-top":-(1.2*indicator.attr("data-hidden_count"))+"em"})}).on("mouseout",function(){indicator.css({height:"","margin-top":""})}):indicator.on("click","function"==typeof onclick?onclick:function(){return $j(".calendar_calEvent",day.div).last()[0].scrollIntoView(!1),day._out_of_view(),!1}));var count=parseInt(indicator.attr("data-hidden_count"))+1;indicator.attr("data-hidden_count",count),0===this.display_settings.granularity?(indicator.append(event.div.clone()),indicator.attr("data-hidden_label",day.egw().lang("%1 event(s) %2",indicator.attr("data-hidden_count"),""))):fixed_height||indicator.text(day.egw().lang("%1 event(s) %2",indicator.attr("data-hidden_count"),"")),indicator.css("top",timegrid.scrolling.height()+timegrid.scrolling.scrollTop()-indicator.innerHeight())}if(fixed_height&&indicator.append("
"+event.options.value.title+"
"),""!==indicator){var color=jQuery.Color(event.div.css("background-color")).toString()!==jQuery.Color("white").toString()?event.div.css("background-color"):event.div.css("border-bottom-color");"rgba(0, 0, 0, 0)"!==color&&indicator.css("border-color",color)}},_spread_events:function(){if(!this.date)return[];var day_start=this.date.valueOf()/1e3,dst_check=new Date(this.date);dst_check.setUTCHours(12);var daylight_diff=day_start+43200-dst_check.valueOf()/1e3;daylight_diff&&(day_start-=daylight_diff);var eventCols=[],col_ends=[];this._children.sort(function(a,b){var start=new Date(a.options.value.start)-new Date(b.options.value.start),end=new Date(a.options.value.end)-new Date(b.options.value.end);if(a.options.value.whole_day&&b.options.value.whole_day){var duration=new Date(b.options.value.end)-new Date(b.options.value.start)-(new Date(a.options.value.end)-new Date(a.options.value.start));return duration?duration:a.options.value.app_id-b.options.value.app_id}return a.options.value.whole_day||b.options.value.whole_day?a.options.value.whole_day?-1:1:start?start:end});for(var i=0;i=this.date||new Date(event.end)<=this.date))this._children[i].destroy(),this.removeChild(this._children[i]);else{var c=0;if(event.multiday=!1,"object"!=typeof event.start&&(event.start=new Date(event.start)),"object"!=typeof event.end&&(event.end=new Date(event.end)),event.start_m=parseInt((event.start.valueOf()/1e3-day_start)/60),event.start_m<0&&(event.start_m=0,event.multiday=!0),event.end_m=parseInt((event.end.valueOf()/1e3-day_start)/60),event.end_m>=1440&&(event.end_m=1439,event.multiday=!0),event.start.getUTCHours()||event.start.getUTCMinutes()||23!=event.end.getUTCHours()||59!=event.end.getUTCMinutes()||(event.whole_day_on_top=event.non_blocking&&"0"!=event.non_blocking),!event.whole_day_on_top){for(c=0;event.start_m=0||!event)&&i=0||!event){if(columns[c][i].div.css("top",top+"%"),columns[c][i].div.css("height",height+"%"),columns[c][i].div.is(":visible")){var border_diff=columns[c][i].div.outerHeight()-columns[c][i].div.height();columns[c][i].div.css("height",columns[c][i].div.height()-border_diff)}columns[c][i].div.css("left",left.toFixed(1)+"%"),columns[c][i].div.css("right",right.toFixed(1)+"%"),columns[c][i].div.css("z-index",parseInt(20)+c),columns[c][i]._small_size()}}else this.all_day.has(columns[c][i].div).length&&columns[c][i].div.prependTo(this.event_wrapper),columns[c][i].div.css("top",""),columns[c][i].div.css("height",""),columns[c][i].div.css("left",""),columns[c][i].div.css("right",""),columns[c][i].body.css("padding-top","")}if(event&&columns[c].indexOf(event)>=0)return}},_time_to_position:function(time){var pos=0;return pos=time/60/24*100,pos=pos.toFixed(1)},attachToDOM:function(){this._super.apply(this,arguments),this.onclick||$j(this.node).off("click"),$j(this.node).on("click.et2_daycol",".calendar_calDayColHeader,.calendar_calAddEvent",jQuery.proxy(this.click,this))},click:function(_ev){if(this.title.is(_ev.target))return app.calendar.update_state({view:"day",date:this.date.toJSON()}),!1;if($j(_ev.target).hasClass("calendar_calAddEvent")&&!_ev.target.dataset.whole_day){var options={date:_ev.target.dataset.date||this.options.date,hour:_ev.target.dataset.hour||this._parent.options.day_start,minute:_ev.target.dataset.minute||0};return this.options.owner!=app.calendar.state.owner&&(options.owner=this.options.owner),this.egw().open(null,"calendar","add",options,"_blank"),!1}if(this.header.has(_ev.target).length&&!$j(".hiddenEventBefore",this.header).has(_ev.target)||this.header.is(_ev.target)){var end=this.date.getFullYear()+"-"+(this.date.getUTCMonth()+1)+"-"+this.date.getUTCDate()+"T23:59";return this.egw().open(null,"calendar","add",{start:this.date.toJSON(),end:end,non_blocking:!0},"_blank"),!1}},getDetachedAttributes:function(_attrs){},getDetachedNodes:function(){return[this.getDOMNode()]},setDetachedAttributes:function(_nodes,_values){},resize:function(){this.disabled||!this.div.is(":visible")||this._parent.disabled||(this.display_settings.granularity!==this._parent.options.granularity&&this._draw(),this.position_event(),this._out_of_view())}})}.call(this);et2_register_widget(et2_calendar_daycol,["calendar-daycol"]);var et2_calendar_timegrid=function(){"use strict";return et2_calendar_view.extend([et2_IDetachedDOM,et2_IResizeable],{createNamespace:!0,attributes:{value:{type:"any",description:"An array of events, indexed by date (Ymd format)."},day_start:{name:"Day start time",type:"string",default:parseInt(egw.preference("workdaystarts","calendar"))||9,description:"Work day start time. If unset, this will default to the current user's preference"},day_end:{name:"Day end time",type:"string",default:parseInt(egw.preference("workdayends","calendar"))||17,description:"Work day end time. If unset, this will default to the current user's preference"},show_weekend:{name:"Weekends",type:"boolean",default:5!=egw.preference("days_in_weekview","calendar"),description:"Display weekends. The date range should still include them for proper scrolling, but they just won't be shown."},granularity:{name:"Granularity",type:"integer",default:parseInt(egw.preference("interval","calendar"))||30,description:"How many minutes per row, or 0 to display events as a list"},onchange:{name:"onchange",type:"js",default:et2_no_init,description:"JS code which is executed when the date range changes."},onevent_change:{name:"onevent_change",type:"js",default:et2_no_init,description:"JS code which is executed when an event changes."},height:{default:"100%"}},init:function(){this._super.apply(this,arguments),this.div=$j(document.createElement("div")).addClass("calendar_calTimeGrid").addClass("calendar_TimeGridNoLabel"),this.gridHeader=$j(document.createElement("div")).addClass("calendar_calGridHeader").appendTo(this.div),this.dayHeader=$j(document.createElement("div")).appendTo(this.gridHeader),this.scrolling=$j(document.createElement("div")).addClass("calendar_calTimeGridScroll").appendTo(this.div).append('
'),this.days=$j(document.createElement("div")).addClass("calendar_calDayCols").appendTo(this.scrolling),this.owner=et2_createWidget("select-account_ro",{},this),this._labelContainer=$j(document.createElement("label")).addClass("et2_label").appendTo(this.gridHeader),this.gridHover=jQuery('
'),this.day_list=[],this.day_widgets=[],this.update_timer=null,this.resize_timer=null,this.setDOMNode(this.div[0])},destroy:function(){framework.getApplicationByName("calendar").tab&&$j(framework.getApplicationByName("calendar").tab.contentDiv).off("show."+this.id),this._super.apply(this,arguments),this._actionObject.clear(),this._actionObject.unregisterActions(),this._actionObject.remove(),this._actionObject=null,this.div.off(),this.div=null,this.gridHeader=null,this.dayHeader=null,this.days=null,this.scrolling=null,this._labelContainer=null,this.resize_timer&&window.clearTimeout(this.resize_timer)},doLoadingFinished:function(){this._super.apply(this,arguments),framework.getApplicationByName("calendar").tab&&$j(framework.getApplicationByName("calendar").tab.contentDiv).on("show."+this.id,jQuery.proxy(function(){this.scrolling&&this.scrolling.scrollTop(this._top_time)},this)),this.resize(),this._drawGrid(),this._link_actions(this.options.actions||this._parent.options.actions||[]);var timegrid=this;return this.div.on("mouseover",".calendar_calEvent:not(.ui-resizable):not(.rowNoEdit)",function(){if(0!==timegrid.options.granularity){timegrid._get_event_info(this);$j(this).resizable({distance:10,grid:[1e4,timegrid.rowHeight],autoHide:!1,handles:"s,se",containment:"parent",create:function(event,ui){var resizeHelper=event.target.getAttribute("data-resize");"WD"!=resizeHelper&&"WDS"!=resizeHelper||jQuery(this).resizable("destroy")},stop:function(event,ui){var e=new jQuery.Event("change");e.originalEvent=event,e.data={duration:0};var event_data=timegrid._get_event_info(this),event_widget=timegrid.getWidgetById(event_data.widget_id),sT=event_widget.options.value.start_m;if("undefined"!=typeof this.dropEnd&&1==this.dropEnd.length){var eT=parseInt(60*this.dropEnd.attr("data-hour"))+parseInt(this.dropEnd.attr("data-minute"));e.data.duration=(eT-sT)/60*3600,event_widget&&(event_widget.options.value.end_m=eT,event_widget.options.value.duration=e.data.duration),$j(this).trigger(e),event_widget._update(event_widget.options.value),$j(this).resizable("instance")&&$j(this).resizable("destroy")}event_widget&&event_widget._parent&&event_widget._parent.position_event(event_widget),timegrid.div.children(".drop-hover").removeClass(".drop-hover")},resize:function(event,ui){timegrid._get_time_from_position(ui.helper[0].getBoundingClientRect().left,ui.helper[0].getBoundingClientRect().bottom+5),timegrid.gridHover.hide();var drop=timegrid._drag_helper(this,ui.element[0]);drop&&!drop.is(":visible")&&drop.get(0).scrollIntoView(!1)}})}}),this.div.on("dragcreate",".calendar_calEvent",function(event,ui){$j(this).draggable("option","cancel",".rowNoEdit"),$j(this).draggable("option","cursorAt",{top:5,left:-5})}).on("dragstart",".calendar_calEvent",function(event,ui){$j(".calendar_calEvent",ui.helper).width($j(this).width()).height($j(this).outerHeight()).css("top","").css("left","").appendTo(ui.helper),ui.helper.width($j(this).width())}).on("mousemove",function(event){timegrid._get_time_from_position(event.clientX,event.clientY)}).on("mouseout",function(){timegrid.gridHover.hide()}),!0},_drag_helper:function(element,helper,height){if(element){if(element.dropEnd=this.gridHover,element.dropEnd.length&&(this._drop_data=element.dropEnd[0].dataset||{}),"undefined"!=typeof element.dropEnd&&element.dropEnd.length){this.gridHover.is(":visible")&&(this.scrolling.scrollTop()>0&&this.scrolling.scrollTop()>=this.gridHover.position().top-this.rowHeight?this.scrolling.scrollTop(this.gridHover.position().top-this.rowHeight):this.scrolling.scrollTop()+this.scrolling.height()<=this.gridHover.position().top+2*this.rowHeight&&this.scrolling.scrollTop(this.scrolling.scrollTop()+this.rowHeight));var time="";this._drop_data.whole_day?time=this.egw().lang("Whole day"):0===this.options.granularity?$j(helper).addClass("calendar_calTimeGridList"):time=jQuery.datepicker.formatTime("12"===egw.preference("timeformat")?"h:mmtt":"HH:mm",{hour:element.dropEnd.attr("data-hour"),minute:element.dropEnd.attr("data-minute"),seconds:0,timezone:0},{ampm:"12"==egw.preference("timeformat")}),element.innerHTML='
'+time+"
"}else element.innerHTML='
';return $j(element).width($j(helper).width()),element.dropEnd}},_event_drop:function(timegrid,event,ui,dropEnd){var e=new jQuery.Event("change");if(e.originalEvent=event,e.data={start:0},"undefined"!=typeof dropEnd&&dropEnd){var drop_date=dropEnd.date||!1,event_data=timegrid._get_event_info(ui.draggable),event_widget=timegrid.getWidgetById(event_data.widget_id);if(event_widget||(event_widget=timegrid.getParent().getWidgetById(event_data.widget_id)),event_widget){event_widget._parent.date_helper.set_year(drop_date.substring(0,4)),event_widget._parent.date_helper.set_month(drop_date.substring(4,6)),event_widget._parent.date_helper.set_date(drop_date.substring(6,8)),"calendar"==event_data.app&&event_widget.options.value.whole_day?(event_widget._parent.date_helper.set_hours(0),event_widget._parent.date_helper.set_minutes(0)):0===timegrid.options.granularity?(event_widget._parent.date_helper.set_hours(event_widget.options.value.start.getUTCHours()),event_widget._parent.date_helper.set_minutes(event_widget.options.value.start.getUTCMinutes())):(event_widget._parent.date_helper.set_hours(dropEnd.whole_day?0:dropEnd.hour||0),event_widget._parent.date_helper.set_minutes(dropEnd.whole_day?0:dropEnd.minute||0));var loading=ui.helper.clone(!0).appendTo($j("body"));0==$j(".calendar_timeDemo",loading).length?$j(".calendar_calEventHeader",loading).addClass("loading"):$j(".calendar_timeDemo",loading).after('
'),event_widget.recur_prompt(function(button_id){if("cancel"===button_id||!button_id){var app_id=event_widget.options.value.app_id?event_widget.options.value.app_id:event_widget.options.value.id+(event_widget.options.value.recur_type?":"+event_widget.options.value.recur_date:"");return egw().dataStoreUID("calendar::"+app_id,egw.dataGetUIDdata("calendar::"+app_id).data),void loading.remove()}if("infolog"===event_data.app){var duration=dropEnd.whole_day?86399:event_widget.options.value.whole_day?60*egw().preference("defaultlength","calendar"):!1;egw().json("stylite_infolog_calendar_integration::ajax_moveInfologEvent",[event_data.app_id,event_widget._parent.date_helper.getValue()||!1,duration],function(){loading.remove()}).sendRequest(!0)}else{var duration=event_widget.options.value.whole_day&&dropEnd.hour?86399:!1;dropEnd.whole_day&&(duration="whole_day");var _send=function(series_instance){var start=new Date(event_widget._parent.date_helper.getValue());egw().json("calendar.calendar_uiforms.ajax_moveEvent",["series"===button_id?event_data.id:event_data.app_id,event_data.owner,start,timegrid.options.owner||egw.user("account_id"),duration,series_instance],function(){loading.remove()}).sendRequest(!0)};event_widget.options.value.recur_type&&"series"===button_id?event_widget.series_split_prompt(function(_button_id){_button_id===et2_dialog.OK_BUTTON?_send(event_widget.options.value.recur_date):loading.remove()}):_send(event_widget.options.value.recur_date)}})}}},invalidate:function(trigger){this.day_list=[],this.update_timer&&window.clearTimeout(this.update_timer),this.update_timer=window.setTimeout(jQuery.proxy(function(){this.widget.update_timer=null,window.clearTimeout(this.resize_timer),this.widget.loader.hide().show(),this.widget._actionManager&&this.widget._link_actions(this.widget._actionManager.children),this.widget._drawDays(),this.widget._drawTimes(),this.trigger&&this.widget.change(),window.setTimeout(jQuery.proxy(function(){this.loader.hide()},this.widget),100)},{widget:this,trigger:trigger}),ET2_GRID_INVALIDATE_TIMEOUT)},detachFromDOM:function(){$j(this.div).off(".et2_calendar_timegrid"),this._super.apply(this,arguments)},attachToDOM:function(){this._super.apply(this,arguments),$j(this.div).on("change.et2_calendar_timegrid",".calendar_calEvent",this,function(e){var args=Array.prototype.slice.call(arguments);return-1==args.indexOf(this)&&args.push(this),e.data.event_change.apply(e.data,args)}),$j(this.div).on("change.et2_calendar_timegrid","*:not(.calendar_calEvent)",this,function(e){return e.data.change.call(e.data,e,this)}),this.div.on("resize",this,function(e){e.stopPropagation()})},getDOMNode:function(_sender){return _sender!==this&&_sender?_sender.instanceOf(et2_calendar_daycol)?this.days?this.days[0]:null:_sender?this.gridHeader?this.gridHeader[0]:null:void 0:this.div?this.div[0]:null},set_disabled:function(disabled){this._super.apply(this,arguments),disabled&&this.loader.show()},_drawGrid:function(){this.div.css("height",this.options.height).empty(),this.loader.prependTo(this.div).show(),this._drawTimes(),this.invalidate()},_drawTimes:function(){$j(".calendar_calTimeRow",this.div).remove(),this.div.toggleClass("calendar_calTimeGridList",0===this.options.granularity),this.gridHeader.attr("data-date",this.options.start_date).attr("data-owner",this.options.owner).append(this._labelContainer).append(this.owner.getDOMNode()).append(this.dayHeader).appendTo(this.div);Math.max(this.gridHeader.outerHeight(!0),18);if(this.scrolling.appendTo(this.div).off(),0===this.options.granularity)return this.scrolling.css("height","100%"),this.days.css("height","100%"),void this.iterateOver(function(day){day.resize()},this,et2_calendar_daycol);var wd_start=60*this.options.day_start,wd_end=60*this.options.day_end,granularity=this.options.granularity,totalDisplayMinutes=wd_end-wd_start,rowsToDisplay=Math.ceil((totalDisplayMinutes+60)/granularity),row_count=1440/this.options.granularity;this.scrolling.on("scroll",jQuery.proxy(this._scroll,this));(100/rowsToDisplay).toFixed(1);this.rowHeight=this.scrolling.height()/rowsToDisplay,this.rowHeight<5&&this.div.is(":visible")&&0===this.rowHeight&&(this.rowHeight=5);var show={5:[0,15,30,45],10:[0,30],15:[0,30],45:[0,15,30,45]},html="";parseInt(this.div.css("line-height"));this._top_time=0;for(var t=0,i=0;1440>t;t+=granularity,++i){html+='
';var time=jQuery.datepicker.formatTime("12"===egw.preference("timeformat")?"h:mmtt":"HH:mm",{hour:t/60,minute:t%60,seconds:0,timezone:0},{ampm:"12"===egw.preference("timeformat")});wd_start>=t&&t+granularity>wd_start&&(this._top_time=this.rowHeight*(i+1+(wd_start-(t+granularity))/granularity));var time_label=("undefined"==typeof show[granularity]?t%60===0:-1!==show[granularity].indexOf(t%60))?time:"";time_label&&"12"==egw.preference("timeformat")&&time_label.split(":")[0]<10&&(time_label="  "+time_label),html+='
'+time_label+"
\n"}$j(".calendar_calTimeLabels",this.scrolling).empty().height(this.rowHeight*i).append(html),this.days.css("height",this.rowHeight*i+"px"),this.gridHover.css("height",this.rowHeight),this.scrolling.scrollTop(this._top_time)},resizeTimes:function(){this.resize_timer&&window.clearTimeout(this.resize_timer),this.upate_timer||(this.resize_timer=window.setTimeout(jQuery.proxy(function(){this._resizeTimes&&(this.resize_timer=null,this._resizeTimes())},this),1))},_resizeTimes:function(){if(this.div.is(":visible")){var wd_start=60*this.options.day_start,wd_end=60*this.options.day_end,totalDisplayMinutes=wd_end-wd_start,rowsToDisplay=Math.ceil((totalDisplayMinutes+60)/this.options.granularity),row_count=1440/this.options.granularity,new_height=this.scrolling.height()/rowsToDisplay,old_height=this.rowHeight;this.rowHeight=new_height,$j(".calendar_calTimeLabels",this.scrolling).height(this.rowHeight*row_count),this.days.css("height",0===this.options.granularity?"100%":this.rowHeight*row_count+"px"),this._top_time=wd_start*this.rowHeight/this.options.granularity,this.scrolling.scrollTop(this._top_time),this.rowHeight!=old_height&&this.iterateOver(function(child){child!==this&&child.resize()},this,et2_IResizeable)}},_drawDays:function(){this.scrolling.append(this.days),0===this.day_list.length&&this.options.start_date&&this.options.end_date&&(this.day_list=this._calculate_day_list(this.options.start_date,this.options.end_date,this.options.show_weekend));var daily_owner=1===this.day_list.length&&this.options.owner.length>1&&this.options.owner.length<(parseInt(egw.preference("day_consolidate","calendar"))||6),daycols_needed=daily_owner?this.options.owner.length:this.day_list.length,day_width=Math.min($j(this.getInstanceManager().DOMContainer).width(),this.days.width())/daycols_needed;if(!day_width||!this.day_list){var dim=egw.getHiddenDimensions(this.days,!1);day_width=dim.w/Math.max(daycols_needed,1)}for(var add_index=0,before=!0;daycols_needed>this.day_widgets.length;){var existing_index=this.day_widgets[add_index]&&!daily_owner?this.day_list.indexOf(this.day_widgets[add_index].options.date):-1;before=existing_index>add_index;var day=et2_createWidget("calendar-daycol",{owner:this.options.owner,width:(before?0:day_width)+"px"},this);this.isInTree()&&day.doLoadingFinished(),-1!=existing_index&&parseInt(this.day_list[add_index])daycols_needed;){for(;delete_index>1&&this.day_list.indexOf(this.day_widgets[delete_index].options.date)>-1;)delete_index--,before=!0;0>delete_index&&(delete_index=0),before&&this.day_widgets[delete_index].set_width("0px"),this.day_widgets[delete_index].div.hide(),this.day_widgets[delete_index].header.hide(),this.day_widgets[delete_index].destroy(),this.day_widgets.splice(delete_index--,1)}for(var i=0;i=this.date_helper.date.getTime()&&14>=i);return day_list},_link_actions:function(actions){var objectManager=egw_getObjectManager(this.getInstanceManager().app,!0,1);objectManager=objectManager.getObjectById(this.getInstanceManager().uniqueId,2)||objectManager;var parent=objectManager.getObjectById(this.id,1)||objectManager.getObjectById(this._parent.id,1)||objectManager;if(!parent)return void egw.debug("error","No parent objectManager found");for(var i=0;i0){parent=parent.children[i];break}}var widget_object=this._actionObject||parent.getObjectById(this.id),aoi=new et2_action_object_impl(this,this.getDOMNode());aoi.doTriggerEvent=function(_event,_data){var event=_data.event||!1;if(event&&!_data.ui.draggable.hasClass("rowNoEdit")){if("drop"===event.type){var dropEnd=!1,helper=$j(".calendar_d-n-d_timeCounter",_data.ui.helper)[0];helper&&helper.dropEnd&&helper.dropEnd.length>=1&&"undefined"!=typeof this.dropEnd&&this.dropEnd.length>=1&&(dropEnd=helper.dropEnd[0].dataset||!1),this.getWidget()._event_drop.call($j(".calendar_d-n-d_timeCounter",_data.ui.helper)[0],this.getWidget(),event,_data.ui,dropEnd)}var drag_listener=function(event,ui){aoi.getWidget()._drag_helper($j(".calendar_d-n-d_timeCounter",ui.helper)[0],ui.helper[0],0)},time=$j(".calendar_d-n-d_timeCounter",_data.ui.helper);switch(_event){case EGW_AI_DRAG_OVER:_data.ui.draggable.on("drag.et2_timegrid"+widget_object.id,drag_listener),_data.ui.draggable.on("dragend.et2_timegrid"+widget_object.id,function(){_data.ui.draggable.off("drag.et2_timegrid"+widget_object.id)}),$j(".calendar_calEventHeader",_data.ui.helper).css("top",""),$j(".calendar_calEventBody",_data.ui.helper).css("padding-top",""),time.length?time.data("count",time.data("count")+1):_data.ui.helper.prepend('
');break;case EGW_AI_DRAG_OUT:_data.ui.draggable.off("drag.et2_timegrid"+widget_object.id);var timegrid=aoi.getWidget();timegrid.gridHover.hide(),timegrid.scrolling.scrollTop(timegrid._top_time),time.data("count",time.data("count")-1),time.length&&time.data("count")<=0&&time.remove()}}},null==widget_object?widget_object=parent.insertObject(!1,new egwActionObject(this.id,parent,aoi,this._actionManager||parent.manager.getActionById(this.id)||parent.manager)):widget_object.setAOI(aoi),this._actionObject=widget_object,widget_object.clear(),widget_object.unregisterActions();var action_links=this._get_action_links(actions);this._init_links_dnd(widget_object.manager,action_links),widget_object.updateActionLinks(action_links)},_init_links_dnd:function(mgr,actionLinks){var self=this,drop_action=mgr.getActionById("egw_link_drop"),drag_action=mgr.getActionById("egw_link_drag");return!egw.link_get_registry(this.dataStorePrefix||"calendar","query")||egw.link_get_registry(this.dataStorePrefix||"calendar","title")?(drop_action&&(drop_action.remove(),actionLinks.indexOf(drop_action.id)>=0&&actionLinks.splice(actionLinks.indexOf(drop_action.id),1)),void(drag_action&&(drag_action.remove(),actionLinks.indexOf(drag_action.id)>=0&&actionLinks.splice(actionLinks.indexOf(drag_action.id),1)))):(null==drop_action&&(drop_action=mgr.addAction("drop","egw_link_drop",egw.lang("Create link"),egw.image("link"),function(action,source,target){for(var links=[],id="",i=0;i0&&label.trim().length<6||this.options.owner.length>1)},set_granularity:function(minutes){minutes=Math.max(0,minutes),this.options.granularity!==minutes?0===this.options.granularity||0===minutes?(this.options.granularity=minutes,this.invalidate()):(this.options.granularity=minutes,this._drawTimes()):this.update_timer||this.resizeTimes()},set_show_weekend:function(weekends){weekends=!!weekends,this.options.show_weekend!==weekends&&(this.options.show_weekend=weekends,this.isAttached()&&this.invalidate())},change:function(){if(this.onchange){if("function"==typeof this.onchange){var args=Array.prototype.slice.call(arguments);return-1==args.indexOf(this)&&args.push(this),this.onchange.apply(this,args)}return et2_compileLegacyJS(this.options.onchange,this,_node)()}},event_change:function(event,dom_node){if(this.onevent_change){var event_data=this._get_event_info(dom_node),event_widget=this.getWidgetById(event_data.widget_id);et2_calendar_event.recur_prompt(event_data,jQuery.proxy(function(button_id,event_data){if("cancel"===button_id)return!1;if("function"==typeof this.onevent_change){var args=Array.prototype.slice.call(arguments);return-1==args.indexOf(event_widget)&&args.push(event_widget),event.button_id=button_id,this.onevent_change.apply(this,[event,event_widget,button_id])}return et2_compileLegacyJS(this.options.onevent_change,event_widget,dom_node)()},this))}return!1},get_granularity:function(){return"undefined"==typeof this.options.granularity&&(this.options.granularity=egw.preference("interval","calendar")||30),parseInt(this.options.granularity)},click:function(_ev){var result=!0;if(_ev.target.dataset.id||$j(_ev.target).parents(".calendar_calEvent").length){var event=this._get_event_info(_ev.originalEvent.target);if("function"==typeof this.onclick){var args=Array.prototype.slice.call(arguments);-1==args.indexOf(this)&&args.splice(1,0,this),result=this.onclick.apply(this,args)}var event_node=$j(event.event_node);return event.id&&result&&!this.disabled&&!this.options.readonly&&event_node&&!event_node.hasClass("rowNoView")?(event.widget_id&&this.getWidgetById(event.widget_id)?this.getWidgetById(event.widget_id).recur_prompt():et2_calendar_event.recur_prompt(event),!1):result}if(this.gridHeader.is(_ev.target)&&_ev.target.dataset)app.calendar.update_state(jQuery.extend({view:"week"},_ev.target.dataset));else if(this.dayHeader.has(_ev.target).length)for(var i=1;ithis.options.height&&0!=this.options.granularity;if($j(this.getInstanceManager().DOMContainer).css({"overflow-y":too_small||_too_small?"auto":"hidden","overflow-x":"hidden",height:too_small||_too_small?height:"100%"}),too_small||_too_small){if(this.options.height=Math.max(this.options.height,needed),!_too_small&&rowCount>1&&this._parent)return void window.setTimeout(jQuery.proxy(function(){this._parent&&this._parent.iterateOver(function(widget){widget.disabled||widget.resize(!0)},this,et2_calendar_timegrid)},this),1);this.div.addClass("calendar_calTimeGridFixed")}else this.div.removeClass("calendar_calTimeGridFixed");this.div.css("height",this.options.height),this.update_timer||this.resizeTimes();for(var total_width=$j(this.getInstanceManager().DOMContainer).parent().innerWidth()-this.days.position().left,day_width=(total_width>0?total_width:$j(this.getInstanceManager().DOMContainer).width())/this.day_widgets.length,i=0;idays&&(width=85*days/31,this.rows.css("width",width+"%"))),"month"==this._parent.options.group_by&&this.rows.append(this._yearlyPlannerMarkDays(this.options.start_date,days)),"month"===this._parent.options.group_by&&31>days&&this.rows.after('
')},set_label:function(label){this.options.label=label,this.title.text(label),"month"===this._parent.options.group_by?(this.title.attr("data-date",this.options.start_date.toJSON()),this.title.addClass("et2_clickable et2_link")):(this.title.attr("data-date",""),this.title.removeClass("et2_clickable"))},set_start_date:function(new_date){if(!new_date||null===new_date)throw exception("Invalid end date. "+new_date.toString());this.options.start_date=new Date("string"==typeof new_date?new_date:new_date.toJSON()),this.options.start_date.setUTCHours(0),this.options.start_date.setUTCMinutes(0),this.options.start_date.setUTCSeconds(0)},set_end_date:function(new_date){if(!new_date||null===new_date)throw exception("Invalid end date. "+new_date.toString());this.options.end_date=new Date("string"==typeof new_date?new_date:new_date.toJSON()),this.options.end_date.setUTCHours(23),this.options.end_date.setUTCMinutes(59),this.options.end_date.setUTCSeconds(59)},_yearlyPlannerMarkDays:function(start,days){for(var day_width=100/days,t=new Date(start),content="",i=0;days>i;i++){var holidays=[],day_class=this._parent.day_class_holiday(t,holidays);day_class&&(content+='
"),t.setUTCDate(t.getUTCDate()+1)}return content},_update_events:function(events){for(;this._children.length;)this._children[this._children.length-1].free(),this.removeChild(this._children[this._children.length-1]);this._cached_rows=[];for(var c=0;c
').appendTo(this.rows),height=rows.length*(parseInt(window.getComputedStyle(row[0]).getPropertyValue("height"))||20);row.remove();for(var c=0;c=0||!event)&&i=1440&&(event.end_m=1439,event.multiday=!0),event.start.getUTCHours()||event.start.getUTCMinutes()||23!=event.end.getUTCHours()||59!=event.end.getUTCMinutes()||(event.whole_day_on_top=event.non_blocking&&"0"!=event.non_blocking)}for(var event_start=new Date(event.start).valueOf(),row=0;row_end[row]>event_start;++row);"undefined"==typeof rows[row]&&(rows[row]=[]),rows[row].push(this._children[n]),row_end[row]=new Date(event.end).valueOf()}return this._cached_rows=rows,rows},_time_to_position:function(time,start,end){var pos=0;start=this.options.start_date,end=this.options.end_date,"string"==typeof start&&(start=new Date(start),end=new Date(end));var wd_start=60*(parseInt(egw.preference("workdaystarts","calendar"))||9),t=(60*(parseInt(egw.preference("workdayends","calendar"))||17),time);return t="number"==typeof time&&3600>time?new Date(start.valueOf()+3600*wd_start*1e3):new Date(time),start>=t?0:t>=end?100:(pos=(t-start)/(end-start),"month"!==this._parent.options.group_by,pos=100*pos)},getDetachedAttributes:function(_attrs){},getDetachedNodes:function(){return[this.getDOMNode()]},setDetachedAttributes:function(_nodes,_values){}})}.call(this);et2_register_widget(et2_calendar_planner_row,["calendar-planner_row"]);var et2_calendar_planner=function(){"use strict";return et2_calendar_view.extend([et2_IDetachedDOM,et2_IResizeable],{createNamespace:!0,attributes:{group_by:{name:"Group by",type:"string",default:"0",description:"Display planner by 'user', 'month', or the given category"},filter:{name:"Filter",type:"string",default:"",description:"A filter that is used to select events. It is passed along when events are queried."},value:{type:"any",description:"A list of events, optionally you can set start_date, end_date and group_by as keys and events will be fetched"},onchange:{name:"onchange",type:"js",default:et2_no_init,description:"JS code which is executed when the date range changes."},onevent_change:{name:"onevent_change",type:"js",default:et2_no_init,description:"JS code which is executed when an event changes."}},init:function(){this._super.apply(this,arguments),this.div=$j(document.createElement("div")).addClass("calendar_plannerWidget"),this.gridHeader=$j(document.createElement("div")).addClass("calendar_plannerHeader").appendTo(this.div),this.headerTitle=$j(document.createElement("div")).addClass("calendar_plannerHeaderTitle").appendTo(this.gridHeader),this.headers=$j(document.createElement("div")).addClass("calendar_plannerHeaderRows").appendTo(this.gridHeader),this.rows=$j(document.createElement("div")).addClass("calendar_plannerRows").appendTo(this.div),this.grid=$j(document.createElement("div")).addClass("calendar_plannerGrid").appendTo(this.div),this.vertical_bar=$j(document.createElement("div")).addClass("verticalBar").appendTo(this.div),this.value=[],this.update_timer=null,this.doInvalidate=!0,this.setDOMNode(this.div[0]),this.registeredCallbacks=[]},destroy:function(){this._super.apply(this,arguments),this.div.off();for(var i=0;i'),$j(this).trigger(e),$j(this).resizable("destroy"),loading.remove()}event_widget&&event_widget._parent.position_event(event_widget)},resize:function(event,ui){planner._drag_helper(this,{top:ui.position.top,left:ui.position.left+ui.helper.width()},ui.helper.outerHeight())}})}).on("mousemove",function(event){if(0==$j(event.target).closest(".calendar_eventRows").length)return void planner.vertical_bar.hide();if(planner.vertical_bar.position({my:"right-1",of:event,collision:"fit"}),planner.vertical_bar.css("top","0px"),"month"==planner.options.group_by)var time=planner._get_time_from_position(event.clientX,event.clientY);else var time=planner._get_time_from_position(event.offsetX,event.offsetY);if(time){var formatDate=new Date(time.valueOf()+60*time.getTimezoneOffset()*1e3);planner.vertical_bar.html(""+date(12==egw.preference("timeformat","calendar")?"h:ia":"H:i",formatDate)+"").show()}else planner.vertical_bar.hide()}),this.div.on("dragcreate",".calendar_calEvent",function(event,ui){$j(this).draggable("option","cancel",".rowNoEdit"),$j(this).draggable("option","cursorAt",{top:5,left:5})}).on("dragstart",".calendar_calEvent",function(event,ui){$j(".calendar_calEvent",ui.helper).width($j(this).width()).height($j(this).outerHeight()).css("top","").css("left","").appendTo(ui.helper),ui.helper.width($j(this).width())}),!0},groupers:{user:{title:function(){return this.egw().lang("User")},headers:function(){var start=new Date(this.options.start_date),end=new Date(this.options.end_date),start_date=new Date(start.getUTCFullYear(),start.getUTCMonth(),start.getUTCDate()),end_date=new Date(end.getUTCFullYear(),end.getUTCMonth(),end.getUTCDate()),day_count=Math.round((end_date-start_date)/864e5)+1;if(day_count>=6&&this.headers.append(this._header_months(start,day_count)),120>day_count){var weeks=this._header_weeks(start,day_count);this.headers.append(weeks),this.grid.append(weeks)}if(60>day_count){var days=this._header_days(start,day_count);this.headers.append(days),this.grid.append(days)}if(7>=day_count){var hours=this._header_hours(start,day_count);this.headers.append(hours),this.grid.append(hours)}},row_labels:function(){for(var labels=[],accounts=egw.accounts(),already_added=[],i=0;iuser)egw.accountData(user,"account_fullname",!0,function(result){for(var id in result)already_added.indexOf(""+id)<0&&(this.push({id:id,label:result[id],data:{participants:id,owner:id}}),already_added.push(""+id))},labels);else{user=parseInt(user);for(var j=0;j=0||"owner"===this.options.filter&&event.owner===user)&&("undefined"==typeof rows[label_index]&&(rows[label_index]=[]),rows[label_index].push(event))};for(var user in participants){var participant=participants[user];if(parseInt(user)<0){var planner=this;egw.accountData(user,"account_fullname",!0,function(result){for(var id in result)participants[id]||add_row.call(planner,id,participant)},labels)}else add_row.call(this,user,participant)}},draw_row:function(sort_key,label,events){return-1!==["user","both"].indexOf(egw.preference("planner_show_empty_rows","calendar"))||events.length?this._drawRow(sort_key,label,events,this.options.start_date,this.options.end_date):void 0}},month:{title:function(){return this.egw().lang("Month")},headers:function(){this.headers.append(this._header_day_of_month())},row_labels:function(){var labels=[],d=new Date(this.options.start_date);d=new Date(d.valueOf()+60*d.getTimezoneOffset()*1e3);for(var i=0;12>i;i++)labels.push({id:d.getFullYear()+"-"+d.getMonth(),label:app.calendar.egw.lang(date("F",d))+" "+d.getFullYear()}),d.setMonth(d.getMonth()+1);return labels},group:function(labels,rows,event){if(!event||!event.app||"infolog"!=event.app){var start=new Date(event.start);start=new Date(start.valueOf()+60*start.getTimezoneOffset()*1e3);for(var key=start.getFullYear()+"-"+start.getMonth(),label_index=!1,i=0;i11&&(++year,month=0),key=sprintf("%04d-%d",year,month);for(var i=0;i=6&&this.headers.append(this._header_months(start,day_count)),120>day_count){var weeks=this._header_weeks(start,day_count);this.headers.append(weeks),this.grid.append(weeks)}if(60>day_count){var days=this._header_days(start,day_count);this.headers.append(days),this.grid.append(days)}if(7>=day_count){var hours=this._header_hours(start,day_count);this.headers.append(hours),this.grid.append(hours)}},row_labels:function(){var im=this.getInstanceManager(),categories=et2_selectbox.cat_options({_type:"select-cat",getInstanceManager:function(){return im}},{application:"calendar"}),labels=[];if(app.calendar.state.cat_id&&""!==app.calendar.state.cat_id.toString()&&"0"!=app.calendar.state.cat_id.toString()){var cat_id=app.calendar.state.cat_id;"string"==typeof cat_id&&(cat_id=cat_id.split(","));for(var i=0;i=0;i--)labels[i].id=labels[i].value,labels[i].data={cat_id:labels[i].id,main:labels[i].value==labels[i].main},labels[i].children&&labels[i].children.length&&(labels[i].data.has_children=!0);return labels},group:function(labels,rows,event){var cats=event.category;"string"==typeof event.category&&(cats=cats.split(","));for(var cat=0;cat0&&delete_index>=0;)this._children[delete_index].free(),this.removeChild(this._children[delete_index--]);this.rows.empty().append(this.grid),this.grid.empty();var grouper=this.groupers[isNaN(this.options.group_by)?this.options.group_by:"category"];if(grouper){this.headers.empty(),this.headerTitle.text(grouper.title.apply(this)),grouper.headers.apply(this),this.grid.find("*").contents().filter(function(){return 3===this.nodeType}).remove();for(var labels=grouper.row_labels.call(this),events={},i=0;i',start=new Date(this.options.start_date);start=new Date(start.valueOf()+60*start.getTimezoneOffset()*1e3);var end=new Date(this.options.end_date);end=new Date(end.valueOf()+60*end.getTimezoneOffset()*1e3);var title=app.calendar.egw.lang(date("F",start))+" "+date("Y",start)+" - "+app.calendar.egw.lang(date("F",end))+" "+date("Y",end);content+='",content+="",content+='
';for(var left=0,i=0;31>i;left+=day_width,++i)content+='
'+(1+i)+"
\n";return content+="
\n"},_header_months:function(start,days){var content='
',days_in_month=0,day_width=100/days,end=new Date(start);end.setUTCDate(end.getUTCDate()+days); +for(var t=new Date(start.valueOf()),left=0,i=0;days>i;t.setUTCDate(1),t.setUTCMonth(t.getUTCMonth()+1),left+=days_in_month*day_width,i+=days_in_month){var u=new Date(t.getUTCFullYear(),t.getUTCMonth()+1,0,-t.getTimezoneOffset()/60);days_in_month=1+(u-t)/864e5;var first=new Date(t.getUTCFullYear(),t.getUTCMonth(),1,-t.getTimezoneOffset()/60);if(0>=days_in_month)break;i+days_in_month>days&&(days_in_month=days-i);var title=app.calendar.egw.lang(date("F",new Date(t.valueOf()+60*t.getTimezoneOffset()*1e3)));days_in_month>10?title+=" "+t.getUTCFullYear():5>days_in_month&&(title=" "),content+='"}return content+="
"},_header_weeks:function(start,days){for(var content='
',state="",t=new Date(start.valueOf()),week_end=app.calendar.date.end_of_week(start),days_in_week=Math.floor((week_end-start)/864e5+1),week_width=100/days*(7>=days?days:days_in_week),left=0,i=0;days>i;t.setUTCDate(t.getUTCDate()+7),left+=week_width){7>days-i&&(days_in_week=days-i);var usertime=new Date(t.valueOf());start.getTimezoneOffset()<0&&usertime.setUTCMinutes(usertime.getUTCMinutes()-start.getTimezoneOffset()),week_width=100/days*Math.min(days,days_in_week);var title=app.calendar.egw.lang("Week")+" "+app.calendar.date.week_number(usertime);start.getTimezoneOffset()>0&&usertime.setUTCMinutes(usertime.getUTCMinutes()+start.getTimezoneOffset()),state=app.calendar.date.start_of_week(usertime),state.setUTCHours(0),state.setUTCMinutes(0),state=state.toJSON(),(days_in_week>1||1==days)&&(content+='"),i+=days_in_week,7!=days_in_week&&(t.setUTCDate(t.getUTCDate()-(7-days_in_week)),days_in_week=7)}return content+="
"},_header_days:function(start,days){for(var day_width=100/days,content='
',t=new Date(start.valueOf()+60*start.getTimezoneOffset()*1e3),left=0,i=0;days>i;t.setDate(t.getDate()+1),left+=day_width,++i){var holidays=[],tempDate=new Date(t);tempDate.setMinutes(tempDate.getMinutes()-start.getTimezoneOffset());var day_class=this.day_class_holiday(tempDate,holidays),title="",state="";title=3>=days?app.calendar.egw.lang(date("l",t))+", "+date("j",t)+". "+app.calendar.egw.lang(date("F",t)):7>=days?app.calendar.egw.lang(date("l",t))+" "+date("j",t):app.calendar.egw.lang(date("D",t)).substr(0,2)+"
"+date("j",t),state=new Date(t.valueOf()-60*start.getTimezoneOffset()*1e3).toJSON(),content+='\n"}return content+="
"},_header_hours:function(start,days){for(var divisors=[1,2,3,4,6,8,12],decr=1,i=0;idays);i++)decr=divisors[i];var hours=24*days;if(1===days){var t=new Date(start.getUTCFullYear(),start.getUTCMonth(),start.getUTCDate(),-start.getTimezoneOffset()/60),s=new Date(start);s.setUTCHours(23),s.setUTCMinutes(59),s.setUTCSeconds(59),hours=Math.ceil((s.getTime()-t.getTime())/36e5)}for(var cell_width=100/hours*decr,content='
',t=new Date(start.valueOf()+60*start.getTimezoneOffset()*1e3),left=0,i=0;hours>i;left+=cell_width,i+=decr){var title=date(12==egw.preference("timeformat","calendar")?"ha":"H",t);content+='",t.setHours(t.getHours()+decr)}return content+="
"},day_class_holiday:function(date,holiday_list){if(!date)return"";var day_class="",holidays=et2_calendar_view.get_holidays(this,date.getUTCFullYear());this.date_helper.set_value(date.toJSON());var date_key=""+this.date_helper.get_year()+sprintf("%02d",this.date_helper.get_month())+sprintf("%02d",this.date_helper.get_date());if(holidays&&holidays[date_key]){holidays=holidays[date_key];for(var i=0;i0){parent=parent.children[i];break}}}var widget_object=this._actionObject||parent.getObjectById(this.id),aoi=new et2_action_object_impl(this,this.getDOMNode());aoi.doTriggerEvent=function(_event,_data){var event=_data.event||!1;if(event&&!_data.ui.draggable.hasClass("rowNoEdit")){"drop"===event.type&&this.getWidget()._event_drop.call($j(".calendar_d-n-d_timeCounter",_data.ui.helper)[0],this.getWidget(),event,_data.ui);var drag_listener=function(event,ui){aoi.getWidget()._drag_helper($j(".calendar_d-n-d_timeCounter",ui.helper)[0],{top:ui.position.top,left:ui.position.left-$j(this).parent().offset().left},0)},time=$j(".calendar_d-n-d_timeCounter",_data.ui.helper);switch(_event){case EGW_AI_DRAG_OVER:_data.ui.draggable.on("drag.et2_timegrid"+widget_object.id,drag_listener),_data.ui.draggable.on("dragend.et2_timegrid"+widget_object.id,function(){_data.ui.draggable.off("drag.et2_timegrid"+widget_object.id)}),time.length?time.data("count",time.data("count")+1):_data.ui.helper.prepend('
');break;case EGW_AI_DRAG_OUT:_data.ui.draggable.off("drag.et2_timegrid"+widget_object.id),$j("[data-date]",this.doGetDOMNode()).removeClass("ui-state-active"),time.data("count",time.data("count")-1),time.length&&time.data("count")<=0&&time.remove()}}},null==widget_object?widget_object=parent.insertObject(!1,new egwActionObject(this.id,parent,aoi,this._actionManager||parent.manager.getActionById(this.id)||parent.manager),EGW_AO_FLAG_IS_CONTAINER):widget_object.setAOI(aoi);var action_links=this._get_action_links(actions);this._init_links_dnd(widget_object.manager,action_links),widget_object.updateActionLinks(action_links),this._actionObject=widget_object},_init_links_dnd:function(mgr,actionLinks){var self=this,drop_action=mgr.getActionById("egw_link_drop"),drag_action=mgr.getActionById("egw_link_drag");return!egw.link_get_registry(this.dataStorePrefix||"calendar","query")||egw.link_get_registry(this.dataStorePrefix||"calendar","title")?(drop_action&&(drop_action.remove(),actionLinks.indexOf(drop_action.id)>=0&&actionLinks.splice(actionLinks.indexOf(drop_action.id),1)),void(drag_action&&(drag_action.remove(),actionLinks.indexOf(drag_action.id)>=0&&actionLinks.splice(actionLinks.indexOf(drag_action.id),1)))):(null==drop_action&&(drop_action=mgr.addAction("drop","egw_link_drop",egw.lang("Create link"),egw.image("link"),function(action,source,dropped){for(var links=[],id="",i=0;i'+formatted_time+""},_event_drop:function(planner,event,ui){var e=new jQuery.Event("change");if(e.originalEvent=event,e.data={start:0},"undefined"!=typeof this.dropEnd){var drop_date=this.dropEnd.toJSON()||!1,event_data=planner._get_event_info(ui.draggable),event_widget=planner.getWidgetById(event_data.widget_id);if(event_widget){event_widget._parent.date_helper.set_value(drop_date),event_widget.options.value.start=new Date(event_widget._parent.date_helper.getValue());var loading=ui.helper.clone().appendTo(ui.helper.parent());$j(".calendar_timeDemo",loading).after('
'),event_widget.recur_prompt(function(button_id){"cancel"!==button_id&&button_id&&("infolog"===event_data.app?egw().json("stylite_infolog_calendar_integration::ajax_moveInfologEvent",[event_data.id,event_widget.options.value.start||!1],function(){loading.remove()}).sendRequest(!0):egw().json("calendar.calendar_uiforms.ajax_moveEvent",["series"===button_id?event_data.id:event_data.app_id,event_data.owner,event_widget.options.value.start,planner.options.owner||egw.user("account_id")],function(){loading.remove()}).sendRequest(!0))})}}},_fetch_data:function(){var value=[],fetch=!1;this.doInvalidate=!1;for(var i=0;i0;i++)if(this._children[i].div[0]==row[0]){row_widget=this._children[i];break}if(!row_widget)return!1;rel_x=Math.min((x-row_widget.rows.offset().left)/row_widget.rows.width(),1),rel_time=(new Date(row_widget.options.end_date)-new Date(row_widget.options.start_date))*rel_x/1e3,this.date_helper.set_value(row_widget.options.start_date.toJSON())}if(0>rel_time)return!1;var interval=egw.preference("interval","calendar")||30;return this.date_helper.set_minutes(Math.round(rel_time/(60*interval))*interval),new Date(this.date_helper.getValue())},getDetachedAttributes:function(_attrs){_attrs.push("start_date","end_date")},getDetachedNodes:function(){return[this.getDOMNode()]},setDetachedAttributes:function(_nodes,_values){this.div=$j(_nodes[0]),_values.start_date&&this.set_start_date(_values.start_date),_values.end_date&&this.set_end_date(_values.end_date)},resize:function(){var height=Math.min($j(this.getInstanceManager().DOMContainer).height(),$j(this.getInstanceManager().DOMContainer).parent().innerHeight());height-=$j("#calendar-toolbar",this.div.parents(".egw_fw_ui_tab_content")).outerHeight(!0),this.options.height=height,this.div.css("height",this.options.height),this.rows.height(this.div.height()-this.headers.outerHeight())}})}.call(this);et2_register_widget(et2_calendar_planner,["calendar-planner"]),app.classes.calendar=function(){"use strict";return AppJS.extend({appname:"calendar",sidebox_et2:null,state:{date:new Date,view:egw.preference("saved_states","calendar")?egw.preference("saved_states","calendar").view:egw.preference("defaultcalendar","calendar")||"day",owner:egw.user("account_id")},states_to_save:["owner","status_filter","filter","cat_id","view","sortby","planner_view","weekend"],sidebox_changes_views:["day","week","month"],sidebox_hooked_templates:[],_queries_in_progress:[],init:function(){return window.top!==window&&!egw(window).is_popup()&&window.top.app.calendar?void(window.app.calendar=window.top.app.calendar):(this._super.apply(this,arguments),jQuery(jQuery.proxy(this._scroll,this)),void jQuery.extend(this.state,this.egw.preference("saved_states","calendar")))},destroy:function(){if(this._super.apply(this,arguments),window.top!==window&&window.top.app.calendar===this&&delete window.top.app.calendar,jQuery("body").off(".calendar"),this.sidebox_et2){var date=this.sidebox_et2.getWidgetById("date");$j(window).off("resize.calendar"+date.dom_id)}this.sidebox_hooked_templates=null,egw_unregisterGlobalShortcut(jQuery.ui.keyCode.PAGE_UP,!1,!1,!1),egw_unregisterGlobalShortcut(jQuery.ui.keyCode.PAGE_DOWN,!1,!1,!1)},et2_ready:function(_et2,_name){if(this._super.apply(this,arguments),"calendar"===_et2.app){var sidebox=jQuery("#favorite_sidebox_"+this.appname);if(0==sidebox.length&&null!=egw_getFramework()){var egw_fw=egw_getFramework();sidebox=$j("#favorite_sidebox_"+this.appname,egw_fw.sidemenuDiv)}var content=this.et2.getArrayMgr("content");switch(_name){case"calendar.sidebox":this.sidebox_et2=_et2.widgetContainer,this.sidebox_hooked_templates.push(this.sidebox_et2),$j(_et2.DOMContainer).hide(),this._setup_sidebox_filters(),this.state=content.data;break;case"calendar.edit":"undefined"==typeof content.data.conflicts&&("freetime"!=content.data.button_was?(this.set_enddate_visibility(),this.check_recur_type(),this.et2.getWidgetById("recur_exception").set_disabled(!content.data.recur_exception||"undefined"==typeof content.data.recur_exception[0])):this.freetime_search(),content.data.lock_token&&(window.onbeforeunload=function(){this.egw.json("calendar.calendar_uiforms.ajax_unlock",[content.data.id,content.data.lock_token],null,!0,null,null).sendRequest(!0)})),this.alarm_custom_date();break;case"calendar.freetimesearch":this.set_enddate_visibility();break;case"calendar.list":window.setTimeout(jQuery.proxy(function(){this.filter_change()},this),0)}this._et2_view_init(_et2,_name)}},observer:function(_msg,_app,_id,_type,_msg_type,_links){var do_refresh=!1;switch(_app){case"infolog":if(jQuery(".calendar_calDayTodos").find("a").each(function(i,a){var match=a.href.split(/&info_id=/);match&&"undefined"!=typeof match[1]&&match[1]==_id&&(do_refresh=!0)}),"0"!==egw.preference("calendar_integration","infolog"))switch(jQuery('div [data-app="infolog"][data-app_id="'+_id+'"]').length>0&&(do_refresh=!0),_type){case"add":do_refresh=!0}do_refresh&&this._clear_cache();break;case"calendar":if(""==this.state.view){var iframe=this.sidebox_et2.getWidgetById("iframe");if(!iframe)return;return iframe.set_src(iframe.node.src),!1}var event=!1;if(_id&&(event=egw.dataGetUIDdata("calendar::"+_id)),event&&event.data&&event.data.date||"delete"===_type){var recurrences=Object.keys(egw.dataSearchUIDs(new RegExp("^calendar::"+_id+":"))),ids=event&&event.data.recur_type&&"string"==typeof _id&&_id.indexOf(":")<0||recurrences.length?recurrences:["calendar::"+_id];if("delete"===_type)for(var i in ids)egw.dataStoreUID(ids[i],null);else"update"!==_type&&this._update_events(this.state,ids);return!1}this._clear_cache(),this.setState({state:this.state})}},linkHandler:function(_url){if("about:blank"==_url)return!1;if(_url.match("menuaction=calendar.calendar_uiviews.")){var view=_url.match(/calendar_uiviews\.([^&?]+)/);view=view&&view.length>1?view[1]:null;var q={};if(_url.split("?")[1].split("&").forEach(function(i){q[i.split("=")[0]]=unescape(i.split("=")[1])}),delete q.ajax,delete q.menuaction,(!view&&q.view||q.view!=view&&"index"==view)&&(view=q.view),this.sidebox_et2&&"undefined"==typeof app.classes.calendar.views[view]&&"index"!=view)return q.owner&&(q.owner=q.owner.split(","),q.owner=q.owner.reduce(function(p,c){return p.indexOf(c)<0&&p.push(c),p},[]),q.owner=q.owner.join(",")),q.menuaction="calendar.calendar_uiviews.index",this.sidebox_et2.getWidgetById("iframe").set_src(egw.link("/index.php",q)),$j(this.sidebox_et2.parentNode).show(),!0;if(app.classes.calendar.views[view]){if("index"==view){var pref=this.egw.preference("saved_states","calendar");view=pref.view||"day"}if("string"==typeof app.classes.calendar.views[view].etemplates[0])return _url+"&ajax=true";var set=jQuery.extend({view:view},q);return this.update_state(set),!0}}else if(this.sidebox_et2){var iframe=this.sidebox_et2.getWidgetById("iframe");if(!iframe)return!1;iframe.set_src(_url),$j(this.sidebox_et2.parentNode).show();for(var _view in app.classes.calendar.views)for(var i=0;i div:first"),weekly=jQuery("#calendar-view_view tbody");if("day"==state.view){var sortable=daily;weekly.sortable("instance")&&weekly.sortable("disable")}else{var sortable=weekly;daily.sortable("instance")&&daily.sortable("disable")}if(sortable.sortable("instance")||sortable.sortable({cancel:"#divAppboxHeader, .calendar_calWeekNavHeader, .calendar_plannerHeader",handle:".calendar_calGridHeader",axis:"y",revert:!0,helper:"clone",create:function(){jQuery(this)},start:function(event,ui){$j(".calendar_calTimeGrid",ui.helper).css("position","absolute"),app.classes.calendar.views[app.calendar.state.view].etemplates[0].widgetContainer.iterateOver(function(widget){widget.options.owner&&!widget.disabled?widget.div.parents("tr").attr("data-owner",widget.options.owner):widget.div.parents("tr").removeAttr("data-owner")},this,et2_calendar_timegrid)},stop:function(){},update:function(){var state=app.calendar.getState();if(state&&"undefined"!=typeof state.owner){var sortedArr=sortable.sortable("toArray",{attribute:"data-owner"});sortedArr=sortedArr.filter(function(value,index,self){return""!==value&&self.indexOf(value)===index});var parent=null,children=[];"day"==state.view?app.classes.calendar.views.day.etemplates[0].widgetContainer.iterateOver(function(widget){var idx=sortedArr.indexOf(widget.options.owner);widget.set_left(parseInt(widget.options.width)*idx+"px"),parent=widget._parent,children.splice(idx,0,widget)},this,et2_calendar_daycol):app.classes.calendar.views.day.etemplates[0].widgetContainer.iterateOver(function(widget){parent=widget._parent;var idx=sortedArr.indexOf(widget.options.owner);children.splice(idx,0,widget),widget.resize()},this,et2_calendar_timegrid),parent._children.sort(function(a,b){return children.indexOf(a)-children.indexOf(b)}),app.calendar.state.owner=sortedArr}}}),state.owner.length>1&&("day"==state.view&&state.owner.length div:first",helper:function(event,element){var scroll=element.parentsUntil(".calendar_calTimeGrid").last().next(),helper=$j(document.createElement("div")).append(element.clone()).css("height",scroll.parent().css("height")).css("background-color","white").css("width",element.css("width"));return helper}},sortable.sortable("option",options);break;case"week":options={placeholder:"srotable_cal_wk_ph",axis:"y",handle:".calendar_calGridHeader",helper:"clone"},sortable.sortable("option",options)}}else sortable.sortable("disable")},_scroll:function(){var scroll_animate=function(direction,delta){if(!app.calendar._scroll_disabled){var id=$j(this).closest(".et2_container").attr("id");if(id)var template=etemplate2.getById(id);else template=app.classes.calendar.views[app.calendar.state.view].etemplates[0];if(template){app.calendar._scroll_disabled=!0;var widget=null;template.widgetContainer.iterateOver(function(w){w.getDOMNode()==this&&(widget=w)},this,et2_widget),null==widget&&(template.widgetContainer.iterateOver(function(w){widget=w},this,et2_calendar_timegrid),null==widget)||(window.setTimeout(function(){app.calendar&&(app.calendar._scroll_disabled=!1)},2e3),window.setTimeout(function(){var view=app.classes.calendar.views[app.calendar.state.view]||!1,start=new Date(app.calendar.state.date);return view&&-1!==view.etemplates.indexOf(template)?(start=view.scroll(delta),void app.calendar.update_state({date:app.calendar.date.toString(start)})):!1},0))}}};framework.applications.calendar&&framework.applications.calendar.tab&&(jQuery(framework.applications.calendar.tab.contentDiv).swipe("destroy").swipe({swipe:function(event,direction,distance,duration,fingerCount){if("up"==direction||"down"==direction){if(1>=fingerCount)return;var at_bottom=-1!==direction,at_top=1!==direction;$j(this).children(":not(.calendar_calGridHeader)").each(function(){at_bottom=at_bottom&&Math.abs(this.scrollTop-(this.scrollHeight-this.offsetHeight))<=2}).each(function(){at_top=at_top&&0===this.scrollTop})}var delta="down"==direction||"right"==direction?-1:1,opposite={down:"up",up:"down",left:"right",right:"left"};return direction=opposite[direction],scroll_animate.call($j(event.target).closest(".calendar_calTimeGrid, .calendar_plannerWidget")[0],direction,delta),!1},allowPageScroll:jQuery.fn.swipe.pageScroll.VERTICAL,threshold:100,fallbackToMouseEvents:!1,triggerOnTouchEnd:!1}),egw_registerGlobalShortcut(jQuery.ui.keyCode.PAGE_UP,!1,!1,!1,function(){return"listview"==app.calendar.state.view?!1:(scroll_animate.call(this,"up",-1),!0)}),egw_registerGlobalShortcut(jQuery.ui.keyCode.PAGE_DOWN,!1,!1,!1,function(){return"listview"==app.calendar.state.view?!1:(scroll_animate.call(this,"down",1),!0)}))},resizeHelper:function(_X,_Y){for(var $drops=jQuery("div[id^='drop_']"),top=Math.round(_Y),left=Math.round(_X),i=0;i<$drops.length;i++)if(top>=Math.round($drops[i].getBoundingClientRect().top)&&top<=Math.round($drops[i].getBoundingClientRect().bottom)&&left>=Math.round($drops[i].getBoundingClientRect().left)&&left<=Math.round($drops[i].getBoundingClientRect().right))return $drops[i];return!1},cal_dnd_tZone_converter:function(_date){var date=_date;if("undefined"!=_date){var tZone=_date.split("T")[1];if(tZone.search("am")>0){tZone=tZone.replace(" am","");var tAm=tZone.substr(0,2);"12"==tAm&&(tZone=tZone.replace("12","00")),date=_date.split("T")[0]+"T"+tZone}if(tZone.search("pm")>0){var pmTime=tZone.replace(" pm",""),H=parseInt(pmTime.substring(0,2))+12;pmTime=H.toString()+pmTime.substr(2,2),date=_date.split("T")[0]+"T"+pmTime}}return date},event_change:function(event,widget,dialog_button){if(widget.div.addClass("loading"),"infolog"==widget.options.value.app)egw().json("stylite_infolog_calendar_integration::ajax_moveInfologEvent",[widget.options.value.app_id,widget.options.value.start,widget.options.value.duration],function(){widget.div&&widget.div.removeClass("loading")}).sendRequest();else{var _send=function(){egw().json("calendar.calendar_uiforms.ajax_moveEvent",["exception"==dialog_button?widget.options.value.app_id:widget.options.value.id,widget.options.value.owner,widget.options.value.start,widget.options.value.owner,widget.options.value.duration,"series"==dialog_button?widget.options.value.start:null],function(){widget&&widget.div&&widget.div.removeClass("loading")}).sendRequest(!0)};"series"==dialog_button&&widget.options.value.recur_type?widget.series_split_prompt(function(_button_id){_button_id==et2_dialog.OK_BUTTON&&_send()}):_send()}},freetime_search_popup:function(_link){this.egw.open_link(_link,"ft_search","700x500")},freetime_search:function(){var content=this.et2.getArrayMgr("content").data;content.start=this.et2.getWidgetById("start").get_value(),content.end=this.et2.getWidgetById("end").get_value(),content.duration=this.et2.getWidgetById("duration").get_value();var request=this.egw.json("calendar.calendar_uiforms.ajax_freetimesearch",[content],null,null,null,null);request.sendRequest()},check_recur_type:function(){var recurType=this.et2.getWidgetById("recur_type"),recurData=this.et2.getWidgetById("recur_data");recurType&&recurData&&recurData.set_disabled(2!=recurType.get_value())},set_enddate_visibility:function(){var duration=this.et2.getWidgetById("duration"),start=this.et2.getWidgetById("start"),end=this.et2.getWidgetById("end"),content=this.et2.getArrayMgr("content").data;"undefined"!=typeof duration&&"undefined"!=typeof end&&(end.set_disabled(""!==duration.get_value()),end.disabled||content.end||(end.set_value(start.get_value()),"undefined"!=typeof content.duration&&end.set_value("+"+content.duration)))},actions_change:function(_event,widget){var event=this.et2.getArrayMgr("content").data;if(widget){var id=this.et2.getArrayMgr("content").data.id;switch(widget.get_value()){case"print":this.egw.open_link("calendar.calendar_uiforms.edit&cal_id="+id+"&print=1","_blank","700x700");break;case"mail":this.egw.json("calendar.calendar_uiforms.ajax_custom_mail",[event,!event.id,!1],null,null,null,null).sendRequest(),this.et2._inst.submit();break;case"sendrequest":this.egw.json("calendar.calendar_uiforms.ajax_custom_mail",[event,!event.id,!0],null,null,null,null).sendRequest(),this.et2._inst.submit();break;case"infolog":this.egw.open_link("infolog.infolog_ui.edit&action=calendar&action_id="+($j.isPlainObject(event)?event.id:event),"_blank","700x600","infolog"),this.et2._inst.submit();break;case"ical":this.et2._inst.postSubmit();break;default:this.et2._inst.submit()}}},custom_mail:function(vars){this.egw.open_link(this.egw.link("/index.php",vars),"_blank","700x700")},delete_btn:function(widget,exceptions){var content=this.et2.getArrayMgr("content").data; +if(exceptions){var buttons=[{button_id:"keep",title:this.egw.lang("All exceptions are converted into single events."),text:this.egw.lang("Keep exceptions"),id:"button[delete_keep_exceptions]",image:"keep",default:!0},{button_id:"delete",title:this.egw.lang("The exceptions are deleted together with the series."),text:this.egw.lang("Delete exceptions"),id:"button[delete_exceptions]",image:"delete"},{button_id:"cancel",text:this.egw.lang("Cancel"),id:"dialog[cancel]",image:"cancel"}];et2_dialog.show_dialog(function(_button_id){return"dialog[cancel]"!=_button_id?(widget.getRoot().getWidgetById("delete_exceptions").set_value("button[delete_exceptions]"==_button_id),widget.getInstanceManager().submit("button[delete]"),!0):!1},this.egw.lang("Do you want to keep the series exceptions in your calendar?"),this.egw.lang("This event is part of a series"),{},buttons,et2_dialog.WARNING_MESSAGE)}else 0!==content.recur_type?et2_dialog.confirm(widget,"Delete this series of recuring events","Delete Series"):et2_dialog.confirm(widget,"Delete this event","Delete")},print_participants_status:function(_event,widget){if(widget&&window.opener){var editPopWindow=window.opener;editPopWindow&&editPopWindow.etemplate2.getByApplication("calendar")[0].widgetContainer.getWidgetById(widget.id).set_value(widget.get_value()),this.et2._inst.submit(),editPopWindow.opener.egw_refresh("status changed","calendar")}else widget&&window.egw_refresh(this.egw.lang("The original popup edit window is closed! You need to close the print window and reopen the entry again."),"calendar")},edit_participant_search:function(request,widget){if("resources"==widget.app_select.val()){var values=widget.getInstanceManager().getValues(widget.getRoot());"object"==typeof request.options&&null!=request.options||(request.options={}),request.options.exec={start:values.start,end:values.end,duration:values.duration,participants:values.participants,recur_type:values.recur_type,event_id:values.link_to.to_id,show_conflict:"resources_without_conflict"==egw.preference("defaultresource_sel","calendar")?"0":"1"},values.whole_day&&(request.options.exec.whole_date=!0)}return!0},freetime_select:function(_event,_widget){if(_widget){var content=this.et2._inst.widgetContainer.getArrayMgr("content").data,selectedId=_widget.id.match(/^select\[([0-9])\]$/i)[1],sTime=this.et2.getWidgetById(selectedId+"start");if(window.opener&&sTime){var editWindowObj=window.opener.etemplate2.getByApplication("calendar")[0];if("undefined"!=typeof editWindowObj){var startTime=editWindowObj.widgetContainer.getWidgetById("start"),endTime=editWindowObj.widgetContainer.getWidgetById("end");startTime&&endTime&&(startTime.set_value(sTime.get_value()),endTime.set_value(sTime.get_value()),endTime.set_value("+"+content.duration))}}else alert(this.egw.lang("The original calendar edit popup is closed!"))}egw(window).close()},filter_change:function(){var view=app.classes.calendar.views.listview.etemplates[0].widgetContainer||!1,filter=view?view.getWidgetById("nm").getWidgetById("filter"):null,dates=view?view.getWidgetById("calendar.list.dates"):null;filter?app.calendar.state.filter=filter.getValue():delete app.calendar.state.filter,filter&&dates&&(dates.set_disabled("custom"!==filter.value),"custom"==filter.value&&jQuery(view.getWidgetById("startdate").getDOMNode()).find("input").focus())},action_open:function(_action,_events){var id=_events[0].id.split("::");if(_action.data.open){var open=JSON.parse(_action.data.open)||{},extra=open.extra||"";if(extra=extra.replace(/(\$|%24)app/,id[0]).replace(/(\$|%24)id/,id[1]),!extra){var context={};egw.dataGetUIDdata(_events[0].id)&&egw.dataGetUIDdata(_events[0].id).data?(context=egw.dataGetUIDdata(_events[0].id).data,extra={}):_events[0].iface.getWidget()&&_events[0].iface.getWidget().instanceOf(et2_valueWidget)&&(context=_events[0].iface.getWidget().getValue?_events[0].iface.getWidget().getValue():_events[0].iface.getWidget().options.value||{},extra={}),context.date&&(extra.date=context.date),context.app&&(extra.app=context.app),context.app_id&&(extra.app_id=context.app_id)}this.egw.open(open.id_data||"",open.app,open.type,extra?extra:context)}else if(_action.data.url){var url=_action.data.url;url=url.replace(/(\$|%24)app/,id[0]).replace(/(\$|%24)id/,id[1]),this.egw.open_link(url)}},status:function(_action,_events){for(var i=0;i<_events.length;i++){var event_widget=_events[i].iface.getWidget()||!1;event_widget&&event_widget.recur_prompt(jQuery.proxy(function(button_id,event_data){switch(button_id){case"exception":egw().json("calendar.calendar_uiforms.ajax_status",[event_data.app_id,egw.user("account_id"),_action.data.id]).sendRequest(!0);break;case"series":case"single":egw().json("calendar.calendar_uiforms.ajax_status",[event_data.id,egw.user("account_id"),_action.data.id]).sendRequest(!0);break;case"cancel":}},this))}},cal_fix_app_id:function(_action,_senders){var app="calendar",id=_senders[0].id,matches=id.match(/^(?:calendar::)?([0-9]+)(:([0-9]+))?$/);matches?id=matches[1]:(matches=id.match(/^([a-z_-]+)([0-9]+)/i),matches&&(app=matches[1],id=matches[2]));var backup_url=_action.data.url;_action.data.url=_action.data.url.replace(/(\$|%24)id/,id),_action.data.url=_action.data.url.replace(/(\$|%24)app/,app),nm_action(_action,_senders,!1,{ids:[id]}),_action.data.url=backup_url},cal_open:function(_action,_senders){if(_senders[0].iface.getWidget){var widget=_senders[0].iface.getWidget();return widget.recur_prompt()}var id=_senders[0].id,data=egw.dataGetUIDdata(id);if(data&&data.data)return void et2_calendar_event.recur_prompt(data.data);var matches=id.match(/^(?:calendar::)?([0-9]+):([0-9]+)$/),backup=_action.data;if(_action.parent.data&&_action.parent.data.nextmatch){var js_integration_data=_action.parent.data.nextmatch.options.settings.js_integration_data||this.et2.getArrayMgr("content").data.nm.js_integration_data;"string"==typeof js_integration_data&&(js_integration_data=JSON.parse(js_integration_data))}if(matches=id.match(/^calendar::([a-z_-]+)([0-9]+)/i),matches&&js_integration_data&&js_integration_data[matches[1]]){var app=matches[1];_action.data.url=window.egw_webserverUrl+"/index.php?";var get_params=js_integration_data[app].edit;get_params[js_integration_data[app].edit_id]=matches[2];for(var name in get_params)_action.data.url+=name+"="+encodeURIComponent(get_params[name])+"&";if(js_integration_data[app].edit_popup)return egw.open_link(_action.data.url,"_blank",js_integration_data[app].edit_popup,app),void(_action.data=backup)}else{var data=egw.dataGetUIDdata(_senders[0].id);if(data&&data.data)return egw.open(data.data.app_id,data.data.app,"edit")}egw.open(id.replace(/^calendar::/g,""),"calendar","edit")},delete:function(_action,_events){for(var i=0;i<_events.length;i++){var event_widget=_events[i].iface.getWidget()||!1;event_widget&&event_widget.recur_prompt(jQuery.proxy(function(button_id,event_data){switch(button_id){case"exception":egw().json("calendar.calendar_uiforms.ajax_delete",[event_data.app_id]).sendRequest(!0);break;case"series":case"single":egw().json("calendar.calendar_uiforms.ajax_delete",[event_data.id]).sendRequest(!0);break;case"cancel":}},this))}},cal_delete:function(_action,_senders){for(var matches=(_action.data,!1),i=0;i<_senders.length;i++){var id=_senders[i].id;matches||(matches=id.match(/^(?:calendar::)?([0-9]+):([0-9]+)$/))}if(matches){var popup=jQuery("#calendar-list_delete_popup").get(0);return void("undefined"!=typeof popup&&nm_open_popup(_action,_senders))}nm_action(_action,_senders)},move_edit_series:function(_DOM,_button){var content=this.et2.getArrayMgr("content").data,start_date=this.et2.getWidgetById("start").get_value(),end_date=this.et2.getWidgetById("end").get_value(),whole_day=this.et2.getWidgetById("whole_day"),duration=""+this.et2.getWidgetById("duration").get_value(),is_whole_day=whole_day&&whole_day.get_value()==whole_day.options.selected_value,button=_button,that=this,instance_date=window.location.search.match(/date=(\d{4}-\d{2}-\d{2}(?:.+Z)?)/);return instance_date&&instance_date.length&&instance_date[1]&&(instance_date=new Date(unescape(instance_date[1])),instance_date.setUTCMinutes(instance_date.getUTCMinutes()+instance_date.getTimezoneOffset())),"undefined"==typeof content||null==content.id||"undefined"==typeof content.recur_type||null==content.recur_type||0==content.recur_type?!0:content.start!=start_date||content.whole_day!=is_whole_day||duration&&""+content.duration!=duration||!duration&&Math.abs(new Date(end_date)-new Date(content.end))>6e4?void et2_calendar_event.series_split_prompt(content,instance_date,function(_button_id){_button_id==et2_dialog.OK_BUTTON&&that.et2._inst.submit(button)}):!0},edit_series:function(event,id,date){2==arguments.length&&(date=id,id=event,event=null);var edit_id=id,edit_date=date,that=this,buttons=[{text:this.egw.lang("Edit exception"),id:"exception",class:"ui-priority-primary",default:!0},{text:this.egw.lang("Edit series"),id:"series"},{text:this.egw.lang("Cancel"),id:"cancel"}];et2_dialog.show_dialog(function(_button_id){switch(_button_id){case"exception":that.egw.open(edit_id,"calendar","edit","&date="+edit_date+"&exception=1");break;case"series":that.egw.open(edit_id,"calendar","edit","&date="+edit_date);break;case"cancel":}},this.egw.lang("Do you want to edit this event as an exception or the whole series?"),this.egw.lang("This event is part of a series"),{},buttons,et2_dialog.WARNING_MESSAGE)},sidebox_merge:function(event,widget){if(!widget||!widget.getValue())return!1;if("listview"==this.state.view){var nm=etemplate2.getById("calendar-list").widgetContainer.getWidgetById("nm")||!1,selected=nm?nm.controller._objectManager.getSelectedLinks():[],action=nm.controller._actionManager.getActionById("document_"+widget.getValue());!nm||selected&&selected.length||nm.controller._selectionMgr.selectAll(!0),action&&selected&&action.execute(selected)}else widget.getRoot().getWidgetById("first").set_value(app.calendar.state.first),widget.getRoot().getWidgetById("last").set_value(app.calendar.state.last),widget.getInstanceManager().postSubmit();return window.setTimeout(function(){widget.set_value("")},100),!1},set_state:function(_state){"object"==typeof _state&&(null!==this.sidebox_et2?this.update_state(_state):this.state=_state)},update_state:function(_set){if(window!==window.top)return window.top.app.calendar.update_state(_set);if(!this.state_update_in_progress){var changed=[],new_state=jQuery.extend({},this.state);if("object"==typeof _set)for(var s in _set)new_state[s]!==_set[s]&&("string"==typeof new_state[s]||"string"!=typeof new_state[s]&&new_state[s]+""!=_set[s]+"")&&(changed.push(s+": "+new_state[s]+" -> "+_set[s]),new_state[s]=_set[s]);changed.length&&!this.state_update_in_progress&&(console.log("Calendar state changed",changed.join("\n")),this.egw.debug("navigation","Calendar state changed",changed.join("\n")),this.setState({state:new_state}))}},getState:function(){var state=jQuery.extend({},this.state);if(!state){var egw_script_tag=document.getElementById("egw_script_id");state=egw_script_tag.getAttribute("data-calendar-state"),state=state?JSON.parse(state):{}}if(state.owner==egw.user("account_id")&&(state.owner=0),"listview"==state.view){var listview=app.classes.calendar.views.listview.etemplates[0]&&app.classes.calendar.views.listview.etemplates[0].widgetContainer&&app.classes.calendar.views.listview.etemplates[0].widgetContainer.getWidgetById("nm");listview&&listview.activeFilters&&listview.activeFilters.search&&(state.keywords=listview.activeFilters.search)}return delete state.date,delete state.first,delete state.last,delete state.startdate,delete state.enddate,delete state.start_date,delete state.end_date,state},setState:function(state){framework&&framework.applications.calendar&&framework.applications.calendar.hasSideboxMenuContent&&framework.setActiveApp(framework.applications.calendar),"string"==typeof state&&(-1==state.indexOf("{")&&"null"!=state||(state=JSON.parse(state))),"object"==typeof state.state&&state.state.view||(state.state={view:"week"}),state.state.date||(state.state.date=state.name?this.state.date:new Date),"undefined"==typeof state.state.weekend&&(state.state.weekend=!0);var view=app.classes.calendar.views[state.state.view];for(var _view in app.classes.calendar.views)if(state.state.view!=_view&&app.classes.calendar.views[_view])for(var i=0;i=0&&(state.state.owner[state.state.owner.indexOf("0")]=this.egw.user("account_id"));var grid_count=0;switch(state.state.view){case"day":case"day4":grid_count=1;break;case"week":grid_count=state.state.owner.length>=parseInt(this.egw.preference("week_consolidate","calendar"))?1:state.state.owner.length;break;case"weekN":grid_count=parseInt(this.egw.preference("multiple_weeks","calendar"))||3}var grid=view.etemplates[0].widgetContainer.getWidgetById("view");if(grid){var value=[];state.state.first=view.start_date(state.state).toJSON();var date=new Date(state.state.first);switch($j(grid.getDOMNode()).toggleClass("hideDayColHeader","week"==state.state.view),state.state.view){case"month":var end=state.state.last=view.end_date(state.state);grid_count=Math.ceil((end-date)/864e5/7);case"weekN":for(var week=0;grid_count>week;week++){var val={id:app.classes.calendar._daywise_cache_id(date,state.state.owner),start_date:date.toJSON(),end_date:new Date(date.toJSON()),owner:state.state.owner};val.end_date.setUTCHours(167),val.end_date.setUTCMinutes(59),val.end_date.setUTCSeconds(59),val.end_date=val.end_date.toJSON(),value.push(val),date.setUTCHours(168)}state.state.last=val.end_date;break;case"day":var end=state.state.last=view.end_date(state.state).toJSON();value.push({id:app.classes.calendar._daywise_cache_id(date,state.state.owner),start_date:state.state.first,end_date:state.state.last,owner:view.owner(state.state)});break;default:for(var end=state.state.last=view.end_date(state.state).toJSON(),owner=0;grid_count>owner&&owner1?state.state.owner[owner]||0:state.state.owner;value.push({id:app.classes.calendar._daywise_cache_id(date,_owner),start_date:date,end_date:end,owner:_owner})}}if("day"==state.state.view&&state.state.owner.lengthrow_index)for(var j=i-row_index;j>0;j--){grid._children.unshift(grid._children.pop());var a=grid._children[0].getDOMNode().parentNode.parentNode,b=grid._children[1].getDOMNode().parentNode.parentNode;a.parentNode.insertBefore(a,b)}else if(row_index>i){var a=grid._children[row_index].getDOMNode().parentNode.parentNode,b=grid._children[i].getDOMNode().parentNode.parentNode;a.parentNode.insertBefore(a,b),grid._children.splice(i,0,widget),grid._children.splice(row_index+1,1)}break}row_index++},this,et2_calendar_view),row_index=0,grid.iterateOver(function(widget){return row_index=0?(view.etemplates[0].widgetContainer.iterateOver(function(w){w.set_width(.69*$j(view.etemplates[0].DOMContainer).width())},this,et2_calendar_timegrid),$j(view.etemplates[1].DOMContainer).css({left:"69%",height:$j(framework.tabsUi.activeTab.contentDiv).height()-30+"px"}),this.egw.jsonq("calendar_uiviews::ajax_get_todos",[state.state.date,state.state.owner[0]],function(data){this.getWidgetById("label").set_value(data.label||""),this.getWidgetById("todos").set_value({content:data.todos||""})},view.etemplates[1].widgetContainer),view.etemplates[0].resize()):($j(app.classes.calendar.views.day.etemplates[1].DOMContainer).show(),$j(app.classes.calendar.views.day.etemplates[1].DOMContainer).css("left","100%"),window.setTimeout(jQuery.proxy(function(){$j(this).hide()},app.classes.calendar.views.day.etemplates[1].DOMContainer),1e3),$j(app.classes.calendar.views.day.etemplates[0].DOMContainer).css("width","100%"),view.etemplates[0].widgetContainer.iterateOver(function(w){w.set_width("100%")},this,et2_calendar_timegrid)):($j(view.etemplates[0].DOMContainer).css("width","100%"),view.etemplates[0].widgetContainer.iterateOver(function(w){w.set_width("100%")},this,et2_calendar_timegrid));for(var i=0;istate.state.enddate&&(state.state.enddate=state.state.startdate),nm.applyFilters(state.state),nm.activeFilters.enddate&&(this.state.last=nm.activeFilters.enddate),this.filter_change()}else{try{var nm=app.classes.calendar.views.listview.etemplates[0].widgetContainer.getWidgetById("nm");nm.controller._grid.doInvalidate=!1}catch(e){}delete state.state.keywords}if(this.state=jQuery.extend({},state.state),this._sortable(),this.sidebox_hooked_templates.length)for(var j=0;j=_secs?label=self.egw.lang("%1 minutes",_secs/60):86400>=_secs&&(label=self.egw.lang("%1 hours",_secs/3600)),label};if("undefined"==typeof content.alarm[1].default);else{var def_alarm=this.egw.preference("true"===_widget.get_value()?"default-alarm-wholeday":"default-alarm","calendar");def_alarm||0===def_alarm?(jQuery("#calendar-edit_alarm > tbody :nth-child(1)").show(),start.set_hours(0),start.set_minutes(0),time.set_value(start.get_value()),time.set_value("-"+60*def_alarm),event.set_value(_secs_to_label(60*def_alarm))):jQuery("#calendar-edit_alarm > tbody :nth-child(1)").hide()}}},_clear_cache:function(){for(var events=egw.dataKnownUIDs("calendar"),i=0;it);need_data&&seperate_owners&&this._fetch_data(jQuery.extend({},state,{owner:value[i].owner}),this.sidebox_et2?null:this.et2.getInstanceManager())}need_data&&!seperate_owners&&this._fetch_data(state,this.sidebox_et2?null:this.et2.getInstanceManager())},_fetch_data:function(state,instance,start){if(this.sidebox_et2||instance){"undefined"==typeof start&&(start=0);var cat_id=state.cat_id?state.cat_id:!1;cat_id&&"undefined"!=typeof cat_id.join&&""==cat_id.join("")&&(cat_id=!1);var query=jQuery.extend({},{get_rows:"calendar.calendar_uilist.get_rows",row_id:"row_id",startdate:state.first||state.date,enddate:state.last,col_filter:{participant:"string"==typeof state.owner||"number"==typeof state.owner?[state.owner]:state.owner},filter:"custom",status_filter:state.status_filter,cat_id:cat_id,csv_export:!1});framework.applications.calendar.sidemenuEntry.showAjaxLoader();var query_string=JSON.stringify(query);-1==this._queries_in_progress.indexOf(query_string)&&(this._queries_in_progress.push(query_string),this.egw.dataFetch(instance?instance.etemplate_exec_id:this.sidebox_et2.getInstanceManager().etemplate_exec_id,{start:start,num_rows:400},query,this.id,function(data){var idx=this._queries_in_progress.indexOf(query_string);if(idx>=0&&this._queries_in_progress.splice(idx,1),data.rows&&data.rows.sel_options&&this.sidebox_et2)for(var field in data.rows.sel_options){var widget=this.sidebox_et2.getWidgetById(field);if(widget&&widget.set_select_options){for(var i in data.rows.sel_options[field]){var found=!1,option=data.rows.sel_options[field][i];for(var j in widget.options.select_options)if(option.value==widget.options.select_options[j].value){widget.options.select_options[j].label=option.label,found=!0;break}found||(widget.options.select_options.push||(widget.options.select_options=[]),widget.options.select_options.push(option))}var in_progress=app.calendar.state_update_in_progress;if(app.calendar.state_update_in_progress=!0,widget.set_select_options(widget.options.select_options),widget.set_value(widget.getValue()),"owner"==field)try{var participant=app.classes.calendar.views.listview.etemplates[0].widgetContainer.getWidgetById("nm").getWidgetById("participant");participant&&(participant.options.select_options=widget.options.select_options,participant.set_select_options(widget.options.select_options))}catch(e){}app.calendar.state_update_in_progress=in_progress}}data.order&&data.total&&this._update_events(state,data.order),data.order.length+start1&&("day"==state.view&&state.owner.length=bounds.first&&record.data.date<=bounds.last&&(updated_days[record.data.date]=[]),"undefined"!=typeof updated_days[record.data.date]&&updated_days[record.data.date].push(record.data.row_id);var dates={start:"string"==typeof record.data.start?record.data.start:record.data.start.toJSON(),end:"string"==typeof record.data.end?record.data.end:record.data.end.toJSON()};if(dates.start.substr(0,10)!==dates.end.substr(0,10)){var end=new Date(Math.min(new Date(record.data.end),new Date(state.last)));end.setUTCHours(23),end.setUTCMinutes(59),end.setUTCSeconds(59);var t=new Date(Math.max(new Date(record.data.start),new Date(state.first)));do{var expanded_date=""+t.getUTCFullYear()+sprintf("%02d",t.getUTCMonth()+1)+sprintf("%02d",t.getUTCDate());"undefined"==typeof updated_days[expanded_date]&&expanded_date>=bounds.first&&expanded_date<=bounds.last&&(updated_days[expanded_date]=[]),record.data.date!==expanded_date&&"undefined"!=typeof updated_days[expanded_date]&&updated_days[expanded_date].push(record.data.row_id),t.setUTCDate(t.getUTCDate()+1)}while(end>=t)}}}for(var day in updated_days)for(var i=0;i<("object"==typeof state.owner?state.owner.length:1);i++){var owner=multiple_owner?state.owner[i]:state.owner,cache_id=app.classes.calendar._daywise_cache_id(day,owner);if(egw.dataHasUID(cache_id)){var c=egw.dataGetUIDdata(cache_id);if(c.data&&null!==c.data){var data=c.data.concat(updated_days[day]).filter(function(value,index,self){return self.indexOf(value)===index});this.egw.dataStoreUID(cache_id,data)}}else this.egw.dataStoreUID(cache_id,updated_days[day]);if(!multiple_owner)break}},date:{toString:function(date){return"string"==typeof date&&(date=new Date(date)), +date.getUTCFullYear()+"-"+sprintf("%02d",date.getUTCMonth()+1)+"-"+sprintf("%02d",date.getUTCDate())+"T"+sprintf("%02d",date.getUTCHours())+":"+sprintf("%02d",date.getUTCMinutes())+":"+sprintf("%02d",date.getUTCSeconds())+"Z"},long_date:function(first,last,display_time,display_day){if(!first)return"";"string"==typeof first&&(first=new Date(first)),"string"==typeof last&&last&&(last=new Date(last)),last&&"object"==typeof last||(last=!1),display_time||(display_time=!1),display_day||(display_day=!1);var range="",datefmt=egw.preference("dateformat"),timefmt="12"===egw.preference("timeformat")?"h:i a":"H:i",month_before_day="m"==datefmt[0].toLowerCase()||"m"==datefmt[2].toLowerCase()&&"d"==datefmt[4];display_day&&(range=jQuery.datepicker.formatDate("DD",first)+("d"!=datefmt[0]?" ":", "));for(var i=0;5>i;i+=2)switch(datefmt[i]){case"d":if(range+=first.getUTCDate()+("."==datefmt[1]?".":""),!last||first.getUTCMonth()==last.getUTCMonth()&&first.getFullYear()==last.getFullYear())display_time&&(range+=" "+jQuery.datepicker.formatDate(dateTimeFormat(timefmt),last)),last&&(range+=" - ");else{if(month_before_day||(range+=jQuery.datepicker.formatDate("MM",first)),first.getFullYear()!=last.getFullYear()&&"Y"!=datefmt[0]&&(range+=("d"!=datefmt[0]?", ":" ")+first.getFullYear()),display_time&&(range+=" "+jQuery.datepicker.formatDate(dateTimeFormat(timefmt),first)),!last)return range;range+=" - ",first.getFullYear()!=last.getFullYear()&&"Y"==datefmt[0]&&(range+=last.getFullYear()+", "),month_before_day&&(range+=jQuery.datepicker.formatDate("MM",last))}last&&(range+=" "+last.getUTCDate()+("."==datefmt[1]?".":""));break;case"m":case"M":range+=" "+jQuery.datepicker.formatDate("MM",month_before_day?first:last)+" ";break;case"Y":"m"!=datefmt[0]&&(range+=" "+("Y"==datefmt[0]?first.getFullYear()+("d"==datefmt[2]?", ":" "):last.getFullYear()+" "))}return display_time&&last&&(range+=" "+jQuery.datepicker.formatDate(dateTimeFormat(timefmt),last)),"Y"==datefmt[4]&&"m"==datefmt[0]&&(range+=", "+last.getFullYear()),range},week_number:function(_date){var d=new Date(_date),day=d.getUTCDay();return"Monday"==egw.preference("weekdaystarts","calendar")||day?"Saturday"==egw.preference("weekdaystarts","calendar")&&6==day&&d.setUTCDate(d.getUTCDate()+2):d.setUTCDate(d.getUTCDate()+1),jQuery.datepicker.iso8601Week(new Date(d.valueOf()+60*d.getTimezoneOffset()*1e3))},start_of_week:function(date){var d=new Date(date),day=d.getUTCDay(),diff=0;switch(egw.preference("weekdaystarts","calendar")){case"Saturday":diff=6===day?0:0===day?-1:-(day+1);break;case"Monday":diff=0===day?-6:1-day;break;case"Sunday":default:diff=-day}return d.setUTCDate(d.getUTCDate()+diff),d},end_of_week:function(date){var d=app.calendar.date.start_of_week(date);return d.setUTCDate(d.getUTCDate()+6),d}},_setup_sidebox_filters:function(){var date_widget=this.sidebox_et2.getWidgetById("date");if(date_widget){date_widget.input_date.datepicker("option",{showButtonPanel:!1,onChangeMonthYear:function(year,month,inst){var go_button=date_widget.getRoot().getWidgetById("header_go");if(go_button){var temp_date=new Date(year,month-1,1,0,0,0);go_button.btn.attr("title",egw.lang(date("F",temp_date))),temp_date.setUTCMinutes(temp_date.getUTCMinutes()-temp_date.getTimezoneOffset()),go_button.btn.attr("data-date",temp_date.toJSON())}},beforeShowDay:function(date){var holidays=et2_calendar_view.get_holidays({day_class_holiday:function(){}},date.getFullYear()),day_holidays=holidays[""+date.getFullYear()+sprintf("%02d",date.getMonth()+1)+sprintf("%02d",date.getDate())],css_class="",tooltip="";if("undefined"!=typeof day_holidays&&day_holidays.length)for(var i=0;i=0?app.calendar.update_state({view:"week",date:date,days:days}):"planner"==view?app.calendar.update_state({date:date,planner_view:"week"}):"listview"==view?app.calendar.update_state({date:date,end_date:app.calendar.date.toString(app.classes.calendar.views.week.end_date({date:date})),filter:"week"}):app.calendar.update_state({date:date})});var today=$j("#calendar-sidebox_header_today");today.attr("title",egw.lang("today"));var go_button=date_widget.getRoot().getWidgetById("header_go");if(go_button&&go_button.btn){go_button=go_button.btn;var temp_date=new Date(date_widget.get_value());temp_date.setUTCDate(1),temp_date.setUTCMinutes(temp_date.getUTCMinutes()+temp_date.getTimezoneOffset()),go_button.attr("title",egw.lang(date("F",temp_date))),temp_date.setUTCMinutes(temp_date.getUTCMinutes()-temp_date.getTimezoneOffset()),go_button.attr("data-date",temp_date.toJSON())}var preferred_width=$j("#calendar-sidebox_date .ui-datepicker-inline").outerWidth(),font_ratio=12/parseFloat($j("#calendar-sidebox_date .ui-datepicker-inline").css("font-size"));$j(window).on("resize.calendar"+date_widget.dom_id,function(){try{var percent=1+($j(date_widget.getDOMNode()).width()-preferred_width)/preferred_width;percent*=font_ratio,$j("#calendar-sidebox_date .ui-datepicker-inline").css("font-size",100*percent+"%");var buttons=$j("#calendar-sidebox_date .ui-datepicker-header a span");today.length&&go_button.length&&(go_button.position({my:"left+15px center",at:"right center-1",of:$j("#calendar-sidebox_date .ui-datepicker-year")}),today.css({left:(buttons.first().offset().left+buttons.last().offset().left)/2-Math.ceil(today.outerWidth(!0)/2),top:go_button.css("top")}),buttons.position({my:"center",at:"center",of:go_button}).css("left",""))}catch(e){}}).trigger("resize")}var button=$j("#calendar-sidebox_owner ~ span.et2_clickable");1==button.length&&(button.parent().css("margin-right",button.outerWidth(!0)+2),button.parent().parent().css("white-space","nowrap")),$j(window).on("resize.calendar-owner",function(){var preferred_width=$j("#calendar-et2_target").children().first().outerWidth()||0;if(app.calendar&&app.calendar.sidebox_et2){var owner=app.calendar.sidebox_et2.getWidgetById("owner");preferred_width&&owner.input.hasClass("chzn-done")&&owner.input.next().css("width",preferred_width)}})},_et2_view_init:function(_et2,_name){var hidden="undefined"!=typeof this.state.view,all_loaded=null!==this.sidebox_et2;if(0!==_et2.uniqueId.indexOf("portlet")){var view_et2=!1;for(var view in app.classes.calendar.views){var index=app.classes.calendar.views[view].etemplates.indexOf(_name);index>-1&&(view_et2=!0,app.classes.calendar.views[view].etemplates[index]=_et2,$j(_et2.DOMContainer).one("clear",jQuery.proxy(function(){this.view.etemplates[this.index]=_name},jQuery.extend({},{view:app.classes.calendar.views[view],index:""+index,name:_name}))),this.state.view===view&&(hidden=!1)),app.classes.calendar.views[view].etemplates.forEach(function(et){all_loaded=all_loaded&&"string"!=typeof et})}if("calendar.list"==_name){var nm=_et2.widgetContainer.getWidgetById("nm");nm&&(nm.controller._grid.doInvalidate=!1,nm.set_startdate=jQuery.proxy(function(date){this.state.first=this.date.toString(new Date(date))},this),nm.set_enddate=jQuery.proxy(function(date){this.state.last=this.date.toString(new Date(date))},this))}if(view_et2)hidden&&$j(_et2.DOMContainer).hide();else{var app_name=_name.split(".")[0];app_name&&"calendar"!=app_name&&egw.app(app_name)&&(this.sidebox_hooked_templates.push(_et2.widgetContainer),$j(_et2.DOMContainer).one("clear",jQuery.proxy(function(){app.calendar&&app.calendar.sidebox_hooked_templates.splice(this,1,0)},this.sidebox_hooked_templates.length-1)))}all_loaded&&this.setState({state:this.state})}},View:{etemplates:["calendar.view"],header:function(state){var formatDate=new Date(state.date);return formatDate=new Date(formatDate.valueOf()+60*formatDate.getTimezoneOffset()*1e3),app.calendar.View._owner(state)+date(egw.preference("dateformat"),formatDate)},_owner:function(state){var owner="";if(state.owner.length&&1==state.owner.length&&app.calendar.sidebox_et2){var own=app.calendar.sidebox_et2.getWidgetById("owner").getDOMNode();own.selectedIndex>=0&&(owner=own.options[own.selectedIndex].innerHTML+": ")}return owner},start_date:function(state){var d=state.date?new Date(state.date):new Date;return d.setUTCHours(0),d.setUTCMinutes(0),d.setUTCSeconds(0),d.setUTCMilliseconds(0),d},end_date:function(state){var d=state.date?new Date(state.date):new Date;return d.setUTCHours(23),d.setUTCMinutes(59),d.setUTCSeconds(59),d.setUTCMilliseconds(0),d},owner:function(state){return state.owner||0},show_weekend:function(state){return state.weekend},granularity:function(state){var list=egw.preference("use_time_grid","calendar");return 0===list?parseInt(egw.preference("interval","calendar"))||30:("string"==typeof list&&(list=list.split(",")),!list.indexOf&&jQuery.isPlainObject(list)&&(list=jQuery.map(list,function(el){return el})),list.indexOf(state.view)>=0?0:parseInt(egw.preference("interval","calendar"))||30)},extend:function(sub){return jQuery.extend({},this,{_super:this},sub)},scroll:function(delta){var d=new Date(app.calendar.state.date);return d.setUTCDate(d.getUTCDate()+7*delta),d}}})}.call(this),jQuery.extend(app.classes.calendar,{DAYWISE_CACHE_ID:"calendar_daywise",_daywise_cache_id:function(date,owner){"object"==typeof date&&(date=date.getUTCFullYear()+sprintf("%02d",date.getUTCMonth()+1)+sprintf("%02d",date.getUTCDate()));var state_owner=app.calendar?app.calendar.state.owner.toString()||"":"",_owner=owner&&"0"!=owner.toString()&&owner!==state_owner?owner.toString():"";return _owner==egw.user("account_id")&&(_owner=""),app.classes.calendar.DAYWISE_CACHE_ID+"::"+date+(_owner?"-"+_owner:"")},views:{day:app.classes.calendar.prototype.View.extend({header:function(state){return app.calendar.View.header.call(this,state)},etemplates:["calendar.view","calendar.todo"],start_date:function(state){var d=app.calendar.View.start_date.call(this,state);return state.date=app.calendar.date.toString(d),d},show_weekend:function(state){return state.days="1",state.weekend="true",app.calendar.View.show_weekend.call(this,state)},scroll:function(delta){var d=new Date(app.calendar.state.date);return d.setUTCDate(d.getUTCDate()+delta),d}}),day4:app.classes.calendar.prototype.View.extend({header:function(state){return app.calendar.View.header.call(this,state)},end_date:function(state){var d=app.calendar.View.end_date.call(this,state);return state.days="4",d.setUTCHours(95),d.setUTCMinutes(59),d.setUTCSeconds(59),d.setUTCMilliseconds(0),d},show_weekend:function(state){return state.weekend="true",!0},scroll:function(delta){var d=new Date(app.calendar.state.date);return d.setUTCDate(d.getUTCDate()+4*delta),d}}),week:app.classes.calendar.prototype.View.extend({header:function(state){var end_date=state.last;return app.classes.calendar.views.week.show_weekend(state)||(end_date=new Date(state.last),end_date.setUTCDate(end_date.getUTCDate()-2)),app.calendar.View._owner(state)+app.calendar.egw.lang("Week")+" "+app.calendar.date.week_number(state.first)+": "+app.calendar.date.long_date(state.first,end_date)},start_date:function(state){return app.calendar.date.start_of_week(app.calendar.View.start_date.call(this,state))},end_date:function(state){var d=app.calendar.date.start_of_week(state.date||new Date);return d.setUTCHours(167),d.setUTCMinutes(59),d.setUTCSeconds(59),d.setUTCMilliseconds(0),d}}),weekN:app.classes.calendar.prototype.View.extend({header:function(state){return app.calendar.View._owner(state)+app.calendar.egw.lang("Week")+" "+app.calendar.date.week_number(state.first)+" - "+app.calendar.date.week_number(state.last)+": "+app.calendar.date.long_date(state.first,state.last)},start_date:function(state){return app.calendar.date.start_of_week(app.calendar.View.start_date.call(this,state))},end_date:function(state){state.days=""+(state.days>=5?state.days:egw.preference("days_in_weekview","calendar")||7);var d=app.calendar.date.start_of_week(app.calendar.View.start_date.call(this,state));return d.setUTCHours(168*(parseInt(this.egw.preference("multiple_weeks","calendar"))||3)-1),d}}),month:app.classes.calendar.prototype.View.extend({header:function(state){var formatDate=new Date(state.date);return formatDate=new Date(formatDate.valueOf()+60*formatDate.getTimezoneOffset()*1e3),app.calendar.View._owner(state)+app.calendar.egw.lang(date("F",formatDate))+" "+date("Y",formatDate)},start_date:function(state){var d=app.calendar.View.start_date.call(this,state);return d.setUTCDate(1),app.calendar.date.start_of_week(d)},end_date:function(state){var d=app.calendar.View.end_date.call(this,state);return d=new Date(d.getFullYear(),d.getUTCMonth()+1,1,0,-d.getTimezoneOffset(),0),d.setUTCSeconds(d.getUTCSeconds()-1),app.calendar.date.end_of_week(d)},granularity:function(state){return 0},scroll:function(delta){var d=new Date(app.calendar.state.date);return d.setUTCMonth(d.getUTCMonth()+delta),d}}),planner:app.classes.calendar.prototype.View.extend({header:function(state){var startDate=new Date(state.first);startDate=new Date(startDate.valueOf()+60*startDate.getTimezoneOffset()*1e3);var endDate=new Date(state.last);return endDate=new Date(endDate.valueOf()+60*endDate.getTimezoneOffset()*1e3),app.calendar.View._owner(state)+date(egw.preference("dateformat"),startDate)+(startDate==endDate?"":" - "+date(egw.preference("dateformat"),endDate))},etemplates:["calendar.planner"],group_by:function(state){return state.sortby?state.sortby:0},start_date:function(state){var d=app.calendar.View.start_date.call(this,state);if(state.sortby&&"month"===state.sortby)d.setUTCDate(1);else{if(!state.planner_view||!app.classes.calendar.views[state.planner_view])return d=app.calendar.date.start_of_week(d),d.setUTCHours(0),d.setUTCMinutes(0),d.setUTCSeconds(0),d.setUTCMilliseconds(0),d;d=app.classes.calendar.views[state.planner_view].start_date.call(this,state)}return d},end_date:function(state){var d=app.calendar.View.end_date.call(this,state);return state.sortby&&"month"===state.sortby?(d.setUTCDate(0),d.setUTCFullYear(d.getUTCFullYear()+1)):state.planner_view&&app.classes.calendar.views[state.planner_view]?d=app.classes.calendar.views[state.planner_view].end_date.call(this,state):state.days?(d.setUTCDate(d.getUTCDate()+parseInt(state.days)-1),delete state.days):d=app.calendar.date.end_of_week(d),d},scroll:function(delta){if(app.calendar.state.planner_view)return app.classes.calendar.views[app.calendar.state.planner_view].scroll.call(this,delta);var d=new Date(app.calendar.state.date);if("month"===app.calendar.state.sortby)return d.setUTCMonth(d.getUTCMonth()+delta),d.setUTCDate(1),d.setUTCHours(0),d.setUTCMinutes(0),d;if(app.calendar.state.first&&app.calendar.state.last)var diff=new Date(app.calendar.state.last)-new Date(app.calendar.state.first),days=Math.round(diff/864e5);return d.setUTCDate(d.getUTCDate()+days*delta),days>8&&(d=app.calendar.date.start_of_week(d)),d}}),listview:app.classes.calendar.prototype.View.extend({header:function(state){var startDate=new Date(state.first);startDate=new Date(startDate.valueOf()+60*startDate.getTimezoneOffset()*1e3);var start_check=""+startDate.getFullYear()+startDate.getMonth()+startDate.getDate(),endDate=new Date(state.last);endDate=new Date(endDate.valueOf()+60*endDate.getTimezoneOffset()*1e3);var end_check=""+endDate.getFullYear()+endDate.getMonth()+endDate.getDate();return app.calendar.View._owner(state)+date(egw.preference("dateformat"),startDate)+(start_check==end_check?"":" - "+date(egw.preference("dateformat"),endDate))},etemplates:["calendar.list"]})}}); +//# sourceMappingURL=app.min.js.map \ No newline at end of file diff --git a/calendar/js/app.min.js.map b/calendar/js/app.min.js.map new file mode 100644 index 0000000000..5fc174d64a --- /dev/null +++ b/calendar/js/app.min.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["et2_widget_event.js","et2_widget_owner.js","et2_widget_view.js","et2_widget_daycol.js","et2_widget_timegrid.js","et2_widget_planner_row.js","et2_widget_planner.js","app.js"],"names":["et2_event_action_object_impl","widget","node","aoi","et2_action_object_impl","doSetState","_state","_outerCall","et2_calendar_owner","et2_taglist_email","extend","attributes","autocomplete_url","default","autocomplete_params","name","type","description","allowFreeEntries","ignore","select_options","lib_options","autoSelect","groupBy","minChars","selectFirst","toggleOnClick","doLoadingFinished","this","_super","apply","arguments","_oldValue","taglist","getValue","$taglist","on","expand","window","setTimeout","div","find","removeClass","call","et2_register_widget","et2_calendar_view","et2_valueWidget","createNamespace","owner","egw","user","start_date","end_date","init","date_helper","et2_createWidget","loadingFinished","loader","$j","update_timer","destroy","clearTimeout","hide","prependTo","options","set_owner","invalidate","trigger_event","get_start_date","Date","get_end_date","set_start_date","new_date","length","set_value","set_year","substring","set_month","set_date","old_date","isAttached","set_end_date","_owner","old","jQuery","isArray","split","events","isEmptyObject","set_disabled","id","set_id","value","proxy","_get_owner_name","parseInt","isNaN","application","link_title","match","accounts","j","label","_get_event_info","dom_node","event_node","closest","day_node","result","dataset","widget_id","shift","join","is_consolidated","owners","view","preference","holiday_cache","get_holidays","year","cache","json","sendRequest","done","response","data","undefined","free","day_class_holiday","et2_calendar_event","et2_IDetachedDOM","et2_no_init","onclick","event","document","createElement","addClass","class","css","width","_tooltipElem","off","remove","append","stop","fadeTo","fadeOut","set_statustext","_tooltip","trigger","title","appendTo","body","icons","setDOMNode","row_id","dataRegisterUID","_UID_callback","getInstanceManager","execId","_actionObject","old_app_id","dataUnregisterUID","_value","old_id","dataHasUID","dataStoreUID","_values_check","_sameday_check","_parent","date","position_event","_update","recur_type","recur_date","formatted_start","start","toJSON","action_parent","actions","instanceOf","et2_container","getParent","_link_actions","e","im","et2_selectbox","cat_options","_type","app","includeCSS","has","empty","droppable","attr","whole_day","app_id","index","toggleClass","private","status_class","_status_class","category","cats","i","participants","toggle","whole_day_on_top","is_private","lang","html","_get_timespan","Color","toRgbaString","_icons","start_time","datepicker","formatTime","hour","start_m","minute","seconds","timezone","ampm","trim","is","_small_size","line_height","parseFloat","visible_lines","Math","floor","innerHeight","height","getHiddenDimensions","h","max","status","split_status","border","bg_color","header_color","timespan","valueOf","input_date","val","end","times","multiday","cat_label","cat","readonly","indexOf","span","text","children","each","push","outerHTML","location","parts","replace","image","priority","public","single","multiple","uid","Object","keys","non_blocking","alarm","end_m","duration","getUTCHours","getUTCMinutes","getUTCFullYear","getUTCMonth","getUTCDate","owner_match","parent_owner","accountData","members","concat","event_start","event_end","clear","unregisterActions","new_cache_id","classes","calendar","_daywise_cache_id","new_daywise","dataGetUIDdata","old_cache_id","old_daywise","splice","attachToDOM","click","_ev","args","Array","prototype","slice","recur_prompt","callback","extra_data","series_split_prompt","objectManager","egw_getAppObjectManager","getObjectById","insertObject","egwActionObject","getDOMNode","_actionManager","manager","getActionById","setAOI","action_links","_get_action_links","updateActionLinks","getDetachedAttributes","_attrs","getDetachedNodes","setDetachedAttributes","_nodes","_values","event_data","edit_id","edit_date","opener","that","extra_params","_button_id","exception","open","buttons","et2_dialog","show_dialog","button_id","QUESTION_MESSAGE","instance_date","tempDate","today","getFullYear","getMonth","getDate","getHours","getTimezoneOffset","getSeconds","termination_date","BUTTONS_OK_CANCEL","WARNING_MESSAGE","drag_helper","ui","helper","quantity","role","matches","et2_calendar_daycol","et2_IResizeable","display_birthday_as_event","display_holiday_as_event","left","header","all_day","event_wrapper","display_settings","wd_start","wd_end","granularity","rowsToDisplay","rowHeight","titleHeight","registeredUID","et2_calendar_timegrid","sender","_draw","day_start","day_end","dayHeader","idx","siblings","childNodes","prepend","eq","min","after","_date","force_redraw","debug","get_year","sprintf","get_month","get_date","formatDate","date_string","_children","long_date","cache_id","removeChild","_data_callback","toString","set_class","classnames","event_ids","disabled","_update_events","set_label","set_left","set_width","outerWidth","setUTCMinutes","holidays","holiday_list","_events","getArrayMgr","getEntry","sort","a","b","c","getWidgetById","isInTree","_out_of_view","isHidden","elem","docViewTop","timegrid","scrolling","scrollTop","docViewBottom","elemTop","position","top","elemBottom","outerHeight","visible","hidden","completely","padding-top","margin-top","show","ceil","scrollHeight","iterateOver","background-color","day","_hidden_indicator","update_state","title_height","indicator","fixed_height","hasClass","first","scrollIntoView","last","count","clone","dom_id","color","_spread_events","dst_check","setUTCHours","daylight_diff","eventCols","col_ends","columns","right","resizeTimes","_time_to_position","border_diff","toFixed","time","pos","target","state","resize","show_weekend","onchange","onevent_change","gridHeader","days","_labelContainer","gridHover","day_list","day_widgets","resize_timer","framework","getApplicationByName","tab","contentDiv","_top_time","_drawGrid","resizable","distance","grid","autoHide","handles","containment","create","resizeHelper","getAttribute","Event","originalEvent","event_widget","sT","dropEnd","eT","_get_time_from_position","getBoundingClientRect","bottom","drop","_drag_helper","element","get","draggable","clientX","clientY","_drop_data","innerHTML","_event_drop","drop_date","set_hours","set_minutes","loading","_send","series_instance","OK_BUTTON","_drawDays","_drawTimes","change","ET2_GRID_INVALIDATE_TIMEOUT","detachFromDOM","event_change","stopPropagation","_sender","totalDisplayMinutes","row_count","_scroll",5,10,15,45,"t","time_label","upate_timer","_resizeTimes","new_height","old_height","child","_calculate_day_list","daily_owner","daycols_needed","day_width","DOMContainer","dim","w","add_index","before","existing_index","unshift","delete_index","substr","getTime","getUTCDay","egw_getObjectManager","uniqueId","parent","parent_finder","iface","doGetDOMNode","widget_object","doTriggerEvent","_event","_data","getWidget","drag_listener","EGW_AI_DRAG_OVER","EGW_AI_DRAG_OUT","_init_links_dnd","mgr","actionLinks","self","drop_action","drag_action","link_get_registry","dataStorePrefix","addAction","action","source","links","getAppName","message","params","app_registry","add_app","add_id","n","acceptedTypes","selected","set_dragType","use_days_sent","consolidated","day_id","week_number","set_granularity","minutes","set_show_weekend","weekends","et2_compileLegacyJS","_node","get_granularity","parents","x","y","round","path","elementFromPoint","tagName","style","display","$node","my","at","of","_too_small","rowCount","innerWidth","needed","too_small","overflow-y","overflow-x","total_width","et2_calendar_planner_row","rows","nextAll","group_by","_yearlyPlannerMarkDays","setUTCSeconds","content","day_class","setUTCDate","_cached_rows","row","getComputedStyle","getPropertyValue","cached_length","map","row_end","et2_calendar_planner","filter","headerTitle","headers","vertical_bar","doInvalidate","registeredCallbacks","planner","collision","offsetX","offsetY","groupers","day_count","_header_months","weeks","_header_weeks","_header_days","hours","_header_hours","row_labels","labels","already_added","localeCompare","group","status_to_show","add_row","participant","label_index","draw_row","sort_key","_drawRow","month","_header_day_of_month","d","setMonth","key","end_key","categories","cat_id","main","has_children","_fetch_data","grouper","contents","nodeType","extra","days_in_month","setUTCMonth","u","week_end","end_of_week","days_in_week","week_width","usertime","start_of_week","setDate","setMinutes","getMinutes","divisors","decr","s","cell_width","setHours","date_key","offset","EGW_AO_FLAG_IS_CONTAINER","dropped","formatted_time","fetch","last_data","array","forEach","set_group_by","Error","parentNode","rel_x","rel_time","row_widget","interval","AppJS","appname","sidebox_et2","states_to_save","sidebox_changes_views","sidebox_hooked_templates","_queries_in_progress","is_popup","egw_unregisterGlobalShortcut","keyCode","PAGE_UP","PAGE_DOWN","et2_ready","_et2","_name","sidebox","egw_getFramework","egw_fw","sidemenuDiv","et2","widgetContainer","_setup_sidebox_filters","set_enddate_visibility","check_recur_type","recur_exception","freetime_search","lock_token","onbeforeunload","alarm_custom_date","filter_change","_et2_view_init","observer","_msg","_app","_id","_msg_type","_links","do_refresh","href","_clear_cache","iframe","set_src","src","recurrences","dataSearchUIDs","RegExp","ids","setState","linkHandler","_url","q","unescape","ajax","menuaction","views","reduce","p","link","pref","etemplates","set","_view","toolbar_action","planner_view","weekend","checked","delta","scroll","set_app_header","template","etemplate2","getById","egw_app_header","_sortable","getState","daily","weekly","sortable","cancel","handle","axis","revert","removeAttr","update","sortedArr","attribute","disableSelection","placeholder","parentsUntil","next","scroll_animate","direction","_scroll_disabled","et2_widget","applications","swipe","fingerCount","at_bottom","at_top","abs","offsetHeight","opposite","down","up","allowPageScroll","fn","pageScroll","VERTICAL","threshold","fallbackToMouseEvents","triggerOnTouchEnd","egw_registerGlobalShortcut","_X","_Y","$drops","cal_dnd_tZone_converter","tZone","search","tAm","pmTime","H","dialog_button","freetime_search_popup","_link","open_link","get_value","request","recurType","recurData","actions_change","_inst","submit","isPlainObject","postSubmit","custom_mail","vars","delete_btn","exceptions","getRoot","confirm","print_participants_status","editPopWindow","getByApplication","egw_refresh","edit_participant_search","app_select","values","getValues","exec","event_id","link_to","to_id","show_conflict","whole_date","freetime_select","_widget","selectedId","sTime","editWindowObj","startTime","endTime","alert","close","dates","focus","action_open","_action","JSON","parse","context","id_data","url","cal_fix_app_id","_senders","backup_url","nm_action","cal_open","backup","nextmatch","js_integration_data","settings","nm","egw_webserverUrl","get_params","edit","encodeURIComponent","edit_popup","delete","cal_delete","popup","nm_open_popup","move_edit_series","_DOM","_button","is_whole_day","selected_value","button","edit_series","sidebox_merge","controller","_objectManager","getSelectedLinks","_selectionMgr","selectAll","execute","set_state","_set","state_update_in_progress","changed","new_state","console","log","egw_script_tag","getElementById","listview","activeFilters","keywords","startdate","enddate","hasSideboxMenuContent","setActiveApp","cachable_changes","unique","daywise","dataKnownUIDs","DAYWISE_CACHE_ID","found","item","grid_count","week","day_value","_need_data","row_index","pop","insertBefore","updater","tabsUi","activeTab","jsonq","todos","col_filter","applyFilters","_grid","option_state","os_key","et2_inputWidget","highlight_favorite","save","set_preference","favorite","current_state","need_redirect","query","is_event","_selected","is_widget","enableClass","disableClass","_egw","alarm_date","alarm_options","startDate","setTime","set_alarmOptions_WD","cells","_secs_to_label","_secs","def_alarm","dataDeleteUID","need_data","seperate_owners","last_owner","instance","get_rows","status_filter","csv_export","sidemenuEntry","showAjaxLoader","query_string","stringify","dataFetch","etemplate_exec_id","num_rows","sel_options","field","set_select_options","option","in_progress","order","total","hideAjaxLoader","updated_days","bounds","multiple_owner","record","expanded_date","getUTCSeconds","display_time","display_day","range","datefmt","timefmt","month_before_day","toLowerCase","dateTimeFormat","iso8601Week","diff","date_widget","showButtonPanel","onChangeMonthYear","inst","go_button","temp_date","btn","beforeShowDay","day_holidays","css_class","tooltip","nextSibling","firstChild","textContent","preferred_width","font_ratio","percent","input","all_loaded","view_et2","one","et","set_startdate","set_enddate","app_name","View","own","selectedIndex","setUTCMilliseconds","list","el","sub","state_owner","day4","weekN","endDate","sortby","setUTCFullYear","start_check","end_check"],"mappings":";;AAmjCA,QAASA,8BAA6BC,OAAQC,MAE7C,GAAIC,KAAM,GAAIC,wBAAuBH,OAAQC,KAQ7C,OAHAC,KAAIE,WAAa,SAASC,OAAQC,cAG3BJ,ICpiCR,GAAIK,oBAAqB,WAAa,YAAc,OAAOC,mBAAkBC,QAE5EC,YACCC,kBACCC,QAAW,+CAEZC,qBACCC,KAAQ,0BACRC,KAAQ,MACRH,WACAI,YAAe,yFAEhBC,kBACCL,SAAW,EACXM,QAAQ,GAETC,gBACCJ,KAAQ,MACRD,KAAQ,iBAERF,WACAI,YAAe,gDAKjBI,aACCC,YAAY,EACZC,QAAS,MACTC,SAAU,EACVC,aAAa,EAIbC,eAAe,GAIhBC,kBAAmB,WAClBC,KAAKC,OAAOC,MAAMF,KAAMG,UAExB,IAAI9B,QAAS2B,IAkBb,OAhBAA,MAAKI,UAAYJ,KAAKK,QAAQC,WAC9BN,KAAKO,SACHC,GAAG,QAAS,WAAYnC,OAAOgC,QAAQI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":"app.min.js"} \ No newline at end of file diff --git a/calendar/js/et2_widget_daycol.js b/calendar/js/et2_widget_daycol.js index c39b7f7972..00abb86cd0 100644 --- a/calendar/js/et2_widget_daycol.js +++ b/calendar/js/et2_widget_daycol.js @@ -1,4 +1,4 @@ -/* +/* * Egroupware * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @package etemplate @@ -9,8 +9,6 @@ */ -"use strict"; - /*egw:uses et2_core_valueWidget; /calendar/js/et2_widget_event.js; @@ -23,7 +21,7 @@ * * @augments et2_valueWidget */ -var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizeable], +var et2_calendar_daycol = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizeable], { attributes: { @@ -78,7 +76,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea this.event_wrapper = $j(document.createElement('div')) .addClass("event_wrapper") .appendTo(this.div); - + this.setDOMNode(this.div[0]); // Used for its date calculations - note this is a datetime, parent @@ -95,14 +93,14 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea rowHeight: 20, // Percentage; not yet available titleHeight: 2.0 - } + }; this.registeredUID = null; }, doLoadingFinished: function() { this._super.apply(this, arguments); - + // Parent will have everything we need, just load it from there if(this._parent && this._parent.options.owner) @@ -127,7 +125,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea this.div = null; this.header = null; this.title = null; - + // date_helper has no parent, so we must explicitly remove it this.date_helper.destroy(); this.date_helper = null; @@ -170,7 +168,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea // Figure out insert index var idx = 0; - var siblings = this._parent.getDOMNode(this).childNodes + var siblings = this._parent.getDOMNode(this).childNodes; while(idx < siblings.length && siblings[idx] != this.getDOMNode()) { idx++; @@ -193,9 +191,9 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea * Set the date * * @param {string|Date} _date New date - * @param {Object[]} events=false List of event data to be displayed, or false to + * @param {Object[]} events =false List of event data to be displayed, or false to * automatically fetch data from content array - * @param {boolean} force_redraw=false Redraw even if the date is the same. + * @param {boolean} force_redraw =false Redraw even if the date is the same. * Used for when new data is available. */ set_date: function(_date, events, force_redraw) @@ -257,7 +255,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea } var cache_id = app.classes.calendar._daywise_cache_id(new_date,this.options.owner); - if(this.options.date && this.registeredUID && + if(this.options.date && this.registeredUID && cache_id !== this.registeredUID) { egw.dataUnregisterUID(this.registeredUID,false,this); @@ -297,7 +295,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea * combination of both. */ set_owner: function(_owner) { - + this.title .attr("data-owner", _owner); this.header.attr('data-owner',_owner); @@ -311,10 +309,10 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea { return; } - + this.options.owner = typeof _owner !== 'object' ? [_owner] : _owner; - var cache_id = app.classes.calendar._daywise_cache_id(this.options.date,_owner) + var cache_id = app.classes.calendar._daywise_cache_id(this.options.date,_owner); if(this.options.date && this.registeredUID && cache_id !== this.registeredUID) { @@ -339,7 +337,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea * * Events should update themselves when their data changes, here we are * dealing with a change in which events are displayed on this day. - * + * * @param {String[]} event_ids * @returns {undefined} */ @@ -376,7 +374,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea }, set_width: function(width) { this.options.width = width; - + if(this.div) { this.div.outerWidth(this.options.width); @@ -398,7 +396,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea // Set today class - note +1 when dealing with today, as months in JS are 0-11 var today = new Date(); today.setUTCMinutes(today.getUTCMinutes() - today.getTimezoneOffset()); - + this.title.toggleClass("calendar_calToday", this.options.date === ''+today.getUTCFullYear()+ sprintf("%02d",today.getUTCMonth()+1)+ sprintf("%02d",today.getUTCDate()) @@ -458,7 +456,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea this.removeChild(node); node.free(); } - + // Make sure children are in cronological order, or columns are backwards events.sort(function(a,b) { var start = new Date(a.start) - new Date(b.start); @@ -503,7 +501,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea * Apply styles for out-of-view and partially hidden events * * There are 3 different states or modes of display: - * + * * - 'Normal' - When showing events positioned by time, the indicator is just * a bar colored by the last category color. On hover it shows either the * title of a single event or "x event(s)" if more than one are hidden. @@ -514,7 +512,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea * week (not auto-sized to fit screen) the indicator is the same as sized. * On hover it shows the titles of the hidden events, clicking changes * the view to the selected day. - * + * * - GridList - When showing just a list, the indicator shows "x event(s)", * and on hover shows the category color, title & time. Clicking changes * the view to the selected day, and opens the event for editing. @@ -533,7 +531,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea // elem is jquery div of event function isHidden(elem) { var docViewTop = timegrid.scrolling.scrollTop(), - docViewBottom = docViewTop + ( + docViewBottom = docViewTop + ( this.display_settings.granularity === 0 ? this.event_wrapper.height() : timegrid.scrolling.height() @@ -563,10 +561,10 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea } } // Check all day overflow - this.all_day.toggleClass('overflown', + this.all_day.toggleClass('overflown', this.all_day[0].scrollHeight - this.all_day.height() > 5 ); - + // Check each event this.iterateOver(function(event) { // Skip whole day events and events missing value @@ -707,7 +705,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea }); } } - var count = parseInt(indicator.attr('data-hidden_count')) + 1 + var count = parseInt(indicator.attr('data-hidden_count')) + 1; indicator.attr('data-hidden_count', count); if(this.display_settings.granularity === 0) { @@ -746,13 +744,13 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea /** * Sort a day's events into minimally overlapping columns - * + * * @returns {Array[]} Events sorted into columns */ _spread_events: function() { if(!this.date) return []; - + var day_start = this.date.valueOf() / 1000; var dst_check = new Date(this.date); dst_check.setUTCHours(12); @@ -775,7 +773,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea if(a.options.value.whole_day && b.options.value.whole_day) { // Longer duration comes first so we have nicer bars across the top - var duration = + var duration = (new Date(b.options.value.end) - new Date(b.options.value.start)) - (new Date(a.options.value.end) - new Date(a.options.value.start)); @@ -787,12 +785,12 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea } return start ? start : end; }); - + for(var i = 0; i < this._children.length; i++) { var event = this._children[i].options.value || false; if(!event) continue; - if(event.date && event.date != this.options.date && + if(event.date && event.date != this.options.date && // Multi-day events date may be different (new Date(event.start) >= this.date || new Date(event.end) <= this.date ) ) @@ -942,7 +940,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea } } }, - + /** * Calculates the vertical position based on the time * @@ -954,10 +952,10 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea _time_to_position: function(time) { var pos = 0.0; - + // 24h pos = ((time / 60) / 24) * 100; - + pos = pos.toFixed(1); return pos; @@ -1035,7 +1033,7 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea * @param {array} _attrs array to add further attributes to */ getDetachedAttributes: function(_attrs) { - + }, getDetachedNodes: function() { @@ -1043,9 +1041,9 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea }, setDetachedAttributes: function(_nodes, _values) { - + }, - + // Resizable interface /** * Resize @@ -1070,6 +1068,6 @@ var et2_calendar_daycol = et2_valueWidget.extend([et2_IDetachedDOM, et2_IResizea this._out_of_view(); } -}); +});}).call(this); et2_register_widget(et2_calendar_daycol, ["calendar-daycol"]); diff --git a/calendar/js/et2_widget_event.js b/calendar/js/et2_widget_event.js index 475f9403f8..b037389f58 100644 --- a/calendar/js/et2_widget_event.js +++ b/calendar/js/et2_widget_event.js @@ -9,8 +9,6 @@ */ -"use strict"; - /*egw:uses /etemplate/js/et2_core_valueWidget; */ @@ -42,7 +40,7 @@ * * @augments et2_valueWidget */ -var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], +var et2_calendar_event = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDetachedDOM], { attributes: { @@ -66,7 +64,7 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], this._super.apply(this, arguments); var event = this; - + // Main container this.div = $j(document.createElement("div")) .addClass("calendar_calEvent") @@ -137,7 +135,7 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], this._actionObject.remove(); this._actionObject = null; } - + this.div.off(); this.title.remove(); this.title = null; @@ -148,7 +146,7 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], this.div = null; $j('body.egw_tooltip').remove(); - + // Unregister, or we'll continue to be notified... if(this.options.value) { @@ -224,7 +222,7 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], // Update to reflect new information var event = this.options.value; - + var id = event.row_id ? event.row_id : event.id + (event.recur_type ? ':'+event.recur_date : ''); var formatted_start = event.start.toJSON(); @@ -273,10 +271,10 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], this.div // Let timegrid always get the drag .droppable('option','greedy',false) - + // Set full day flag .attr('data-full_day', event.whole_day) - + // Put everything we need for basic interaction here, so it's available immediately .attr('data-id', event.id) .attr('data-app', event.app || 'calendar') @@ -314,14 +312,14 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], this.title.toggle(!event.whole_day_on_top); this.body.toggleClass('calendar_calEventBodySmall', event.whole_day_on_top || false); - + // Header var title = !event.is_private ? event['title'] : egw.lang('private'); this.title .html(''+this._get_timespan(event) + '
') .append(''+title+'') - + // Colors - don't make them transparent if there is no color if(jQuery.Color("rgba(0,0,0,0)").toRgbaString() != jQuery.Color(this.div,'background-color').toRgbaString()) { @@ -331,7 +329,7 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], this.icons.appendTo(this.title) .html(this._icons()); - + // Body if(event.whole_day_on_top) { @@ -373,7 +371,7 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], /** * Calculate display variants for when event is too short for full display - * + * * Display is based on the number of visible lines, calculated off the header * height: * 1 - show just the event title, with ellipsis @@ -415,7 +413,7 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], /** * Examines the participants & returns CSS classname for status - * + * * @returns {String} */ _status_class: function() { @@ -449,7 +447,7 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], */ _tooltip: function() { if(!this.div) return ''; - + var border = this.div.css('borderTopColor'); var bg_color = this.div.css('background-color'); var header_color = this.title.css('color'); @@ -479,7 +477,7 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], } cat.destroy(); } - + return '
'+ '
'+ ''+timespan+''+ @@ -614,7 +612,7 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], } else { - var duration = event.multiday ? + var duration = event.multiday ? (event.end - event.start) / 60000 : (event.end_m - event.start_m); if (event.end_m === 24*60-1) ++duration; @@ -635,7 +633,7 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], } return timespan; }, - + /** * Make sure event data has all proper values, and format them as expected * @param {Object} event @@ -659,7 +657,7 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], this._parent.date_helper.set_value(event.end); event.end = new Date(this._parent.date_helper.getValue()); } - + // We need minutes for durations if(typeof event.start_m === 'undefined') { @@ -771,14 +769,14 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], { old_cache_id = app.classes.calendar._daywise_cache_id(this.options.value.date,this._parent.options.owner); } - + if(new_cache_id != old_cache_id) { var old_daywise = egw.dataGetUIDdata(old_cache_id); old_daywise = old_daywise && old_daywise.data ? old_daywise.data : []; old_daywise.splice(old_daywise.indexOf(this.options.value.id),1); egw.dataStoreUID(old_cache_id,old_daywise); - + if (new_daywise.indexOf(event.id) < 0) { new_daywise.push(event.id); @@ -888,7 +886,7 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], action_links.push('egw_link_drop'); this._actionObject.updateActionLinks(action_links); }, - + /** * Code for implementing et2_IDetachedDOM * @@ -905,7 +903,7 @@ var et2_calendar_event = et2_valueWidget.extend([et2_IDetachedDOM], setDetachedAttributes: function(_nodes, _values) { }, -}); +});}).call(this); et2_register_widget(et2_calendar_event, ["calendar-event"]); // Static class stuff @@ -918,7 +916,7 @@ et2_register_widget(et2_calendar_event, ["calendar-event"]); */ /** * Recur prompt - * If the event is recurring, asks the user if they want to edit the event as + * If the event is recurring, asks the user if they want to edit the event as * an exception, or change the whole series. Then the callback is called. * * If callback is not provided, egw.open() will be used to open an edit dialog. @@ -936,7 +934,7 @@ et2_register_widget(et2_calendar_event, ["calendar-event"]); * data. * @param {Object} [extra_data] - Additional data passed to the callback, used * as extra parameters for default callback - * + * * @augments {et2_calendar_event} */ et2_calendar_event.recur_prompt = function(event_data, callback, extra_data) @@ -1039,7 +1037,7 @@ et2_calendar_event.drag_helper = function(event,ui) { * * @param {string} status - combined value, O: status letter: U, T, A, R * @param {int} [quantity] - quantity -* @param {string} [role] +* @param {string} [role] * @return string status U, T, A or R, same as $status parameter on return */ et2_calendar_event.split_status = function(status,quantity,role) diff --git a/calendar/js/et2_widget_owner.js b/calendar/js/et2_widget_owner.js index e28e249bde..d3dd2b9cf1 100644 --- a/calendar/js/et2_widget_owner.js +++ b/calendar/js/et2_widget_owner.js @@ -1,16 +1,14 @@ -/* +/* * Egroupware * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License - * @package - * @subpackage + * @package + * @subpackage * @link http://www.egroupware.org * @author Nathan Gray * @version $Id$ */ -"use strict"; - /*egw:uses et2_widget_taglist; */ @@ -25,7 +23,7 @@ * @see http://nicolasbize.github.io/magicsuggest/ * @augments et2_selectbox */ -var et2_calendar_owner = et2_taglist_email.extend( +var et2_calendar_owner = (function(){ "use strict"; return et2_taglist_email.extend( { attributes: { "autocomplete_url": { @@ -47,7 +45,7 @@ var et2_calendar_owner = et2_taglist_email.extend( // Set to empty object to use selectbox's option finding "default": {}, "description": "Internally used to hold the select options." - }, + } }, // Allows sub-widgets to override options to the library @@ -81,9 +79,9 @@ var et2_calendar_owner = et2_taglist_email.extend( .removeClass('ms-res-item-active'); } },1); - }) - - + }); + + return true; }, @@ -92,5 +90,5 @@ var et2_calendar_owner = et2_taglist_email.extend( if(this.taglist == null) return null; return this.taglist.getValue(); } -}); +});}).call(this); et2_register_widget(et2_calendar_owner, ["calendar-owner"]); \ No newline at end of file diff --git a/calendar/js/et2_widget_planner.js b/calendar/js/et2_widget_planner.js index 03ad5f46bd..f9de576da9 100644 --- a/calendar/js/et2_widget_planner.js +++ b/calendar/js/et2_widget_planner.js @@ -1,4 +1,4 @@ -/* +/* * Egroupware Calendar timegrid * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @package etemplate @@ -9,8 +9,6 @@ */ -"use strict"; - /*egw:uses /calendar/js/et2_widget_view.js; /calendar/js/et2_widget_planner_row.js; @@ -25,10 +23,10 @@ * * @augments et2_calendar_view */ -var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResizeable], +var et2_calendar_planner = (function(){ "use strict"; return et2_calendar_view.extend([et2_IDetachedDOM, et2_IResizeable], { createNamespace: true, - + attributes: { group_by: { name: "Group by", @@ -118,7 +116,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi doLoadingFinished: function() { this._super.apply(this, arguments); - + // Don't bother to draw anything if there's no date yet if(this.options.start_date) { @@ -282,7 +280,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi }); return true; }, - + /** * These handle the differences between the different group types. * They provide the different titles, labels and grouping @@ -375,7 +373,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi } else // users { - user = parseInt(user) + user = parseInt(user); for(var j = 0; j < accounts.length && already_added.indexOf(''+user) < 0; j++) { if(accounts[j].value === user) @@ -433,7 +431,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi } rows[label_index].push(event); } - } + }; for(var user in participants) { var participant = participants[user]; @@ -611,7 +609,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi break; } } - + // Get its children immediately egw.json( this.getInstanceManager().app+'.etemplate_widget_menupopup.ajax_get_options.etemplate', @@ -692,7 +690,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi * Something changed, and the planner needs to be re-drawn. We wait a bit to * avoid re-drawing twice if start and end date both changed, then recreate. * - * @param {boolean} trigger=false Trigger an event once things are done. + * @param {boolean} trigger =false Trigger an event once things are done. * Waiting until invalidate completes prevents 2 updates when changing the date range. * @returns {undefined} */ @@ -703,7 +701,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi // Not yet ready if(!this.options.start_date || !this.options.end_date) return; - + // Wait a bit to see if anything else changes, then re-draw the days if(this.update_timer !== null) { @@ -797,7 +795,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi this._children[delete_index].free(); this.removeChild(this._children[delete_index--]); } - + // Clear old rows this.rows.empty() .append(this.grid); @@ -813,10 +811,10 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi this.grid.find('*').contents().filter(function(){ return this.nodeType === 3; }).remove(); - + // Get the rows / labels var labels = grouper.row_labels.call(this); - + // Group the events var events = {}; for(var i = 0; i < this.value.length; i++) @@ -882,7 +880,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi { row.doLoadingFinished(); } - + // Add actual events row._update_events(events); @@ -938,16 +936,16 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi for(var left = 0,i = 0; i < days;t.setUTCDate(1),t.setUTCMonth(t.getUTCMonth()+1),left += days_in_month*day_width,i += days_in_month) { var u = new Date(t.getUTCFullYear(),t.getUTCMonth()+1,0,-t.getTimezoneOffset()/60); - days_in_month = 1+ ((u-t) / (24*3600*1000)) + days_in_month = 1+ ((u-t) / (24*3600*1000)); var first = new Date(t.getUTCFullYear(),t.getUTCMonth(),1,-t.getTimezoneOffset()/60); if(days_in_month <= 0) break; - + if (i + days_in_month > days) { days_in_month = days - i; } - var title = app.calendar.egw.lang(date('F',new Date(t.valueOf() + t.getTimezoneOffset() * 60 * 1000))) + var title = app.calendar.egw.lang(date('F',new Date(t.valueOf() + t.getTimezoneOffset() * 60 * 1000))); if (days_in_month > 10) { title += ' '+t.getUTCFullYear(); @@ -967,7 +965,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi /** * Make a header showing the week numbers - * + * * @param {Date} start * @param {number} days * @returns {string} HTML snippet @@ -976,7 +974,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi { var content = '
'; - var state = '' + var state = ''; // we're not using UTC so date() formatting function works var t = new Date(start.valueOf()); @@ -998,7 +996,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi // Gets the right week # east of GMT. West does not need it(?) usertime.setUTCMinutes(usertime.getUTCMinutes() - start.getTimezoneOffset()); } - + week_width = 100 / days * Math.min(days, days_in_week); var title = app.calendar.egw.lang('Week')+' '+app.calendar.date.week_number(usertime); @@ -1006,7 +1004,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi if(start.getTimezoneOffset() > 0) { // Gets the right week start west of GMT - usertime.setUTCMinutes(usertime.getUTCMinutes() +start.getTimezoneOffset()) + usertime.setUTCMinutes(usertime.getUTCMinutes() +start.getTimezoneOffset()); } state = app.calendar.date.start_of_week(usertime); state.setUTCHours(0); @@ -1077,7 +1075,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi /** * Create a header with hours - * + * * @param {Date} start * @param {number} days * @returns {string} HTML snippet for the header @@ -1104,7 +1102,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi var cell_width = 100 / hours * decr; var content = '
'; - + // we're not using UTC so date() formatting function works var t = new Date(start.valueOf() + start.getTimezoneOffset() * 60 * 1000); for(var left = 0,i = 0; i < hours; left += cell_width,i += decr) @@ -1132,7 +1130,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi if(!date) return ''; var day_class = ''; - + // Holidays and birthdays var holidays = et2_calendar_view.get_holidays(this,date.getUTCFullYear()); @@ -1192,7 +1190,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi if(!parent) { debugger; - egw.debug('error','No parent objectManager found') + egw.debug('error','No parent objectManager found'); return; } @@ -1214,7 +1212,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi var aoi = new et2_action_object_impl(this,this.getDOMNode()); aoi.doTriggerEvent = function(_event, _data) { - + // Determine target node var event = _data.event || false; if(!event) return; @@ -1298,6 +1296,9 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi /** * Automatically add dnd support for linking + * + * @param {type} mgr + * @param {type} actionLinks */ _init_links_dnd: function(mgr,actionLinks) { var self = this; @@ -1421,6 +1422,10 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi /** * Show the current time while dragging * Used for resizing as well as drag & drop + * + * @param {type} element + * @param {type} position + * @param {type} height */ _drag_helper: function(element, position ,height) { @@ -1441,9 +1446,13 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi //$j(element).width($j(helper).width()); }, - + /** * Handler for dropping an event on the timegrid + * + * @param {type} planner + * @param {type} event + * @param {type} ui */ _event_drop: function(planner, event,ui) { var e = new jQuery.Event('change'); @@ -1495,7 +1504,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi /** * Use the egw.data system to get data from the calendar list for the * selected time span. - * + * */ _fetch_data: function() { @@ -1563,11 +1572,11 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi egw.includeCSS('/phpgwapi/categories.php?app='+event.data.app); } } - + this.invalidate(false); } }, this, this.getInstanceManager().execId,this.id); - + t.setUTCDate(t.getUTCDate() + 1); } while(t < end); @@ -1641,7 +1650,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi /** * Change how the planner is grouped - * + * * @param {string|number} group_by 'user', 'month', or an integer category ID * @returns {undefined} */ @@ -1662,6 +1671,8 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi /** * Call change handler, if set + * + * @param {type} event */ change: function(event) { if (this.onchange) @@ -1681,6 +1692,9 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi /** * Call event change handler, if set + * + * @param {type} event + * @param {type} dom_node */ event_change: function(event, dom_node) { if (this.onevent_change) @@ -1723,7 +1737,7 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi click: function(_ev) { var result = true; - + // Is this click in the event stuff, or in the header? if(this.gridHeader.has(_ev.target).length === 0 && !$j(_ev.target).hasClass('calendar_plannerRowHeader')) { @@ -1792,17 +1806,17 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi return false; } }, - + /** * Get time from position - * + * * @param {number} x * @param {number} y * @returns {Date|Boolean} A time for the given position, or false if one * could not be determined. */ _get_time_from_position: function(x,y) { - + x = Math.round(x); y = Math.round(y); @@ -1840,13 +1854,13 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi } } if(rel_time < 0) return false; - + var interval = egw.preference('interval','calendar') || 30; this.date_helper.set_minutes(Math.round(rel_time / (60 * interval))*interval); return new Date(this.date_helper.getValue()); }, - + /** * Code for implementing et2_IDetachedDOM * @@ -1887,5 +1901,5 @@ var et2_calendar_planner = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResi // Set height for rows this.rows.height(this.div.height() - this.headers.outerHeight()); } -}); +});}).call(this); et2_register_widget(et2_calendar_planner, ["calendar-planner"]); \ No newline at end of file diff --git a/calendar/js/et2_widget_planner_row.js b/calendar/js/et2_widget_planner_row.js index d40a29ab1f..888bbb232b 100644 --- a/calendar/js/et2_widget_planner_row.js +++ b/calendar/js/et2_widget_planner_row.js @@ -1,13 +1,18 @@ -/* +/* * Egroupware * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License - * @package - * @subpackage + * @package + * @subpackage * @link http://www.egroupware.org * @author Nathan Gray * @version $Id$ */ +/*egw:uses + /calendar/js/et2_widget_view.js; + /calendar/js/et2_widget_daycol.js; + /calendar/js/et2_widget_event.js; +*/ /** @@ -17,7 +22,7 @@ * * @augments et2_valueWidget */ -var et2_calendar_planner_row = et2_valueWidget.extend([et2_IDetachedDOM], +var et2_calendar_planner_row = (function(){ "use strict"; return et2_valueWidget.extend([et2_IDetachedDOM], { attributes: { start_date: { @@ -57,7 +62,7 @@ var et2_calendar_planner_row = et2_valueWidget.extend([et2_IDetachedDOM], // Used for its date calculations this.date_helper = et2_createWidget('date-time',{},null); this.date_helper.loadingFinished(); - + this.set_start_date(this.options.start_date); this.set_end_date(this.options.end_date); @@ -73,7 +78,7 @@ var et2_calendar_planner_row = et2_valueWidget.extend([et2_IDetachedDOM], destroy: function() { this._super.apply(this, arguments); - + // date_helper has no parent, so we must explicitly remove it this.date_helper.destroy(); this.date_helper = null; @@ -90,7 +95,7 @@ var et2_calendar_planner_row = et2_valueWidget.extend([et2_IDetachedDOM], return this.rows[0]; } }, - + /** * Draw the individual divs for weekends and events */ @@ -176,7 +181,7 @@ var et2_calendar_planner_row = et2_valueWidget.extend([et2_IDetachedDOM], this.options.end_date.setUTCMinutes(59); this.options.end_date.setUTCSeconds(59); }, - + /** * Mark special days (birthdays, holidays) on the planner * @@ -201,7 +206,7 @@ var et2_calendar_planner_row = et2_valueWidget.extend([et2_IDetachedDOM], (holidays ? ' title="'+holidays.join(',')+'"' : '')+ ' >
'; } - t.setUTCDate(t.getUTCDate()+1) + t.setUTCDate(t.getUTCDate()+1); } return content; }, @@ -231,7 +236,7 @@ var et2_calendar_planner_row = et2_valueWidget.extend([et2_IDetachedDOM], value: events[c] },this); } - + // Seperate loop so column sorting finds all children in the right place for(var c = 0; c < events.length && c < this._children.length; c++) { @@ -306,7 +311,7 @@ var et2_calendar_planner_row = et2_valueWidget.extend([et2_IDetachedDOM], var end = new Date(a.options.value.end) - new Date(b.options.value.end); return start ? start : end; }); - + for(var n = 0; n < this._children.length; n++) { var event = this._children[n].options.value || false; @@ -333,7 +338,7 @@ var et2_calendar_planner_row = et2_valueWidget.extend([et2_IDetachedDOM], { day_start -= daylight_diff; } - + event['start_m'] = parseInt((event.start.valueOf()/1000 - day_start) / 60); if (event['start_m'] < 0) { @@ -378,7 +383,7 @@ var et2_calendar_planner_row = et2_valueWidget.extend([et2_IDetachedDOM], // Handle the different value types start = this.options.start_date; end = this.options.end_date; - + if(typeof start === 'string') { start = new Date(start); @@ -412,7 +417,7 @@ var et2_calendar_planner_row = et2_valueWidget.extend([et2_IDetachedDOM], var start_date = new Date(start.getUTCFullYear(), start.getUTCMonth(),start.getUTCDate()); var end_date = new Date(end.getUTCFullYear(), end.getUTCMonth(),end.getUTCDate()); var t_date = new Date(t.getUTCFullYear(), t.getUTCMonth(),t.getUTCDate()); - + var days = Math.round((end_date - start_date) / (24 * 3600 * 1000))+1; pos = 1 / days * Math.round((t_date - start_date) / (24*3600 * 1000)); @@ -460,8 +465,8 @@ var et2_calendar_planner_row = et2_valueWidget.extend([et2_IDetachedDOM], setDetachedAttributes: function(_nodes, _values) { - }, + } -}); +});}).call(this); et2_register_widget(et2_calendar_planner_row, ["calendar-planner_row"]); \ No newline at end of file diff --git a/calendar/js/et2_widget_timegrid.js b/calendar/js/et2_widget_timegrid.js index fd1b522513..6b3e6a1e87 100644 --- a/calendar/js/et2_widget_timegrid.js +++ b/calendar/js/et2_widget_timegrid.js @@ -1,4 +1,4 @@ -/* +/* * Egroupware Calendar timegrid * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License * @package etemplate @@ -9,12 +9,8 @@ */ -"use strict"; - /*egw:uses /calendar/js/et2_widget_view.js; - /calendar/js/et2_widget_daycol.js; - /calendar/js/et2_widget_event.js; */ /** @@ -31,10 +27,10 @@ * * @augments et2_calendar_view */ -var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IResizeable], +var et2_calendar_timegrid = (function(){ "use strict"; return et2_calendar_view.extend([et2_IDetachedDOM, et2_IResizeable], { createNamespace: true, - + attributes: { value: { type: "any", @@ -99,7 +95,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes .appendTo(this.div); this.dayHeader = $j(document.createElement("div")) .appendTo(this.gridHeader); - + // Contains times / rows this.scrolling = $j(document.createElement('div')) .addClass("calendar_calTimeGridScroll") @@ -119,7 +115,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes .appendTo(this.gridHeader); this.gridHover = jQuery('
'); - + // List of dates in Ymd // The first one should be start_date, last should be end_date this.day_list = []; @@ -134,7 +130,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes this.setDOMNode(this.div[0]); }, destroy: function() { - + // Stop listening to tab changes if(framework.getApplicationByName('calendar').tab) { @@ -204,7 +200,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes this.div.on('mouseover', '.calendar_calEvent:not(.ui-resizable):not(.rowNoEdit)', function() { // Only resize in timegrid if(timegrid.options.granularity === 0) return; - + // Load the event timegrid._get_event_info(this); var that = this; @@ -292,10 +288,10 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes { drop.get(0).scrollIntoView(false); } - } + } }); }); - + // Customize and override some draggable settings this.div .on('dragcreate','.calendar_calEvent', function(event, ui) { @@ -323,11 +319,15 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes /** * Show the current time while dragging * Used for resizing as well as drag & drop + * + * @param {type} element + * @param {type} helper + * @param {type} height */ _drag_helper: function(element, helper,height) { if(!element) return; - + element.dropEnd = this.gridHover; if(element.dropEnd.length) @@ -385,6 +385,11 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes /** * Handler for dropping an event on the timegrid + * + * @param {type} timegrid + * @param {type} event + * @param {type} ui + * @param {type} dropEnd */ _event_drop: function(timegrid, event,ui, dropEnd) { var e = new jQuery.Event('change'); @@ -425,7 +430,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes event_widget._parent.date_helper.set_hours(dropEnd.whole_day ? 0 : dropEnd.hour||0); event_widget._parent.date_helper.set_minutes(dropEnd.whole_day ? 0 : dropEnd.minute||0); } - + // Leave the helper there until the update is done var loading = ui.helper.clone(true).appendTo($j('body')); // and add a loading icon so user knows something is happening @@ -437,7 +442,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes { $j('.calendar_timeDemo',loading).after('
'); } - + event_widget.recur_prompt(function(button_id) { if(button_id === 'cancel' || !button_id) { @@ -463,12 +468,12 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes else { //Edit calendar event - + // Duration - check for whole day dropped on a time, change it to full day var duration = event_widget.options.value.whole_day && dropEnd.hour ? 86400-1 : false; // Event (whole day or not) dropped on whole day section, change to whole day non blocking if(dropEnd.whole_day) duration = 'whole_day'; - + // Send the update var _send = function(series_instance) { @@ -534,7 +539,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes this.widget.update_timer = null; window.clearTimeout(this.resize_timer); this.widget.loader.hide().show(); - + // Update actions if(this.widget._actionManager) { @@ -640,13 +645,13 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes .append(this.owner.getDOMNode()) .append(this.dayHeader) .appendTo(this.div); - + // Max with 18 avoids problems when it's not shown var header_height = Math.max(this.gridHeader.outerHeight(true), 18); - + this.scrolling .appendTo(this.div) - .off() + .off(); // No time grid - list if(this.options.granularity === 0) @@ -666,7 +671,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes var rowsToDisplay = Math.ceil((totalDisplayMinutes+60)/granularity); var row_count = (1440 / this.options.granularity); - + this.scrolling .on('scroll', jQuery.proxy(this._scroll, this)); @@ -695,7 +700,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes }; var html = ''; var line_height = parseInt(this.div.css('line-height')); - this._top_time = 0 + this._top_time = 0; for(var t = 0,i = 0; t < 1440; t += granularity,++i) { html += '
'; @@ -712,7 +717,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes ); if(t <= wd_start && t + granularity > wd_start) { - this._top_time = this.rowHeight * (i+1+(wd_start - (t+granularity))/granularity) + this._top_time = this.rowHeight * (i+1+(wd_start - (t+granularity))/granularity); } var time_label = (typeof show[granularity] === 'undefined' ? t % 60 === 0 : show[granularity].indexOf(t % 60) !== -1) ? time : ''; @@ -749,7 +754,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes } // No point if it is just going to be redone completely if(this.upate_timer) return; - + this.resize_timer = window.setTimeout(jQuery.proxy(function() { if(this._resizeTimes) { @@ -775,7 +780,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes var totalDisplayMinutes = wd_end - wd_start; var rowsToDisplay = Math.ceil((totalDisplayMinutes+60)/this.options.granularity); var row_count = (1440 / this.options.granularity); - + var new_height = this.scrolling.height() / rowsToDisplay; var old_height = this.rowHeight; this.rowHeight = new_height; @@ -785,7 +790,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes '100%' : (this.rowHeight*row_count)+'px' ); - + // Scroll to start of day this._top_time = (wd_start * this.rowHeight) / this.options.granularity; this.scrolling.scrollTop(this._top_time); @@ -806,14 +811,14 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes */ _drawDays: function() { this.scrolling.append(this.days); - + // If day list is still empty, recalculate it from start & end date if(this.day_list.length === 0 && this.options.start_date && this.options.end_date) { this.day_list = this._calculate_day_list(this.options.start_date, this.options.end_date, this.options.show_weekend); } // For a single day, we show each owner in their own daycol - var daily_owner = this.day_list.length === 1 && + var daily_owner = this.day_list.length === 1 && this.options.owner.length > 1 && this.options.owner.length < (parseInt(egw.preference('day_consolidate','calendar')) || 6); var daycols_needed = daily_owner ? this.options.owner.length : this.day_list.length; @@ -834,7 +839,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes { var existing_index = this.day_widgets[add_index] && !daily_owner ? this.day_list.indexOf(this.day_widgets[add_index].options.date) : -1; before = existing_index > add_index; - + var day = et2_createWidget('calendar-daycol',{ owner: this.options.owner, width: (before ? 0 : day_width) + "px" @@ -877,7 +882,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes this.day_widgets[delete_index].destroy(); this.day_widgets.splice(delete_index--,1); } - + // Create / update day widgets with dates and data for(var i = 0; i < this.day_widgets.length; i++) { @@ -916,7 +921,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes // Adjust and scroll to start of day this.resizeTimes(); - + // Don't hold on to value any longer, use the data cache for best info this.value = {}; @@ -927,7 +932,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes // Handle not fully visible elements this._scroll(); - + // TODO: Figure out how to do this with detached nodes /* var nodes = this.day_col.getDetachedNodes(); @@ -944,14 +949,14 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes /** * Update UI while scrolling within the selected time - * + * * Toggles out of view indicators and adjusts not visible headers * @param {Event} event Scroll event */ _scroll: function(event) { if(!this.day_widgets) return; - + // Loop through days, let them deal with it for(var day = 0; day < this.day_widgets.length; day++) { @@ -967,13 +972,13 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes * @param {Date|string} end_date Date that et2_date widget can understand * @param {boolean} show_weekend If not showing weekend, Saturday and Sunday * will not be in the returned list. - * + * * @returns {string[]} List of days in Ymd format */ _calculate_day_list: function(start_date, end_date, show_weekend) { - + var day_list = []; - + this.date_helper.set_value(end_date); var end = this.date_helper.date.getTime(); var i = 1; @@ -1009,10 +1014,10 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes if(!parent) { debugger; - egw.debug('error','No parent objectManager found') + egw.debug('error','No parent objectManager found'); return; } - + for(var i = 0; i < parent.children.length; i++) { var parent_finder = jQuery(parent.children[i].iface.doGetDOMNode()).find(this.div); @@ -1027,13 +1032,13 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes // are handled internally using jQuery directly. var widget_object = this._actionObject || parent.getObjectById(this.id); var aoi = new et2_action_object_impl(this,this.getDOMNode()); - + aoi.doTriggerEvent = function(_event, _data) { // Determine target node var event = _data.event || false; if(!event) return; if(_data.ui.draggable.hasClass('rowNoEdit')) return; - + /* We have to handle the drop in the normal event stream instead of waiting for the egwAction system so we can get the helper, and destination @@ -1067,7 +1072,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes // Remove formatting for out-of-view events (full day non-blocking) $j('.calendar_calEventHeader',_data.ui.helper).css('top',''); $j('.calendar_calEventBody',_data.ui.helper).css('padding-top',''); - + if(time.length) { // The out will trigger after the over, so we count @@ -1098,7 +1103,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes break; } }; - + if (widget_object == null) { // Add a new container to the object manager which will hold the widget // objects @@ -1112,7 +1117,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes widget_object.setAOI(aoi); } this._actionObject = widget_object; - + // Delete all old objects widget_object.clear(); widget_object.unregisterActions(); @@ -1122,12 +1127,15 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes var action_links = this._get_action_links(actions); this._init_links_dnd(widget_object.manager, action_links); - + widget_object.updateActionLinks(action_links); }, /** * Automatically add dnd support for linking + * + * @param {type} mgr + * @param {type} actionLinks */ _init_links_dnd: function(mgr,actionLinks) { var self = this; @@ -1190,7 +1198,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes // Ok, stop. return false; } - + id = source[i].id.split('::'); links.push({app: id[0] == 'filemanager' ? 'link' : id[0], id: id[1]}); } @@ -1214,7 +1222,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes { // Get date and time var params = jQuery.extend({},$j('.drop-hover[data-date]',target.iface.getDOMNode())[0].dataset || {}); - + // Add link IDs var app_registry = egw.link_get_registry('calendar'); params[app_registry.add_app] = []; @@ -1291,16 +1299,16 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes * * Events will be retrieved automatically from the egw.data cache, so there * is no great need to provide them. - * + * * @param {Object[]} events Array of events, indexed by date in Ymd format: * { * 20150501: [...], * 20150502: [...] * } * Days should be in order. - * @param {string|number|Date} events.start_date - New start date - * @param {string|number|Date} events.end_date - New end date - * @param {number|number[]|string|string[]} event.owner - Owner ID, which can + * {string|number|Date} events.start_date - New start date + * {string|number|Date} events.end_date - New end date + * {number|number[]|string|string[]} event.owner - Owner ID, which can * be an account ID, a resource ID (as defined in calendar_bo, not * necessarily an entry from the resource app), or a list containing a * combination of both. @@ -1308,7 +1316,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes set_value: function set_value(events) { if(typeof events !== 'object') return false; - + var use_days_sent = true; if(events.start_date) @@ -1321,7 +1329,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes } this._super.apply(this,arguments); - + if(use_days_sent) { var day_list = Object.keys(events); @@ -1330,7 +1338,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes this.set_start_date(day_list[0]); this.set_end_date(day_list[day_list.length-1]); } - + // We need to check if we're attached already, as the datastore can cause // conflicts across other events (especially home) if we call it too early if(this.isAttached()) @@ -1383,7 +1391,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes { var old = this.options.owner || 0; this._super.apply(this, arguments); - + this.owner.set_label(''); this.div.removeClass('calendar_TimeGridNoLabel'); @@ -1415,7 +1423,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes } else { - this.owner.options.application = 'home-accounts' + this.owner.options.application = 'home-accounts'; this.owner.set_value(typeof _owner == "string" || typeof _owner == "number" ? _owner : jQuery.extend([],_owner)); this.set_label(''); $j(this.getDOMNode(this.owner)).prepend(this.owner.getDOMNode()); @@ -1454,21 +1462,21 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes this.options.owner.length > 1 ); }, - + /** * Set how big the time divisions are * * Setting granularity to 0 will remove the time divisions and display * each days events in a list style. This 'gridlist' is not to be confused * with the list view, which uses a nextmatch. - * + * * @param {number} minutes */ set_granularity: function(minutes) { // Avoid < 0 minutes = Math.max(0,minutes); - + if(this.options.granularity !== minutes) { if(this.options.granularity === 0 || minutes === 0) @@ -1528,6 +1536,9 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes /** * Call event change handler, if set + * + * @param {type} event + * @param {type} dom_node */ event_change: function(event, dom_node) { if (this.onevent_change) @@ -1580,7 +1591,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes click: function(_ev) { var result = true; - + // Is this click in the event stuff, or in the header? if(_ev.target.dataset.id || $j(_ev.target).parents('.calendar_calEvent').length) { @@ -1639,13 +1650,13 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes * * This does not return an actual time on a clock, but finds the closest * time node (.calendar_calAddEvent or day column) to the given position. - * + * * @param {number} x * @param {number} y * @returns {DOMNode[]} time node(s) for the given position */ _get_time_from_position: function(x,y) { - + x = Math.round(x); y = Math.round(y); if(this.options.granularity === 0) @@ -1660,7 +1671,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes delete this.gridHover[0].dataset[id]; } var node = document.elementFromPoint(x,y); - + while(node && node != this.node && node.tagName != 'BODY' && path.length < 10) { path.push(node); @@ -1716,7 +1727,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes this.gridHover.css('left',''); return this.gridHover; }, - + /** * Code for implementing et2_IDetachedDOM * @@ -1745,7 +1756,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes // Resizable interface /** - * @param {boolean} [too_small=null] Force the widget to act as if it was too small + * @param {boolean} [_too_small=null] Force the widget to act as if it was too small */ resize: function (_too_small) { @@ -1773,9 +1784,9 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes // Allow for toolbar height -= $j('#calendar-toolbar',this.div.parents('.egw_fw_ui_tab_content')).outerHeight(true); - + this.options.height = Math.floor(height / rowCount); - + // Allow for borders & padding this.options.height -= 2*((this.div.outerWidth(true) - this.div.innerWidth()) + parseInt(this.div.parent().css('padding-top'))); @@ -1813,7 +1824,7 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes this.div.removeClass('calendar_calTimeGridFixed'); } this.div.css('height', this.options.height); - + // Re-do time grid if(!this.update_timer) { @@ -1833,5 +1844,5 @@ var et2_calendar_timegrid = et2_calendar_view.extend([et2_IDetachedDOM, et2_IRes day.set_width(day_width + 'px'); } } -}); +});}).call(this); et2_register_widget(et2_calendar_timegrid, ["calendar-timegrid"]); \ No newline at end of file diff --git a/calendar/js/et2_widget_view.js b/calendar/js/et2_widget_view.js index 4100ed3e79..262f1373bb 100644 --- a/calendar/js/et2_widget_view.js +++ b/calendar/js/et2_widget_view.js @@ -1,15 +1,13 @@ -/* +/* * Egroupware * @license http://opensource.org/licenses/gpl-license.php GPL - GNU General Public License - * @package - * @subpackage + * @package + * @subpackage * @link http://www.egroupware.org * @author Nathan Gray * @version $Id$ */ -"use strict"; - /*egw:uses /etemplate/js/et2_core_valueWidget; */ @@ -20,13 +18,13 @@ * * et2_calendar_view is responsible for its own loader div, which is displayed while * the times & days are redrawn. - * + * * @augments et2_valueWidget */ -var et2_calendar_view = et2_valueWidget.extend( +var et2_calendar_view = (function(){ "use strict"; return et2_valueWidget.extend( { createNamespace: true, - + attributes: { owner: { name: "Owner", @@ -41,7 +39,7 @@ var et2_calendar_view = et2_valueWidget.extend( end_date: { name: "End date", type: "any" - }, + } }, /** @@ -67,7 +65,7 @@ var et2_calendar_view = et2_valueWidget.extend( // date_helper has no parent, so we must explicitly remove it this.date_helper.destroy(); this.date_helper = null; - + // Stop the invalidate timer if(this.update_timer) { @@ -89,7 +87,7 @@ var et2_calendar_view = et2_valueWidget.extend( * @param {boolean} [trigger_event=false] Trigger an event once things are done. * Waiting until invalidate completes prevents 2 updates when changing the date range. * @returns {undefined} - * + * * @memberOf et2_calendar_view */ invalidate: function invalidate(trigger_event) { @@ -253,9 +251,9 @@ var et2_calendar_view = et2_valueWidget.extend( * 20150502: [...] * } * Days should be in order. - * @param {string|number|Date} events.start_date - New start date - * @param {string|number|Date} events.end_date - New end date - * @param {number|number[]|string|string[]} event.owner - Owner ID, which can + * {string|number|Date} events.start_date - New start date + * {string|number|Date} events.end_date - New end date + * {number|number[]|string|string[]} event.owner - Owner ID, which can * be an account ID, a resource ID (as defined in calendar_bo, not * necessarily an entry from the resource app), or a list containing a * combination of both. @@ -333,7 +331,7 @@ var et2_calendar_view = et2_valueWidget.extend( } else // users { - user = parseInt(user) + user = parseInt(user); var accounts = egw.accounts('both'); for(var j = 0; j < accounts.length; j++) { @@ -376,9 +374,9 @@ var et2_calendar_view = et2_valueWidget.extend( result.widget_id = 'event_' + widget_id.join(''); } return result; - }, + } -}); +});}).call(this); // Static class stuff jQuery.extend(et2_calendar_view, @@ -386,7 +384,7 @@ jQuery.extend(et2_calendar_view, /** * Check if the view should be consolidated into one, or listed seperately * based on the user's preferences - * + * * @param {string[]} owners List of owners * @param {string} view Name of current view (day, week) * @returns {boolean} True of only one is needed, false if each owner needs