Your IP : 3.145.12.145
(function(e){function t(e){this.calendar=e;this.params={}}t.prototype={show:function(e){var t;this.params=e;this.entry=this.params.entry;var s=e.entry.getPart(0);if(e.specialTarget){this.bindNode=e.specialTarget}else if(s&&s.params&&s.params.wrapNode){this.bindNode=s.params.wrapNode}if(!this.bindNode)return;t=new BX.PopupWindow(this.calendar.id+"-simple-view-popup",this.bindNode,{autoHide:true,closeByEsc:true,offsetTop:0,offsetLeft:0,closeIcon:true,titleBar:true,draggable:true,resizable:false,lightShadow:true,className:"calendar-simple-view-popup",content:this.createContent()});BX.addClass(t.titleBar,"calendar-add-popup-titlebar");BX.removeClass(t.popupContainer,"popup-window-with-titlebar");BX.removeClass(t.closeIcon,"popup-window-titlebar-close-icon");t.show(true);this.popup=t;this.popupButtonsContainer=t.buttonsContainer;BX.addClass(t.contentContainer,"calendar-view-popup-wrap");BX.adjust(t.contentContainer,{attrs:{style:""}});t.popupContainer.style.minHeight=t.popupContainer.offsetHeight-20+"px";BX.bind(document,"keydown",BX.proxy(this.keyHandler,this));BX.addCustomEvent(t,"onPopupClose",BX.proxy(this.close,this));this.calendar.disableKeyHandler()},close:function(e){if(!e)e={};this.calendar.enableKeyHandler();if(this.popup){BX.removeCustomEvent(this.popup,"onPopupClose",BX.proxy(this.close,this));this.popup.destroy()}if(this.params.closeCallback&&typeof this.params.closeCallback=="function")this.params.closeCallback();if(e.deselectEntry){setTimeout(BX.delegate(function(){this.calendar.getView().deselectEntry()},this),300)}BX.unbind(document,"keydown",BX.proxy(this.keyHandler,this))},isShown:function(){return this.popup&&this.popup.isShown&&this.popup.isShown()},createContent:function(e){if(e&&e.entry)this.entry=e.entry;this.wrap=BX.create("DIV",{props:{className:"calendar-right-block-event-info"}});var t;this.DOM={name:this.wrap.appendChild(BX.create("DIV",{props:{className:"calendar-right-block-event-info-title"},html:'<div class="calendar-right-block-event-info-title-calendar" style="background-color: '+this.entry.color+';"></div>'+BX.util.htmlspecialchars(this.entry.name)})),date:this.wrap.appendChild(BX.create("DIV",{props:{className:"calendar-right-block-event-info-date"},text:this.calendar.util.formatDateUsable(this.entry.from)})),tableWrap:this.wrap.appendChild(BX.create("TABLE",{props:{className:"calendar-field-right-block-table"}})),buttonsWrap:this.wrap.appendChild(BX.create("DIV",{props:{className:"calendar-right-block-event-info-btn-container"}}))};if(this.calendar.util.getDayCode(this.entry.from)==this.calendar.util.getDayCode(this.entry.to)){this.DOM.date.innerHTML=this.calendar.util.formatDateUsable(this.entry.from);if(this.entry.fullDay){this.DOM.date.innerHTML+=", "+BX.message("EC_ALL_DAY")}else{this.DOM.date.innerHTML+=", "+this.calendar.util.formatTime(this.entry.from.getHours(),this.entry.from.getMinutes())+" – "+this.calendar.util.formatTime(this.entry.to.getHours(),this.entry.to.getMinutes())}}else{this.DOM.date.innerHTML=this.calendar.util.formatDateUsable(this.entry.from)+", "+this.calendar.util.formatTime(this.entry.from.getHours(),this.entry.from.getMinutes())+" – "+this.calendar.util.formatDateUsable(this.entry.to)+", "+this.calendar.util.formatTime(this.entry.to.getHours(),this.entry.to.getMinutes())}if(this.entry.isRecursive()&&this.entry.data["~RRULE_DESCRIPTION"]){t=this.DOM.tableWrap.insertRow(-1);BX.adjust(t.insertCell(-1),{props:{className:"calendar-field-table-cell-name"},html:BX.message("EC_REPEAT")+":"});BX.adjust(t.insertCell(-1),{props:{className:"calendar-field-table-cell-value"},html:'<div class="calendar-field-container calendar-field-container-text"><div class="calendar-field-block"><div class="calendar-text">'+BX.util.htmlspecialchars(this.entry.data["~RRULE_DESCRIPTION"])+"</div></div></div>"})}if(this.calendar.util.isMeetingsEnabled()&&this.entry.isMeeting()&&this.entry.getAttendees().length>0){t=this.DOM.tableWrap.insertRow(-1);BX.adjust(t.insertCell(-1),{props:{className:"calendar-field-table-cell-name"},html:BX.message("EC_HOST")+":"});this.DOM.hostWrap=BX.adjust(t.insertCell(-1),{props:{className:"calendar-field-table-cell-value"}}).appendChild(BX.create("DIV",{props:{className:"calendar-field-container calendar-field-container-members"}})).appendChild(BX.create("DIV",{props:{className:"calendar-field-block"}})).appendChild(BX.create("DIV",{props:{className:"calendar-add-popup-selected-members"}}));var s=false;this.showAttendees(this.DOM.hostWrap,this.entry.getAttendees().filter(function(e){if(s)return false;s=e.STATUS=="H"||e.USER_ID==this.entry.getMeetingHost();return s},this));t=this.DOM.tableWrap.insertRow(-1);BX.adjust(t.insertCell(-1),{props:{className:"calendar-field-table-cell-name"},html:BX.message("EC_ATTENDEES_LABEL")+":"});this.DOM.attendeesWrap=BX.adjust(t.insertCell(-1),{props:{className:"calendar-field-table-cell-value"}}).appendChild(BX.create("DIV",{props:{className:"calendar-field-container calendar-field-container-members"}})).appendChild(BX.create("DIV",{props:{className:"calendar-field-block"}})).appendChild(BX.create("DIV",{props:{className:"calendar-add-popup-selected-members"}}));this.showAttendees(this.DOM.attendeesWrap,this.entry.getAttendees().filter(function(e){return e.STATUS=="Y"||e.STATUS=="H"}),this.entry.getAttendees().length)}var a=this.calendar.util.getTextLocation(this.entry.location);if(a){t=this.DOM.tableWrap.insertRow(-1);BX.adjust(t.insertCell(-1),{props:{className:"calendar-field-table-cell-name"},html:BX.message("EC_LOCATION")+":"});BX.adjust(t.insertCell(-1),{props:{className:"calendar-field-table-cell-value"},html:'<div class="calendar-field-container calendar-field-container-text"><div class="calendar-field-block"><div class="calendar-text">'+BX.util.htmlspecialchars(a)+"</div></div></div>"})}if(this.calendar.util.showEventDescriptionInSimplePopup()){this.entry.getDescription(BX.proxy(function(e){if(BX.isNodeInDom(this.DOM.tableWrap)&&e){t=this.DOM.tableWrap.insertRow(-1);BX.adjust(t.insertCell(-1),{attrs:{colSpan:2,className:"calendar-field-table-cell-value"},html:'<div class="calendar-field-container calendar-field-container-text calendar-container-short-description"><div class="calendar-field-block"><div class="calendar-text calendar-description-field">'+e+"</div></div></div>"})}},this))}this.showButtons();return this.wrap},showButtons:function(){if(this.calendar.util.useViewSlider()){this.DOM.buttonsWrap.appendChild(BX.create("SPAN",{props:{className:"calendar-right-block-event-info-btn"},text:BX.message("EC_VIEW"),events:{click:BX.proxy(function(){if(this.entry.isTask()){BX.SidePanel.Instance.open(this.calendar.util.getViewTaskPath(this.entry.id),{loader:"task-new-loader"})}else{this.calendar.getView().showViewSlider({entry:this.entry})}this.close({deselectEntry:true})},this)}}))}if(this.calendar.util.isMeetingsEnabled()&&this.entry&&this.entry.getCurrentStatus()){var e=this.entry.getCurrentStatus();if(e=="Q"){this.DOM.buttonsWrap.appendChild(BX.create("SPAN",{props:{className:"calendar-right-block-event-info-btn"},text:BX.message("EC_VIEW_DESIDE_BUT_Y"),events:{click:BX.proxy(function(){this.calendar.entryController.setMeetingStatus(this.entry,"Y");this.close({deselectEntry:true})},this)}}));this.DOM.buttonsWrap.appendChild(BX.create("SPAN",{props:{className:"calendar-right-block-event-info-btn"},text:BX.message("EC_VIEW_DESIDE_BUT_N"),events:{click:BX.proxy(function(){this.calendar.entryController.setMeetingStatus(this.entry,"N");this.close({deselectEntry:true})},this)}}))}else if(e=="Y"){this.DOM.buttonsWrap.appendChild(BX.create("SPAN",{props:{className:"calendar-right-block-event-info-btn"},text:BX.message("EC_VIEW_DESIDE_BUT_N"),events:{click:BX.proxy(function(){this.calendar.entryController.setMeetingStatus(this.entry,"N");this.close({deselectEntry:true})},this)}}))}else if(e=="N"){this.DOM.buttonsWrap.appendChild(BX.create("SPAN",{props:{className:"calendar-right-block-event-info-btn"},text:BX.message("EC_VIEW_DESIDE_BUT_Y"),events:{click:BX.proxy(function(){this.calendar.entryController.setMeetingStatus(this.entry,"Y");this.close({deselectEntry:true})},this)}}))}}if(this.calendar.entryController.canDo(this.entry,"edit")&&!this.entry.isTask()){this.DOM.buttonsWrap.appendChild(BX.create("SPAN",{props:{className:"calendar-right-block-event-info-btn"},text:BX.message("EC_SEC_EDIT"),events:{click:BX.proxy(function(){this.calendar.entryController.editEntry({entry:this.entry});this.close({deselectEntry:true})},this)}}))}if(this.calendar.entryController.canDo(this.entry,"delete")&&!this.entry.isTask()){this.DOM.buttonsWrap.appendChild(BX.create("SPAN",{props:{className:"calendar-right-block-event-info-btn"},text:BX.message("EC_SEC_DELETE"),events:{click:BX.proxy(function(){this.calendar.entryController.deleteEntry(this.entry);this.close({deselectEntry:true})},this)}}))}},showAttendees:function(e,t,s){var a,i,r=5,n=t.length,l=7;if(n>0){if(n>l){n=r}for(a=0;a<n;a++){i=t[a]||{};e.appendChild(BX.create("IMG",{attrs:{id:"simple_view_popup_"+i.USER_ID,src:i.AVATAR||"","bx-tooltip-user-id":i.USER_ID},props:{title:i.DISPLAY_NAME,className:"calendar-member"}}))}if(n<t.length){this.DOM.moreUsersLink=e.appendChild(BX.create("SPAN",{props:{className:"calendar-member-more-count"},text:" "+BX.message("EC_ATTENDEES_MORE").replace("#COUNT#",t.length-n),events:{click:BX.delegate(function(){this.showUserListPopup(this.DOM.moreUsersLink,t)},this)}}))}if(s-1>0&&n<s){this.DOM.allUsersLink=e.appendChild(BX.create("SPAN",{props:{className:"calendar-member-total-count"},text:" ("+BX.message("EC_ATTENDEES_TOTAL_COUNT").replace("#COUNT#",s-1)+")",events:{click:BX.delegate(function(){this.showUserListPopup(this.DOM.allUsersLink,this.entry.getAttendees())},this)}}))}}},showUserListPopup:function(e,t){if(this.userListPopup)this.userListPopup.close();if(this.popup)this.popup.setAutoHide(false);if(!t||!t.length)return;this.DOM.userListPopupWrap=BX.create("DIV",{props:{className:"calendar-user-list-popup-block"}});t.forEach(function(e){var t=this.DOM.userListPopupWrap.appendChild(BX.create("DIV",{props:{className:"calendar-slider-sidebar-user-container calendar-slider-sidebar-user-card"}}));t.appendChild(BX.create("DIV",{props:{className:"calendar-slider-sidebar-user-block-avatar"}})).appendChild(BX.create("DIV",{props:{className:"calendar-slider-sidebar-user-block-item"}})).appendChild(BX.create("IMG",{props:{width:34,height:34,src:e.AVATAR}}));t.appendChild(BX.create("DIV",{props:{className:"calendar-slider-sidebar-user-info"}})).appendChild(BX.create("A",{props:{href:e.URL?e.URL:"#",className:"calendar-slider-sidebar-user-info-name"},text:e.DISPLAY_NAME}))},this);this.userListPopup=new BX.PopupWindow(this.calendar.id+"-view-user-list-popup",e,{autoHide:true,closeByEsc:true,offsetTop:0,offsetLeft:0,width:220,resizable:false,lightShadow:true,content:this.DOM.userListPopupWrap,className:"calendar-user-list-popup"});this.userListPopup.setAngle({offset:36});this.userListPopup.show();BX.addCustomEvent(this.userListPopup,"onPopupClose",BX.delegate(function(){if(this.popup)this.popup.setAutoHide(true);this.userListPopup.destroy()},this))},keyHandler:function(e){var t=this.calendar.util.getKeyCodes(),s=e.keyCode;if(this.entry){if(s==t["enter"]){if(this.entry.isTask()){BX.SidePanel.Instance.open(this.calendar.util.getViewTaskPath(this.entry.id),{loader:"task-new-loader"})}else{this.calendar.getView().showViewSlider({entry:this.entry})}this.close({deselectEntry:true})}else if(s==t["delete"]||s==t["backspace"]){this.calendar.entryController.deleteEntry(this.entry)}}}};if(e.BXEventCalendar){e.BXEventCalendar.SimpleViewPopup=t}else{BX.addCustomEvent(e,"onBXEventCalendarInit",function(){e.BXEventCalendar.SimpleViewPopup=t})}})(window);