File manager - Edit - /home/c14075/dragmet-ural.ru/www/bitrix/modules/calendar/install/js/calendar/entry/dist/entry.bundle.min.js
Back
this.BX=this.BX||{};(function(t,e,i,a,s,n,r,o,l){"use strict";class d{static getNewEntry(t){const s={};const n=d.getNewEntryTime(new Date);const r=a.Util.getUserSettings();const l=a.Util.getCurrentUserId();s.ID=null;s.NAME=d.getNewEntryName();s.dateFrom=n.from;s.dateTo=n.to;if(t.type==="location"){s.SECT_ID=o.RoomsManager.getNewEntrySectionId(t.type,parseInt(t.ownerId))}else{s.SECT_ID=i.SectionManager.getNewEntrySectionId(t.type,parseInt(t.ownerId))}s.REMIND=d.getNewEntryReminders();s.attendeesEntityList=[{entityId:"user",id:l}];s.ATTENDEE_LIST=[{id:a.Util.getCurrentUserId(),status:"H"}];if(t.type==="user"&&l!==t.ownerId){s.attendeesEntityList.push({entityId:"user",id:t.ownerId});s.ATTENDEE_LIST=[{id:t.ownerId,status:"H"},{id:a.Util.getCurrentUserId(),status:"Y"}]}else if(t.type==="group"){s.attendeesEntityList.push({entityId:"project",id:t.ownerId})}s.TZ_FROM=r.timezoneName||r.timezoneDefaultName||"";s.TZ_TO=r.timezoneName||r.timezoneDefaultName||"";return new e.Entry({data:s})}static getNewEntryTime(t,e){t=a.Util.getUsableDateTime(t);const i=a.Util.getCalendarContext();if(i){const e=i.getDisplayedViewRange();if(l.Type.isDate(e==null?void 0:e.start)){const s=t.getTime();if(s<e.start.getTime()||s>e.end.getTime()){const s=new Date(e.start.getTime());const n=i.util.getWorkTime();s.setHours(n.start,0,0,0);t=a.Util.getUsableDateTime(s)}}}return{from:t,to:new Date(t.getTime()+(e||3600)*1e3)}}static getNewEntryName(){return d.newEntryName||""}static setNewEntryName(t){d.newEntryName=t}static showEditEntryNotification(t){a.Util.showNotification(l.Loc.getMessage("CALENDAR_SAVE_EVENT_NOTIFICATION"),[{title:l.Loc.getMessage("CALENDAR_EVENT_DO_VIEW"),events:{click:function(e,i,a){d.openViewSlider(t);i.close()}}}])}static showNewEntryNotification(t){a.Util.showNotification(l.Loc.getMessage("CALENDAR_NEW_EVENT_NOTIFICATION"),[{title:l.Loc.getMessage("CALENDAR_EVENT_DO_VIEW"),events:{click:(e,i,a)=>{d.openViewSlider(t);i.close()}}}])}static showDeleteEntryNotification(t){if(t&&t instanceof e.Entry){BX.UI.Notification.Center.notify({id:"calendar"+t.getUniqueId(),content:l.Loc.getMessage("CALENDAR_DELETE_EVENT_NOTIFICATION"),actions:[{title:l.Loc.getMessage("CALENDAR_EVENT_DO_CANCEL"),events:{click:(e,i,a)=>{t.cancelDelete();i.close()}}}]})}}static showReleaseLocationNotification(){BX.UI.Notification.Center.notify({content:l.Loc.getMessage("CALENDAR_RELEASE_LOCATION_NOTIFICATION")})}static closeDeleteNotificationBalloon(t){if(t&&t instanceof e.Entry){const e=BX.UI.Notification.Center.getBalloonById("calendar"+t.getUniqueId());if(e){e.close()}}}static openEditSlider(t={}){const e=a.Util.getBX();if(e.Calendar&&e.Calendar.SliderLoader){new e.Calendar.SliderLoader(t.entry?"EDIT"+t.entry.id:"NEW",{calendarContext:t.calendarContext,entry:t.entry||null,type:t.type,isLocationCalendar:t.isLocationCalendar||false,roomsManager:t.roomsManager||null,locationAccess:t.locationAccess||false,dayOfWeekMonthFormat:t.dayOfWeekMonthFormat||false,locationCapacity:t.locationCapacity||0,ownerId:t.ownerId,userId:t.userId,formDataValue:t.formDataValue||null}).show()}}static openViewSlider(t=null,e={}){if(!l.Type.isNull(t)){const i=a.Util.getBX();if(i.Calendar&&i.Calendar.SliderLoader){new i.Calendar.SliderLoader(t,{entryDateFrom:e.from,timezoneOffset:e.timezoneOffset,dayOfWeekMonthFormat:e.dayOfWeekMonthFormat||false,calendarContext:e.calendarContext||null,link:e.link}).show()}}}static deleteEntry(t,i=null){if(t instanceof e.Entry){const e=a.Util.getBX().SidePanel.Instance.getTopSlider();const n=()=>{if(e&&e.options.type==="calendar:slider"){a.Util.getBX().SidePanel.Instance.close()}};s.EventEmitter.subscribe("BX.Calendar.Entry:beforeDelete",n);const r=()=>{const t=a.Util.getCalendarContext();if(!t&&!i){return a.Util.getBX().reload()}if(t){t.reload()}else if(i){i.reload()}s.EventEmitter.unsubscribe("BX.Calendar.Entry:delete",r);s.EventEmitter.unsubscribe("BX.Calendar.Entry:beforeDelete",n)};s.EventEmitter.subscribe("BX.Calendar.Entry:delete",r);t.delete()}}static setMeetingStatus(t,i,s={}){return new Promise((n=>{if(!l.Type.isPlainObject(s)){s={}}s.recursionMode=s.recursionMode||false;if(i==="N"&&!s.confirmed){if(t.isRecursive()){this.showConfirmStatusDialog(t,n);return false}}BX.ajax.runAction("calendar.api.calendarajax.setMeetingStatus",{data:{entryId:t.id,entryParentId:t.parentId,status:i,recursionMode:s.recursionMode,currentDateFrom:a.Util.formatDate(t.from)}}).then((a=>{BX.Event.EventEmitter.emit("BX.Calendar.Entry:onChangeMeetingStatus",new l.Event.BaseEvent({data:{entry:t,status:i,recursionMode:s.recursionMode,currentDateFrom:t.from,counters:a.data.counters}}));if(t instanceof e.Entry){t.setCurrentStatus(i)}n({entry:t,status:i,recursionMode:s.recursionMode,currentDateFrom:t.from})}))}))}static showConfirmStatusDialog(t,e=null){if(!this.confirmDeclineDialog){this.confirmDeclineDialog=this.createConfirmStatusDialog()}this.confirmDeclineDialog.show();this.confirmDeclineDialog.unsubscribeAll("onDecline");this.confirmDeclineDialog.subscribe("onDecline",(function(i){if(i&&l.Type.isFunction(i.getData)){d.setMeetingStatus(t,"N",{recursionMode:i.getData().recursionMode,confirmed:true}).then((()=>{if(l.Type.isFunction(e)){e()}}))}}))}static showConfirmEditDialog(t){if(!this.confirmEditDialog){this.confirmEditDialog=this.createConfirmEditDialog()}this.confirmEditDialog.show();if(l.Type.isFunction(t.callback)){this.confirmEditDialog.unsubscribeAll("onEdit");this.confirmEditDialog.subscribe("onEdit",(e=>{if(e&&l.Type.isFunction(e.getData)){t.callback(e.getData())}}))}}static showReInviteUsersDialog(t){if(!this.reinviteUsersDialog){this.reinviteUsersDialog=this.createReinviteUserDialog()}this.reinviteUsersDialog.show();if(l.Type.isFunction(t.callback)){this.reinviteUsersDialog.unsubscribeAll("onSelect");this.reinviteUsersDialog.subscribe("onSelect",(function(e){if(e&&l.Type.isFunction(e.getData)){t.callback(e.getData())}}))}}static showConfirmedEmailDialog(t={}){if(!this.confirmedEmailDialog){this.confirmedEmailDialog=this.createConfirmedEmailDialog()}this.confirmedEmailDialog.show();if(l.Type.isFunction(t.callback)){this.confirmedEmailDialog.unsubscribeAll("onSelect");this.confirmedEmailDialog.subscribe("onSelect",(function(e){if(e&&l.Type.isFunction(e.getData)){t.callback(e.getData())}}))}}static showEmailLimitationDialog(t={}){if(!this.limitationEmailDialog){this.limitationEmailDialog=this.createEmailLimitationDialog()}this.limitationEmailDialog.subscribe("onClose",(()=>{if(l.Type.isFunction(t.callback)){t.callback()}}));this.limitationEmailDialog.show()}static getCompactViewForm(t=true){if(!d.compactEntryForm&&t){d.compactEntryForm=new n.CompactEventForm}return d.compactEntryForm}static openCompactViewForm(t={}){const e=d.getCompactViewForm();if(!e.isShown()){e.unsubscribeAll("onClose");if(l.Type.isFunction(t.closeCallback)){e.subscribe("onClose",t.closeCallback)}e.showInViewMode(t)}}static openCompactEditForm(t={}){const e=d.getCompactViewForm();if(!e.isShown()){e.unsubscribeAll("onClose");if(l.Type.isFunction(t.closeCallback)){e.subscribe("onClose",t.closeCallback)}e.showInEditMode(t)}}static getEntryInstance(t,i,a={}){let s=null;if(t instanceof e.Entry){s=t}else{if(l.Type.isObject(t)&&l.Type.isObject(t.data)){s=new e.Entry({data:t.data,userIndex:i})}else if(l.Type.isObject(t)){s=new e.Entry({data:t,userIndex:i})}else{s=d.getNewEntry(a)}}return s}static getUserIndex(t={}){return d.userIndex}static setUserIndex(t){d.userIndex=t}handlePullChanges(t){var e;if(!BX.Calendar.Util.checkRequestId(t.requestUid)){return}const i=d.getCompactViewForm();if(i&&i.isShown()){i.handlePull(t)}BX.SidePanel.Instance.getOpenSliders().forEach((e=>{var i;const a=d.slidersMap.get(e);if(a&&a.entry&&a.entry.parentId===parseInt(t==null?void 0:(i=t.fields)==null?void 0:i.PARENT_ID)){var s;if(t.command==="delete_event"&&a.entry.getType()===(t==null?void 0:(s=t.fields)==null?void 0:s.CAL_TYPE)){e.close()}}}));if(t.command==="set_meeting_status"){top.BX.Event.EventEmitter.emit("BX.Calendar:doReloadCounters")}else if(t.command==="delete_event"||t.command==="edit_event"){var s,n,r,o,c;if(!t.fields||t!=null&&(s=t.fields)!=null&&s.IS_MEETING&&(t==null?void 0:(n=t.fields)==null?void 0:n.MEETING_STATUS)==="Q"){top.BX.Event.EventEmitter.emit("BX.Calendar:doReloadCounters")}if((t==null?void 0:(r=t.fields)==null?void 0:r.CAL_TYPE)==="location"&&(o=top.BX.Calendar)!=null&&(c=o.Controls)!=null&&c.Location){top.BX.Calendar.Controls.Location.handlePull(t)}}const h=a.Util.getCalendarContext();const E=parseInt(t==null?void 0:(e=t.fields)==null?void 0:e.SECTION_ID);let u=l.Type.isArray(t.sections)&&t.sections.find((t=>t.id===E&&t.isShown()));let T=t!=null&&t.fields?d.getEntryInstance(h.getView().getEntryById(d.getEntryUniqueId(t.fields))):null;if((u||T)&&h){h.reloadDebounce()}}static registerDeleteTimeout(t){d.delayedActionList.push(t)}static unregisterDeleteTimeout({action:t,data:e}){d.delayedActionList=d.delayedActionList.filter((i=>i.action!==t||i.data.entryId!==e.entryId||i.data.recursionMode!==e.recursionMode||i.data.excludeDate!==e.excludeDate))}static doDelayedActions(){let t=[];return new Promise((e=>{if(!d.delayedActionList.length){e()}d.delayedActionList.forEach((({action:i,data:a,params:s})=>{const n=parseInt(a.requestUid);t.push(a.requestUid);if(s.entry){d.closeDeleteNotificationBalloon(s.entry)}BX.ajax.runAction(`calendar.api.calendarajax.${i}`,{data:a}).then((()=>{l.Type.isFunction(s.callback);{s.callback()}t=t.filter((t=>t!==n));if(!t.length){e()}}),(()=>{t=t.filter((t=>t!==n));if(!t.length){e()}}));d.unregisterDeleteTimeout({action:i,data:a,params:s})}))}))}static getEntryUniqueId(t,e){let i=t.PARENT_ID||t.ID;if(t.RRULE){i+="|"+(e?a.Util.formatDate(e.from):a.Util.formatDate(BX.parseDate(t.DATE_FROM)))}if(t["~TYPE"]==="tasks"){i+="|"+"task"}return i}static registerEntrySlider(t,e){const i=a.Util.getBX().SidePanel.Instance.getTopSlider();if(i){d.slidersMap.set(i,{entry:t,control:e})}}static getNewEntryReminders(t="withTime"){const e=a.Util.getUserSettings();if(l.Type.isObjectLike(e.defaultReminders)&&l.Type.isArray(e.defaultReminders[t])&&e.defaultReminders[t].length){return e.defaultReminders[t]}return t==="withTime"?[{type:"min",count:15}]:[{type:"daybefore",before:0,time:480}]}static setNewEntryReminders(t="withTime",e){const i=a.Util.getUserSettings();if(l.Type.isObjectLike(i.defaultReminders)){i.defaultReminders[t]=e}a.Util.setUserSettings(i)}static createConfirmEditDialog(){const t=a.Util.getBX();return new t.Calendar.Controls.ConfirmEditDialog}static createConfirmStatusDialog(){const t=a.Util.getBX();return new t.Calendar.Controls.ConfirmStatusDialog}static createReinviteUserDialog(){const t=a.Util.getBX();return new t.Calendar.Controls.ReinviteUserDialog}static createConfirmedEmailDialog(){const t=a.Util.getBX();return new t.Calendar.Controls.ConfirmedEmailDialog}static createEmailLimitationDialog(){const t=a.Util.getBX();return new t.Calendar.Controls.EmailLimitationDialog}}d.newEntryName="";d.userIndex={};d.delayedActionList=[];d.DELETE_DELAY_TIMEOUT=4e3;d.slidersMap=new WeakMap;class c{constructor(t={}){this.FULL_DAY_LENGTH=86400;this.prepareData(t.data);this.parts=[];if(t.userIndex){this.setUserIndex(t.userIndex)}this.delayTimeoutMap=new Map}prepareData(t){this.data=t;this.id=parseInt(this.data.ID||0);this.parentId=parseInt(this.data.PARENT_ID||0);if(!this.data.DT_SKIP_TIME){this.data.DT_SKIP_TIME=this.data.SKIP_TIME?"Y":"N"}this.fullDay=this.data.DT_SKIP_TIME==="Y";this.accessibility=this.data.ACCESSIBILITY||"busy";this.important=this.data.IMPORTANCE==="high";this.private=!!this.data.PRIVATE_EVENT;this.setSectionId(this.data.SECT_ID);this.name=this.data.NAME;this.userTimezoneOffsetFrom=parseInt(this.data["~USER_OFFSET_FROM"])||0;this.userTimezoneOffsetTo=parseInt(this.data["~USER_OFFSET_TO"])||this.userTimezoneOffsetFrom;if(!this.data.DT_LENGTH){this.data.DT_LENGTH=this.data.DURATION||0}if(this.fullDay&&!this.data.DT_LENGTH){this.data.DT_LENGTH=this.FULL_DAY_LENGTH}if(!l.Type.isString(this.data.DATE_FROM)&&!l.Type.isString(this.data.DATE_TO)&&l.Type.isDate(this.data.dateFrom)&&l.Type.isDate(this.data.dateTo)){this.from=this.data.dateFrom;this.to=this.data.dateTo;this.data.DT_LENGTH=Math.round((this.to.getTime()-this.from.getTime())/1e3);this.data.DURATION=this.data.DT_LENGTH;if(this.fullDay){this.data.DATE_FROM=a.Util.formatDate(this.from.getTime());this.data.DATE_TO=a.Util.formatDate(this.to.getTime())}else{this.from=new Date(this.from.getTime()-(parseInt(this.data["~USER_OFFSET_FROM"])||0)*1e3);this.to=new Date(this.to.getTime()-(parseInt(this.data["~USER_OFFSET_TO"])||0)*1e3)}}else{if(this.isTask()){this.from=BX.parseDate(this.data.DATE_FROM)||new Date;this.to=BX.parseDate(this.data.DATE_TO)||this.from}else{this.from=BX.parseDate(this.data.DATE_FROM)||new Date;this.to=BX.parseDate(this.data.DATE_TO)||this.from}}if(this.fullDay){this.from.setHours(0,0,0,0);this.to.setHours(0,0,0,0)}if(!this.data.ATTENDEES_CODES&&!this.isTask()){if(this.data.CAL_TYPE==="user"&&this.data.OWNER_ID){this.data.ATTENDEES_CODES=["U"+this.data.OWNER_ID]}else if(this.data.CREATED_BY){this.data.ATTENDEES_CODES=["U"+this.data.CREATED_BY]}}this.startDayCode=this.from;this.endDayCode=this.to;if(!l.Type.isArray(this.data.REMIND)&&l.Type.isArray(this.data.remind)){this.data.REMIND=[];this.data.remind.forEach((function(t){this.data.REMIND.push({type:"min",count:t})}),this);delete this.data.remind}}getAttendeesCodes(){return this.data.ATTENDEES_CODES||[]}getAttendeesEntityList(){return this.data.attendeesEntityList||[]}getAttendees(){if(!this.attendeeList){this.attendeeList=[];if(l.Type.isArray(this.data["ATTENDEE_LIST"])){const t=this.getUserIndex();this.data["ATTENDEE_LIST"].forEach((e=>{if(t[e.id]){let i=BX.clone(t[e.id]);i.STATUS=e.status;i.ENTRY_ID=e.entryId||false;this.attendeeList.push(i)}}))}}return this.attendeeList}setUserIndex(t){this.userIndex=t}getUserIndex(){return this.userIndex||d.getUserIndex()}cleanParts(){this.parts=[]}startPart(t){t.partIndex=this.parts.length;this.parts.push(t);return this.parts[t.partIndex]}registerPartNode(t,e){t.params=e}checkPartIsRegistered(t){return l.Type.isPlainObject(t.params)}getPart(t){return this.parts[t]||false}getWrap(t){return this.parts[t||0].params.wrapNode}getSectionName(){}getDescription(){return this.data.DESCRIPTION||""}applyViewRange(t){let e=t.start.getTime(),i=t.end.getTime(),a=this.from.getTime(),s=this.to.getTime();if(s<e||a>i)return false;if(a<e){this.displayFrom=t.start;this.startDayCode=this.displayFrom}if(s>i){this.displayTo=t.end;this.endDayCode=this.displayTo}return true}isPersonal(){}isMeeting(){return!!this.data.IS_MEETING}isPrivate(){return this.private}isResourcebooking(){return this.data.EVENT_TYPE==="#resourcebooking#"}isTask(){return this.data["~TYPE"]==="tasks"}isSharingEvent(){return this.data["EVENT_TYPE"]==="#shared#"}isInvited(){return this.getCurrentStatus()==="Q"}isLocation(){return this.getType()==="location"}isFullDay(){return this.fullDay}isLongWithTime(){return!this.fullDay&&a.Util.getDayCode(this.from)!==a.Util.getDayCode(this.to)}isExpired(){return this.to.getTime()<(new Date).getTime()}hasEmailAttendees(){if(this.emailAttendeesCache===undefined){const t=d.getUserIndex();for(let e=0;e<this.data["ATTENDEE_LIST"].length;e++){let i=this.data["ATTENDEE_LIST"][e];if((i.status==="Y"||i.status==="Q")&&t[i.id]&&t[i.id].EMAIL_USER){this.emailAttendeesCache=true;break}}}return this.emailAttendeesCache}ownerIsEmailUser(){if(this.ownerIsEmailUserCache===undefined){const t=d.getUserIndex();this.ownerIsEmailUserCache=t[parseInt(this.data.MEETING_HOST)]&&t[parseInt(this.data.MEETING_HOST)].EMAIL_USER}return this.ownerIsEmailUserCache}isSelected(){return!!this.selected}isCrm(){return!!this.data.UF_CRM_CAL_EVENT}isFirstReccurentEntry(){return(this.data.DATE_FROM_TS_UTC===Math.floor(BX.parseDate(this.data["~DATE_FROM"]).getTime()/1e3)*1e3||BX.parseDate(this.data["DATE_FROM"]).getTime()===BX.parseDate(this.data["~DATE_FROM"]).getTime())&&!this.data.RECURRENCE_ID}isRecursive(){return!!this.data.RRULE}isFirstInstance(){return this.data.RRULE&&this.data.RINDEX===0}getMeetingHost(){return parseInt(this.data.MEETING_HOST)}getMeetingNotify(){return this.data.MEETING.NOTIFY}getHideGuests(){return this.data.MEETING&&BX.Type.isBoolean(this.data.MEETING.HIDE_GUESTS)?this.data.MEETING.HIDE_GUESTS:true}getRrule(){return this.data.RRULE}getRRuleDescription(){return this.data["~RRULE_DESCRIPTION"]}hasRecurrenceId(){return this.data.RECURRENCE_ID}wasEverRecursive(){return this.data.RRULE||this.data.RECURRENCE_ID}deselect(){this.selected=false}select(){this.selected=true}deleteParts(t){const e=a.Util.getCalendarContext();if(e){const i=e.getView().getContainer();if(t==="all"){e.getView().entries.forEach((t=>{if(parseInt(t.id)===this.id||parseInt(t.data.RECURRENCE_ID)===this.id||parseInt(t.data.RECURRENCE_ID)===parseInt(this.data.RECURRENCE_ID)||parseInt(t.id)===parseInt(this.data.RECURRENCE_ID)){const e=i.querySelector('div[data-bx-calendar-entry="'+t.uid+'"]');if(e){e.style.opacity=0;setTimeout((()=>{e.style.display="none"}),200)}}}))}else if(t==="next"){e.getView().entries.forEach((t=>{if((parseInt(t.id)===this.id||parseInt(t.data.RECURRENCE_ID)===this.id||parseInt(t.data.RECURRENCE_ID)===parseInt(this.data.RECURRENCE_ID)||parseInt(t.id)===parseInt(this.data.RECURRENCE_ID))&&t.from.getTime()>this.from.getTime()){const e=i.querySelector('div[data-bx-calendar-entry="'+t.uid+'"]');if(e){e.style.opacity=0;setTimeout((()=>{e.style.display="none"}),200)}}}))}else if(t==="this"||!t){const t=i.querySelectorAll('div[data-bx-calendar-entry="'+this.getUniqueId()+'"]');t.forEach((t=>{t.style.opacity=0;setTimeout((()=>{t.style.display="none"}),200)}))}}}getUniqueId(){return d.getEntryUniqueId(this.data,this)}getCurrentStatus(){let t=a.Util.getCurrentUserId(),e=false,i,s;if(this.isMeeting()){if(t===parseInt(this.data.CREATED_BY)){e=this.data.MEETING_STATUS||"Q"}else if(t===parseInt(this.data.MEETING_HOST)){e="H"}else if(l.Type.isArray(this.data["ATTENDEE_LIST"])){for(i=0;i<this.data["ATTENDEE_LIST"].length;i++){s=this.data["ATTENDEE_LIST"][i];if(parseInt(s.id)===t){e=s.status;break}}}}else if(t===parseInt(this.data.CREATED_BY)){e=this.data.MEETING_STATUS||"H"}return a.Util.getMeetingStatusList().includes(e)?e:false}setCurrentStatus(t){if(this.isMeeting()&&a.Util.getMeetingStatusList().includes(t)){this.data.MEETING_STATUS=t;const e=a.Util.getCurrentUserId();if(l.Type.isArray(this.data["ATTENDEE_LIST"])){for(let i=0;i<this.data["ATTENDEE_LIST"].length;i++){if(parseInt(this.data["ATTENDEE_LIST"][i].id)===e){this.data["ATTENDEE_LIST"][i].status=t;this.attendeeList=null;break}}}}}getReminders(){let t=[];if(this.data&&this.data.REMIND){this.data.REMIND.forEach((function(e){switch(e.type){case"min":t.push(e.count);break;case"hour":t.push(parseInt(e.count)*60);break;case"day":t.push(parseInt(e.count)*60*24);break;case"daybefore":t.push(e);break;case"date":if(!l.Type.isDate(e.value)){e.value=a.Util.parseDate(e.value)}if(l.Type.isDate(e.value)){t.push(e)}break}}))}return t}getLengthInDays(){let t=new Date(this.from.getFullYear(),this.from.getMonth(),this.from.getDate(),0,0,0),e=new Date(this.to.getFullYear(),this.to.getMonth(),this.to.getDate(),0,0,0);return Math.round((e.getTime()-t.getTime())/a.Util.getDayLength())+1}getName(){return this.name||""}getColor(){return this.data.COLOR}getType(){return this.data.CAL_TYPE}getOwnerId(){return this.data.OWNER_ID}delete(t){t=l.Type.isPlainObject(t)?t:{};let e=t.recursionMode||false;if(this.wasEverRecursive()&&!t.confirmed){return this.showConfirmDeleteDialog({entry:this})}else{BX.onCustomEvent("BX.Calendar.Entry:beforeDelete",[{entryId:this.id,recursionMode:e,entryData:this.data}]);d.showDeleteEntryNotification(this);this.deleteParts(e);const i="deleteCalendarEntry";const s={entryId:this.id,recursionMode:t.recursionMode||false,requestUid:a.Util.registerRequestId()};d.registerDeleteTimeout({action:i,data:s,params:{entry:this,callback:()=>{BX.onCustomEvent("BX.Calendar.Entry:delete",[{entryId:this.id,recursionMode:e}])}}});this.deleteTimeout=setTimeout(d.doDelayedActions,d.DELETE_DELAY_TIMEOUT);this.delayTimeoutMap.set(this.deleteTimeout,{action:i,data:s})}}deleteThis(){let t="this";if(this.isRecursive()){BX.onCustomEvent("BX.Calendar.Entry:beforeDelete",[{entryId:this.id,recursionMode:t,entryData:this.data}]);d.showDeleteEntryNotification(this);this.deleteParts(t);const e="excludeRecursionDate";const i={entryId:this.id,recursionMode:t,excludeDate:this.data.DATE_FROM};d.registerDeleteTimeout({action:e,data:i,params:{entry:this,callback:()=>{BX.onCustomEvent("BX.Calendar.Entry:delete",[i])}}});this.deleteTimeout=setTimeout(d.doDelayedActions,d.DELETE_DELAY_TIMEOUT);this.delayTimeoutMap.set(this.deleteTimeout,{action:e,data:i})}else if(this.hasRecurrenceId()){this.delete({confirmed:true,recursionMode:"this"})}}deleteNext(){let t="next";if(this.isRecursive()&&this.isFirstReccurentEntry()){this.deleteAll()}else{BX.onCustomEvent("BX.Calendar.Entry:beforeDelete",[{entryId:this.id,recursionMode:t}]);d.showDeleteEntryNotification(this);this.deleteParts(t);const e=a.Util.getCalendarContext();const i="changeRecurciveEntryUntil";const s={entryId:this.id,recursionMode:t,untilDate:a.Util.formatDate(this.from.getTime()-a.Util.getDayLength())};d.registerDeleteTimeout({action:i,data:s,params:{entry:this,callback:()=>{BX.onCustomEvent("BX.Calendar.Entry:delete",[s])}}});this.deleteTimeout=setTimeout(d.doDelayedActions,d.DELETE_DELAY_TIMEOUT);this.delayTimeoutMap.set(this.deleteTimeout,{action:i,data:s})}}deleteAll(){return this.delete({confirmed:true,recursionMode:"all"})}cancelDelete(){if(this.deleteTimeout){const t=this.delayTimeoutMap.get(this.deleteTimeout);if(t){d.unregisterDeleteTimeout(t);BX.onCustomEvent("BX.Calendar.Entry:cancelDelete",[{entryId:this.id,entryData:this.data}]);this.delayTimeoutMap.delete(this.delayTimeoutMap)}clearTimeout(this.deleteTimeout);this.deleteTimeout=null}const t=a.Util.getCalendarContext();if(t){t.reload()}}showConfirmDeleteDialog(t){if(!this.confirmDeleteDialog){this.confirmDeleteDialog=new(window.BX||window.top.BX).Calendar.Controls.ConfirmDeleteDialog({entry:t.entry})}this.confirmDeleteDialog.show()}save(){}getLocation(){return this.data.LOCATION}setTimezone(t,e=null){if(l.Type.isString(t)){this.data.TZ_FROM=t;if(l.Type.isNull(e)){this.data.TZ_TO=t}}if(l.Type.isString(e)){this.data.TZ_TO=e}}getTimezoneFrom(){return this.data.TZ_FROM||""}getTimezoneTo(){return this.data.TZ_TO||""}setSectionId(t){this.data.SECT_ID=this.sectionId=this.isTask()?"tasks":parseInt(t)}setDateTimeValue({from:t,to:e}){if(l.Type.isDate(t)&&l.Type.isDate(e)){this.from=this.data.dateFrom=t;this.to=this.data.dateTo=e;this.data.DT_LENGTH=Math.round((this.to.getTime()-this.from.getTime())/1e3);this.data.DURATION=this.data.DT_LENGTH;if(this.fullDay){this.data.DATE_FROM=a.Util.formatDate(this.from.getTime());this.data.DATE_TO=a.Util.formatDate(this.to.getTime())}else{this.data.DATE_FROM=a.Util.formatDateTime(this.from.getTime());this.data.DATE_TO=a.Util.formatDateTime(this.to.getTime())}}}}c.CAL_TYPES={user:"user",group:"group",company:"company_calendar"};t.EntryManager=d;t.Entry=c})(this.BX.Calendar=this.BX.Calendar||{},BX.Calendar,BX.Calendar,BX.Calendar,BX.Event,BX.Calendar,BX,BX.Calendar,BX); //# sourceMappingURL=entry.bundle.map.js
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.27 |
proxy
|
phpinfo
|
Settings