diff --git a/calendar/js/app.min.js b/calendar/js/app.min.js deleted file mode 100644 index 17b3ba70e8..0000000000 --- a/calendar/js/app.min.js +++ /dev/null @@ -1,15 +0,0 @@ -/*! - * EGroupware (http://www.egroupware.org/) minified Javascript - * - * full sources are available under https://svn.stylite.de/viewvc/egroupware/ - * - * build Wed Mar 02 2016 15:24:00 - */ - -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.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;i'+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_planner_row=function(){"use strict";return et2_valueWidget.extend([et2_IDetachedDOM],{attributes:{start_date:{name:"Start date",type:"any"},end_date:{name:"End date",type:"any"},value:{type:"any"}},init:function(){this._super.apply(this,arguments),this.div=$j(document.createElement("div")).addClass("calendar_plannerRowWidget").css("width",this.options.width),this.title=$j(document.createElement("div")).addClass("calendar_plannerRowHeader").appendTo(this.div),this.rows=$j(document.createElement("div")).addClass("calendar_eventRows").appendTo(this.div),this.setDOMNode(this.div[0]),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)},doLoadingFinished:function(){return this._super.apply(this,arguments),this.set_label(this.options.label),this._draw(),!0},destroy:function(){this._super.apply(this,arguments),this.date_helper.destroy(),this.date_helper=null},getDOMNode:function(_sender){return _sender!==this&&_sender?_sender._parent===this?this.rows[0]:void 0:this.div[0]},_draw:function(){this.rows.remove(".calendar_eventRowsMarkedDay,.calendar_eventRowsFiller").nextAll().remove();var days=31,width=85;"month"===this._parent.options.group_by&&(days=new Date(this.options.end_date.getUTCFullYear(),this.options.end_date.getUTCMonth()+1,0).getUTCDate(),31>days&&(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 deleted file mode 100644 index d0385edc61..0000000000 --- a/calendar/js/app.min.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["et2_widget_event.js","et2_widget_owner.js","et2_widget_view.js","et2_widget_timegrid.js","et2_widget_daycol.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_timegrid","et2_IDetachedDOM","et2_IResizeable","day_start","day_end","show_weekend","granularity","onchange","et2_no_init","onevent_change","height","document","createElement","addClass","gridHeader","appendTo","dayHeader","scrolling","append","days","_labelContainer","gridHover","day_list","day_widgets","resize_timer","setDOMNode","framework","getApplicationByName","tab","contentDiv","off","_actionObject","clear","unregisterActions","remove","scrollTop","_top_time","resize","_drawGrid","_link_actions","actions","_parent","timegrid","resizable","distance","grid","rowHeight","autoHide","handles","containment","create","event","ui","resizeHelper","target","getAttribute","stop","e","Event","originalEvent","duration","event_data","event_widget","getWidgetById","sT","start_m","dropEnd","eT","attr","end_m","trigger","_update","position_event","children","_get_time_from_position","helper","getBoundingClientRect","left","bottom","drop","_drag_helper","element","is","get","scrollIntoView","draggable","top","width","outerHeight","css","clientX","clientY","_drop_data","position","time","whole_day","lang","datepicker","formatTime","hour","minute","seconds","timezone","ampm","innerHTML","_event_drop","start","drop_date","date","getParent","app","set_hours","set_minutes","getUTCHours","getUTCMinutes","loading","clone","after","recur_prompt","button_id","app_id","recur_type","recur_date","dataStoreUID","dataGetUIDdata","_send","series_instance","series_split_prompt","_button_id","et2_dialog","OK_BUTTON","show","_actionManager","_drawDays","_drawTimes","change","ET2_GRID_INVALIDATE_TIMEOUT","detachFromDOM","attachToDOM","args","Array","prototype","slice","indexOf","push","event_change","stopPropagation","getDOMNode","_sender","instanceOf","et2_calendar_daycol","disabled","empty","toggleClass","Math","max","iterateOver","day","wd_start","wd_end","totalDisplayMinutes","rowsToDisplay","ceil","row_count","_scroll","toFixed",5,10,15,45,"html","t","i","time_label","trim","floor","resizeTimes","upate_timer","_resizeTimes","new_height","old_height","child","_calculate_day_list","daily_owner","daycols_needed","day_width","min","getInstanceManager","DOMContainer","dim","getHiddenDimensions","w","add_index","before","existing_index","isInTree","unshift","prepend","delete_index","set_width","header","splice","substr","calendar","state","getUTCMonth","set_class","set_left","set_label","_out_of_view","end","getTime","getUTCDay","get_year","sprintf","get_month","get_date","objectManager","egw_getObjectManager","getObjectById","uniqueId","parent","debug","parent_finder","iface","doGetDOMNode","widget_object","doTriggerEvent","_event","_data","hasClass","getWidget","drag_listener","EGW_AI_DRAG_OVER","EGW_AI_DRAG_OUT","insertObject","egwActionObject","manager","getActionById","setAOI","action_links","_get_action_links","_init_links_dnd","updateActionLinks","mgr","actionLinks","self","drop_action","drag_action","link_get_registry","dataStorePrefix","addAction","image","action","source","links","et2_calendar_event","getAppName","concat","message","params","app_registry","add_app","add_id","n","open","acceptedTypes","selected","set_dragType","use_days_sent","Object","keys","consolidated","row_id","day_id","classes","_daywise_cache_id","week_number","toString","set_granularity","minutes","set_show_weekend","weekends","et2_compileLegacyJS","_node","get_granularity","click","_ev","parents","onclick","readonly","update_state","has","_children","x","y","round","path","elementFromPoint","tagName","style","display","$node","my","at","of","getDetachedAttributes","_attrs","getDetachedNodes","setDetachedAttributes","_nodes","_values","_too_small","rowCount","innerHeight","outerWidth","innerWidth","needed","too_small","overflow-y","overflow-x","total_width","class","_tooltipElem","fadeTo","fadeOut","set_statustext","_tooltip","title","body","icons","dataRegisterUID","_UID_callback","execId","old_app_id","dataUnregisterUID","_value","old_id","dataHasUID","_values_check","_sameday_check","formatted_start","toJSON","action_parent","et2_container","im","et2_selectbox","cat_options","_type","includeCSS","droppable","index","private","status_class","_status_class","category","cats","participants","toggle","whole_day_on_top","is_private","_get_timespan","Color","toRgbaString","_icons","start_time","_small_size","line_height","parseFloat","visible_lines","h","status","split_status","border","bg_color","header_color","timespan","valueOf","input_date","val","times","multiday","cat_label","cat","span","text","each","outerHTML","location","parts","replace","priority","public","single","multiple","uid","non_blocking","alarm","getUTCFullYear","getUTCDate","owner_match","parent_owner","accountData","members","event_start","event_end","new_cache_id","new_daywise","old_cache_id","old_daywise","callback","extra_data","egw_getAppObjectManager","edit_id","edit_date","opener","that","extra_params","exception","buttons","show_dialog","QUESTION_MESSAGE","instance_date","tempDate","today","getFullYear","getMonth","getDate","getHours","getTimezoneOffset","getSeconds","termination_date","BUTTONS_OK_CANCEL","WARNING_MESSAGE","drag_helper","quantity","role","matches","display_birthday_as_event","display_holiday_as_event","all_day","event_wrapper","display_settings","titleHeight","registeredUID","sender","_draw","idx","siblings","childNodes","eq","_date","force_redraw","formatDate","date_string","long_date","cache_id","removeChild","_data_callback","classnames","event_ids","_update_events","setUTCMinutes","holidays","holiday_list","_events","getArrayMgr","getEntry","sort","a","b","c","isHidden","elem","docViewTop","docViewBottom","elemTop","elemBottom","visible","hidden","completely","padding-top","margin-top","scrollHeight","background-color","_hidden_indicator","title_height","indicator","fixed_height","first","last","count","dom_id","color","_spread_events","dst_check","setUTCHours","daylight_diff","eventCols","col_ends","columns","right","_time_to_position","border_diff","pos","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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ItiB,MAAK0K,IAAI6F,SAASC,MAAM6R,OACxEtd,KAAOuI,KAAK8I,MAAMkmB,KAAO,MAO9B,OALAhW,GAAEzC,WAAWyC,EAAE3J,aAAgB5X,KAAKuoB,OACjCvoB,KAAO,IAETuhB,EAAI5b,IAAI6F,SAAS/F,KAAKmd,cAAcrB,IAE9BA,KAIToQ,SAAUhsB,IAAIqK,QAAQxE,SAAS9D,UAAUuxB,KAAK3hC,QAC7C+T,OAAQ,SAASI,OAEhB,GAAIipB,WAAY,GAAIz5B,MAAKwQ,MAAM6R,MAC/BoX,WAAY,GAAIz5B,MAAKy5B,UAAUpe,UAA4C,GAAhCoe,UAAUhb,oBAA2B,IAChF,IAAIogB,aAAc,GAAGpF,UAAUpb,cAAgBob,UAAUnb,WAAamb,UAAUlb,UAE5EmgB,QAAU,GAAI1+B,MAAKwQ,MAAM8R,KAC7Boc,SAAU,GAAI1+B,MAAK0+B,QAAQrjB,UAA0C,GAA9BqjB,QAAQjgB,oBAA2B,IAC1E,IAAIqgB,WAAY,GAAGJ,QAAQrgB,cAAgBqgB,QAAQpgB,WAAaogB,QAAQngB,SACxE,OAAO7T,KAAI6F,SAASytB,KAAKn9B,OAAO2P,OAC/BhG,KAAK5L,IAAImE,WAAW,cAAc02B,YACjCoF,aAAeC,UAAY,GAAK,MAAQt0B,KAAK5L,IAAImE,WAAW,cAAc27B,WAE7E3R,YAAa","file":"app.min.js"} \ No newline at end of file diff --git a/etemplate/js/etemplate2.min.js b/etemplate/js/etemplate2.min.js deleted file mode 100644 index 5749309afa..0000000000 --- a/etemplate/js/etemplate2.min.js +++ /dev/null @@ -1,38 +0,0 @@ -/*! - * EGroupware (http://www.egroupware.org/) minified Javascript - * - * full sources are available under https://svn.stylite.de/viewvc/egroupware/ - * - * build Thu Mar 03 2016 15:04:04 - */ - -function et2_loadXMLFromURL(_url,_callback,_context){"undefined"==typeof _context&&(_context=null);var win;try{opener&&opener.etemplate2&&(win=opener)}catch(e){}"undefined"==typeof win&&(win=top),win.jQuery.ajax({url:_url,context:_context,type:"GET",dataType:"xml",success:function(_data,_status,_xmlhttp){_callback.call(_context,_data.documentElement)},error:function(_xmlhttp,_err){egw().debug("error","Loading eTemplate from "+_url+" failed! "+_xmlhttp.status+" "+_xmlhttp.statusText)}})}function et2_directChildrenByTagName(_node,_tagName){_tagName=_tagName.toLowerCase();for(var result=[],i=0;i<_node.childNodes.length;i++)_tagName==_node.childNodes[i].nodeName.toLowerCase()&&result.push(_node.childNodes[i]);return result}function et2_filteredNodeIterator(_node,_callback,_context){for(var i=0;i<_node.childNodes.length;i++){var node=_node.childNodes[i],nodeName=node.nodeName.toLowerCase();"#"!=nodeName.charAt(0)&&_callback.call(_context,node,nodeName)}}function et2_readAttrWithDefault(_node,_name,_default){var val=_node.getAttribute(_name);return null===val?_default:val}function et2_evalBool(_val){return"string"!=typeof _val||"false"!=_val&&"0"!=_val?!!_val:!1}function et2_form_name(_cname,_name){for(var parts=[],i=0;i0&&(parts=parts.concat(name.replace(/]/g,"").split("[")))}var name=parts.shift();return parts.length?name+"["+parts.join("][")+"]":name}function et2_checkType(_val,_type,_attr,_widget){function _err(){var res=et2_typeDefaults[_type];return"undefined"!=typeof _val&&_val&&egw.debug("warn","Widget %o: '"+_val+"' was not of specified _type '"+_type+(null!=_attr?"' for attribute '"+_attr+"' ":"")+"and is now '"+res+"'",_widget),res}if("undefined"==typeof _attr&&(_attr=null),"any"==_type)return _val;if(_val===et2_typeDefaults[_type])return _val;if("boolean"==_type){if(_val===!0||_val===!1)return _val;if("string"==typeof _val){var lcv=_val.toLowerCase();if("true"===lcv||"false"===lcv||""===lcv)return"true"===_val;if("0"===lcv||"1"===lcv)return"1"===_val}else if("number"==typeof _val)return 0!=_val;return _err()}if("string"==_type||"html"==_type||"rawstring"==_type)return"number"==typeof _val?_val.toString():"string"==typeof _val?"string"==_type?html_entity_decode(_val):_val:"object"==typeof _val&&jQuery.isEmptyObject(_val)?"":_err();if("float"==_type)return"number"==typeof _val?_val:isNaN(_val)?_err():parseFloat(_val);if("integer"==_type)return parseInt(_val)==_val?parseInt(_val):_err();if("dimension"==_type)return"auto"==_val?_val:isNaN(_val)?"string"==typeof _val&&(_val.indexOf("px")==_val.length-2&&!isNaN(_val.split("px")[0])||_val.indexOf("%")==_val.length-1&&!isNaN(_val.split("%")[0]))?_val:_err():parseFloat(_val)+"px";if("js"==_type){if("function"==typeof _val||"undefined"==typeof _val)return _val;if(_val&&(_val=_val.replace(/window\.close\(\)/g,"egw(window).close()")),"string"==typeof _val&&"app."==_val.substr(0,4)&&window.app){for(var parts=_val.split("."),func=parts.pop(),parent=window,i=0;istart&&(start+=end),end="undefined"==typeof len?end:0>len?len+end:len+start,start>=str.length||0>start||start>end?"":str.slice(start,end)}function et2_csvSplit(_str,_num,_delimiter,_enclosure){if("undefined"!=typeof _str&&null!=_str||(_str=""),"undefined"==typeof _num&&(_num=null),"undefined"==typeof _delimiter&&(_delimiter=","),"undefined"==typeof _enclosure&&(_enclosure='"'),-1==_str.indexOf(_enclosure))return null===_num?_str.split(_delimiter):_str.split(_delimiter,_num);for(var parts=_str.split(_delimiter),n=0;"undefined"!=typeof parts[n];n++){var part=parts[n];if(part.charAt(0)===_enclosure){for(var m=n;"undefined"!=typeof parts[m+1]&&parts[n].substr(-1)!==_enclosure;)parts[n]+=_delimiter+parts[++m],delete parts[m];parts[n]=et2_substr(parts[n].replace(new RegExp(_enclosure+_enclosure,"g"),_enclosure),1,-1),n=m}}return parts=et2_arrayValues(parts),null!==_num&&_num>0&&_num0&&(parts[_num-1]=parts.slice(_num-1,parts.length).join(_delimiter),parts=parts.slice(0,_num)),parts}function et2_activateLinks(_content){function _splitPush(_matches,_proc){if(_matches){_match=!0;for(var i=1;i<_matches.length;i++)"undefined"==typeof _matches[i]&&(_matches[i]="");var splitted=_content.split(_matches[0]),left=splitted.shift();left&&(arr=arr.concat(et2_activateLinks(left))),_proc(_matches),_content=splitted.join(_matches[0])}}var _match=!1,arr=[],mail_regExp=/(mailto:)?([a-z0-9._-]+)@([a-z0-9_-]+)\.([a-z0-9._-]+)/i,protocol="(http:\\/\\/|(ftp:\\/\\/|https:\\/\\/))",domain="([\\w-]+\\.[\\w-.]+)",subdir="([\\w\\-\\.,@?^=%&;:\\/~\\+#]*[\\w\\-\\@?^=%&\\/~\\+#])?",http_regExp=new RegExp(protocol+domain+subdir,"i"),domain="www(\\.[\\w-.]+)",subdir="([\\w\\-\\.,@?^=%&:\\/~\\+#]*[\\w\\-\\@?^=%&\\/~\\+#])?",www_regExp=new RegExp(domain+subdir,"i");do{if(_match=!1,!_content)break;_splitPush(_content.match(mail_regExp),function(_matches){arr.push({href:(_matches[1]?"":"mailto:")+_matches[0],text:_matches[2]+"@"+_matches[3]+"."+_matches[4]})}),_splitPush(_content.match(http_regExp),function(_matches){arr.push({href:_matches[0],text:_matches[2]+_matches[3]+_matches[4]})}),_splitPush(_content.match(www_regExp),function(_matches){arr.push({href:"http://"+_matches[0],text:_matches[0]})})}while(_match);return arr.push(_content),arr}function et2_insertLinkText(_text,_node,_target){if(!_node)return void egw.debug("warn","et2_insertLinkText called without node",_text,_node,_target);for(var i=_node.childNodes.length-1;i>=0;i--)_node.removeChild(_node.childNodes[i]);for(var i=0;i<_text.length;i++){var s=_text[i];if("string"==typeof s||"number"==typeof s)for(var lines=s.split?s.split("\n"):[s],j=0;j_ar2.bottom)}function et2_rangeIntersectDir(_ar1,_ar2){return _ar1.bottom<_ar2.top?-1:_ar1.top>_ar2.bottom?1:0}function et2_rangeEqual(_ar1,_ar2){return _ar1.top===_ar2.top&&_ar1.bottom===_ar2.bottom}function et2_rangeSubstract(_ar1,_ar2){var res=[_ar1];et2_rangeIntersect(_ar1,_ar2)&&(res=[et2_bounds(_ar1.top,_ar2.top),et2_bounds(_ar2.bottom,_ar1.bottom)]);for(var i=res.length-1;i>=0;i--)res[i].bottom-res[i].top<=0&&res.splice(i,1);return res}function html_entity_decode(_str){return _str&&-1!=_str.indexOf("&")?jQuery(""+_str+"").text():_str}function et2_arrayMgrs_expand(_owner,_mgrs,_data,_row){var result={};for(var key in _mgrs)if(result[key]=_mgrs[key],"undefined"!=typeof _data[key]){var rowData={};rowData[_row]=_data[key],result[key]=_mgrs[key].openPerspective(_owner,rowData,_row)}return result}function et2_register_widget(_constructor,_types){"use strict";for(var i=0;i<_types.length;i++){var type=_types[i].toLowerCase();et2_registry[type]&&egw.debug("warn","Widget class registered for "+type+" will be overwritten."),et2_registry[type]=_constructor}}function et2_createWidget(_name,_attrs,_parent){"use strict";"undefined"==typeof _attrs&&(_attrs={}),"undefined"==typeof _parent&&(_parent=null);var nodeName=_attrs.type=_name,readonly=_attrs.readonly="undefined"==typeof _attrs.readonly?!1:_attrs.readonly,constructor="undefined"==typeof et2_registry[nodeName]?et2_placeholder:et2_registry[nodeName];return readonly&&"undefined"!=typeof et2_registry[nodeName+"_ro"]&&(constructor=et2_registry[nodeName+"_ro"]),constructor.prototype.generateAttributeSet(_attrs),new constructor(_parent,_attrs)}function et2_action_object_impl(widget,node){var aoi=new egwActionObjectInterface,objectNode=node;return aoi.getWidget=function(){return widget},aoi.doGetDOMNode=function(){return objectNode?objectNode:widget.getDOMNode()},aoi.doSetState=function(_state,_outerCall){},aoi.doTriggerEvent=function(_event,_data){switch(_event){case EGW_AI_DRAG_OVER:$j(this.node).addClass("ui-state-active");break;case EGW_AI_DRAG_OUT:$j(this.node).removeClass("ui-state-active")}},aoi}function expose(widget){"use strict";var IMAGE_DEFAULT={title:egw.lang("loading"),href:"",type:"image/png",thumbnail:"",loading:!0},mime_regex=new RegExp(/(video\/(mp4|ogg|webm))|(image\/:*(?!tif|x-xcf|pdf))/);navigator.userAgent.match(/(MSIE|Trident)/)&&mime_regex.compile(/(video\/mp4)|(image\/:*(?!tif|x-xcf|pdf))/);var gallery=null,find_nextmatch=function(widget){for(var current=widget,nextmatch=null;null==nextmatch&¤t;)current=current.getParent(),"undefined"!=typeof current&¤t.instanceOf(et2_nextmatch)&&(nextmatch=current);return null!=nextmatch&&null!=nextmatch.controller&&nextmatch.dom_id.match(/filemanager/,"ig")?nextmatch:null},read_from_nextmatch=function(nm,images,start_at){start_at||(start_at=0);for(var image_index=start_at,stop=Math.max.apply(null,Object.keys(nm.controller._indexMap)),i=start_at;stop>=i;i++)if(nm.controller._indexMap[i]&&nm.controller._indexMap[i].uid){var uid=nm.controller._indexMap[i].uid;if(uid){var data=egw.dataGetUIDdata(uid);if(data&&data.data&&data.data.mime&&mime_regex.test(data.data.mime)){var media=this.getMedia(data.data);images[image_index++]=jQuery.extend({},data.data,media[0])}}}else images[image_index++]=IMAGE_DEFAULT},set_slide=function(index,image){for(var active=index==gallery.index;index>gallery.getNumber();)gallery.add([jQuery.extend({},IMAGE_DEFAULT)]);if(image.loading)return void(gallery.slidesContainer.find('[data-index="'+index+'"]').hasClass(gallery.options.slideErrorClass)&&$j(gallery.slides[index]).addClass(gallery.options.slideLoadingClass).removeClass(gallery.options.slideErrorClass));$j(gallery.slides[index]).removeClass(gallery.options.slideLoadingClass);var new_index=gallery.num;gallery.add([image]),gallery.list[index]=gallery.list[new_index],gallery.list.splice(new_index,1);var dom_nodes=["indicators","slides"];for(var i in dom_nodes){var var_name=dom_nodes[i];$j(gallery[var_name][index]).remove(),gallery[var_name][index]=gallery[var_name][new_index];var node=$j(gallery[var_name][index]);node.attr("data-index",index).insertAfter($j("[data-index='"+(index-1)+"']",node.parent())),active&&node.addClass(gallery.options.activeIndicatorClass),gallery[var_name].splice(new_index,1)}active&&(gallery.activeIndicator=$j(gallery.indicators[index])),gallery.positions[index]=active?0:index>gallery.index?gallery.slideWidth:-gallery.slideWidth,gallery.positions.splice(new_index,1),gallery.elements[index]&&(delete gallery.elements[index],gallery.loadElement(index)),gallery.num-=1};return widget.extend([et2_IExposable],{init:function(){this._super.apply(this,arguments),this.mime_regexp=mime_regex;var self=this;this.expose_options={container:"#blueimp-gallery",slidesContainer:"div",titleElement:"h3",displayClass:"blueimp-gallery-display",controlsClass:"blueimp-gallery-controls",singleClass:"blueimp-gallery-single",leftEdgeClass:"blueimp-gallery-left",rightEdgeClass:"blueimp-gallery-right",playingClass:"blueimp-gallery-playing",slideClass:"slide",slideLoadingClass:"",slideErrorClass:"slide-error",slideContentClass:"slide-content",toggleClass:"toggle",prevClass:"prev",nextClass:"next",closeClass:"close",playPauseClass:"play-pause",fullscreenClass:"fullscreen",typeProperty:"type",titleProperty:"title",urlProperty:"href",displayTransition:!0,clearSlides:!0,stretchImages:!0,toggleControlsOnReturn:!0,toggleSlideshowOnSpace:!0,enableKeyboardNavigation:!0,closeOnEscape:!0,closeOnSlideClick:!1,closeOnSwipeUpOrDown:!0,emulateTouchEvents:!0,stopTouchEventsPropagation:!1,hidePageScrollbars:!0,disableScroll:!0,carousel:!0,continuous:!1,unloadElements:!0,startSlideshow:!1,slideshowInterval:3e3,index:0,preloadRange:2,transitionSpeed:400,hideControlsOnSlideshow:!0,toggleFullscreenOnSlideShow:!0,slideshowTransitionSpeed:void 0,indicatorContainer:"ol",activeIndicatorClass:"active",thumbnailProperty:"thumbnail",thumbnailIndicators:!0,thumbnailWithImgTag:!0,onopen:jQuery.proxy(this.expose_onopen,this),onopened:jQuery.proxy(this.expose_onopened,this),onslide:function(index,slide){self.expose_onslide.apply(self,[this,index,slide])},onslideend:function(index,slide){self.expose_onslideend.apply(self,[this,index,slide])},onslidecomplete:function(index,slide){self.expose_onslidecomplete.apply(self,[this,index,slide])},onclose:jQuery.proxy(this.expose_onclose,this),onclosed:jQuery.proxy(this.expose_onclosed,this)};var $body=jQuery("body");if(0==$body.find("#blueimp-gallery").length){var $expose_node=jQuery(document.createElement("div")).attr({id:"blueimp-gallery",class:"blueimp-gallery"});$expose_node.append('

×
    '),$body.append($expose_node)}},set_value:function(_value){if("undefined"!=typeof this._super&&(this._super.apply(this,arguments),this.options.expose_view)){var self=this;_value&&"string"==typeof _value.mime&&_value.mime.match(mime_regex,"ig")&&"undefined"!=typeof _value.download_url&&"undefined"!=typeof this.options.expose_view&&this.options.expose_view&&jQuery(this.node).on("click",function(event){event.altKey||event.ctrlKey||event.shiftKey||event.metaKey||self._init_blueimp_gallery(event,_value),event.stopImmediatePropagation()}).addClass("et2_clickable")}},_init_blueimp_gallery:function(event,_value){var mediaContent=[],nm=find_nextmatch(this),current_index=0;if(nm&&!this._is_target_indepth(nm,event.target)){var current_entry=nm.controller.getRowByNode(event.target);read_from_nextmatch.call(this,nm,mediaContent);for(var i=0;i0&&(res=!0)}return res},expose_onopen:function(event){},expose_onopened:function(event){var nm=find_nextmatch(this),self=this;if(nm){var total_count=nm.controller._grid.getTotalCount();if(total_count>=gallery.num){var $indicator=gallery.container.find(".indicator");$indicator.off().addClass("paginating").swipe(function(event,direction,distance){if(direction==jQuery.fn.swipe.directions.LEFT)distance*=-1;else if(direction!=jQuery.fn.swipe.directions.RIGHT)return;$j(this).css("left",min(0,parseInt($j(this).css("left"))-30*distance)+"px")}),$indicator.bind("mousewheel DOMMousewheel",function(event,_delta){var delta=_delta||event.originalEvent.wheelDelta/120;if(!(delta>0&&parseInt($j(this).css("left"))>gallery.container.width()/2)){if(0>delta&&$j(this).width()+parseInt($j(this).css("left"))=index?1:-1;break}if(!gallery.list[index+direction]||gallery.list[index+direction].loading||total_count>gallery.getNumber()&&index+ET2_DATAVIEW_STEPSIZE>gallery.getNumber()){var start=Math.max(0,direction>0?index:index-ET2_DATAVIEW_STEPSIZE),end=Math.min(total_count-1,start+ET2_DATAVIEW_STEPSIZE);nm.controller._gridCallback(start,end);var images=[];read_from_nextmatch.call(this,nm,images,start);for(var i in images)set_slide(i,images[i])}}},expose_onslidecomplete:function(gallery,index,slide){},expose_onclose:function(event){var nm=find_nextmatch(this);nm&&!this._is_target_indepth(nm)&&(gallery.container.find(".indicator").removeClass("paginating").off("mousewheel").off("swipe"),nm.applyFilters({col_filter:{mime:""}}))},expose_onclosed:function(event){}})}function date(format,timestamp){var jsdate,f,formatChrCb,that=this,formatChr=/\\?([a-z])/gi,_pad=function(n,c){return(n+="").length4||21>j?"th":{1:"st",2:"nd",3:"rd"}[j%10]||"th"},w:function(){return jsdate.getDay()},z:function(){var a=new Date(f.Y(),f.n()-1,f.j()),b=new Date(f.Y(),0,1);return Math.round((a-b)/864e5)+1},W:function(){var a=new Date(f.Y(),f.n()-1,f.j()-f.N()+3),b=new Date(a.getFullYear(),0,4);return _pad(1+Math.round((a-b)/864e5/7),2)},F:function(){return txt_words[6+f.n()]},m:function(){return _pad(f.n(),2)},M:function(){return f.F().slice(0,3)},n:function(){return jsdate.getMonth()+1},t:function(){return new Date(f.Y(),f.n(),0).getDate()},L:function(){return 1===new Date(f.Y(),1,29).getMonth()|0},o:function(){var n=f.n(),W=f.W(),Y=f.Y();return Y+(12===n&&9>W?-1:1===n&&W>9)},Y:function(){return jsdate.getFullYear()},y:function(){return(f.Y()+"").slice(-2)},a:function(){return jsdate.getHours()>11?"pm":"am"},A:function(){return f.a().toUpperCase()},B:function(){var H=3600*jsdate.getUTCHours(),i=60*jsdate.getUTCMinutes(),s=jsdate.getUTCSeconds();return _pad(Math.floor((H+i+s+3600)/86.4)%1e3,3)},g:function(){return f.G()%12||12},G:function(){return jsdate.getHours()},h:function(){return _pad(f.g(),2)},H:function(){return _pad(f.G(),2)},i:function(){return _pad(jsdate.getMinutes(),2)},s:function(){return _pad(jsdate.getSeconds(),2)},u:function(){return _pad(1e3*jsdate.getMilliseconds(),6)},e:function(){throw"Not supported (see source code of date() for timezone on how to add support)"},I:function(){var a=new Date(f.Y(),0),c=Date.UTC(f.Y(),0),b=new Date(f.Y(),6),d=Date.UTC(f.Y(),6);return 0+(a-c!==b-d)},O:function(){var a=jsdate.getTimezoneOffset();return(a>0?"-":"+")+_pad(Math.abs(a/60*100),4)},P:function(){var O=f.O();return O.substr(0,3)+":"+O.substr(3,2)},T:function(){return"UTC"},Z:function(){return 60*-jsdate.getTimezoneOffset()},c:function(){return"Y-m-d\\Th:i:sP".replace(formatChr,formatChrCb)},r:function(){return"D, d M Y H:i:s O".replace(formatChr,formatChrCb)},U:function(){return jsdate.getTime()/1e3|0}},this.date=function(format,timestamp){return that=this,jsdate="undefined"==typeof timestamp?new Date:timestamp instanceof Date?new Date(timestamp):new Date(1e3*timestamp),format.replace(formatChr,formatChrCb)},this.date(format,timestamp)}function et2_dataview_rowAOI(_node){"use strict";var aoi=new egwActionObjectInterface;aoi.node=_node,aoi.selectMode=EGW_SELECTMODE_DEFAULT,aoi.checkBox=null,aoi.doGetDOMNode=function(){return aoi.node},$j(_node).mousedown(egwPreventSelect);var selectHandler=function(e,_params){if(egwUnfocus(),_node.onselectstart=null,e.target!=aoi.checkBox){var selected=egwBitIsSet(aoi.getState(),EGW_AO_STATE_SELECTED),state=egwGetShiftState(e);if(_params&&egwIsMobile())switch(_params.swip){case"left":case"right":state=1,_egw_active_menu&&_egw_active_menu.hide();break;case"up":case"down":return}switch(aoi.selectMode){case EGW_SELECTMODE_DEFAULT:aoi.updateState(EGW_AO_STATE_SELECTED,!egwBitIsSet(state,EGW_AO_SHIFT_STATE_MULTI)||!selected,state);break;case EGW_SELECTMODE_TOGGLE:aoi.updateState(EGW_AO_STATE_SELECTED,!selected,egwSetBit(state,EGW_AO_SHIFT_STATE_MULTI,!0))}}};return egwIsMobile()?$j(_node).swipe({allowPageScroll:"vertical",swipe:function(event,direction){selectHandler(event,{swip:direction})},click:function(event){selectHandler(event)}}):$j(_node).click(selectHandler),$j(aoi.checkBox).change(function(){aoi.updateState(EGW_AO_STATE_SELECTED,this.checked,EGW_AO_SHIFT_STATE_MULTI)}),aoi.doSetState=function(_state){var selected=egwBitIsSet(_state,EGW_AO_STATE_SELECTED);this.checkBox&&(this.checkBox.checked=selected),$j(this.node).toggleClass("focused",egwBitIsSet(_state,EGW_AO_STATE_FOCUSED)),$j(this.node).toggleClass("selected",selected)},aoi}function nm_action(_action,_senders,_target,_ids){if(!_action.checkbox||_action.data&&"undefined"!=typeof _action.data.nm_action){if("undefined"!=typeof _action.data&&_action.data||(_action.data={}),"undefined"==typeof _action.data.nm_action&&"popup"==_action.type&&(_action.data.nm_action="submit"),"undefined"==typeof _ids){for(var nm=null,action=_action;null==nm&&null!=action;)null!=action.data&&action.data.nextmatch&&(nm=action.data.nextmatch),action=action.parent;nm&&(_ids=nm.getSelection(),_action.data.nextmatch=nm)}for(var idsArr=_ids.ids,i=0;i=0?'"'+id.replace(/"/g,'""')+'"':id)+(i=0?egw_open_id=egw_open_id.split(":")[params.shift(params[2])]:params.length>1&&""==params[0]&&-1!=params[1].indexOf("from=merge")?params.shift():params.shift(params[2])),params.length>1&&""==params[0]&&-1!=params[1].indexOf("from=merge")&¶ms.shift();var extra=params.join("-");egw(app,window).open(egw_open_id,app,type,extra,target);break;case"open_popup":if(null==nm_popup_action){nm_open_popup(_action,_ids.ids);break}case"submit":var checkboxes=mgr.getActionsByAttr("checkbox",!0),checkbox_values={};if(checkboxes)for(var i in checkboxes)checkbox_values[checkboxes[i].id]=checkboxes[i].checked;var nextmatch=_action.data.nextmatch;if(!nextmatch&&_senders.length&&(nextmatch=_senders[0]._context._widget),nextmatch){var old_value=nextmatch.getValue,value=nextmatch.getValue();jQuery.extend(value,this.activeFilters,{selected:idsArr,select_all:_ids.all,checkboxes:checkbox_values}),value[nextmatch.options.settings.action_var]=_action.id,nextmatch.getValue=function(){return value},_action.data.postSubmit?nextmatch.getInstanceManager().postSubmit():nextmatch.getInstanceManager().submit(),"open_popup"==_action.data.nm_action&&(nextmatch.refresh(idsArr),nextmatch.getValue=old_value)}else egw().debug("error","Missing nextmatch widget, could not submit",_action)}}}function fetchAll(ids,nextmatch,callback){if(!nextmatch||!nextmatch.controller)return!1;var selection=nextmatch.getSelection();if(!selection.all)return!1;if(nextmatch.controller._grid&&nextmatch.controller._grid.getTotalCount()>ids.length){var idsArr=[],count=idsArr.length,total=nextmatch.controller._grid.getTotalCount(),cancel=!1,dialog=et2_dialog.show_dialog(function(){count=total,cancel=!0},egw.lang("Loading"),egw.lang("please wait..."),{},[{button_id:et2_dialog.CANCEL_BUTTON,text:"cancel",id:"dialog[cancel]",image:"cancel"}]);do nextmatch.controller.dataFetch({start:count,num_rows:200},function(data){if(data&&data.order)for(var i=0;i=total&&(dialog.destroy(),cancel||callback.call(this,idsArr))},this),count+=200;while(total>count);return!0}return!1}function doLongTask(idsArr,all,_action,nextmatch){if(all||idsArr.length>1||"undefined"==typeof _action.data.egw_open){if(all){var fetching=fetchAll(idsArr,nextmatch,function(idsArr){et2_dialog.long_task(null,_action.data.message||_action.caption,_action.data.title,_action.data.menuaction,idsArr)});if(fetching)return!0}return et2_dialog.long_task(null,_action.data.message||_action.caption,_action.data.title,_action.data.menuaction,idsArr),!0}return!1}function nm_compare_field(_action,_senders,_target){var value=!1,field=document.getElementById(_action.data.fieldId);if(field)value=$j(field).val();else{var nextmatch=_action.data.nextmatch;if(!nextmatch&&_senders.length&&(nextmatch=_senders[0]._context._widget),!nextmatch)return!1;field=nextmatch.getWidgetById(_action.data.fieldId),value=field.getValue()}return field?"!"==_action.data.fieldValue.substr(0,1)?value!=_action.data.fieldValue.substr(1):value==_action.data.fieldValue:!1}function nm_open_popup(_action,_selected){var uid;"undefined"!=typeof _action.data.nextmatch?uid=_action.data.nextmatch.getInstanceManager().uniqueId:"undefined"!=typeof _selected[0]&&(uid=_selected[0].manager.data.nextmatch.getInstanceManager().uniqueId);var popup=jQuery("#"+(uid||"")+"_"+_action.id+"_popup").first()||jQuery("[id*='"+_action.id+"_popup']").first();if(popup){nm_popup_action=_action,_selected.length&&"object"==typeof _selected[0]?(_action.data.nextmatch=_selected[0]._context._widget,nm_popup_ids=_selected):(egw().debug("warn","Not proper format for IDs, should be array of egwActionObject",_selected),nm_popup_ids=_selected);var dialog=jQuery(".action_popup-content",popup);if(0==dialog.length&&(dialog=jQuery(document.createElement("div")).addClass("action_popup-content"),1==popup.children().length?dialog.append(popup.children().children().slice(1,popup.children().children().length-1)):dialog.append(popup.children().slice(1,popup.children().length-1)),dialog.appendTo(popup)),1==dialog.length){var dialog_parent=dialog.parent(),d_buttons=[],action=_action;popup.show();var buttons=jQuery("button:visible",popup).each(function(index){var but=jQuery(this);if(but.hide(),but.attr("id"))var widget_id=but.attr("id").replace(_action.data.nextmatch.getInstanceManager().uniqueId+"_",""),button=nm_popup_action.data.nextmatch.getRoot().getWidgetById(widget_id);d_buttons.push({text:but.text(),click:button&&button.onclick?function(e){dialog.dialog("close"),nm_popup_action=action,button.onclick.apply(button,e.currentTarget)}:function(e){dialog.dialog("close"),nm_popup_action=null}})}),dialog_width=dialog.outerWidth(!0);popup.hide(),dialog.dialog({title:jQuery(".promptheader",popup).text(),modal:!0,buttons:d_buttons,minWidth:dialog_width,close:function(event,ui){dialog.dialog("destroy"),dialog.appendTo(dialog_parent),buttons.show()}})}nm_popup_action=null,nm_popup_senders=null}}function nm_submit_popup(button){if(nm_popup_action.data.nextmatch){var widget_id=$j(button).attr("id").replace(nm_popup_action.data.nextmatch.getInstanceManager().uniqueId+"_","");nm_popup_action.data.nextmatch.getRoot().getWidgetById(widget_id).clicked=!0}if(nm_popup_ids.length&&"object"!=typeof nm_popup_ids[0]){var ids={ids:[]};for(var i in nm_popup_ids)nm_popup_ids[i]&&ids.ids.push(nm_popup_ids[i])}nm_action(nm_popup_action,nm_popup_ids,button,ids),nm_hide_popup(button,null),nm_popup_ids=null}function nm_hide_popup(element,div_id){var prefix=element.id.substring(0,element.id.indexOf("[")),popup=div_id?document.getElementById(div_id):jQuery("#"+prefix+"_popup").get(0)||jQuery("[id*='"+prefix+"_popup']").get(0);return popup&&(popup.style.display="none"),nm_popup_action=null,nm_popup_senders=null,!1}function nm_activate_link(_action,_senders){$j(_senders[0].iface.getDOMNode()).find(".et2_clickable:first").trigger("click")}function dtmlXMLLoaderObject(t,e,n,i){return this.xmlDoc="",this.async="undefined"!=typeof n?n:!0,this.onloadAction=t||null,this.mainObject=e||null,this.waitCall=null,this.rSeed=i||!1,this}function callerFunction(t,e){return this.handler=function(n){return n||(n=window.event),t(n,e),!0},this.handler}function getAbsoluteLeft(t){return getOffset(t).left}function getAbsoluteTop(t){return getOffset(t).top}function getOffsetSum(t){for(var e=0,n=0;t;)e+=parseInt(t.offsetTop),n+=parseInt(t.offsetLeft),t=t.offsetParent;return{top:e,left:n}}function getOffsetRect(t){var e=t.getBoundingClientRect(),n=document.body,i=document.documentElement,a=window.pageYOffset||i.scrollTop||n.scrollTop,s=window.pageXOffset||i.scrollLeft||n.scrollLeft,r=i.clientTop||n.clientTop||0,o=i.clientLeft||n.clientLeft||0,d=e.top+a-r,l=e.left+s-o;return{top:Math.round(d),left:Math.round(l)}}function getOffset(t){return t.getBoundingClientRect?getOffsetRect(t):getOffsetSum(t); -}function convertStringToBoolean(t){switch("string"==typeof t&&(t=t.toLowerCase()),t){case"1":case"true":case"yes":case"y":case 1:case!0:return!0;default:return!1}}function getUrlSymbol(t){return-1!=t.indexOf("?")?"&":"?"}function dhtmlDragAndDropObject(){return window.dhtmlDragAndDrop?window.dhtmlDragAndDrop:(this.lastLanding=0,this.dragNode=0,this.dragStartNode=0,this.dragStartObject=0,this.tempDOMU=null,this.tempDOMM=null,this.waitDrag=0,window.dhtmlDragAndDrop=this,this)}function _dhtmlxError(){return this.catches||(this.catches=[]),this}function dhtmlXHeir(t,e){for(var n in e)"function"==typeof e[n]&&(t[n]=e[n]);return t}function dhtmlxEvent(t,e,n){t.addEventListener?t.addEventListener(e,n,!1):t.attachEvent&&t.attachEvent("on"+e,n)}function dhtmlxDetachEvent(t,e,n){t.removeEventListener?t.removeEventListener(e,n,!1):t.detachEvent&&t.detachEvent("on"+e,n)}function dhtmlxDnD(t,e){e&&(this._settings=e),dhtmlxEventable(this),dhtmlxEvent(t,"mousedown",dhtmlx.bind(function(e){this.dragStart(t,e)},this))}function dataProcessor(t){return this.serverProcessor=t,this.action_param="!nativeeditor_status",this.object=null,this.updatedRows=[],this.autoUpdate=!0,this.updateMode="cell",this._tMode="GET",this.post_delim="_",this._waitMode=0,this._in_progress={},this._invalid={},this.mandatoryFields=[],this.messages=[],this.styles={updated:"font-weight:bold;",inserted:"font-weight:bold;",deleted:"text-decoration : line-through;",invalid:"background-color:FFE0E0;",invalid_cell:"border-bottom:2px solid red;",error:"color:red;",clear:"font-weight:normal;text-decoration:none;"},this.enableUTFencoding(!0),dhtmlxEventable(this),this}function itempickerDocumentAction(context,data){"use strict";var formid="itempicker_action_form",form="
    ";$j("body").append(form),$j("#"+formid).submit().remove()}function etemplate2(_container,_menuaction){"undefined"==typeof _menuaction&&(_menuaction="home.etemplate_new.ajax_process_content.etemplate"),this.DOMContainer=_container,this.menuaction=_menuaction,this.uniqueId=_container.getAttribute("id")?_container.getAttribute("id").replace(".","-"):"",this.widgetContainer=null}function etemplate2_handle_load(_type,_response){var data=_response.data;if(jQuery.isArray(data["refresh-opener"])&&window.opener){var egw=window.egw(opener);egw.refresh.apply(egw,data["refresh-opener"])}var egw=window.egw(window);if("object"==typeof data.data&&"string"==typeof data.data.app_header&&(egw.app_header(data.data.app_header,data.data.currentapp||null),delete data.data.app_header),jQuery.isArray(data.message)&&egw.message.apply(egw,data.message),data["window-close"])return"string"==typeof data["window-close"]&&"true"!==data["window-close"]&&alert(data["window-close"]),egw.close(),!0;if(data["window-focus"]&&window.focus(),window.framework&&jQuery.isArray(data.setSidebox)&&window.framework.setSidebox.apply(window.framework,data.setSidebox),"string"==typeof data.url&&"object"==typeof data.data){if("function"==typeof this.load)return this.load(data.name,data.url,data.data),!0;var node=document.getElementById(data.DOMNodeID);if(node){if(node.children.length){var old=etemplate2.getById(node.id);old&&old.clear()}var et2=new etemplate2(node);return et2.load(data.name,data.url,data.data),!0}egw.debug("error","Could not find target node %s",data.DOMNodeId)}throw"Error while parsing et2_load response"}function etemplate2_handle_validation_error(_type,_response){for(var id in _response.data){var widget=this.widgetContainer.getWidgetById(id);if(widget){widget.showMessage(_response.data[id],"validation_error");for(var tmpWidget=widget;tmpWidget._parent&&"tabbox"!=tmpWidget._type;)tmpWidget=tmpWidget._parent;"tabbox"==tmpWidget._type&&tmpWidget.activateTab(widget)}}egw().debug("warn","Validation errors",_response.data)}function etemplate2_handle_assign(type,res,req){if("undefined"!=typeof res.data.id&&"undefined"!=typeof res.data.key&&"undefined"!=typeof res.data.value){if("undefined"==typeof res.data.etemplate_exec_id||res.data.etemplate_exec_id!=this.etemplate_exec_id)return!1;if("etemplate_exec_id"==res.data.key)return this.etemplate_exec_id=res.data.value,!0;if(null==this.widgetContainer)return egw.debug("warn","Tried to call assign on an un-loaded etemplate",res.data),!1;var widget=this.widgetContainer.getWidgetById(res.data.id);if(widget){if("function"!=typeof widget["set_"+res.data.key])return egw.debug("warn","Cannot set %s attribute %s via JSON assign, no set_%s()",res.data.id,res.data.key,res.data.key),!1;try{return widget["set_"+res.data.key].call(widget,res.data.value),!0}catch(e){egw.debug("error","When assigning %s on %s via AJAX, \n"+(e.message||e+""),res.data.key,res.data.id,widget)}}return!1}throw"Invalid parameters"}function xajax_eT_wrapper(obj,widget){if(egw().debug("warn","xajax_eT_wrapper() is deprecated, replace with widget.getInstanceManager().submit()"),"object"==typeof obj){if($j("div.popupManual div.noPrint").hide(),$j("div.ajax-loader").show(),"undefined"==typeof widget&&obj.id)for(var et2=etemplate2.getByApplication(egw_getAppName()),i=0;i=0){for(var result="_"+_variable.variable,i=0;i<_variable.accessExpressions.length;i++)result+="["+_php_compileString(_vars,_variable.accessExpressions[i])+"]";return"(typeof _"+_variable.variable+' != "undefined" && typeof '+result+'!="undefined" && '+result+" != null ? "+result+':"")'}_throwCompilerErr("Variable $"+_variable.variable+" is not defined.")}function _php_compileString(_vars,_string){_string instanceof Array||(_string=[_string]);for(var parts=[],hasString=!1,i=0;i<_string.length;i++){var part=_string[i];"string"==typeof part?(hasString=!0,parts.push("'"+part.replace(/\\/g,"\\\\").replace(/'/g,"\\'")+"'")):parts.push(_php_compileVariable(_vars,part))}return hasString||parts.push('""'),parts.join(" + ")}function _php_compileJSCode(_vars,_tree){return"return "+_php_compileString(_vars,_tree)+";"}var STATE_DEFAULT=0,STATE_ESCAPED=1,STATE_CURLY_BRACE_OPEN=2,STATE_EXPECT_CURLY_BRACE_CLOSE=3,STATE_EXPECT_RECT_BRACE_CLOSE=4,STATE_EXPR_BEGIN=5,STATE_EXPR_END=6,PHP_VAR_PREG=/^([A-Za-z0-9_]+)/;this.et2_compilePHPExpression=function(_expr,_vars){"undefined"==typeof _vars&&(_vars=[]);try{var parser=_php_parser(_expr),syntaxTree=[];_php_parseDoubleQuoteString(parser,syntaxTree);var js=_php_compileJSCode(_vars,syntaxTree);egw.debug("log","Compiled PHP "+_expr+" --> "+js)}catch(e){return egw.debug("warn","Error compiling PHP "+_expr+" --> using it literally ("+("string"==typeof e?e:e.message)+")!"),function(){return _expr}}for(var attrs=[],i=0;i<_vars.length;i++)attrs.push("_"+_vars[i]);return attrs.push(js),Function.apply(Function,attrs)}}).call(window);var et2_arrayMgr=function(){"use strict";return Class.extend({splitIds:!0,init:function(_data,_parentMgr){if("undefined"==typeof _parentMgr&&(_parentMgr=null),this.parentMgr=_parentMgr,"undefined"!=typeof _data&&_data||(egw.debug("log","No data passed to content array manager. Probably a mismatch between template namespaces and data."),_data={}),this.splitIds)for(var key in _data){var indexes=key.replace(/[/g,"[").split("[");if(indexes.length>1){for(var value=_data[key],target=_data,i=0;i1){indexes=[indexes.shift(),indexes.join("[")],indexes[1]=indexes[1].substring(0,indexes[1].length-1);var children=indexes[1].split("][");children.length&&(indexes=jQuery.merge([indexes[0]],children))}return indexes},getPath:function(_path){return"undefined"==typeof _path&&(_path=[]),null!=this.perspectiveData.key&&(_path=this.perspectiveData.key.replace(/]/g,"").split("[").concat(_path)),null!=this.parentMgr&&(_path=this.parentMgr.getPath(_path)),_path},getEntry:function(_key,_referenceInto,_skipEmpty){"undefined"==typeof _referenceInto&&(_referenceInto=!1),"undefined"==typeof _skipEmpty&&(_skipEmpty=!1);for(var indexes=this.explodeKey(_key),entry=this.data,i=0;i=0&&(null!=this.perspectiveData.row||!_ident.match(/\$\{?row\}?/))){var row=this.perspectiveData.row,row_cont=this.data[row]||{},cont=this.data,_cont=this.data,proto=this.constructor.prototype;if("undefined"==typeof proto.compiledExpressions[_ident])try{null==this.perspectiveData.row?proto.compiledExpressions[_ident]=et2_compilePHPExpression(_ident,["cont","_cont"]):proto.compiledExpressions[_ident]=et2_compilePHPExpression(_ident,["row","cont","row_cont","_cont"])}catch(e){proto.compiledExpressions[_ident]=null,egw.debug("error","Error while compiling PHP->JS ",e)}if(proto.compiledExpressions[_ident])try{_ident=null==this.perspectiveData.row?proto.compiledExpressions[_ident](cont,_cont):proto.compiledExpressions[_ident](row,cont,row_cont,_cont)}catch(e){egw.debug("log","object"==typeof e?e.message:e),_ident=null}}return is_index_in_content&&(_ident="@"==_ident.charAt(1)?this.getRoot().getEntry(_ident.substr(2)):this.getEntry(_ident.substr(1))),_ident},parseBoolExpression:function(_expression){if("!"==_expression.charAt(0))return!this.parseBoolExpression(_expression.substr(1));var parts=_expression.split("="),val=this.expandName(parts[0]);if("undefined"!=typeof parts[1]){var checkVal=this.expandName(parts[1]);return"/"==checkVal.charAt(0)?!!new RegExp(checkVal.substr(1,checkVal.length-2)).test(val):val==checkVal}return et2_evalBool(val)},openPerspective:function(_owner,_root,_row){var root="string"==typeof _root?this.data[_root]:null==_root?this.data:_root;"undefined"==typeof root&&"string"==typeof _root&&(root=this.getEntry(_root));var constructor=this.isReadOnly?et2_readonlysArrayMgr:et2_arrayMgr,mgr=new constructor(root,this);return mgr.perspectiveData.owner=_owner,"string"==typeof _root&&(mgr.perspectiveData.key=_root),"undefined"!=typeof _row&&(mgr.perspectiveData.row=_row),mgr}})}.call(this),et2_readonlysArrayMgr=function(){"use strict";return et2_arrayMgr.extend({isReadOnly:function(_id,_attr,_parent){var entry=null;if(null!=_id){(_id.indexOf("$")>=0||_id.indexOf("@")>=0)&&(_id=this.expandName(_id));for(var mgr=this;mgr.parentMgr&&jQuery.isEmptyObject(mgr.data);)mgr=mgr.parentMgr;entry=mgr.getEntry(_id)}return"undefined"!=typeof entry&&"object"!=typeof entry?entry:"undefined"!=typeof _attr&&null!==_attr?et2_evalBool(_attr):"undefined"!=typeof _parent&&_parent?!0:(entry=this.getEntry("__ALL__"),null!==entry&&"undefined"!=typeof entry)},expandName:function(ident){return this.perspectiveData.owner.getArrayMgr("content").expandName(ident)}})}.call(this),et2_registry={},et2_widget=function(){"use strict";return ClassWithAttributes.extend({attributes:{id:{name:"ID",type:"string",description:"Unique identifier of the widget"},no_lang:{name:"No translation",type:"boolean",default:!1,description:"If true, no translations are made for this widget"},span:{ignore:!0},type:{name:"Widget type",type:"string",ignore:!0,description:"What kind of widget this is"},readonly:{ignore:!0}},legacyOptions:[],createNamespace:!1,init:function(_parent,_attrs){"undefined"==typeof _parent&&(_parent=null),"undefined"==typeof _attrs&&(_attrs={}),this._mgrs={},this._inst=null,this._children=[],this._type=_attrs.type,this.id=_attrs.id,null!=_parent&&_parent.addChild(this),this.supportedWidgetClasses=[et2_widget],_attrs.id&&this.createNamespace&&this.checkCreateNamespace(),this.id,this.transformAttributes(_attrs),this.options=et2_cloneObject(_attrs)},destroy:function(){for(var i=this._children.length-1;i>=0;i--)this._children[i].free();"undefined"!=typeof this._parent&&null!==this._parent&&this._parent.removeChild(this);for(var key in this._mgrs)this._mgrs[key]&&this._mgrs[key].owner==this&&this._mgrs[key].free()},clone:function(_parent){"undefined"==typeof _parent&&(_parent=null);var copy=new this.constructor(_parent,this.options);return copy.assign(this),copy},assign:function(_obj){"undefined"==typeof _obj._children&&this.egw().debug("log","Foo!");for(var i=0;i<_obj._children.length;i++)_obj._children[i].clone(this);this.setArrayMgrs(_obj.mgrs)},getParent:function(){return this._parent},getChildren:function(){return this._children},getRoot:function(){return null!=this._parent?this._parent.getRoot():this},addChild:function(_node){this.insertChild(_node,this._children.length)},insertChild:function(_node,_idx){this.isOfSupportedWidgetClass(_node)?(_node._parent&&_node._parent.removeChild(_node),_node._parent=this,this._children.splice(_idx,0,_node),_node.implements(et2_IDOMNode)&&this.implements(et2_IDOMNode)&&_node.parentNode&&(_node.detachFromDOM(),_node.parentNode=this.getDOMNode(_node),_node.attachToDOM())):this.egw().debug("error","Widget "+_node._type+" is not supported by this widget class",this)},removeChild:function(_node){var idx=this._children.indexOf(_node);idx>=0&&(_node._parent=null,this._children.splice(idx,1))},getWidgetById:function(_id){if(this.id==_id)return this;if(!this._children)return null;for(var i=0;i0){if(_target.id&&this.getArrayMgr("modifications").getEntry(_target.id)){var mod=this.getArrayMgr("modifications").getEntry(_target.id);"undefined"!=typeof mod.options&&(attrValue=_attrsObj[i].value=mod.options)}"@"!=attrValue.charAt(0)&&-1==attrValue.indexOf("$")||(attrValue=mgr.expandName(attrValue));for(var splitted=et2_csvSplit(attrValue+""),j=0;j_proto.legacyOptions.length&&(attrValue=splitted.slice(j));var attr=_proto.attributes[_proto.legacyOptions[j]];"boolean"==attr.type?attrValue=mgr.parseBoolExpression(attrValue):"object"!=typeof attrValue&&(attrValue=mgr.expandName(attrValue)),_target[_proto.legacyOptions[j]]=attrValue}}else{if(null!=mgr&&"undefined"!=typeof _proto.attributes[attrName]){var attr=_proto.attributes[attrName];attrValue="boolean"==attr.type?mgr.parseBoolExpression(attrValue):mgr.expandName(attrValue)}_target[attrName]=attrValue}}},transformAttributes:function(_attrs){if(this.id&&("string"!=typeof this.id&&console.log(this.id),this.getArrayMgr("modifications"))){var data=this.getArrayMgr("modifications").getEntry(this.id);if(this.createNamespace&&this.getArrayMgr("modifications").perspectiveData.owner==this&&(data=this.getArrayMgr("modifications").data),"object"==typeof data)for(var key in data)_attrs[key]=data[key]}for(var key in _attrs)_attrs[key]&&"undefined"!=typeof this.attributes[key]&&(this.attributes[key].translate===!0||"!no_lang"===this.attributes[key].translate&&!_attrs.no_lang)&&(_attrs[key]=this.egw().lang(_attrs[key],"%s"))},createElementFromNode:function(_node){var attributes={},_nodeName=attributes.type=_node.getAttribute("type")?_node.getAttribute("type"):_node.nodeName.toLowerCase(),readonly=attributes.readonly=this.getArrayMgr("readonlys")?this.getArrayMgr("readonlys").isReadOnly(_node.getAttribute("id"),_node.getAttribute("readonly"),"undefined"!=typeof this.readonly?this.readonly:this.options.readonly):!1,modifications=this.getArrayMgr("modifications");if(modifications&&_node.getAttribute("id")){var entry=modifications.getEntry(_node.getAttribute("id"));if(null==entry){var entry=modifications.data[_node.getAttribute("id")];if(entry)this.egw().debug("warn","getEntry("+_node.getAttribute("id")+") failed, but the data is there.",modifications,entry);else var entry=modifications.getRoot().getEntry(_node.getAttribute("id"))}entry&&entry.type&&(_nodeName=attributes.type=entry.type),entry=null}("@"==_nodeName.charAt(0)||_nodeName.indexOf("$")>=0)&&(_nodeName=attributes.type=this.getArrayMgr("content").expandName(_nodeName));var constructor="undefined"==typeof et2_registry[_nodeName]?et2_placeholder:et2_registry[_nodeName];readonly&&"undefined"!=typeof et2_registry[_nodeName+"_ro"]&&(constructor=et2_registry[_nodeName+"_ro"]),this.parseXMLAttrs(_node.attributes,attributes,constructor.prototype),constructor.prototype.generateAttributeSet(attributes);var widget=new constructor(this,attributes);return widget.loadFromXML(_node),widget},loadFromXML:function(_node){for(var i=0;i<_node.childNodes.length;i++){var node=_node.childNodes[i],widgetType=node.nodeName.toLowerCase();"#comment"!=widgetType&&("#text"!=widgetType?this.createElementFromNode(node):node.data.replace(/^\s+|\s+$/g,"")&&this.loadContent(node.data))}},loadContent:function(_content){},loadingFinished:function(promises){if(this.initAttributes(this.options),"undefined"==typeof promises){promises=[];var warn_if_deferred=!0}var loadChildren=function(){for(var i=0;iidx||idx>=this.parentNode.childNodes.length-1?this.parentNode.appendChild(node):this.parentNode.insertBefore(node,this.parentNode.childNodes[idx]),this._attachSet={node:node,parent:this.parentNode},!0}return!1},isAttached:function(){return null!=this.parentNode},getSurroundings:function(){return this._surroundingsMgr||(this._surroundingsMgr=new et2_surroundingsMgr(this)),this._surroundingsMgr},set_parent_node:function(_node){if("string"==typeof _node){var parent=$j("#"+_node);0==parent.length?this.egw().debug("warn",'Unable to find DOM parent node with ID "%s" for widget %o.',_node,this):this.setParentDOMNode(parent.get(0))}else this.setParentDOMNode(_node)},setParentDOMNode:function(_node){_node!=this.parentNode&&(this.detachFromDOM(),this.parentNode=_node,this.attachToDOM())},getParentDOMNode:function(){return this.parentNode},getDOMIndex:function(){if(this._parent){var idx=0,children=this._parent.getChildren();if(children&&children.indexOf)return children.indexOf(this);egw.debug("warn","No Array.indexOf(), falling back to looping. ");for(var i=0;i0){var hasPlaceholder=et2_hasChild(this._widgetSurroundings,this._widgetPlaceholder);if(hasPlaceholder||(this._widgetPlaceholder=document.createElement("span"),this._widgetSurroundings.push(this._widgetPlaceholder),this._ownPlaceholder=!0),1==this._widgetSurroundings.length)this._widgetSurroundings[0]==this._widgetPlaceholder?this._widgetContainer=null:this._widgetContainer=this._widgetSurroundings[0];else{this._widgetContainer=document.createElement("span");for(var i=0;i1?parts.pop():null,template_name=parts.pop(),xml=null,templates=etemplate2.prototype.templates;if(!(xml=templates[template_name])){if(template_name.indexOf(".")<0){var root=_parent?_parent.getRoot():null,top_name=root&&root._inst?root._inst.name:null;top_name&&template_name.indexOf(".")<0&&(template_name=top_name+"."+template_name)}if(xml=templates[template_name],!xml){var url=this.options.url;if(!this.options.url){var splitted=template_name.split(".");url=this.getRoot()._inst.template_base_url+splitted.shift()+"/templates/default/"+splitted.join(".")+".xet"+(cache_buster?"?download="+cache_buster:"")}return-1==url.indexOf("?")&&(url+="?download="+(new Date).valueOf()),void((this.options.url||splitted.length)&&et2_loadXMLFromURL(url,function(_xmldoc){for(var i=0;i<_xmldoc.childNodes.length;i++){var template=_xmldoc.childNodes[i];"template"==template.nodeName.toLowerCase()&&(templates[template.getAttribute("id")]=template)}"undefined"!=typeof templates[template_name]&&this.loadFromXML(templates[template_name]),this.loading.resolve()},this))}}null!==xml&&"undefined"!=typeof xml?(this.egw().debug("log","Loading template from XML: ",template_name),this.loadFromXML(xml),this.loading.resolve()):(this.egw().debug("warn","Unable to find XML for ",template_name),this.loading.reject())}else this.loading.resolve()},checkCreateNamespace:function(){if(this.content){var old_id=this.id;this.id=this.content,this._super.apply(this,arguments),this.id=old_id}},getDOMNode:function(){return this.div},doLoadingFinished:function(){return this._super.apply(this,arguments),this.loading.done(jQuery.proxy(function(){$j(this).trigger("load")},this.div)),this.loading.promise()}})}.call(this);et2_register_widget(et2_template,["template"]);var et2_grid=function(){"use strict";return et2_DOMWidget.extend([et2_IDetachedDOM,et2_IAligned,et2_IResizeable],{createNamespace:!0,attributes:{border:{ignore:!0},align:{name:"Align",type:"string",default:"left",description:"Position of this element in the parent hbox"},spacing:{ignore:!0},padding:{ignore:!0},sortable:{name:"Sortable callback",type:"string",default:et2_no_init,description:"PHP function called when user sorts the grid. Setting this enables sorting the grid rows. The callback will be passed the ID of the grid and the new order of the rows."}},init:function(){this.table=$j(document.createElement("table")).addClass("et2_grid"),this.thead=$j(document.createElement("thead")).appendTo(this.table),this.tfoot=$j(document.createElement("tfoot")).appendTo(this.table),this.tbody=$j(document.createElement("tbody")).appendTo(this.table),this._super.apply(this,arguments),this.rowCount=0,this.columnCount=0,this.cells=[],this.rowData=[],this.colData=[],this.managementArray=[],this.template_node=null,this.wrapper=null},destroy:function(){this._super.call(this,arguments)},_initCells:function(_colData,_rowData){for(var w=_colData.length,h=_rowData.length,cells=new Array(h),y=0;h>y;y++){cells[y]=new Array(w);for(var x=0;w>x;x++)cells[y][x]={td:null,widget:null,colData:_colData[x],rowData:_rowData[y],disabled:_colData[x].disabled||_rowData[y].disabled,class:_colData[x].class,colSpan:1,autoColSpan:!1,rowSpan:1,autoRowSpan:!1,width:_colData[x].width,x:x,y:y}}return cells},_getColDataEntry:function(){return{width:"auto",class:"",align:"",span:"1",disabled:!1}},_getRowDataEntry:function(){return{height:"auto",class:"",valign:"top",span:"1",disabled:!1}},_getCell:function(_cells,_x,_y){if(_y>=0&&_y<_cells.length){var row=_cells[_y];if(_x>=0&&_x0||value.indexOf("$")>0){var ident=content.expandName(value);for("@"!=value[0]&&(ident=content.getEntry(ident,!1,!0));null!=ident&&1e3>rowIndex;)rowData[rowIndex]=jQuery.extend({},rowDataEntry),content.perspectiveData.row=++rowIndex,ident=content.expandName(value),"@"!=value[0]&&(ident=content.getEntry(ident,!1,!0));return void(rowIndex>=1e3&&egw.debug("error","Problem in autorepeat fallback: too many rows for '%s'. Use a nextmatch, or start debugging.",value))}}};et2_filteredNodeIterator(this.lastRowNode,check,this),cont=!1,content.perspectiveData=currentPerspective}rowIndex<=rowData.length-1&&(this.lastRowNode=null)},_fillCells:function(cells,columns,rows){var h=cells.length,w=h>0?cells[0].length:0,currentPerspective=jQuery.extend({},this.getArrayMgr("content").perspectiveData),x=0;et2_filteredNodeIterator(columns,function(node,nodeName){function _readColNode(node,nodeName){if(y>=h)return void this.egw().debug("warn","Skipped grid cell in column, '"+nodeName+"'");var cell=this._getCell(cells,x,y);node.getAttribute("span")?cell.rowSpan=node.getAttribute("span"):(cell.rowSpan=cell.colData.span,cell.autoRowSpan=!0),"all"==cell.rowSpan&&(cell.rowSpan=cells.length);for(var span=cell.rowSpan=this._forceNumber(cell.rowSpan),widget=this.createElementFromNode(node,nodeName),i=0;span>i&&y=w)return void("description"!=nodeName&&this.egw().debug("warn","Skipped grid cell in row, '"+nodeName+"'"));var cell=this._getCell(cells,x,y);node.getAttribute("span")?cell.colSpan=node.getAttribute("span"):(cell.colSpan=cell.rowData.span,cell.autoColSpan=!0),"all"==cell.colSpan&&(cell.colSpan=cells[y].length);var span=cell.colSpan=this._forceNumber(cell.colSpan);if(node.getAttribute("align")&&(cell.align=node.getAttribute("align")),"nextmatch-"==nodeName.substr(0,10)&&(cell.nm_id=node.getAttribute("id")),node.getAttribute("class")&&(cell.class+=(cell.class?" ":"")+node.getAttribute("class")),!cell.disabled){if(!nm){var mgrs=this.getArrayMgrs();for(var name in mgrs)this.getArrayMgr(name).perspectiveData.row=y;this._getCell(cells,x,y).rowData.id&&(this._getCell(cells,x,y).rowData.id=this.getArrayMgr("content").expandName(this._getCell(cells,x,y).rowData.id)),this._getCell(cells,x,y).rowData.class&&(this._getCell(cells,x,y).rowData.class=this.getArrayMgr("content").expandName(this._getCell(cells,x,y).rowData.class))}var widget=this.createElementFromNode(node,nodeName)}for(var i=0;span>i&&xy;y++){var x=0;et2_filteredNodeIterator(this.lastRowNode,readRowNode,this)}for(var name in this.getArrayMgrs())this.getArrayMgr(name).perspectiveData=currentPerspective},_expandLastCells:function(_cells){for(var h=_cells.length,w=h>0?_cells[0].length:0,y=0;h>y;y++)for(var x=w-1;x>=0;x--){var cell=_cells[y][x];if(null!=cell.widget){cell.autoColSpan&&(cell.colSpan=w-x);break}}for(var x=0;w>x;x++)for(var y=h-1;y>=0;y--){var cell=_cells[y][x];if(null!=cell.widget){cell.autoRowSpan&&(cell.rowSpan=h-y);break}}},loadFromXML:function(_node){this.template_node=_node;var rowsElems=et2_directChildrenByTagName(_node,"rows"),columnsElems=et2_directChildrenByTagName(_node,"columns");if(1!=rowsElems.length||1!=columnsElems.length)throw"Error while parsing grid, none or multiple rows or columns tags!";var columns=columnsElems[0],rows=rowsElems[0],colData=[],rowData=[];this._fetchRowColData(columns,rows,colData,rowData);var cells=this._initCells(colData,rowData);this._fillCells(cells,columns,rows),this._expandLastCells(cells),this.createTableFromCells(cells,colData,rowData)},createTableFromCells:function(_cells,_colData,_rowData){this.managementArray=[],this.cells=_cells,this.colData=_colData,this.rowData=_rowData;for(var h=this.rowCount=_cells.length,w=this.columnCount=h>0?_cells[0].length:0,y=0;h>y;y++){var parent=(_cells[y],this.tbody);switch(this.rowData[y].part){case"header":this.tbody.children().length||this.tfoot.children().length||(parent=this.thead);break;case"footer":this.tbody.children().length||(parent=this.tfoot)}var tr=$j(document.createElement("tr")).appendTo(parent).addClass(this.rowData[y].class);this.rowData[y].disabled&&tr.hide(),"auto"!=this.rowData[y].height&&tr.height(this.rowData[y].height),this.rowData[y].valign&&tr.attr("valign",this.rowData[y].valign),this.rowData[y].id&&tr.attr("id",this.rowData[y].id);for(var x=0;w>x;){var cell=this._getCell(_cells,x,y);if(null==cell.td&&null!=cell.widget){var td=$j(document.createElement("td")).appendTo(tr).addClass(cell.class);cell.disabled&&(td.hide(),cell.widget.options=cell.disabled),"auto"!=cell.width&&td.width(cell.width),cell.align&&td.attr("align",cell.align),this.managementArray.push({cell:td[0],widget:cell.widget,disabled:cell.disabled});var cs=x==w-1?w-x:Math.min(w-x,cell.colSpan),rs=y==h-1?h-y:Math.min(h-y,cell.rowSpan);cs>1&&td.attr("colspan",cs),rs>1&&td.attr("rowspan",rs);for(var sx=x;x+cs>sx;sx++)for(var sy=y;y+rs>sy;sy++)this._getCell(_cells,sx,sy).td=td;x+=cell.colSpan}else x++}}},getDOMNode:function(_sender){if(_sender==this||"undefined"==typeof _sender)return null!=this.wrapper?this.wrapper[0]:this.table[0];for(var i=0;i').parent(),this.height&&wrapper.css("height",this.height)),wrapper.css("overflow",_value),!wrapper.length||_value&&null!=_value&&"visible"!==_value||this.table.unwrap()},set_align:function(_value){this.align=_value},get_align:function(_value){return this.align},set_value:function(_value){for(var i=0;i=0;i--)this._children[i].free();for(var key in this._mgrs)this._mgrs[key]&&this._mgrs[key].owner==this&&this._mgrs[key].free()}})}.call(this),et2_placeholder=function(){"use strict";return et2_baseWidget.extend([et2_IDetachedDOM],{init:function(){this._super.apply(this,arguments),this.attrNodes={},this.visible=!1,this.placeDiv=$j(document.createElement("span")).addClass("et2_placeholder");var headerNode=$j(document.createElement("span")).text(this._type||"").addClass("et2_caption").appendTo(this.placeDiv),attrsCntr=$j(document.createElement("span")).appendTo(this.placeDiv).hide();headerNode.click(this,function(e){e.data.visible=!e.data.visible,e.data.visible?attrsCntr.show():attrsCntr.hide()});for(var key in this.options)"undefined"!=typeof this.options[key]&&("undefined"==typeof this.attrNodes[key]&&(this.attrNodes[key]=$j(document.createElement("span")).addClass("et2_attr"),attrsCntr.append(this.attrNodes[key])),this.attrNodes[key].text(key+"="+this.options[key]));this.setDOMNode(this.placeDiv[0])},getDetachedAttributes:function(_attrs){_attrs.push("value")},getDetachedNodes:function(){return[this.placeDiv[0]]},setDetachedAttributes:function(_nodes,_values){this.placeDiv=jQuery(_nodes[0])}})}.call(this),et2_box=function(){"use strict";return et2_baseWidget.extend([et2_IDetachedDOM],{attributes:{rows:{ignore:!0},cols:{ignore:!0}},createNamespace:!0,init:function(){this._super.apply(this,arguments),this.div=$j(document.createElement("div")).addClass("et2_"+this._type).addClass("et2_box_widget"),this.setDOMNode(this.div[0])},loadFromXML:function(_node){if("box"!=this._type)return this._super.apply(this,arguments);for(var childIndex=0,repeatNode=null,i=0;i<_node.childNodes.length;i++){var node=_node.childNodes[i],widgetType=node.nodeName.toLowerCase();if("#comment"!=widgetType)if("#text"!=widgetType){var id=et2_readAttrWithDefault(node,"id","");id.indexOf("$")<0||"box"!=widgetType?(this.createElementFromNode(node),childIndex++):repeatNode=node}else node.data.replace(/^\s+|\s+$/g,"")&&this.loadContent(node.data)}if(null!=repeatNode){var currentPerspective=this.getArrayMgr("content").perspectiveData;for(childIndex;"undefined"!=typeof this.getArrayMgr("content").data[childIndex]&&this.getArrayMgr("content").data[childIndex];childIndex++){var mgrs=this.getArrayMgrs();for(var name in mgrs)this.getArrayMgr(name).getEntry(childIndex)&&(this.getArrayMgr(name).perspectiveData.row=childIndex);this.createElementFromNode(repeatNode)}for(var name in this.getArrayMgrs())this.getArrayMgr(name).perspectiveData=currentPerspective}},getDetachedAttributes:function(_attrs){_attrs.push("data")},getDetachedNodes:function(){return[this.getDOMNode()]},setDetachedAttributes:function(_nodes,_values){if(_values.data)for(var pairs=_values.data.split(/,/g),i=0;iMath.min(pos,A._max,splitter._DA-bar._DA-B._min)?bar.addClass(opts.barDockedClass).css(opts.origin,range):bar.removeClass(opts.barDockedClass).css(opts.origin,limit),bar._DA=bar[0][opts.pxSplit]):resplit(pos),setBarState(pos==limit?opts.barActiveClass:opts.barLimitClass)}function endSplitMouse(evt){setBarState(opts.barNormalClass),bar.addClass(opts.barHoverClass);var pos=A._posSplit+evt[opts.eventPos];opts.outline&&(zombie.remove(),zombie=null,resplit(pos)),panes.css("-webkit-user-select","text").find("iframe").andSelf().filter("iframe").removeClass(opts.iframeClass),$(document).unbind("mousemove"+opts.eventNamespace+" mouseup"+opts.eventNamespace)}function resplit(pos){bar._DA=bar[0][opts.pxSplit],opts.dockPane==A&&posMath.min(pos,A._max,splitter._DA-bar._DA-B._min)?(bar.addClass(opts.barDockedClass),bar._DA=bar[0][opts.pxSplit],pos=opts.dockPane==A?0:splitter._DA-bar._DA,null==bar._pos&&(bar._pos=A[0][opts.pxSplit])):(bar.removeClass(opts.barDockedClass),bar._DA=bar[0][opts.pxSplit],bar._pos=null,pos=Math.max(A._min,splitter._DA-B._max,Math.min(pos,A._max,splitter._DA-bar._DA-B._min))),bar.css(opts.origin,pos).css(opts.fixed,splitter._DF),A.css(opts.origin,0).css(opts.split,pos).css(opts.fixed,splitter._DF),B.css(opts.origin,pos+bar._DA).css(opts.split,splitter._DA-bar._DA-pos).css(opts.fixed,splitter._DF),panes.trigger("resize"+opts.eventNamespace)}function dimSum(jq,dims){for(var sum=0,i=1;i*",splitter[0]).addClass(opts.paneClass).css({position:"absolute","z-index":"1","-moz-outline-style":"none"}),A=$(panes[0]),B=$(panes[1]);opts.dockPane=opts.dock&&(/right|bottom/.test(opts.dock)?B:A);var focuser=$('').attr({accessKey:opts.accessKey,tabIndex:opts.tabIndex,title:opts.splitbarClass}).bind("focus"+opts.eventNamespace,function(){this.focus(),bar.addClass(opts.barActiveClass)}).bind("keydown"+opts.eventNamespace,function(e){var key=e.which||e.keyCode,dir=key==opts["key"+opts.side1]?1:key==opts["key"+opts.side2]?-1:0;dir&&resplit(A[0][opts.pxSplit]+dir*opts.pxPerKey,!1)}).bind("blur"+opts.eventNamespace,function(){bar.removeClass(opts.barActiveClass)}),bar=$("
    ").insertAfter(A).addClass(opts.barClass).addClass(opts.barStateClass).append(focuser).attr({unselectable:"on"}).css({position:"absolute","user-select":"none","-webkit-user-select":"none","-khtml-user-select":"none","-moz-user-select":"none","z-index":"100"}).bind("mousedown"+opts.eventNamespace,startSplitMouse).bind("mouseover"+opts.eventNamespace,function(){$(this).addClass(opts.barHoverClass)}).bind("mouseout"+opts.eventNamespace,function(){$(this).removeClass(opts.barHoverClass)});/^(auto|default|)$/.test(bar.css("cursor"))&&bar.css("cursor",opts.cursor),bar._DA=bar[0][opts.pxSplit],splitter._PBF=dimSum(splitter,"border"+opts.side3+"Width","border"+opts.side4+"Width"),splitter._PBA=dimSum(splitter,"border"+opts.side1+"Width","border"+opts.side2+"Width"),A._pane=opts.side1,B._pane=opts.side2,$.each([A,B],function(){this._splitter_style=this.style,this._min=opts["min"+this._pane]||dimSum(this,"min-"+opts.split),this._max=opts["max"+this._pane]||dimSum(this,"max-"+opts.split)||9999,this._init=opts["size"+this._pane]===!0?parseInt($.curCSS(this[0],opts.split),10):opts["size"+this._pane]});var initPos=A._init;isNaN(B._init)||(initPos=splitter[0][opts.pxSplit]-splitter._PBA-B._init-bar._DA),opts.cookie&&($.cookie||alert("jQuery.splitter(): jQuery cookie plugin required"),initPos=parseInt($.cookie(opts.cookie),10),$(window).bind("unload"+opts.eventNamespace,function(){var state=String(bar.css(opts.origin));$.cookie(opts.cookie,state,{expires:opts.cookieExpires||365,path:opts.cookiePath||document.location.pathname})})),isNaN(initPos)&&(initPos=Math.round((splitter[0][opts.pxSplit]-splitter._PBA-bar._DA)/2)),opts.anchorToWindow&&(opts.resizeTo=window),opts.resizeTo?(splitter._hadjust=dimSum(splitter,"borderTopWidth","borderBottomWidth","marginBottom"),splitter._hmin=Math.max(dimSum(splitter,"minHeight"),20),$(window).bind("resize"+opts.eventNamespace,function(){var top=splitter.offset().top,eh=$(opts.resizeTo).height();splitter.css("height",Math.max(eh-top-splitter._hadjust,splitter._hmin)+"px"),splitter.trigger("resize")}).trigger("resize"+opts.eventNamespace)):opts.resizeToWidth&&$(window).bind("resize"+opts.eventNamespace,function(){splitter.trigger("resize")}),opts.dock&&(splitter.bind("toggleDock"+opts.eventNamespace,function(){var pw=opts.dockPane[0][opts.pxSplit];splitter.trigger(pw?"dock":"undock")}).bind("dock"+opts.eventNamespace,function(){var pw=A[0][opts.pxSplit];if(pw&&!bar.hasClass("splitter-bar-horizontal-docked")&&!bar.hasClass("splitter-bar-vertical-docked")){bar._pos=pw;var x={};x[opts.origin]=opts.dockPane==A?0:splitter[0][opts.pxSplit]-splitter._PBA-bar[0][opts.pxSplit],bar.animate(x,opts.dockSpeed||1,opts.dockEasing,function(){bar.addClass(opts.barDockedClass),resplit(x[opts.origin]+1)})}}).bind("undock"+opts.eventNamespace,function(){var pw=opts.dockPane[0][opts.pxSplit];if(!pw){(null==bar._pos||Math.abs(bar._pos-splitter._DA-bar._DA)<20)&&(bar._pos=splitter._DA/2);var x={};x[opts.origin]=bar._pos+"px",bar.removeClass(opts.barDockedClass).animate(x,opts.undockSpeed||opts.dockSpeed||1,opts.undockEasing||opts.dockEasing,function(){resplit(bar._pos),bar._pos=null})}}),opts.dockKey&&$('').attr({accessKey:opts.dockKey,tabIndex:-1}).appendTo(bar).bind("focus",function(){splitter.trigger("toggleDock"),this.blur()}),bar.bind("dblclick",function(){splitter.trigger("toggleDock")})),splitter.bind("destroy"+opts.eventNamespace,function(){$([window,document]).unbind(opts.eventNamespace),bar.unbind().remove(),panes.removeClass(opts.paneClass),splitter.removeClass(opts.splitterClass).add(panes).unbind(opts.eventNamespace).attr("style",function(el){return this._splitter_style||""}),splitter=bar=focuser=panes=A=B=opts=args=null}).bind("resize"+opts.eventNamespace,function(e,size){e.target==this&&(splitter._DF=splitter[0][opts.pxFixed]-splitter._PBF,splitter._DA=splitter[0][opts.pxSplit]-splitter._PBA,splitter._DF<=0||splitter._DA<=0||(resplit(isNaN(size)?opts.sizeRight||opts.sizeBottom?splitter._DA-B[0][opts.pxSplit]-bar._DA:A[0][opts.pxSplit]:size),setBarState(opts.barNormalClass)))}).trigger("resize",[initPos])}})}}(jQuery);var et2_split=function(){"use strict";return et2_DOMWidget.extend([et2_IResizeable,et2_IPrint],{attributes:{orientation:{name:"Orientation",description:"Horizontal or vertical (v or h)",default:"v",type:"string"},outline:{name:"Outline",description:"Use a 'ghosted' copy of the splitbar and does not resize the panes until the mouse button is released. Reduces flickering or unwanted re-layout during resize",default:!1,type:"boolean"},dock_side:{name:"Dock",description:"Allow the user to 'Dock' the splitbar to one side of the splitter, essentially hiding one pane and using the entire splitter area for the other pane. One of leftDock, rightDock, topDock, bottomDock.",default:et2_no_init,type:"string"},width:{default:"100%"},overflow:{ignore:!0},no_lang:{ignore:!0},rows:{ignore:!0},cols:{ignore:!0}},DOCK_TOLERANCE:15,init:function(){this._super.apply(this,arguments),this.div=$j(document.createElement("div")).addClass("et2_split"),this.dynheight=new et2_dynheight(this.getParent().getDOMNode()||this.getInstanceManager().DOMContainer,this.div,100),this.left=$j("
    Top / Left
    ").appendTo(this.div),this.right=$j("
    Bottom / Right
    ").appendTo(this.div),this.loading=jQuery.Deferred(),this.stop_resize=!1},destroy:function(){this.left.next().off("mouseup"),this.div.trigger("destroy"),this.dynheight.free(),this._super.apply(this,arguments),0==this._children.length&&this.div.empty(),this.div.remove()},loadFromXML:function(){this._super.apply(this,arguments),this._children.length>0&&(this._children[0]&&(this.left.detach(),this.left=$j(this._children[0].getDOMNode(this._children[0])).appendTo(this.div)),this._children[1]&&(this.right.detach(),this.right=$j(this._children[1].getDOMNode(this._children[1])).appendTo(this.div)));for(var i=0;i activates widget"},tabindex:{name:"Tab index",type:"integer",default:et2_no_init,description:"Specifies the tab order of a widget when the 'tab' button is used for navigating."},background_image:{name:"Add image in front of text",type:"boolean",description:"Adds image in front of text instead of just using an image with text as tooltip",default:et2_no_init},novalidate:{name:"Do NOT validate form",type:"boolean",description:"Do NOT validate form before submitting it",default:!1},needed:{ignore:!0}},legacyOptions:["image","ro_image"],init:function(){return this._super.apply(this,arguments),this.label="",this.clicked=!1,this.btn=null,this.image=null,this.options.background_image||!this.options.image&&!this.options.ro_image?(this.options.readonly||(this.btn=$j(document.createElement("button")).addClass("et2_button").attr({type:"button"}),this.setDOMNode(this.btn[0])),void(this.options.image&&this.set_image(this.options.image))):(this.image=jQuery(document.createElement("img")).addClass("et2_button et2_button_icon"),void this.setDOMNode(this.image[0]))},transformAttributes:function(_attrs){if(this.id&&"undefined"==typeof _attrs.background_image&&!_attrs.image)for(var image in et2_button.default_background_images)if(this.id.match(et2_button.default_background_images[image])){_attrs.image=image,_attrs.background_image=!0;break}for(var name in et2_button.default_classes)if(this.id.match(et2_button.default_classes[name])){_attrs.class=("undefined"==typeof _attrs.class?"":_attrs.class+" ")+name;break}this._super.apply(this,arguments)},set_accesskey:function(key){jQuery(this.node).attr("accesskey",key)},set_image:function(_image){this.options.image=_image,this.update_image()},set_ro_image:function(_image){this.options.ro_image=_image,this.update_image()},update_image:function(_image){if(this.isInTree()&&(this.options.background_image||null!=this.image)){"undefined"==typeof _image&&(_image=this.options.readonly?this.options.ro_image:this.options.image),_image.match(/^[0-9]+\%$/)&&(_image="");var found_image=!1;if(""!=_image){var src=this.egw().image(_image);src?found_image=!0:"/"!=_image[0]&&"http"!=_image.substr(0,4)||(src=image,found_image=!0),found_image&&(null!=this.image?this.image.attr("src",src):this.options.background_image&&(this.btn.css("background-image","url("+src+")"),this.btn.addClass("et2_button_with_image")))}found_image||(this.set_label(this.label),this.btn&&(this.btn.css("background-image",""),this.btn.removeClass("et2_button_with_image")))}},set_readonly:function(_ro){_ro!=this.options.readonly&&(this.options.readonly=_ro,this.image&&this.update_image(),(this.btn||this.image)&&(this.btn||this.image).toggleClass("et2_clickable",!_ro).toggleClass("et2_button_ro",_ro).css("cursor",_ro?"default":"pointer"))},attachToDOM:function(){this._super.apply(this,arguments),this.options.readonly&&(this.btn||this.image)&&(this.btn||this.image).removeClass("et2_clickable").addClass("et2_button_ro").css("cursor","default")},getDOMNode:function(){return this.btn?this.btn[0]:this.image?this.image[0]:null},click:function(_ev){return this.options.readonly?!1:(this.clicked=!0,this._super.apply(this,arguments)?("buttononly"!=this._type&&this.getInstanceManager().submit(this,!1,this.options.novalidate),this.clicked=!1,!0):(this.clicked=!1,!1))},set_label:function(_value){this.btn&&(this.label=_value,this.btn.text(_value),_value&&!this.image?this.btn.addClass("et2_button_text"):this.btn.removeClass("et2_button_text")),this.image&&(this.image.attr("alt",_value),this.options.statustext||this.image.attr("title",_value))},set_tabindex:function(index){jQuery(this.btn).attr("tabindex",index)},isDirty:function(){return!1},resetDirty:function(){},getValue:function(){return this.clicked?!0:null},isValid:function(){return!0},getDetachedAttributes:function(_attrs){_attrs.push("label","value","class","image","ro_image","onclick","background_image")},getDetachedNodes:function(){return[null!=this.btn?this.btn[0]:null,null!=this.image?this.image[0]:null]},setDetachedAttributes:function(_nodes,_values){this.btn="#"!=_nodes[0].nodeName[0]?jQuery(_nodes[0]):null,this.image=jQuery(_nodes[1]),"undefined"!=typeof _values.id&&this.set_id(_values.id),"undefined"!=typeof _values.label&&this.set_label(_values.label),"undefined"!=typeof _values.value,"undefined"!=typeof _values.image&&this.set_image(_values.image),"undefined"!=typeof _values.ro_image&&this.set_ro_image(_values.ro_image),"undefined"!=typeof _values.class&&this.set_class(_values.class),"undefined"!=typeof _values.onclick&&(this.options.onclick=_values.onclick);var type=this._type,attrs=jQuery.extend(_values,this.options),parent=this._parent;jQuery(this.getDOMNode()).bind("click.et2_baseWidget",this,function(e){var widget=et2_createWidget(type,attrs,parent);return e.data=widget,e.data.set_id(_values.id),e.data.click.call(e.data,e)})}})}.call(this);et2_register_widget(et2_button,["button","buttononly"]),jQuery.extend(et2_button,{default_background_images:{save:/save(&|\]|$)/,apply:/apply(&|\]|$)/,cancel:/cancel(&|\]|$)/,delete:/delete(&|\]|$)/,edit:/edit(&|\[\]|$)/,next:/(next|continue)(&|\]|$)/,finish:/finish(&|\]|$)/,back:/(back|previous)(&|\]|$)/,copy:/copy(&|\]|$)/,more:/more(&|\]|$)/,check:/(yes|check)(&|\]|$)/,cancelled:/no(&|\]|$)/,ok:/ok(&|\]|$)/,close:/close(&|\]|$)/,add:/(add(&|\]|$)|create)/},default_classes:{et2_button_cancel:/cancel(&|\]|$)/,et2_button_question:/(yes|no)(&|\]|$)/,et2_button_delete:/delete(&|\]|$)/}});var et2_valueWidget=function(){"use strict";return et2_baseWidget.extend({attributes:{label:{name:"Label",default:"",type:"string",description:"The label is displayed by default in front (for radiobuttons behind) each widget (if not empty). If you want to specify a different position, use a '%s' in the label, which gets replaced by the widget itself. Eg. '%s Name' to have the label Name behind a checkbox. The label can contain variables, as descript for name. If the label starts with a '@' it is replaced by the value of the content-array at this index (with the '@'-removed and after expanding the variables).",translate:!0},value:{name:"Value",description:"The value of the widget",type:"rawstring",default:et2_no_init}},transformAttributes:function(_attrs){if(this._super.apply(this,arguments),this.id){var contentMgr=this.getArrayMgr("content");if(null!=contentMgr){var val=contentMgr.getEntry(this.id,!1,!0);null!==val&&(_attrs.value=val)}this.createNamespace&&this.getArrayMgr("content").perspectiveData.owner==this&&(_attrs.value=this.getArrayMgr("content").data)}},set_label:function(_value){if(_value!=this.label){if(_value){null==this._labelContainer&&(this._labelContainer=$j(document.createElement("label")).addClass("et2_label"),this.getSurroundings().insertDOMNode(this._labelContainer[0])),this._labelContainer.empty();var ph=document.createElement("span");this.getSurroundings().setWidgetPlaceholder(ph);for(var parts=et2_csvSplit(_value,2,"%s"),i=0;ilocX?locX=0:locX>barW&&(locX=barW),0>locY?locY=0:locY>barH&&(locY=barH),val.call($this,"xy",{x:locX/barW*rangeX+minX,y:locY/barH*rangeY+minY})},draw=function(){var arrowOffsetX=0,arrowOffsetY=0,barW=bar.w,barH=bar.h,arrowW=arrow.w,arrowH=arrow.h;setTimeout(function(){rangeX>0&&(arrowOffsetX=x==maxX?barW:x/rangeX*barW|0),rangeY>0&&(arrowOffsetY=y==maxY?barH:y/rangeY*barH|0),arrowW>=barW?arrowOffsetX=(barW>>1)-(arrowW>>1):arrowOffsetX-=arrowW>>1,arrowH>=barH?arrowOffsetY=(barH>>1)-(arrowH>>1):arrowOffsetY-=arrowH>>1,arrow.css({left:arrowOffsetX+"px",top:arrowOffsetY+"px"})},0)},val=function(name,value,context){var set=void 0!==value;if(!set)switch(void 0!==name&&null!=name||(name="xy"),name.toLowerCase()){case"x":return x;case"y":return y;case"xy":default:return{x:x,y:y}}if(null==context||context!=$this){var newX,newY,changed=!1;switch(null==name&&(name="xy"),name.toLowerCase()){case"x":newX=value&&(value.x&&0|value.x||0|value)||0;break;case"y":newY=value&&(value.y&&0|value.y||0|value)||0;break;case"xy":default:newX=value&&value.x&&0|value.x||0,newY=value&&value.y&&0|value.y||0}null!=newX&&(minX>newX?newX=minX:newX>maxX&&(newX=maxX),x!=newX&&(x=newX,changed=!0)),null!=newY&&(minY>newY?newY=minY:newY>maxY&&(newY=maxY),y!=newY&&(y=newY,changed=!0)),changed&&fireChangeEvents.call($this,context||$this)}},range=function(name,value){var set=void 0!==value;if(!set)switch(void 0!==name&&null!=name||(name="all"),name.toLowerCase()){case"minx":return minX;case"maxx":return maxX;case"rangex":return{minX:minX,maxX:maxX,rangeX:rangeX};case"miny":return minY;case"maxy":return maxY;case"rangey":return{minY:minY,maxY:maxY,rangeY:rangeY};case"all":default:return{minX:minX,maxX:maxX,rangeX:rangeX,minY:minY,maxY:maxY,rangeY:rangeY}}var newMinX,newMaxX,newMinY,newMaxY;switch(null==name&&(name="all"),name.toLowerCase()){case"minx":newMinX=value&&(value.minX&&0|value.minX||0|value)||0;break;case"maxx":newMaxX=value&&(value.maxX&&0|value.maxX||0|value)||0;break;case"rangex":newMinX=value&&value.minX&&0|value.minX||0,newMaxX=value&&value.maxX&&0|value.maxX||0;break;case"miny":newMinY=value&&(value.minY&&0|value.minY||0|value)||0;break;case"maxy":newMaxY=value&&(value.maxY&&0|value.maxY||0|value)||0;break;case"rangey":newMinY=value&&value.minY&&0|value.minY||0,newMaxY=value&&value.maxY&&0|value.maxY||0;break;case"all":default:newMinX=value&&value.minX&&0|value.minX||0,newMaxX=value&&value.maxX&&0|value.maxX||0,newMinY=value&&value.minY&&0|value.minY||0,newMaxY=value&&value.maxY&&0|value.maxY||0}null!=newMinX&&minX!=newMinX&&(minX=newMinX,rangeX=maxX-minX),null!=newMaxX&&maxX!=newMaxX&&(maxX=newMaxX,rangeX=maxX-minX),null!=newMinY&&minY!=newMinY&&(minY=newMinY,rangeY=maxY-minY),null!=newMaxY&&maxY!=newMaxY&&(maxY=newMaxY,rangeY=maxY-minY)},bind=function(callback){$.isFunction(callback)&&changeEvents.push(callback)},unbind=function(callback){if($.isFunction(callback))for(var i;-1!=(i=$.inArray(callback,changeEvents));)changeEvents.splice(i,1)},destroy=function(){$(document).unbind("mouseup",mouseUp).unbind("mousemove",mouseMove),bar.unbind("mousedown",mouseDown),bar=null,arrow=null,changeEvents=null};$.extend(!0,$this,{val:val,range:range,bind:bind,unbind:unbind,destroy:destroy}),arrow.src=options.arrow&&options.arrow.image,arrow.w=options.arrow&&options.arrow.width||arrow.width(),arrow.h=options.arrow&&options.arrow.height||arrow.height(),bar.w=options.map&&options.map.width||bar.width(),bar.h=options.map&&options.map.height||bar.height(),bar.bind("mousedown",mouseDown),bind.call($this,draw)},ColorValuePicker=function(picker,color,bindedHex,alphaPrecision){var $this=this,inputs=picker.find("td.Text input"),red=inputs.eq(3),green=inputs.eq(4),blue=inputs.eq(5),alpha=inputs.length>7?inputs.eq(6):null,hue=inputs.eq(0),saturation=inputs.eq(1),value=inputs.eq(2),hex=inputs.eq(inputs.length>7?7:6),ahex=inputs.length>7?inputs.eq(8):null,keyDown=function(e){ -if(""!=e.target.value||e.target==hex.get(0)||(null==bindedHex||e.target==bindedHex.get(0))&&null!=bindedHex){if(!validateKey(e))return e;switch(e.target){case red.get(0):switch(e.keyCode){case 38:return red.val(setValueInRange.call($this,(red.val()<<0)+1,0,255)),color.val("r",red.val(),e.target),!1;case 40:return red.val(setValueInRange.call($this,(red.val()<<0)-1,0,255)),color.val("r",red.val(),e.target),!1}break;case green.get(0):switch(e.keyCode){case 38:return green.val(setValueInRange.call($this,(green.val()<<0)+1,0,255)),color.val("g",green.val(),e.target),!1;case 40:return green.val(setValueInRange.call($this,(green.val()<<0)-1,0,255)),color.val("g",green.val(),e.target),!1}break;case blue.get(0):switch(e.keyCode){case 38:return blue.val(setValueInRange.call($this,(blue.val()<<0)+1,0,255)),color.val("b",blue.val(),e.target),!1;case 40:return blue.val(setValueInRange.call($this,(blue.val()<<0)-1,0,255)),color.val("b",blue.val(),e.target),!1}break;case alpha&&alpha.get(0):switch(e.keyCode){case 38:return alpha.val(setValueInRange.call($this,parseFloat(alpha.val())+1,0,100)),color.val("a",Math.precision(255*alpha.val()/100,alphaPrecision),e.target),!1;case 40:return alpha.val(setValueInRange.call($this,parseFloat(alpha.val())-1,0,100)),color.val("a",Math.precision(255*alpha.val()/100,alphaPrecision),e.target),!1}break;case hue.get(0):switch(e.keyCode){case 38:return hue.val(setValueInRange.call($this,(hue.val()<<0)+1,0,360)),color.val("h",hue.val(),e.target),!1;case 40:return hue.val(setValueInRange.call($this,(hue.val()<<0)-1,0,360)),color.val("h",hue.val(),e.target),!1}break;case saturation.get(0):switch(e.keyCode){case 38:return saturation.val(setValueInRange.call($this,(saturation.val()<<0)+1,0,100)),color.val("s",saturation.val(),e.target),!1;case 40:return saturation.val(setValueInRange.call($this,(saturation.val()<<0)-1,0,100)),color.val("s",saturation.val(),e.target),!1}break;case value.get(0):switch(e.keyCode){case 38:return value.val(setValueInRange.call($this,(value.val()<<0)+1,0,100)),color.val("v",value.val(),e.target),!1;case 40:return value.val(setValueInRange.call($this,(value.val()<<0)-1,0,100)),color.val("v",value.val(),e.target),!1}}}},keyUp=function(e){if(""!=e.target.value||e.target==hex.get(0)||(null==bindedHex||e.target==bindedHex.get(0))&&null!=bindedHex){if(!validateKey(e))return e;switch(e.target){case red.get(0):red.val(setValueInRange.call($this,red.val(),0,255)),color.val("r",red.val(),e.target);break;case green.get(0):green.val(setValueInRange.call($this,green.val(),0,255)),color.val("g",green.val(),e.target);break;case blue.get(0):blue.val(setValueInRange.call($this,blue.val(),0,255)),color.val("b",blue.val(),e.target);break;case alpha&&alpha.get(0):alpha.val(setValueInRange.call($this,alpha.val(),0,100)),color.val("a",Math.precision(255*alpha.val()/100,alphaPrecision),e.target);break;case hue.get(0):hue.val(setValueInRange.call($this,hue.val(),0,360)),color.val("h",hue.val(),e.target);break;case saturation.get(0):saturation.val(setValueInRange.call($this,saturation.val(),0,100)),color.val("s",saturation.val(),e.target);break;case value.get(0):value.val(setValueInRange.call($this,value.val(),0,100)),color.val("v",value.val(),e.target);break;case hex.get(0):hex.val(hex.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,6)),bindedHex&&bindedHex.val(hex.val()),color.val("hex",""!=hex.val()?hex.val():null,e.target);break;case bindedHex&&bindedHex.get(0):bindedHex.val(bindedHex.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,6)),hex.val(bindedHex.val()),color.val("hex",""!=bindedHex.val()?bindedHex.val():null,e.target);break;case ahex&&ahex.get(0):ahex.val(ahex.val().replace(/[^a-fA-F0-9]/g,"").toLowerCase().substring(0,2)),color.val("a",null!=ahex.val()?parseInt(ahex.val(),16):null,e.target)}}},blur=function(e){if(null!=color.val())switch(e.target){case red.get(0):red.val(color.val("r"));break;case green.get(0):green.val(color.val("g"));break;case blue.get(0):blue.val(color.val("b"));break;case alpha&&alpha.get(0):alpha.val(Math.precision(100*color.val("a")/255,alphaPrecision));break;case hue.get(0):hue.val(color.val("h"));break;case saturation.get(0):saturation.val(color.val("s"));break;case value.get(0):value.val(color.val("v"));break;case hex.get(0):case bindedHex&&bindedHex.get(0):hex.val(color.val("hex")),bindedHex&&bindedHex.val(color.val("hex"));break;case ahex&&ahex.get(0):ahex.val(color.val("ahex").substring(6))}},validateKey=function(e){switch(e.keyCode){case 9:case 16:case 29:case 37:case 39:return!1;case"c".charCodeAt():case"v".charCodeAt():if(e.ctrlKey)return!1}return!0},setValueInRange=function(value,min,max){return""==value||isNaN(value)?min:value>max?max:min>value?min:value},colorChanged=function(ui,context){var all=ui.val("all");context!=red.get(0)&&red.val(null!=all?all.r:""),context!=green.get(0)&&green.val(null!=all?all.g:""),context!=blue.get(0)&&blue.val(null!=all?all.b:""),alpha&&context!=alpha.get(0)&&alpha.val(null!=all?Math.precision(100*all.a/255,alphaPrecision):""),context!=hue.get(0)&&hue.val(null!=all?all.h:""),context!=saturation.get(0)&&saturation.val(null!=all?all.s:""),context!=value.get(0)&&value.val(null!=all?all.v:""),context!=hex.get(0)&&(bindedHex&&context!=bindedHex.get(0)||!bindedHex)&&hex.val(null!=all?all.hex:""),bindedHex&&context!=bindedHex.get(0)&&context!=hex.get(0)&&bindedHex.val(null!=all?all.hex:""),ahex&&context!=ahex.get(0)&&ahex.val(null!=all?all.ahex.substring(6):"")},destroy=function(){red.add(green).add(blue).add(alpha).add(hue).add(saturation).add(value).add(hex).add(bindedHex).add(ahex).unbind("keyup",keyUp).unbind("blur",blur),red.add(green).add(blue).add(alpha).add(hue).add(saturation).add(value).unbind("keydown",keyDown),color.unbind(colorChanged),red=null,green=null,blue=null,alpha=null,hue=null,saturation=null,value=null,hex=null,ahex=null};$.extend(!0,$this,{destroy:destroy}),red.add(green).add(blue).add(alpha).add(hue).add(saturation).add(value).add(hex).add(bindedHex).add(ahex).bind("keyup",keyUp).bind("blur",blur),red.add(green).add(blue).add(alpha).add(hue).add(saturation).add(value).bind("keydown",keyDown),color.bind(colorChanged)};$.jPicker={List:[],Color:function(init){var r,g,b,a,h,s,v,$this=this,changeEvents=new Array,fireChangeEvents=function(context){for(var i=0;i255&&(newV.r=255),r!=newV.r&&(r=newV.r,changed=!0);break;case"g":if(hsv)continue;rgb=!0,newV.g=value&&value.g&&0|value.g||value&&0|value||0,newV.g<0?newV.g=0:newV.g>255&&(newV.g=255),g!=newV.g&&(g=newV.g,changed=!0);break;case"b":if(hsv)continue;rgb=!0,newV.b=value&&value.b&&0|value.b||value&&0|value||0,newV.b<0?newV.b=0:newV.b>255&&(newV.b=255),b!=newV.b&&(b=newV.b,changed=!0);break;case"a":newV.a=value&&null!=value.a?0|value.a:null!=value?0|value:255,newV.a<0?newV.a=0:newV.a>255&&(newV.a=255),a!=newV.a&&(a=newV.a,changed=!0);break;case"h":if(rgb)continue;hsv=!0,newV.h=value&&value.h&&0|value.h||value&&0|value||0,newV.h<0?newV.h=0:newV.h>360&&(newV.h=360),h!=newV.h&&(h=newV.h,changed=!0);break;case"s":if(rgb)continue;hsv=!0,newV.s=value&&null!=value.s?0|value.s:null!=value?0|value:100,newV.s<0?newV.s=0:newV.s>100&&(newV.s=100),s!=newV.s&&(s=newV.s,changed=!0);break;case"v":if(rgb)continue;hsv=!0,newV.v=value&&null!=value.v?0|value.v:null!=value?0|value:100,newV.v<0?newV.v=0:newV.v>100&&(newV.v=100),v!=newV.v&&(v=newV.v,changed=!0)}if(changed){if(rgb){r=r||0,g=g||0,b=b||0;var ret=ColorMethods.rgbToHsv({r:r,g:g,b:b});h=ret.h,s=ret.s,v=ret.v}else if(hsv){h=h||0,s=null!=s?s:100,v=null!=v?v:100;var ret=ColorMethods.hsvToRgb({h:h,s:s,v:v});r=ret.r,g=ret.g,b=ret.b}a=null!=a?a:255,fireChangeEvents.call($this,context||$this)}}}},bind=function(callback){$.isFunction(callback)&&changeEvents.push(callback)},unbind=function(callback){if($.isFunction(callback))for(var i;-1!=(i=$.inArray(callback,changeEvents));)changeEvents.splice(i,1)},destroy=function(){changeEvents=null};$.extend(!0,$this,{val:val,bind:bind,unbind:unbind,destroy:destroy}),init&&(null!=init.ahex?val("ahex",init):null!=init.hex?val((null!=init.a?"a":"")+"hex",null!=init.a?{ahex:init.hex+ColorMethods.intToHex(init.a)}:init):null!=init.r&&null!=init.g&&null!=init.b?val("rgb"+(null!=init.a?"a":""),init):null!=init.h&&null!=init.s&&null!=init.v&&val("hsv"+(null!=init.a?"a":""),init))},ColorMethods:{hexToRgba:function(hex){if(hex=this.validateHex(hex),""==hex)return{r:null,g:null,b:null,a:null};var r="00",g="00",b="00",a="255";return 6==hex.length&&(hex+="ff"),hex.length>6?(r=hex.substring(0,2),g=hex.substring(2,4),b=hex.substring(4,6),a=hex.substring(6,hex.length)):(hex.length>4&&(r=hex.substring(4,hex.length),hex=hex.substring(0,4)),hex.length>2&&(g=hex.substring(2,hex.length),hex=hex.substring(0,2)),hex.length>0&&(b=hex.substring(0,hex.length))),{r:this.hexToInt(r),g:this.hexToInt(g),b:this.hexToInt(b),a:this.hexToInt(a)}},validateHex:function(hex){return hex=hex.toLowerCase().replace(/[^a-f0-9]/g,""),hex.length>8&&(hex=hex.substring(0,8)),hex},rgbaToHex:function(rgba){return this.intToHex(rgba.r)+this.intToHex(rgba.g)+this.intToHex(rgba.b)+this.intToHex(rgba.a)},intToHex:function(dec){var result=(0|dec).toString(16);return 1==result.length&&(result="0"+result),result.toLowerCase()},hexToInt:function(hex){return parseInt(hex,16)},rgbToHsv:function(rgb){var delta,r=rgb.r/255,g=rgb.g/255,b=rgb.b/255,hsv={h:0,s:0,v:0},min=0,max=0;return r>=g&&r>=b?(max=r,min=g>b?b:g):g>=b&&g>=r?(max=g,min=r>b?b:r):(max=b,min=g>r?r:g),hsv.v=max,hsv.s=max?(max-min)/max:0,hsv.s?(delta=max-min,r==max?hsv.h=(g-b)/delta:g==max?hsv.h=2+(b-r)/delta:hsv.h=4+(r-g)/delta,hsv.h=parseInt(60*hsv.h),hsv.h<0&&(hsv.h+=360)):hsv.h=0,hsv.s=100*hsv.s|0,hsv.v=100*hsv.v|0,hsv},hsvToRgb:function(hsv){var rgb={r:0,g:0,b:0,a:100},h=hsv.h,s=hsv.s,v=hsv.v;if(0==s)0==v?rgb.r=rgb.g=rgb.b=0:rgb.r=rgb.g=rgb.b=255*v/100|0;else{360==h&&(h=0),h/=60,s/=100,v/=100;var i=0|h,f=h-i,p=v*(1-s),q=v*(1-s*f),t=v*(1-s*(1-f));switch(i){case 0:rgb.r=v,rgb.g=t,rgb.b=p;break;case 1:rgb.r=q,rgb.g=v,rgb.b=p;break;case 2:rgb.r=p,rgb.g=v,rgb.b=t;break;case 3:rgb.r=p,rgb.g=q,rgb.b=v;break;case 4:rgb.r=t,rgb.g=p,rgb.b=v;break;case 5:rgb.r=v,rgb.g=p,rgb.b=q}rgb.r=255*rgb.r|0,rgb.g=255*rgb.g|0,rgb.b=255*rgb.b|0}return rgb}}};var Color=$.jPicker.Color,List=$.jPicker.List,ColorMethods=$.jPicker.ColorMethods;$.fn.jPicker=function(options){var $arguments=arguments;return this.each(function(){var $this=this,settings=$.extend(!0,{},$.fn.jPicker.defaults,options);"input"==$($this).get(0).nodeName.toLowerCase()&&($.extend(!0,settings,{window:{bindToInput:!0,expandable:!0,input:$($this)}}),""==$($this).val()?(settings.color.active=new Color({hex:null}),settings.color.current=new Color({hex:null})):ColorMethods.validateHex($($this).val())&&(settings.color.active=new Color({hex:$($this).val(),a:settings.color.active.val("a")}),settings.color.current=new Color({hex:$($this).val(),a:settings.color.active.val("a")}))),settings.window.expandable?$($this).after('    '):settings.window.liveUpdate=!1;var isLessThanIE7=parseFloat(navigator.appVersion.split("MSIE")[1])<7&&document.body.filters,container=null,colorMapDiv=null,colorBarDiv=null,colorMapL1=null,colorMapL2=null,colorMapL3=null,colorBarL1=null,colorBarL2=null,colorBarL3=null,colorBarL4=null,colorBarL5=null,colorBarL6=null,colorMap=null,colorBar=null,colorPicker=null,elementStartX=null,elementStartY=null,pageStartX=null,pageStartY=null,activePreview=null,currentPreview=null,okButton=null,cancelButton=null,grid=null,iconColor=null,iconAlpha=null,iconImage=null,moveBar=null,setColorMode=function(colorMode){var rgbMap,rgbBar,active=color.active,hex=(images.clientPath,active.val("hex"));switch(settings.color.mode=colorMode,colorMode){case"h":if(setTimeout(function(){setBG.call($this,colorMapDiv,"transparent"),setImgLoc.call($this,colorMapL1,0),setAlpha.call($this,colorMapL1,100),setImgLoc.call($this,colorMapL2,260),setAlpha.call($this,colorMapL2,100),setBG.call($this,colorBarDiv,"transparent"),setImgLoc.call($this,colorBarL1,0),setAlpha.call($this,colorBarL1,100),setImgLoc.call($this,colorBarL2,260),setAlpha.call($this,colorBarL2,100),setImgLoc.call($this,colorBarL3,260),setAlpha.call($this,colorBarL3,100),setImgLoc.call($this,colorBarL4,260),setAlpha.call($this,colorBarL4,100),setImgLoc.call($this,colorBarL6,260),setAlpha.call($this,colorBarL6,100)},0),colorMap.range("all",{minX:0,maxX:100,minY:0,maxY:100}),colorBar.range("rangeY",{minY:0,maxY:360}),null==active.val("ahex"))break;colorMap.val("xy",{x:active.val("s"),y:100-active.val("v")},colorMap),colorBar.val("y",360-active.val("h"),colorBar);break;case"s":if(setTimeout(function(){setBG.call($this,colorMapDiv,"transparent"),setImgLoc.call($this,colorMapL1,-260),setImgLoc.call($this,colorMapL2,-520),setImgLoc.call($this,colorBarL1,-260),setImgLoc.call($this,colorBarL2,-520),setImgLoc.call($this,colorBarL6,260),setAlpha.call($this,colorBarL6,100)},0),colorMap.range("all",{minX:0,maxX:360,minY:0,maxY:100}),colorBar.range("rangeY",{minY:0,maxY:100}),null==active.val("ahex"))break;colorMap.val("xy",{x:active.val("h"),y:100-active.val("v")},colorMap),colorBar.val("y",100-active.val("s"),colorBar);break;case"v":if(setTimeout(function(){setBG.call($this,colorMapDiv,"000000"),setImgLoc.call($this,colorMapL1,-780),setImgLoc.call($this,colorMapL2,260),setBG.call($this,colorBarDiv,hex),setImgLoc.call($this,colorBarL1,-520),setImgLoc.call($this,colorBarL2,260),setAlpha.call($this,colorBarL2,100),setImgLoc.call($this,colorBarL6,260),setAlpha.call($this,colorBarL6,100)},0),colorMap.range("all",{minX:0,maxX:360,minY:0,maxY:100}),colorBar.range("rangeY",{minY:0,maxY:100}),null==active.val("ahex"))break;colorMap.val("xy",{x:active.val("h"),y:100-active.val("s")},colorMap),colorBar.val("y",100-active.val("v"),colorBar);break;case"r":if(rgbMap=-1040,rgbBar=-780,colorMap.range("all",{minX:0,maxX:255,minY:0,maxY:255}),colorBar.range("rangeY",{minY:0,maxY:255}),null==active.val("ahex"))break;colorMap.val("xy",{x:active.val("b"),y:255-active.val("g")},colorMap),colorBar.val("y",255-active.val("r"),colorBar);break;case"g":if(rgbMap=-1560,rgbBar=-1820,colorMap.range("all",{minX:0,maxX:255,minY:0,maxY:255}),colorBar.range("rangeY",{minY:0,maxY:255}),null==active.val("ahex"))break;colorMap.val("xy",{x:active.val("b"),y:255-active.val("r")},colorMap),colorBar.val("y",255-active.val("g"),colorBar);break;case"b":if(rgbMap=-2080,rgbBar=-2860,colorMap.range("all",{minX:0,maxX:255,minY:0,maxY:255}),colorBar.range("rangeY",{minY:0,maxY:255}),null==active.val("ahex"))break;colorMap.val("xy",{x:active.val("r"),y:255-active.val("g")},colorMap),colorBar.val("y",255-active.val("b"),colorBar);break;case"a":if(setTimeout(function(){setBG.call($this,colorMapDiv,"transparent"),setImgLoc.call($this,colorMapL1,-260),setImgLoc.call($this,colorMapL2,-520),setImgLoc.call($this,colorBarL1,260),setImgLoc.call($this,colorBarL2,260),setAlpha.call($this,colorBarL2,100),setImgLoc.call($this,colorBarL6,0),setAlpha.call($this,colorBarL6,100)},0),colorMap.range("all",{minX:0,maxX:360,minY:0,maxY:100}),colorBar.range("rangeY",{minY:0,maxY:255}),null==active.val("ahex"))break;colorMap.val("xy",{x:active.val("h"),y:100-active.val("v")},colorMap),colorBar.val("y",255-active.val("a"),colorBar);break;default:throw"Invalid Mode"}switch(colorMode){case"h":break;case"s":case"v":case"a":setTimeout(function(){setAlpha.call($this,colorMapL1,100),setAlpha.call($this,colorBarL1,100),setImgLoc.call($this,colorBarL3,260),setAlpha.call($this,colorBarL3,100),setImgLoc.call($this,colorBarL4,260),setAlpha.call($this,colorBarL4,100)},0);break;case"r":case"g":case"b":setTimeout(function(){setBG.call($this,colorMapDiv,"transparent"),setBG.call($this,colorBarDiv,"transparent"),setAlpha.call($this,colorBarL1,100),setAlpha.call($this,colorMapL1,100),setImgLoc.call($this,colorMapL1,rgbMap),setImgLoc.call($this,colorMapL2,rgbMap-260),setImgLoc.call($this,colorBarL1,rgbBar-780),setImgLoc.call($this,colorBarL2,rgbBar-520),setImgLoc.call($this,colorBarL3,rgbBar),setImgLoc.call($this,colorBarL4,rgbBar-260),setImgLoc.call($this,colorBarL6,260),setAlpha.call($this,colorBarL6,100)},0)}null!=active.val("ahex")&&activeColorChanged.call($this,active)},activeColorChanged=function(ui,context){(null==context||context!=colorBar&&context!=colorMap)&&positionMapAndBarArrows.call($this,ui,context),setTimeout(function(){updatePreview.call($this,ui),updateMapVisuals.call($this,ui),updateBarVisuals.call($this,ui)},0)},mapValueChanged=function(ui,context){var active=color.active;if(context==colorMap||null!=active.val()){var xy=ui.val("all");switch(settings.color.mode){case"h":active.val("sv",{s:xy.x,v:100-xy.y},context);break;case"s":case"a":active.val("hv",{h:xy.x,v:100-xy.y},context);break;case"v":active.val("hs",{h:xy.x,s:100-xy.y},context);break;case"r":active.val("gb",{g:255-xy.y,b:xy.x},context);break;case"g":active.val("rb",{r:255-xy.y,b:xy.x},context);break;case"b":active.val("rg",{r:xy.x,g:255-xy.y},context)}}},colorBarValueChanged=function(ui,context){var active=color.active;if(context==colorBar||null!=active.val())switch(settings.color.mode){case"h":active.val("h",{h:360-ui.val("y")},context);break;case"s":active.val("s",{s:100-ui.val("y")},context);break;case"v":active.val("v",{v:100-ui.val("y")},context);break;case"r":active.val("r",{r:255-ui.val("y")},context);break;case"g":active.val("g",{g:255-ui.val("y")},context);break;case"b":active.val("b",{b:255-ui.val("y")},context);break;case"a":active.val("a",255-ui.val("y"),context)}},positionMapAndBarArrows=function(ui,context){if(context!=colorMap)switch(settings.color.mode){case"h":var sv=ui.val("sv");colorMap.val("xy",{x:null!=sv?sv.s:100,y:100-(null!=sv?sv.v:100)},context);break;case"s":case"a":var hv=ui.val("hv");colorMap.val("xy",{x:hv&&hv.h||0,y:100-(null!=hv?hv.v:100)},context);break;case"v":var hs=ui.val("hs");colorMap.val("xy",{x:hs&&hs.h||0,y:100-(null!=hs?hs.s:100)},context);break;case"r":var bg=ui.val("bg");colorMap.val("xy",{x:bg&&bg.b||0,y:255-(bg&&bg.g||0)},context);break;case"g":var br=ui.val("br");colorMap.val("xy",{x:br&&br.b||0,y:255-(br&&br.r||0)},context);break;case"b":var rg=ui.val("rg");colorMap.val("xy",{x:rg&&rg.r||0,y:255-(rg&&rg.g||0)},context)}if(context!=colorBar)switch(settings.color.mode){case"h":colorBar.val("y",360-(ui.val("h")||0),context);break;case"s":var s=ui.val("s");colorBar.val("y",100-(null!=s?s:100),context);break;case"v":var v=ui.val("v");colorBar.val("y",100-(null!=v?v:100),context);break;case"r":colorBar.val("y",255-(ui.val("r")||0),context);break;case"g":colorBar.val("y",255-(ui.val("g")||0),context);break;case"b":colorBar.val("y",255-(ui.val("b")||0),context);break;case"a":var a=ui.val("a");colorBar.val("y",255-(null!=a?a:255),context)}},updatePreview=function(ui){try{var all=ui.val("all");activePreview.css({backgroundColor:all&&"#"+all.hex||"transparent"}),setAlpha.call($this,activePreview,all&&Math.precision(100*all.a/255,4)||0)}catch(e){}},updateMapVisuals=function(ui){switch(settings.color.mode){case"h":setBG.call($this,colorMapDiv,new Color({h:ui.val("h")||0,s:100,v:100}).val("hex"));break;case"s":case"a":var s=ui.val("s");setAlpha.call($this,colorMapL2,100-(null!=s?s:100));break;case"v":var v=ui.val("v");setAlpha.call($this,colorMapL1,null!=v?v:100);break;case"r":setAlpha.call($this,colorMapL2,Math.precision((ui.val("r")||0)/255*100,4));break;case"g":setAlpha.call($this,colorMapL2,Math.precision((ui.val("g")||0)/255*100,4));break;case"b":setAlpha.call($this,colorMapL2,Math.precision((ui.val("b")||0)/255*100))}var a=ui.val("a");setAlpha.call($this,colorMapL3,Math.precision(100*(255-(a||0))/255,4))},updateBarVisuals=function(ui){switch(settings.color.mode){case"h":var a=ui.val("a");setAlpha.call($this,colorBarL5,Math.precision(100*(255-(a||0))/255,4));break;case"s":var hva=ui.val("hva"),saturatedColor=new Color({h:hva&&hva.h||0,s:100,v:null!=hva?hva.v:100});setBG.call($this,colorBarDiv,saturatedColor.val("hex")),setAlpha.call($this,colorBarL2,100-(null!=hva?hva.v:100)),setAlpha.call($this,colorBarL5,Math.precision(100*(255-(hva&&hva.a||0))/255,4));break;case"v":var hsa=ui.val("hsa"),valueColor=new Color({h:hsa&&hsa.h||0,s:null!=hsa?hsa.s:100,v:100});setBG.call($this,colorBarDiv,valueColor.val("hex")),setAlpha.call($this,colorBarL5,Math.precision(100*(255-(hsa&&hsa.a||0))/255,4));break;case"r":case"g":case"b":var hValue=0,vValue=0,rgba=ui.val("rgba");"r"==settings.color.mode?(hValue=rgba&&rgba.b||0,vValue=rgba&&rgba.g||0):"g"==settings.color.mode?(hValue=rgba&&rgba.b||0,vValue=rgba&&rgba.r||0):"b"==settings.color.mode&&(hValue=rgba&&rgba.r||0,vValue=rgba&&rgba.g||0);var middle=vValue>hValue?hValue:vValue;setAlpha.call($this,colorBarL2,hValue>vValue?Math.precision((hValue-vValue)/(255-vValue)*100,4):0),setAlpha.call($this,colorBarL3,vValue>hValue?Math.precision((vValue-hValue)/(255-hValue)*100,4):0),setAlpha.call($this,colorBarL4,Math.precision(middle/255*100,4)),setAlpha.call($this,colorBarL5,Math.precision(100*(255-(rgba&&rgba.a||0))/255,4));break;case"a":var a=ui.val("a");setBG.call($this,colorBarDiv,ui.val("hex")||"000000"),setAlpha.call($this,colorBarL5,null!=a?0:100),setAlpha.call($this,colorBarL6,null!=a?100:0)}},setBG=function(el,c){el.css({backgroundColor:c&&6==c.length&&"#"+c||"transparent"})},setImg=function(img,src){!isLessThanIE7||-1==src.indexOf("AlphaBar.png")&&-1==src.indexOf("Bars.png")&&-1==src.indexOf("Maps.png")?img.css({backgroundImage:"url('"+src+"')"}):(img.attr("pngSrc",src),img.css({backgroundImage:"none",filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='scale')"}))},setImgLoc=function(img,y){img.css({top:y+"px"})},setAlpha=function(obj,alpha){if(obj.css({visibility:alpha>0?"visible":"hidden"}),alpha>0&&100>alpha)if(isLessThanIE7){var src=obj.attr("pngSrc");null==src||-1==src.indexOf("AlphaBar.png")&&-1==src.indexOf("Bars.png")&&-1==src.indexOf("Maps.png")?obj.css({opacity:Math.precision(alpha/100,4)}):obj.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='scale') progid:DXImageTransform.Microsoft.Alpha(opacity="+alpha+")"})}else obj.css({opacity:Math.precision(alpha/100,4)});else if(0==alpha||100==alpha)if(isLessThanIE7){var src=obj.attr("pngSrc");null==src||-1==src.indexOf("AlphaBar.png")&&-1==src.indexOf("Bars.png")&&-1==src.indexOf("Maps.png")?obj.css({opacity:""}):obj.css({filter:"progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='scale')"})}else obj.css({opacity:""})},revertColor=function(){color.active.val("ahex",color.current.val("ahex"))},commitColor=function(){color.current.val("ahex",color.active.val("ahex"))},radioClicked=function(e){$(this).parents("tbody:first").find('input:radio[value!="'+e.target.value+'"]').removeAttr("checked"),setColorMode.call($this,e.target.value)},currentClicked=function(){revertColor.call($this)},cancelClicked=function(){revertColor.call($this),settings.window.expandable&&hide.call($this),$.isFunction(cancelCallback)&&cancelCallback.call($this,color.active,cancelButton)},okClicked=function(){commitColor.call($this),settings.window.expandable&&hide.call($this),$.isFunction(commitCallback)&&commitCallback.call($this,color.active,okButton)},iconImageClicked=function(){show.call($this)},currentColorChanged=function(ui,context){var hex=ui.val("hex");currentPreview.css({backgroundColor:hex&&"#"+hex||"transparent"}),setAlpha.call($this,currentPreview,Math.precision(100*(ui.val("a")||0)/255,4))},expandableColorChanged=function(ui,context){var hex=ui.val("hex"),va=ui.val("va");iconColor.css({backgroundColor:hex&&"#"+hex||"transparent"}),setAlpha.call($this,iconAlpha,Math.precision(100*(255-(va&&va.a||0))/255,4)),settings.window.bindToInput&&settings.window.updateInputColor&&settings.window.input.css({backgroundColor:hex&&"#"+hex||"transparent",color:null==va||va.v>75?"#000000":"#ffffff"})},moveBarMouseDown=function(e){settings.window.element,settings.window.page;elementStartX=parseInt(container.css("left")),elementStartY=parseInt(container.css("top")),pageStartX=e.pageX,pageStartY=e.pageY,$(document).bind("mousemove",documentMouseMove).bind("mouseup",documentMouseUp),e.preventDefault()},documentMouseMove=function(e){return container.css({left:elementStartX-(pageStartX-e.pageX)+"px",top:elementStartY-(pageStartY-e.pageY)+"px"}),settings.window.expandable&&!$.support.boxModel&&container.prev().css({left:container.css("left"),top:container.css("top")}),e.stopPropagation(),e.preventDefault(),!1},documentMouseUp=function(e){return $(document).unbind("mousemove",documentMouseMove).unbind("mouseup",documentMouseUp),e.stopPropagation(),e.preventDefault(),!1},quickPickClicked=function(e){return e.preventDefault(),e.stopPropagation(),color.active.val("ahex",$(this).attr("title")||null,e.target),!1},commitCallback=$.isFunction($arguments[1])&&$arguments[1]||null,liveCallback=$.isFunction($arguments[2])&&$arguments[2]||null,cancelCallback=$.isFunction($arguments[3])&&$arguments[3]||null,show=function(){color.current.val("ahex",color.active.val("ahex"));var attachIFrame=function(){if(settings.window.expandable&&!$.support.boxModel){var table=container.find("table:first");container.before("");var f=document.frames[fid];f.document.open(),f.document.write(""),f.document.close(),f.fid=fid;var fwin=document.getElementById(fid);fwin.style.cssText="position:absolute;top:0;left:0;display:none;z-index:99999;",f.show=function(px,py,pw,ph,baseElement){py=py+baseElement.getBoundingClientRect().top+Math.max(document.body.scrollTop,document.documentElement.scrollTop),px=px+baseElement.getBoundingClientRect().left+Math.max(document.body.scrollLeft,document.documentElement.scrollLeft),fwin.style.width=pw+"px",fwin.style.height=ph+"px",fwin.style.posLeft=px,fwin.style.posTop=py,fwin.style.display="block"},f_hide=function(e){return window.event&&window.event.srcElement&&window.event.srcElement.tagName&&"select"==window.event.srcElement.tagName.toLowerCase()?!0:void(fwin.style.display="none")},f.hide=f_hide,document.attachEvent("onclick",f_hide),document.attachEvent("onkeydown",f_hide)}return f}}null==dropdown_menu_hack.menu&&(dropdown_menu_hack.menu=window.createPopup(),document.attachEvent("onkeydown",dropdown_menu_hack.menu.hide)),el.menu=dropdown_menu_hack.menu,el.contentOptions=new Array,el.contentIndex=el.selectedIndex,el.contentHTML=el.outerHTML;for(var i=0;i=selectBox.length&&(do_onchange||(selectBox.length&&""==selectBox.options[0].value&&(selectBox.options[0]=null),selectBox.multiple=!0,selectBox.size=4),selectBox.options[selectBox.length]=new Option(label,value,!1,!0)),selectBox.onchange&&do_onchange&&selectBox.onchange()}function _egw_json_escape_string(input){for(var len=input.length,res="",i=0;len>i;i++)switch(input.charAt(i)){case'"':res+='\\"';break;case"\n":res+="\\n";break;case"\r":res+="\\r";break;case"\\":res+="\\\\";break;case"/":res+="\\/";break;case"\b":res+="\\b";break;case"\f":res+="\\f";break;case" ":res+="\\t";break;default:res+=input.charAt(i)}return res}function _egw_json_encode_simple(input){switch(input.constructor){case String:return'"'+_egw_json_escape_string(input)+'"';case Number:return input.toString();case Boolean:return input?"true":"false";default:return null}}function egw_json_encode(input){return egw.debug("warn","Function %s is deprecated, use egw.jsonEncode() instead",arguments.callee.name),egw.jsonEncode(input)}function egw_json_register_plugin(_callback,_context){egw.debug("warn","Function %s is deprecated",arguments.callee.name),"undefined"==typeof _context&&(_context=window),_egw_json_plugins[_egw_json_plugins.length]={callback:_callback,context:_context}}function _egw_json_plugin_handle(_type,_response,_context){for(var i=0;i<_egw_json_plugins.length;i++)try{var plugin=_egw_json_plugins[i],context=plugin.context;if(plugin.context||"undefined"==typeof _context||(context=_context),plugin.callback.call(context,_type,_response))return!0}catch(e){"undefined"!=typeof console&&console.log(e)}return!1}function egw_json_request(_menuaction,_parameters,_context){egw.debug("warn","Function %s is deprecated",arguments.callee.name),this.context=window.document,"undefined"!=typeof _context&&(this.context=_context),"undefined"!=typeof _parameters?this.parameters=_parameters:this.parameters=new Array,_menuaction.match(/json.php\?menuaction=[a-z_0-9]*\.[a-z_0-9]*\.[a-z_0-9]*/i)?this.url=_menuaction:this.url=this._assembleAjaxUrl(_menuaction),this.request=null,this.sender=null,this.callback=null,this.alertHandler=this.alertFunc,this.onLoadFinish=null,this.loadedJSFiles={},this.handleResponseDone=!1,this.app=null,window.egw_alertHandler&&(this.alertHandler=window.egw_alertHandler)}function _egw_json_debug_log(_msg,_e){"undefined"!=typeof console&&"undefined"!=typeof console.log&&console.log(_msg,_e)}function egw_json_getFormValues(_form,_filterClass){egw.debug("warn","Function %s is deprecated",arguments.callee.name);var elem=null;elem="object"==typeof _form?_form:document.getElementsByName(_form)[0];var serialized=new Object;return"undefined"!=typeof elem&&elem&&elem.childNodes&&("undefined"==typeof _filterClass&&(_filterClass=null),_egw_json_getFormValues(serialized,elem.childNodes,_filterClass)),serialized}function _egw_json_getFormValues(serialized,children,_filterClass){egw.debug("warn","Function %s is deprecated",arguments.callee.name);for(var i=0;i=0){var n=name,k=n.substr(0,n.indexOf("[")),a=n.substr(n.indexOf("["));"undefined"==typeof serialized[k]&&(serialized[k]=new Object);for(var p=serialized;0!=a.length;){var sa=a.substr(0,a.indexOf("]")+1),lk=k,lp=p;a=a.substr(a.indexOf("]")+1),p=p[k],k=sa.substr(1,sa.length-2),""==k&&("select-multiple"==child.type?(k=lk,p=lp):k=_egw_json_getObjectLength(p)),"undefined"==typeof p[k]&&(p[k]=new Object)}p[k]=values}else"undefined"!=typeof values&&(serialized[name]=values)}}function dtmlXMLLoaderObject(a,b,c,d){return this.xmlDoc="",this.async="undefined"!=typeof c?c:!0,this.onloadAction=a||null,this.mainObject=b||null,this.waitCall=null,this.rSeed=d||!1,this}function callerFunction(a,b){return this.handler=function(c){return c||(c=window.event),a(c,b),!0}}function getAbsoluteLeft(a){return getOffset(a).left}function getAbsoluteTop(a){return getOffset(a).top}function getOffsetSum(a){for(var b=0,c=0;a;)b+=parseInt(a.offsetTop),c+=parseInt(a.offsetLeft),a=a.offsetParent;return{top:b,left:c}}function getOffsetRect(a){var b=a.getBoundingClientRect(),c=document.body,d=document.documentElement,e=window.pageYOffset||d.scrollTop||c.scrollTop,g=window.pageXOffset||d.scrollLeft||c.scrollLeft,f=d.clientTop||c.clientTop||0,h=d.clientLeft||c.clientLeft||0,i=b.top+e-f,k=b.left+g-h;return{top:Math.round(i),left:Math.round(k)}}function getOffset(a){return a.getBoundingClientRect?getOffsetRect(a):getOffsetSum(a)}function convertStringToBoolean(a){switch("string"==typeof a&&(a=a.toLowerCase()),a){case"1":case"true":case"yes":case"y":case 1:case!0:return!0;default:return!1}}function getUrlSymbol(a){return-1!=a.indexOf("?")?"&":"?"}function dhtmlDragAndDropObject(){return window.dhtmlDragAndDrop?window.dhtmlDragAndDrop:(this.dragStartObject=this.dragStartNode=this.dragNode=this.lastLanding=0,this.tempDOMM=this.tempDOMU=null,this.waitDrag=0,window.dhtmlDragAndDrop=this,this)}function j(){return this.catches||(this.catches=[]),this}function dhtmlXHeir(a,b){for(var c in b)"function"==typeof b[c]&&(a[c]=b[c]);return a}function dhtmlxEvent(a,b,c){a.addEventListener?a.addEventListener(b,c,!1):a.attachEvent&&a.attachEvent("on"+b,c)}function xmlPointer(data){this.d=data}function dhtmlXTreeObject(htmlObject,width,height,rootId){if(_isIE)try{document.execCommand("BackgroundImageCache",!1,!0)}catch(e){}"object"!=typeof htmlObject?this.parentObject=document.getElementById(htmlObject):this.parentObject=htmlObject,this.parentObject.style.overflow="hidden",this._itim_dg=!0,this.dlmtr=",",this.dropLower=!1,this.enableIEImageFix(),this.xmlstate=0,this.mytype="tree",this.smcheck=!0,this.width=width,this.height=height,this.rootId=rootId,this.childCalc=null,this.def_img_x="18px",this.def_img_y="18px",this.def_line_img_x="18px",this.def_line_img_y="18px",this._dragged=new Array,this._selected=new Array,this.style_pointer="pointer",this._aimgs=!0,this.htmlcA=" [",this.htmlcB="]",this.lWin=window,this.cMenu=0,this.mlitems=0,this.iconURL="",this.dadmode=0,this.slowParse=!1,this.autoScroll=!0,this.hfMode=0,this.nodeCut=new Array,this.XMLsource=0,this.XMLloadingWarning=0,this._idpull={},this._pullSize=0,this.treeLinesOn=!0,this.tscheck=!1,this.timgen=!0,this.dpcpy=!1,this._ld_id=null,this._oie_onXLE=[],this.imPath=window.dhx_globalImgPath||"",this.checkArray=new Array("iconUncheckAll.gif","iconCheckAll.gif","iconCheckGray.gif","iconUncheckDis.gif","iconCheckDis.gif","iconCheckDis.gif"),this.radioArray=new Array("radio_off.gif","radio_on.gif","radio_on.gif","radio_off.gif","radio_on.gif","radio_on.gif"),this.lineArray=new Array("line2.gif","line3.gif","line4.gif","blank.gif","blank.gif","line1.gif"),this.minusArray=new Array("minus2.gif","minus3.gif","minus4.gif","minus.gif","minus5.gif"),this.plusArray=new Array("plus2.gif","plus3.gif","plus4.gif","plus.gif","plus5.gif"),this.imageArray=new Array("leaf.gif","folderOpen.gif","folderClosed.gif"),this.cutImg=new Array(0,0,0),this.cutImage="but_cut.gif",dhtmlxEventable(this),this.dragger=new dhtmlDragAndDropObject,this.htmlNode=new dhtmlXTreeItemObject(this.rootId,"",0,this),this.htmlNode.htmlNode.childNodes[0].childNodes[0].style.display="none",this.htmlNode.htmlNode.childNodes[0].childNodes[0].childNodes[0].className="hiddenRow",this.allTree=this._createSelf(),this.allTree.appendChild(this.htmlNode.htmlNode),dhtmlx.$customScroll&&dhtmlx.CustomScroll.enable(this),_isFF&&(this.allTree.childNodes[0].width="100%",this.allTree.childNodes[0].style.overflow="hidden");var self=this;return this.allTree.onselectstart=new Function("return false;"),_isMacOS&&(this.allTree.oncontextmenu=function(e){return self._doContClick(e||window.event,!0)}),this.allTree.onmousedown=function(e){return self._doContClick(e||window.event)},this.XMLLoader=new dtmlXMLLoaderObject(this._parseXMLTree,this,!0,this.no_cashe),_isIE&&this.preventIECashing(!0),window.addEventListener&&window.addEventListener("unload",function(){try{self.destructor()}catch(e){}},!1),window.attachEvent&&window.attachEvent("onunload",function(){try{self.destructor()}catch(e){}}),this.setImagesPath=this.setImagePath,this.setIconsPath=this.setIconPath,dhtmlx.image_path&&this.setImagePath(dhtmlx.image_path),dhtmlx.skin&&this.setSkin(dhtmlx.skin),this}function cObject(){return this}function dhtmlXTreeItemObject(itemId,itemText,parentObject,treeObject,actionHandler,mode){return this.htmlNode="",this.acolor="",this.scolor="",this.tr=0,this.childsCount=0,this.tempDOMM=0,this.tempDOMU=0,this.dragSpan=0,this.dragMove=0,this.span=0,this.closeble=1,this.childNodes=new Array,this.userData=new cObject,this.checkstate=0,this.treeNod=treeObject,this.label=itemText,this.parentObject=parentObject,this.actionHandler=actionHandler,this.images=new Array(treeObject.imageArray[0],treeObject.imageArray[1],treeObject.imageArray[2]),this.id=treeObject._globalIdStorageAdd(itemId,this),this.treeNod.checkBoxOff?this.htmlNode=this.treeNod._createItem(1,this,mode):this.htmlNode=this.treeNod._createItem(0,this,mode),this.htmlNode.objBelong=this,this}function jsonPointer(data,parent){this.d=data,this.dp=parent}function egwActionStoreJSON(_data,_obj,_setterOnly){for(var key in _data)"_"!=key.charAt(0)&&("function"==typeof _obj["set_"+key]?_obj["set_"+key](_data[key]):"undefined"==typeof _obj[key]||_setterOnly?"data"===_setterOnly&&("undefined"==typeof _data.data&&(_data.data={}),_data.data[key]=_data[key],_obj.set_data(_data.data)):_obj[key]=_data[key])}function egwSetBit(_set,_bit,_state){return _state?_set|=_bit:_set&=~_bit}function egwBitIsSet(_set,_bit){return(_set&_bit)>0}function egwObjectLength(_obj){var len=0;for(var k in _obj)len++;return len}function egwGetShiftState(e){var state=EGW_AO_SHIFT_STATE_NONE;return state=egwSetBit(state,EGW_AO_SHIFT_STATE_MULTI,e.ctrlKey||e.metaKey),state=egwSetBit(state,EGW_AO_SHIFT_STATE_BLOCK,e.shiftKey)}function egwPreventSelect(e){return egwGetShiftState(e)>EGW_AO_SHIFT_STATE_NONE?(this.onselectstart=function(){return!1},!1):!0}function egwResetPreventSelect(elem){}function egwUnfocus(){document.activeElement&&document.activeElement.blur()}function egwCallAbstract(_obj,_fn,_args){if(_fn)return _fn.apply(_obj,_args);throw"egw_action Exception: Abstract function call in JS code."}function egwArraysEqual(_ar1,_ar2){for(var result=_ar1.length==_ar2.length,i=0;i<_ar1.length;i++)result=result&&_ar1[i]==_ar2[i];return result}function egwQueueCallback(_proc,_args,_context,_id){if(_proc){var cur_id=0;cur_id="undefined"==typeof _egwQueuedCallbacks[_id]?_egwQueuedCallbacks[_id]=1:++_egwQueuedCallbacks[_id],window.setTimeout(function(){_egwQueuedCallbacks[_id]==cur_id&&(_proc.apply(_context,_args),delete _egwQueuedCallbacks[_id])},0)}}function egwEventQueue(){this.events={},this.key_id=0}function egwFnct(_context,_default,_acceptedTypes){"undefined"==typeof _context&&(_context=null),"undefined"==typeof _default&&(_default=!1),"undefined"==typeof _acceptedTypes&&(_acceptedTypes=["boolean"]),this.context=_context,this.acceptedTypes=_acceptedTypes,this.fnct=null,this.value=null,this.isDefault=!1,this.setValue(_default)}function egwIsMobile(){if(null==_egw_mobileBrowser){var ua=navigator.userAgent;_egw_mobileBrowser=ua.match(/iPhone/i)||ua.match(/iPad/i)||ua.match(/iPod/)||ua.match(/Android/i)||ua.match(/SymbianOS/i)}return _egw_mobileBrowser}function str_repeat(i,m){for(var o=[];m>0;o[--m]=i);return o.join("")}function sprintf(){for(var a,m,p,c,x,i=0,f=arguments[i++],o=[],s="";f;){if(m=/^[^\x25]+/.exec(f))o.push(m[0]);else if(m=/^\x25{2}/.exec(f))o.push("%");else{if(!(m=/^\x25(?:(\d+)\$)?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(f)))throw'Invalid sprintf format "'+arguments[0]+'"';if(null==(a=arguments[m[1]||i++])||void 0==a)throw"Too few arguments.";if(/[^s]/.test(m[7])&&"number"!=typeof a)throw"Expecting number but found "+typeof a;switch(m[7]){case"b":a=a.toString(2);break;case"c":a=String.fromCharCode(a);break;case"d":a=parseInt(a);break;case"e":a=m[6]?a.toExponential(m[6]):a.toExponential();break;case"f":a=m[6]?parseFloat(a).toFixed(m[6]):parseFloat(a);break;case"o":a="number"==typeof a?a.toString(8):JSON.stringify(a);break;case"s":a=(a=String(a))&&m[6]?a.substring(0,m[6]):a;break;case"u":a=Math.abs(a);break;case"x":a=a.toString(16);break;case"X":a=a.toString(16).toUpperCase()}a=/[def]/.test(m[7])&&m[2]&&a>=0?"+"+a:a,c=m[3]?"0"==m[3]?"0":m[3].charAt(1):" ",x=m[5]-String(a).length-s.length,p=m[5]?str_repeat(c,x):"",o.push(s+(m[4]?a+p:p+a))}f=f.substring(m[0].length)}return o.join("")}function egw_getActionManager(_id,_create,_search_depth){"undefined"==typeof _create&&(_create=!0),"undefined"==typeof _search_depth&&(_search_depth=Number.MAX_VALUE);var res=egw_globalActionManager;return null==egw_globalActionManager&&(res=egw_globalActionManager=new egwActionManager),"undefined"!=typeof _id&&null!=_id&&(res=egw_globalActionManager.getActionById(_id,_search_depth),null==res&&_create&&(res=egw_globalActionManager.addAction("actionManager",_id))),res}function egw_getObjectManager(_id,_create,_search_depth){"undefined"==typeof _create&&(_create=!0),"undefined"==typeof _search_depth&&(_search_depth=Number.MAX_VALUE);var res=egw_globalObjectManager;return null==res&&(res=egw_globalObjectManager=new egwActionObjectManager("_egwGlobalObjectManager",egw_getActionManager())),"undefined"!=typeof _id&&null!=_id&&(res=egw_globalObjectManager.getObjectById(_id,_search_depth),null==res&&_create&&(res=new egwActionObjectManager(_id,egw_getActionManager(_id,!0,_search_depth)),egw_globalObjectManager.addObject(res))),res}function egw_getAppObjectManager(_create){return egw_getObjectManager(egw_getAppName(),_create,1)}function egw_getAppActionManager(_create){return egw_getActionManager(egw_getAppName(),_create,1)}function egwActionHandler(_executeEvent){this.execute=_executeEvent}function egwAction(_parent,_id,_caption,_iconUrl,_onExecute,_allowOnMultiple){if(_parent&&("string"!=typeof _id||!_id)&&"actionManager"!=_parent.type)throw"egwAction _id must be a non-empty string!";"undefined"==typeof _caption&&(_caption=""),"undefined"==typeof _iconUrl&&(_iconUrl=""),"undefined"==typeof _onExecute&&(_onExecute=null),"undefined"==typeof _allowOnMultiple&&(_allowOnMultiple=!0),this.id=_id,this.caption=_caption,this.iconUrl=_iconUrl,this.allowOnMultiple=_allowOnMultiple,this.enabled=new egwFnct(this,!0),this.hideOnDisabled=!1,this.data={},this.type="default",this.canHaveChildren=!1,this.parent=_parent,this.children=[],this.onExecute=new egwFnct(this,null,[]),null!==_onExecute&&this.set_onExecute(_onExecute),this.hideOnMobile=!1}function _egwActionTreeContains(_tree,_elem){for(var i=0;i<_tree.length;i++){if(_tree[i].action==_elem)return _tree[i];if("undefined"!=typeof _tree[i].children){var elem=_egwActionTreeContains(_tree[i].children,_elem);if(elem)return elem}}return null}function egwActionManager(_parent,_id){"undefined"==typeof _parent&&(_parent=null),"undefined"==typeof _id&&(_id=!1);var action=new egwAction(_parent,_id);return action.type="actionManager",action.canHaveChildren=!0,action}function egwActionImplementation(){this.doRegisterAction=function(){throw"Abstract function call: registerAction"},this.doUnregisterAction=function(){throw"Abstract function call: unregisterAction"},this.doExecuteImplementation=function(){throw"Abstract function call: executeImplementation"},this.type=""}function egwActionLink(_manager){this.enabled=!0,this.visible=!0,this.actionId="",this.actionObj=null,this.manager=_manager}function egwActionObject(_id,_parent,_iface,_manager,_flags){"undefined"==typeof _manager&&"object"==typeof _parent&&_parent&&(_manager=_parent.manager),"undefined"==typeof _flags&&(_flags=0),this.id=_id,this.parent=_parent,this.children=[],this.actionLinks=[],this.manager=_manager,this.flags=_flags,this.data=null,this.setSelectedCallback=null,this.registeredImpls=[],this.selectedChildren=[],this.focusedChild=null,this.setAOI(_iface)}function egwActionObjectInterface(){this.doGetDOMNode=function(){return null},this.doSetState=function(_state,_outerCall){},this.doTriggerEvent=function(_event,_data){return!1},this.doMakeVisible=function(){},this._state=EGW_AO_STATE_NORMAL||EGW_AO_STATE_VISIBLE,this.stateChangeCallback=null,this.stateChangeContext=null,this.reconnectActionsCallback=null,this.reconnectActionsContext=null}function egwActionObjectManager(_id,_manager){var ao=new egwActionObject(_id,null,new egwActionObjectInterface,_manager,EGW_AO_FLAG_IS_CONTAINER);return ao.triggerCallback=function(){return!1},ao}function egw_keycode_makeValid(_keyCode){var idx=EGW_VALID_KEYS.indexOf(_keyCode);return idx>=0?_keyCode:-1}function _egw_nodeIsInInput(_node){if(null!=_node&&_node!=document){var tagName=_node.tagName.toLowerCase();return"input"==tagName||"select"==tagName||"textarea"==tagName||"button"==tagName?!0:_egw_nodeIsInInput(_node.parentNode)}return!1}function egw_shortcutIdx(_keyCode,_shift,_ctrl,_alt){return"_"+_keyCode+"_"+(_shift?"S":"")+(_ctrl?"C":"")+(_alt?"A":"")}function egw_registerGlobalShortcut(_keyCode,_shift,_ctrl,_alt,_handler,_context){var idx=egw_shortcutIdx(_keyCode,_shift,_ctrl,_alt);egw_registeredShortcuts[idx]={handler:_handler,context:_context,shortcut:{keyCode:_keyCode,shift:_shift,ctrl:_ctrl,alt:_alt}}}function egw_unregisterGlobalShortcut(_keyCode,_shift,_ctrl,_alt){var idx=egw_shortcutIdx(_keyCode,_shift,_ctrl,_alt);delete egw_registeredShortcuts[idx]}function egw_keyHandler(_keyCode,_shift,_ctrl,_alt){var idx=egw_shortcutIdx(_keyCode,_shift,_ctrl,_alt);if("undefined"!=typeof egw_registeredShortcuts[idx]){var shortcut=egw_registeredShortcuts[idx],result=shortcut.handler.call(shortcut.context,shortcut.shortcut);if(result)return result}var appMgr=egw_getAppObjectManager(!1);if(appMgr){var focusedObject=appMgr.getFocusedObject();if(!focusedObject){for(var cntr=null,i=0;i0&&(cntr.children[0].setFocused(!0),focusedObject=cntr.children[0])}if(focusedObject){var cntr=focusedObject.getContainerRoot(),handled=!1;return cntr&&(handled=cntr.handleKeyPress(_keyCode,_shift,_ctrl,_alt)),handled?handled:focusedObject.executeActionImplementation({keyEvent:{keyCode:_keyCode,shift:_shift,ctrl:_ctrl,alt:_alt}},"popup",EGW_AO_EXEC_SELECTED)}}return!1}function _egwGenMenuItem(_parent,_id,_caption,_iconUrl,_onClick){"undefined"==typeof _parent&&(_parent=null),"undefined"==typeof _id&&(_id=""),"undefined"==typeof _caption&&(_caption=""),"undefined"==typeof _iconUrl&&(_iconUrl=""),"undefined"==typeof _onClick&&(_onClick=null);var item=new egwMenuItem(_parent,_id);return item.set_caption(_caption),item.set_iconUrl(_iconUrl),item.set_onClick(_onClick),item}function _egwGenMenuStructure(_elements,_parent){for(var items=[],i=0;i<_elements.length;i++){var obj=_elements[i],item=new egwMenuItem(_parent,null);for(var key in obj)"children"==key&&obj[key].constructor===Array?item.children=_egwGenMenuStructure(obj[key],item):"id"!=key&&"caption"!=key&&"iconUrl"!=key&&"checkbox"!=key&&"checked"!=key&&"groupIndex"!=key&&"enabled"!=key&&"default"!=key&&"onClick"!=key&&"hint"!=key&&"shortcutCaption"!=key||item["set_"+key](obj[key]);items.push(item)}return items}function _egwSearchMenuItem(_elements,_id){for(var i=0;i<_elements.length;i++){if(_elements[i].id===_id)return _elements[i];var item=_egwSearchMenuItem(_elements[i].children,_id);if(item)return item}return null}function _egwSetMenuOnClick(_elements,_onClick){for(var i=0;i<_elements.length;i++)null===_elements[i].onClick&&(_elements[i].onClick=_onClick),_egwSetMenuOnClick(_elements[i].children,_onClick)}function egwMenu(){this.children=[],this.instance=null}function egwMenuItem(_parent,_id){this.id=_id,this.caption="",this.checkbox=!1,this.checked=!1,this.groupIndex=0,this.enabled=!0,this.iconUrl="",this.onClick=null,this.default=!1,this.data=null,this.shortcutCaption=null,this.children=[],this.parent=_parent}function egwPopupAction(_id,_handler,_caption,_icon,_onExecute,_allowOnMultiple){var action=new egwAction(_id,_handler,_caption,_icon,_onExecute,_allowOnMultiple);return action.type="popup",action.canHaveChildren=["popup"],action.default=!1,action.order=0,action.group=0,action.hint=!1,action.checkbox=!1,action.radioGroup=0,action.checked=!1,action.shortcut=null,action.set_default=function(_value){action.default=_value},action.set_order=function(_value){action.order=_value},action.set_group=function(_value){action.group=_value},action.set_hint=function(_value){action.hint=_value},action.set_checkbox=function(_value){action.checkbox=_value},action.set_checked=function(_value){action.checked=_value},action.set_radioGroup=function(_value){action.radioGroup=_value},action.set_shortcut=function(_value){if(_value){var sc={keyCode:-1,shift:!1,ctrl:!1,alt:!1};"object"==typeof _value&&"undefined"!=typeof _value.keyCode&&"undefined"!=typeof _value.caption&&(sc.keyCode=_value.keyCode,sc.caption=_value.caption,sc.shift="undefined"==typeof _value.shift?!1:_value.shift,sc.ctrl="undefined"==typeof _value.ctrl?!1:_value.ctrl,sc.alt="undefined"==typeof _value.alt?!1:_value.alt),this.shortcut=sc}else this.shortcut=!1},action}function getPopupImplementation(){return _popupActionImpl||(_popupActionImpl=new egwPopupActionImplementation),_popupActionImpl}function egwPopupActionImplementation(){var ai=new egwActionImplementation;return ai.type="popup",ai.auto_paste=!0,ai._registerDefault=function(_node,_callback,_context){var defaultHandler=function(e){if(egwIsMobile&&"A"==e.target.tagName)return!0;if("undefined"!=typeof document.selection&&"undefined"!=typeof document.selection.empty)document.selection.empty();else if("undefined"!=typeof window.getSelection){var sel=window.getSelection();sel.removeAllRanges()}return _callback.call(_context,"default",ai),e.stopPropagation(),e.cancelBubble=!0,_egw_active_menu&&1==e.which&&_egw_active_menu.hide(),!1};egwIsMobile()?$j(_node).bind("click",defaultHandler):_node.ondblclick=defaultHandler},ai._getDefaultLink=function(_links){var defaultAction=null;for(var k in _links)if(_links[k].actionObj.default&&_links[k].enabled){ -defaultAction=_links[k].actionObj;break}return defaultAction},ai._searchShortcut=function(_key,_objs,_links){for(var i=0;i<_objs.length;i++){var sc=_objs[i].shortcut;if(sc&&sc.keyCode==_key.keyCode&&sc.shift==_key.shift&&sc.ctrl==_key.ctrl&&sc.alt==_key.alt&&"popup"==_objs[i].type&&("undefined"==typeof _links[_objs[i].id]||_links[_objs[i].id].enabled))return _objs[i];var obj=this._searchShortcut(_key,_objs[i].children,_links);if(obj)return obj}},ai._searchShortcutInLinks=function(_key,_links){var objs=[];for(var k in _links)_links[k].enabled&&objs.push(_links[k].actionObj);return ai._searchShortcut(_key,objs,_links)},ai._handleKeyPress=function(_key,_selected,_links,_target){if(_key.keyCode==EGW_KEY_ENTER&&!_key.ctrl&&!_key.shift&&!_key.alt){var defaultAction=this._getDefaultLink(_links);if(defaultAction)return defaultAction.execute(_selected),!0}if(_key.keyCode==EGW_KEY_MENU&&!_key.ctrl)return this.doExecuteImplementation({posx:0,posy:0},_selected,_links,_target);var obj=this._searchShortcutInLinks(_key,_links);return obj?(obj.execute(_selected),!0):!1},ai._registerContext=function(_node,_callback,_context){var contextHandler=function(e){if(egwIsMobile()&&(3==e.originalEvent.which,jQuery(".nm-mob-header .nm_action_header").toggleClass("back",_egw_active_menu)),e||(e=window.event),_egw_active_menu)_egw_active_menu.hide();else if(!e.ctrlKey&&3==e.which||0===e.which){var _xy=ai._getPageXY(e),_implContext={event:e,posx:_xy.posx,posy:_xy.posy};_callback.call(_context,_implContext,ai)}return e.cancelBubble=!e.ctrlKey||1==e.which,e.stopPropagation&&e.cancelBubble&&e.stopPropagation(),!e.cancelBubble};$j(_node).on("contextmenu",contextHandler)},ai.doRegisterAction=function(_aoi,_callback,_context){var node=_aoi.getDOMNode();return node?(this._registerDefault(node,_callback,_context),this._registerContext(node,_callback,_context),!0):!1},ai.doUnregisterAction=function(_aoi){},ai.doExecuteImplementation=function(_context,_selected,_links,_target){if("undefined"==typeof _target&&(_target=null),ai._context=_context,"object"==typeof _context&&"object"==typeof _context.keyEvent)return ai._handleKeyPress(_context.keyEvent,_selected,_links,_target);if("default"!=_context){if(("number"!=typeof _context.posx||"number"!=typeof _context.posy)&&"undefined"!=typeof _context.id){var node=_context;x=$j(node).offset().left,y=$j(node).offset().top,_context={posx:x,posy:y}}var menu=ai._buildMenu(_links,_selected,_target);return menu.showAt(_context.posx,_context.posy),!0}var defaultAction=ai._getDefaultLink(_links);return defaultAction&&defaultAction.execute(_selected),!1},ai._groupLayers=function(_layer,_links,_parentGroup){for(var link_groups={},i=0;i<_layer.children.length;i++){var actionObj=_layer.children[i].action,grp=actionObj.group;"undefined"==typeof link_groups[grp]&&(link_groups[grp]=[]);var visible=!0,enabled=!0;"undefined"!=typeof _links[actionObj.id]&&(visible=_links[actionObj.id].visible,enabled=_links[actionObj.id].enabled);for(var inserted=!1,groupObj={actionObj:actionObj,visible:visible,enabled:enabled,groups:[]},j=0;jactionObj.order){inserted=!0,link_groups[grp].splice(j,0,groupObj);break}}inserted||link_groups[grp].push(groupObj),_layer.children[i].children.length>0&&this._groupLayers(_layer.children[i],_links,groupObj)}var groups=[];for(var k in link_groups)groups.push({grp:k,links:link_groups[k]});groups.sort(function(a,b){var ia=parseInt(a.grp),ib=parseInt(b.grp);return ia>ib?1:ib>ia?-1:0});for(var groups2=[],i=0;i0&&this._groupLayers(tree.root[0],_links,groups);var menu=new egwMenu;return this._buildMenuLayer(menu,groups.groups,_selected,!0,_target),menu},ai._getPageXY=function(event){var scrollTop=document.body.scrollTop?document.body.scrollTop:document.documentElement.scrollTop,scrollLeft=document.body.scrollLeft?document.body.scrollLeft:document.documentElement.scrollLeft;return{posx:event.clientX+scrollLeft,posy:event.clientY+scrollTop}},ai._addCopyPaste=function(_links,_selected){var drag=_selected[0].getSelectedLinks("drag").links,drop=_selected[0].getSelectedLinks("drop").links;if(drag&&!jQuery.isEmptyObject(drag)||drop&&!jQuery.isEmptyObject(drop)){var mgr=_selected[0].manager,copy_action=mgr.getActionById("egw_copy"),add_action=mgr.getActionById("egw_copy_add"),clipboard_action=mgr.getActionById("egw_os_clipboard"),paste_action=mgr.getActionById("egw_paste");if(this._context.event){var ui={position:{top:0,left:0},offset:{top:0,left:0}},event=this._context.event.originalEvent;ui.position={top:event.pageY,left:event.pageX},ui.offset={top:event.offsetY,left:event.offsetX}}if(drag&&!jQuery.isEmptyObject(drag)){null==copy_action&&(copy_action=mgr.addAction("popup","egw_copy",egw.lang("Copy to clipboard"),egw.image("copy"),function(action,selected){var clipboard={type:[],selected:[]};for(var k in drag)drag[k].enabled&&drag[k].actionObj.dragType.length>0&&(clipboard.type=clipboard.type.concat(drag[k].actionObj.dragType));clipboard.type=jQuery.unique(clipboard.type);for(var k in selected)selected[k].id&&clipboard.selected.push({id:selected[k].id,data:selected[k].data});egw.setSessionItem("phpgwapi","egw_clipboard",JSON.stringify(clipboard))},!0),copy_action.group=2.5),null==add_action&&(add_action=mgr.addAction("popup","egw_copy_add",egw.lang("Add to clipboard"),egw.image("copy"),function(action,selected){var clipboard=JSON.parse(egw.getSessionItem("phpgwapi","egw_clipboard"))||{type:[],selected:[]};for(var k in drag)drag[k].enabled&&drag[k].actionObj.dragType.length>0&&(clipboard.type=clipboard.type.concat(drag[k].actionObj.dragType));clipboard.type=jQuery.unique(clipboard.type);for(var k in selected)selected[k].id&&clipboard.selected.push({id:selected[k].id,data:selected[k].data});egw.setSessionItem("phpgwapi","egw_clipboard",JSON.stringify(clipboard))},!0),add_action.group=2.5),null==clipboard_action&&(clipboard_action=mgr.addAction("popup","egw_os_clipboard",egw.lang("Copy to OS clipboard"),egw.image("copy"),function(action){document.queryCommandSupported("copy")&&$j(action.data.target).trigger("copy")},!0),clipboard_action.group=2.5);var os_clipboard_caption=this._context.event.originalEvent.target.innerHTML.trim();clipboard_action.set_caption(egw.lang('Copy "%1"',os_clipboard_caption.length>20?os_clipboard_caption.substring(0,20)+"...":os_clipboard_caption)),clipboard_action.data.target=this._context.event.originalEvent.target,$j(clipboard_action.data.target).off("copy").on("copy",function(event){var target=$j(clipboard_action.data.target),old_select=target.css("user-select");target.css("user-select","all");var range=document.createRange();range.selectNode(clipboard_action.data.target),window.getSelection().removeAllRanges(),window.getSelection().addRange(range),target.css("user-select",old_select);var successful=!1;try{"undefined"!=typeof event.target.setActive&&window.clipboardData&&window.clipboardData.setData("Text",$j(clipboard_action.data.target).text().trim()),event.clipboardData&&(event.clipboardData.setData("text/plain",$j(clipboard_action.data.target).text().trim()),event.clipboardData.setData("text/html",$j(clipboard_action.data.target).html())),egw.message(egw.lang("Use Ctrl-C/Cmd-C to copy")),successful=document.execCommand("copy")}catch(err){}return successful?(egw.message(""),window.getSelection().removeAllRanges(),target.css("user-select",old_select),!1):void 0}),"undefined"==typeof _links[copy_action.id]&&(_links[copy_action.id]={actionObj:copy_action,enabled:!0,visible:!0,cnt:0}),"undefined"==typeof _links[add_action.id]&&(_links[add_action.id]={actionObj:add_action,enabled:!0,visible:!0,cnt:0}),"undefined"==typeof _links[clipboard_action.id]&&(_links[clipboard_action.id]={actionObj:clipboard_action,enabled:os_clipboard_caption.length>0,visible:os_clipboard_caption.length>0,cnt:0})}if(drop&&!jQuery.isEmptyObject(drop)){var paste_exec=function(action,selected){var clipboard=JSON.parse(egw.getSessionItem("phpgwapi","egw_clipboard"));drop[action.id].actionObj.ui=ui,drop[action.id].actionObj.paste=!0,drop[action.id].actionObj.execute(clipboard.selected,selected[0]),drop[action.id].actionObj.paste=!1},clipboard=JSON.parse(egw.getSessionItem("phpgwapi","egw_clipboard"))||{type:[],selected:[]};null==paste_action&&(paste_action=mgr.addAction("popup","egw_paste",egw.lang("Paste"),egw.image("editpaste"),paste_exec,!0),paste_action.group=2.5,paste_action.order=9,paste_action.canHaveChildren.push("drop"));var hint=egw.lang("Clipboard")+":\n["+clipboard.type.join(",")+"]\n";paste_action.set_hint(hint);for(var i=0;i0;)paste_action.children[0].remove();if(null==clipboard||"object"!=typeof clipboard.type)return;for(var k in drop){var drop_clone=jQuery.extend({},drop[k].actionObj);drop_clone.parent=paste_action,drop_clone.onExecute=new egwFnct(this,null,[]),drop_clone.set_onExecute(paste_exec),paste_action.children.push(drop_clone),paste_action.allowOnMultiple=paste_action.allowOnMultiple&&drop_clone.allowOnMultiple,_links[k]=jQuery.extend({},drop[k]),_links[k].actionObj=drop_clone,_links[k].enabled=!1,_links[k].visible=!1;for(var i=0;i1?"entries":"entry")||egw.app_name()),index=0,i=0;i<_selected.length;i++){var row=$j(_selected[i].iface.getDOMNode()).clone();if(row&&(rows.push(row),table.append(row)),index++,index==maxRows){var spanCnt=$j(document.createElement("span")).addClass("et2_egw_action_ddHelper_itemsCnt").appendTo(div);spanCnt.text(_selected.length+" "+itemLabel);var restRows=_selected.length-maxRows;restRows&&moreRow.text(_selected.length-maxRows+" "+egw.lang("more %1 selected ...",itemLabel)),table.append(moreRow);break}}var text=$j(document.createElement("div")).addClass("et2_egw_action_ddHelper_tip");if(div.append(text),"draggable"in document.createElement("span")&&navigator&&navigator.userAgent.indexOf("Chrome")>=0&&"filemanager"==egw.app_name()){var key=["Mac68K","MacPPC","MacIntel"].indexOf(window.navigator.platform)<0?egw.lang("Alt"):egw.lang("Command ⌘");text.text(egw.lang("Hold [%1] and [%2] key to drag %3 to your desktop",key,egw.lang("Shift ⇧"),itemLabel))}return div},ai.doRegisterAction=function(_aoi,_callback,_context){var node=_aoi.getDOMNode();if(node){if(node.onselectstart=function(){return!1},!(window.FileReader&&"draggable"in document.createElement("span")))return;var action=null,groups=_context.getActionImplementationGroups();if(!groups.drag)return;for(var i=0;i-1){action=groups.drag[i].link.actionObj;break}return action?(jQuery.event.props.push("dataTransfer"),$j(node).off("mousedown").on("mousedown",function(event){var dragOut=_context.isDragOut(event);if($j(this).attr("draggable",dragOut?"true":""),$j(node).draggable("option","disabled",dragOut),dragOut)$j(node).removeClass("ui-draggable-disabled ui-state-disabled");else if(_context.isSelection(event)?($j(node).draggable("disable"),$j(node).removeClass("ui-draggable-disabled ui-state-disabled")):3!=event.which&&document.getSelection().removeAllRanges(),!dragOut||!this.addEventListener)return}).on("mouseup",function(event){_context.isSelection(event)&&$j(node).draggable("enable")}).on("dragstart",function(event){if(!_context.isSelection(event)&&null!=event.dataTransfer){event.dataTransfer.effectAllowed="copy";var selected=[_context];_context.parent.setAllSelected(!1),_context.setSelected(!0);for(var i=0;i$target.innerWidth()?!1:null!=ai.helper},revert:function(valid){var dTarget=this;if(valid)return!1;var tipTelorance=10,helperTop=ai.helper.position().top;if(helperTop>=dTarget.offset().top&&helperTop<=dTarget.height()+dTarget.offset().top+tipTelorance){var key=["Mac68K","MacPPC","MacIntel"].indexOf(window.navigator.platform)<0?egw.lang("Ctrl"):egw.lang("Command ⌘");egw.message(egw.lang("Hold [%1] key to select text eg. to copy it",key),"info")}return!0},refreshPositions:!0,scroll:!1,iframeFix:!0,delay:300}),!0}return!1},ai.doUnregisterAction=function(_aoi){var node=_aoi.getDOMNode();node&&$j(node).data("uiDraggable")&&$j(node).draggable("destroy")},ai.doExecuteImplementation=function(_context,_selected,_links){this.helper=null;var hasLink=!1;this.ddTypes=[],this.selected=_selected;for(var k in _links)if(_links[k].visible){hasLink=!0,!this.helper&&_links[k].actionObj.onExecute.hasHandler()&&(this.helper=_links[k].actionObj.execute(_selected));for(var type=$j.isArray(_links[k].actionObj.dragType)?_links[k].actionObj.dragType:[_links[k].actionObj.dragType],i=0;i1&&(enabled=!1),enabled||(links[k].enabled=!1,links[k].visible=!links[k].actionObj.hideOnDisabled)}var cnt=0,lnk=null;for(var k in links)links[k].enabled&&links[k].visible&&(lnk=links[k],cnt+=1+links[k].actionObj.children.length,lnk.actionObj.ui=ui);if(1==cnt&&window.setTimeout(function(){lnk.actionObj.execute(selected,_context)},0),cnt>1){var popup=getPopupImplementation(),pos=popup._getPageXY(event.originalEvent);popup.auto_paste=!1,window.setTimeout(function(){popup.doExecuteImplementation(pos,selected,links,_context),popup.auto_paste=!0},0)}$j("body").css({cursor:"auto"}),_aoi.triggerEvent(EGW_AI_DRAG_OUT,{event:event,ui:ui})},over:function(event,ui){_aoi.triggerEvent(EGW_AI_DRAG_OVER,{event:event,ui:ui})},out:function(event,ui){_aoi.triggerEvent(EGW_AI_DRAG_OUT,{event:event,ui:ui})},tolerance:"pointer",hoverClass:"drop-hover",greedy:!0}),!0):!1},ai.doUnregisterAction=function(_aoi){var node=_aoi.getDOMNode();node&&$j(node).data("uiDroppable")&&$j(node).droppable("destroy")},ai._fetchAccepted=function(_links){var accepted=[];for(var k in _links)for(var i=0;i<_links[k].actionObj.acceptedTypes.length;i++){var type=_links[k].actionObj.acceptedTypes[i];-1==accepted.indexOf(type)&&accepted.push(type)}return accepted},ai.doExecuteImplementation=function(_context,_selected,_links){return"links"==_context?_links:void 0},ai}function dhtmlxTree_getNode(_tree,_itemId){var node=_tree._globalIdStorageFind(_itemId);return null!=node?$j("tr:first",node.htmlNode):void 0}function dhtmlxtreeItemAOI(_tree,_itemId){var aoi=new egwActionObjectInterface;return aoi.node=dhtmlxTree_getNode(_tree,_itemId),aoi.id=_itemId,aoi.doGetDOMNode=function(){return aoi.node},aoi.doTriggerEvent=function(_event){_event==EGW_AI_DRAG_OVER&&$j(this.node).addClass("draggedOver"),_event==EGW_AI_DRAG_OUT&&$j(this.node).removeClass("draggedOver")},aoi.doSetState=function(_state){_tree&&_tree.focusItem&&(egwBitIsSet(_state,EGW_AO_STATE_FOCUSED)&&_tree.focusItem(this.id),egwBitIsSet(_state,EGW_AO_STATE_SELECTED)&&_tree.selectItem(this.id,!1))},aoi}function dhtmlXMenuObject(baseId,skin){var main_self=this;if(this.addBaseIdAsContextZone=null,this.isDhtmlxMenuObject=!0,this.skin=null!=skin?skin:"undefined"!=typeof dhtmlx&&"string"==typeof dhtmlx.skin?dhtmlx.skin:"dhx_skyblue",this.imagePath="",this._isIE6=!1,_isIE&&(this._isIE6=null==window.XMLHttpRequest),null==baseId)this.base=document.body;else{var baseObj="string"==typeof baseId?document.getElementById(baseId):baseId;if(null!=baseObj){for(this.base=baseObj,this.base.id||(this.base.id=(new Date).valueOf());this.base.childNodes.length>0;)this.base.removeChild(this.base.childNodes[0]);this.base.className+=" dhtmlxMenu_"+this.skin+"_Middle dir_left",this.base._autoSkinUpdate=!0,this.base.oncontextmenu&&(this.base._oldContextMenuHandler=this.base.oncontextmenu),this.addBaseIdAsContextZone=this.base.id,this.base.onselectstart=function(e){return e=e||event,e.returnValue=!1,!1},this.base.oncontextmenu=function(e){return e=e||event,e.returnValue=!1,!1}}else this.base=document.body}if(this.topId="dhxWebMenuTopId",!this.extendedModule){for(var t=function(){alert(this.i18n.dhxmenuextalert)},extMethods=new Array("setItemEnabled","setItemDisabled","isItemEnabled","_changeItemState","getItemText","setItemText","loadFromHTML","hideItem","showItem","isItemHidden","_changeItemVisible","setUserData","getUserData","setOpenMode","setWebModeTimeout","enableDynamicLoading","_updateLoaderIcon","getItemImage","setItemImage","clearItemImage","setAutoShowMode","setAutoHideMode","setContextMenuHideAllMode","getContextMenuHideAllMode","setVisibleArea","setTooltip","getTooltip","setHotKey","getHotKey","setItemSelected","setTopText","setRTL","setAlign","setHref","clearHref","getCircuit","_clearAllSelectedSubItemsInPolygon","_checkArrowsState","_addUpArrow","_addDownArrow","_removeUpArrow","_removeDownArrow","_isArrowExists","_doScrollUp","_doScrollDown","_countPolygonItems","setOverflowHeight","_getRadioImgObj","_setRadioState","_radioOnClickHandler","getRadioChecked","setRadioChecked","addRadioButton","_getCheckboxState","_setCheckboxState","_readLevel","_updateCheckboxImage","_checkboxOnClickHandler","setCheckboxState","getCheckboxState","addCheckbox","serialize"),q=0;qthis.menuY1+this.menuY2){var t0=Math.floor((this.menuY2-this.menuY1-35)/24);this.limit=t0}else this.limit=0,null!=this.idPull["arrowup_"+id]&&this._removeUpArrow(String(id).replace(this.idPrefix,"")),null!=this.idPull["arrowdown_"+id]&&this._removeDownArrow(String(id).replace(this.idPrefix,""));if(this.limit>0&&this.limit0&&(this.limitmx&&!this._rtl&&(x=srcX-w+2),xx&&(x=0),y+h>my&&null!=this.menuY2&&(y=Math.max(srcY+srcH-h+2,this._isVisibleArea?this.menuY1+2:2),this.context&&this.idPrefix+this.topId==id&&null!=arrowDown&&(y-=2),null==this.itemPull[id]||this.context||this.itemPull[id].parent==this.idPrefix+this.topId&&(y-=this.base.offsetHeight)),this.idPull[pId].style.left=x+"px",this.idPull[pId].style.top=y+arrUpH+"px","undefined"!=typeof this._menuEffect&&this._menuEffect!==!1)this._showPolygonEffect(pId);else if(this.idPull[pId].style.visibility="",this.limit>0&&this.limit0;)this._openedPolygons.pop();var i=this._getSubItemToDeselectByPolygon(parentId);this._removeSubItemFromSelected(-1,-1);for(var q=0;q0&&(m=j)}return m},this._getMenuNodes=function(node){var m=new Array;for(var a in this.itemPull)this.itemPull[a].parent==node&&(m[m.length]=a);return m},this._genStr=function(w){for(var s="",z="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789",q=0;w>q;q++)s+=z.charAt(Math.round(Math.random()*(z.length-1)));return s},this.getItemType=function(id){return id=this.idPrefix+id,null==this.itemPull[id]?null:this.itemPull[id].type},this.forEachItem=function(handler){for(var a in this.itemPull)handler(String(a).replace(this.idPrefix,""))},this._clearAndHide=function(){for(main_self.menuSelected=-1,main_self.menuLastClicked=-1;main_self._openedPolygons.length>0;)main_self._openedPolygons.pop();for(var q=0;q0,this.dLoad&&item.complex&&(item.loaded="no"),this.itemPull[item.id]=item;for(var w=0;w1&&(item._menuOpenTM=window.setTimeout(function(){main_self._showPolygon(pId,level)},delay),isShow=!0)}}isShow||main_self._showPolygon(pId,level)}main_self.itemPull[main_self.idPrefix+parentId].loaded="yes",1==main_self.loaderIcon&&main_self._updateLoaderIcon(main_self.idPrefix+parentId,!1)}this.destructor(),main_self.callEvent("onXLE",[])}else{var t=this.getXMLTopNode("menu");main_self._buildMenu(t,null),main_self.init(),main_self.callEvent("onXLE",[]),main_self._doOnLoad()}},this._xmlLoader=new dtmlXMLLoaderObject(this._xmlParser,window),this._showSubLevelItem=function(id,back){null!=document.getElementById("arrow_"+this.idPrefix+id)&&(document.getElementById("arrow_"+this.idPrefix+id).style.display=back?"none":""),null!=document.getElementById("image_"+this.idPrefix+id)&&(document.getElementById("image_"+this.idPrefix+id).style.display=back?"none":""),null!=document.getElementById(this.idPrefix+id)&&(document.getElementById(this.idPrefix+id).style.display=back?"":"none")},this._hideSubLevelItem=function(id){this._showSubLevelItem(id,!0)},this.idPrefix=this._genStr(12),this._bodyClick=function(e){e=e||event,2==e.button||_isOpera&&1==e.ctrlKey||(main_self.context?main_self.contextAutoHide&&(!_isOpera||main_self._isContextMenuVisible()&&_isOpera)&&main_self._hideContextMenu():main_self._clearAndHide&&main_self._clearAndHide())},this._bodyContext=function(e){e=e||event;var t=String((e.srcElement||e.target).className);if(-1==t.search("dhtmlxMenu")||-1==t.search("SubLevelArea")){for(var toHide=!0,testZone=e.target||e.srcElement;null!=testZone;)null!=testZone.id&&main_self.isContextZone(testZone.id)&&(toHide=!1),testZone==document.body&&(toHide=!1),testZone=testZone.parentNode;toHide&&main_self.hideContextMenu()}},"undefined"!=typeof window.addEventListener?(window.addEventListener("click",this._bodyClick,!1),window.addEventListener("contextmenu",this._bodyContext,!1)):(document.body.attachEvent("onclick",this._bodyClick),document.body.attachEvent("oncontextmenu",this._bodyContext)),this._UID=this._genStr(32),dhtmlxMenuObjectLiveInstances[this._UID]=this,dhtmlxEventable(this),this}function egwMenuImpl(_structure){this.dhtmlxmenu=new dhtmlXMenuObject,this.dhtmlxmenu.setSkin("egw"),this.dhtmlxmenu.renderAsContextMenu();var self=this;this.dhtmlxmenu.attachEvent("onClick",function(id){if(id){var elem=self.dhtmlxmenu.getUserData(id,"egw_menu");if(elem&&elem.onClick){elem.checkbox&&self.dhtmlxmenu.setContextMenuHideAllMode(!1);var res=elem.onClick(elem);if(elem.checkbox&&(res===!1||res===!0)){var checked=res;0!=elem.groupIndex?self.dhtmlxmenu.setRadioChecked(id,checked):self.dhtmlxmenu.setCheckboxState(id,checked)}}}}),this.dhtmlxmenu.attachEvent("onRadioClick",function(group,idChecked,idClicked,zoneId,casState){if(idClicked){var elem=self.dhtmlxmenu.getUserData(idClicked,"egw_menu");elem&&elem.set_checked(!0)}return!0}),this.dhtmlxmenu.attachEvent("onCheckboxClick",function(id,state,zoneId,casState){if(id){var elem=self.dhtmlxmenu.getUserData(id,"egw_menu");elem&&elem.set_checked(!state)}return!0}),this._translateStructure(_structure,this.dhtmlxmenu.topId,0)}!function(global,factory){"object"==typeof module&&"object"==typeof module.exports?module.exports=global.document?factory(global,!0):function(w){if(!w.document)throw new Error("jQuery requires a window with a document");return factory(w)}:factory(global)}("undefined"!=typeof window?window:this,function(window,noGlobal){function isArraylike(obj){var length=obj.length,type=jQuery.type(obj);return"function"===type||jQuery.isWindow(obj)?!1:1===obj.nodeType&&length?!0:"array"===type||0===length||"number"==typeof length&&length>0&&length-1 in obj}function winnow(elements,qualifier,not){if(jQuery.isFunction(qualifier))return jQuery.grep(elements,function(elem,i){return!!qualifier.call(elem,i,elem)!==not});if(qualifier.nodeType)return jQuery.grep(elements,function(elem){return elem===qualifier!==not});if("string"==typeof qualifier){if(risSimple.test(qualifier))return jQuery.filter(qualifier,elements,not);qualifier=jQuery.filter(qualifier,elements)}return jQuery.grep(elements,function(elem){return jQuery.inArray(elem,qualifier)>=0!==not})}function sibling(cur,dir){do cur=cur[dir];while(cur&&1!==cur.nodeType);return cur}function createOptions(options){var object=optionsCache[options]={};return jQuery.each(options.match(rnotwhite)||[],function(_,flag){object[flag]=!0}),object}function detach(){document.addEventListener?(document.removeEventListener("DOMContentLoaded",completed,!1),window.removeEventListener("load",completed,!1)):(document.detachEvent("onreadystatechange",completed),window.detachEvent("onload",completed))}function completed(){(document.addEventListener||"load"===event.type||"complete"===document.readyState)&&(detach(),jQuery.ready())}function dataAttr(elem,key,data){if(void 0===data&&1===elem.nodeType){var name="data-"+key.replace(rmultiDash,"-$1").toLowerCase();if(data=elem.getAttribute(name),"string"==typeof data){try{data="true"===data?!0:"false"===data?!1:"null"===data?null:+data+""===data?+data:rbrace.test(data)?jQuery.parseJSON(data):data}catch(e){}jQuery.data(elem,key,data)}else data=void 0}return data}function isEmptyDataObject(obj){var name;for(name in obj)if(("data"!==name||!jQuery.isEmptyObject(obj[name]))&&"toJSON"!==name)return!1;return!0}function internalData(elem,name,data,pvt){if(jQuery.acceptData(elem)){var ret,thisCache,internalKey=jQuery.expando,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[internalKey]:elem[internalKey]&&internalKey;if(id&&cache[id]&&(pvt||cache[id].data)||void 0!==data||"string"!=typeof name)return id||(id=isNode?elem[internalKey]=deletedIds.pop()||jQuery.guid++:internalKey),cache[id]||(cache[id]=isNode?{}:{toJSON:jQuery.noop}),"object"!=typeof name&&"function"!=typeof name||(pvt?cache[id]=jQuery.extend(cache[id],name):cache[id].data=jQuery.extend(cache[id].data,name)),thisCache=cache[id],pvt||(thisCache.data||(thisCache.data={}),thisCache=thisCache.data),void 0!==data&&(thisCache[jQuery.camelCase(name)]=data),"string"==typeof name?(ret=thisCache[name],null==ret&&(ret=thisCache[jQuery.camelCase(name)])):ret=thisCache,ret}}function internalRemoveData(elem,name,pvt){if(jQuery.acceptData(elem)){var thisCache,i,isNode=elem.nodeType,cache=isNode?jQuery.cache:elem,id=isNode?elem[jQuery.expando]:jQuery.expando;if(cache[id]){if(name&&(thisCache=pvt?cache[id]:cache[id].data)){jQuery.isArray(name)?name=name.concat(jQuery.map(name,jQuery.camelCase)):name in thisCache?name=[name]:(name=jQuery.camelCase(name),name=name in thisCache?[name]:name.split(" ")),i=name.length;for(;i--;)delete thisCache[name[i]];if(pvt?!isEmptyDataObject(thisCache):!jQuery.isEmptyObject(thisCache))return}(pvt||(delete cache[id].data,isEmptyDataObject(cache[id])))&&(isNode?jQuery.cleanData([elem],!0):support.deleteExpando||cache!=cache.window?delete cache[id]:cache[id]=null)}}}function returnTrue(){return!0}function returnFalse(){return!1}function safeActiveElement(){try{return document.activeElement}catch(err){}}function createSafeFragment(document){var list=nodeNames.split("|"),safeFrag=document.createDocumentFragment();if(safeFrag.createElement)for(;list.length;)safeFrag.createElement(list.pop());return safeFrag}function getAll(context,tag){var elems,elem,i=0,found=typeof context.getElementsByTagName!==strundefined?context.getElementsByTagName(tag||"*"):typeof context.querySelectorAll!==strundefined?context.querySelectorAll(tag||"*"):void 0;if(!found)for(found=[],elems=context.childNodes||context;null!=(elem=elems[i]);i++)!tag||jQuery.nodeName(elem,tag)?found.push(elem):jQuery.merge(found,getAll(elem,tag));return void 0===tag||tag&&jQuery.nodeName(context,tag)?jQuery.merge([context],found):found}function fixDefaultChecked(elem){rcheckableType.test(elem.type)&&(elem.defaultChecked=elem.checked)}function manipulationTarget(elem,content){return jQuery.nodeName(elem,"table")&&jQuery.nodeName(11!==content.nodeType?content:content.firstChild,"tr")?elem.getElementsByTagName("tbody")[0]||elem.appendChild(elem.ownerDocument.createElement("tbody")):elem}function disableScript(elem){return elem.type=(null!==jQuery.find.attr(elem,"type"))+"/"+elem.type,elem}function restoreScript(elem){var match=rscriptTypeMasked.exec(elem.type);return match?elem.type=match[1]:elem.removeAttribute("type"),elem}function setGlobalEval(elems,refElements){for(var elem,i=0;null!=(elem=elems[i]);i++)jQuery._data(elem,"globalEval",!refElements||jQuery._data(refElements[i],"globalEval"))}function cloneCopyEvent(src,dest){if(1===dest.nodeType&&jQuery.hasData(src)){var type,i,l,oldData=jQuery._data(src),curData=jQuery._data(dest,oldData),events=oldData.events;if(events){delete curData.handle,curData.events={};for(type in events)for(i=0,l=events[type].length;l>i;i++)jQuery.event.add(dest,type,events[type][i])}curData.data&&(curData.data=jQuery.extend({},curData.data))}}function fixCloneNodeIssues(src,dest){var nodeName,e,data;if(1===dest.nodeType){if(nodeName=dest.nodeName.toLowerCase(),!support.noCloneEvent&&dest[jQuery.expando]){data=jQuery._data(dest);for(e in data.events)jQuery.removeEvent(dest,e,data.handle);dest.removeAttribute(jQuery.expando)}"script"===nodeName&&dest.text!==src.text?(disableScript(dest).text=src.text,restoreScript(dest)):"object"===nodeName?(dest.parentNode&&(dest.outerHTML=src.outerHTML),support.html5Clone&&src.innerHTML&&!jQuery.trim(dest.innerHTML)&&(dest.innerHTML=src.innerHTML)):"input"===nodeName&&rcheckableType.test(src.type)?(dest.defaultChecked=dest.checked=src.checked,dest.value!==src.value&&(dest.value=src.value)):"option"===nodeName?dest.defaultSelected=dest.selected=src.defaultSelected:"input"!==nodeName&&"textarea"!==nodeName||(dest.defaultValue=src.defaultValue)}}function actualDisplay(name,doc){var style,elem=jQuery(doc.createElement(name)).appendTo(doc.body),display=window.getDefaultComputedStyle&&(style=window.getDefaultComputedStyle(elem[0]))?style.display:jQuery.css(elem[0],"display");return elem.detach(),display}function defaultDisplay(nodeName){var doc=document,display=elemdisplay[nodeName];return display||(display=actualDisplay(nodeName,doc),"none"!==display&&display||(iframe=(iframe||jQuery("