403Webshell
Server IP : 80.87.202.40  /  Your IP : 216.73.216.169
Web Server : Apache
System : Linux rospirotorg.ru 5.14.0-539.el9.x86_64 #1 SMP PREEMPT_DYNAMIC Thu Dec 5 22:26:13 UTC 2024 x86_64
User : bitrix ( 600)
PHP Version : 8.2.27
Disable Function : NONE
MySQL : OFF |  cURL : ON |  WGET : ON |  Perl : ON |  Python : OFF |  Sudo : ON |  Pkexec : ON
Directory :  /home/bitrix/ext_www/cvetdv.ru/bitrix/js/calendar/sectionmanager/dist/

Upload File :
current_dir [ Writeable] document_root [ Writeable]

 

Command :


[ Back ]     

Current File : /home/bitrix/ext_www/cvetdv.ru/bitrix/js/calendar/sectionmanager/dist/sectionmanager.bundle.min.js
this.BX=this.BX||{};(function(exports,calendar_util,calendar_sectionmanager,main_core,main_core_events){"use strict";class CalendarSection{constructor(e){this.updateData(e);this.calendarContext=calendar_util.Util.getCalendarContext()}getId(){return this.id}updateData(e){this.data=e||{};this.type=e.CAL_TYPE||"";this.ownerId=parseInt(e.OWNER_ID)||0;this.id=parseInt(e.ID);this.color=this.data.COLOR;this.name=this.data.NAME}isShown(){return this.calendarContext.sectionManager.sectionIsShown(this.id)}show(){if(!this.isShown()){let e=this.calendarContext.sectionManager.getHiddenSections();e=e.filter((e=>e!==this.id),this);this.calendarContext.sectionManager.setHiddenSections(e);this.calendarContext.sectionManager.saveHiddenSections()}}hide(){if(this.isShown()){const e=this.calendarContext.sectionManager.getHiddenSections();e.push(this.id);this.calendarContext.sectionManager.setHiddenSections(e);this.calendarContext.sectionManager.saveHiddenSections()}}remove(){const e=calendar_util.Util.getBX().Event;e.EventEmitter.emit("BX.Calendar.Section:delete",new e.BaseEvent({data:{sectionId:this.id}}));BX.ajax.runAction("calendar.api.calendarajax.deleteCalendarSection",{data:{id:this.id}}).then((e=>this.updateListAfterDelete()),(e=>{}))}hideSyncSection(){this.hide();BX.onCustomEvent(this.calendar,"BXCalendar:onSectionDelete",[this.id]);calendar_util.Util.getBX().Event.EventEmitter.emit("BX.Calendar.Section:delete",new main_core.Event.BaseEvent({data:{sectionId:this.id}}));BX.ajax.runAction("calendar.api.calendarajax.setSectionStatus",{data:{sectionStatus:{[this.id]:false}}}).then((e=>this.updateListAfterDelete()),(e=>{}))}hideExternalCalendarSection(){this.hide();BX.onCustomEvent(this.calendar,"BXCalendar:onSectionDelete",[this.id]);calendar_util.Util.getBX().Event.EventEmitter.emit("BX.Calendar.Section:delete",new main_core.Event.BaseEvent({data:{sectionId:this.id}}));BX.ajax.runAction("calendar.api.calendarajax.hideExternalCalendarSection",{data:{id:this.id}}).then((e=>this.updateListAfterDelete()),(e=>{}))}getLink(){return this.data&&this.data.LINK?this.data.LINK:""}canBeConnectedToOutlook(){return!this.isPseudo()&&this.data.OUTLOOK_JS&&!(this.data.CAL_DAV_CAL&&this.data.CAL_DAV_CON)&&!BX.browser.IsMac()}connectToOutlook(){BX.ajax.runAction("calendar.api.syncajax.getOutlookLink",{data:{id:this.id}}).then((response=>{const url=response.data.result;eval(url)}),(e=>{}))}canDo(e){if(this.isVirtual()&&["access","add","edit"].includes(e)){return false}return this.hasPermission(e)}hasPermission(e){var t;if(e==="edit_section"&&(t=calendar_util.Util.getCalendarContext())!=null&&t.isCollabUser){return false}if(e==="view_event"){e="view_time"}if(!this.data.PERM[e]){return false}return this.data.PERM&&this.data.PERM[e]}isSuperposed(){return!this.isPseudo()&&!!this.data.SUPERPOSED}isPseudo(){return false}isVirtual(){return this.data.CAL_DAV_CAL&&this.data.CAL_DAV_CAL.indexOf("@virtual/events/")!==-1||this.data.GAPI_CALENDAR_ID&&this.data.GAPI_CALENDAR_ID.indexOf("@group.v.calendar.google.com")!==-1||this.data.EXTERNAL_TYPE==="google_readonly"||this.data.EXTERNAL_TYPE==="google_freebusy"}isGoogle(){const e=["google_readonly","google","google_write_read","google_freebusy"];return!this.isPseudo()&&e.includes(this.data.EXTERNAL_TYPE)}isCalDav(){return!this.isPseudo()&&this.data.CAL_DAV_CAL&&this.data.CAL_DAV_CON}isIcloud(){return!this.isPseudo()&&this.data.EXTERNAL_TYPE==="icloud"}isOffice365(){return!this.isPseudo()&&this.data.EXTERNAL_TYPE==="office365"}isArchive(){return!this.isPseudo()&&this.data.EXTERNAL_TYPE==="archive"}isExchange(){return!this.isPseudo()&&this.data["IS_EXCHANGE"]}isCompanyCalendar(){return!this.isPseudo()&&this.type!=="user"&&this.type!=="group"&&!this.ownerId}isGroupCalendar(){return!this.isPseudo()&&this.type==="group"}hasConnection(){return!this.isPseudo()&&this.data.connectionLinks&&this.data.connectionLinks.length}isLocationRoom(){return this.type==="location"}belongsToView(){const e=calendar_util.Util.getCalendarContext();return this.type===e.getCalendarType()&&this.ownerId===e.getOwnerId()}belongsToOwner(){return this.belongsToUser(calendar_util.Util.getCalendarContext().getUserId())}belongsToUser(e){return this.type==="user"&&this.ownerId===parseInt(e)&&this.data.ACTIVE!=="N"}getExternalType(){return this.data.EXTERNAL_TYPE?this.data.EXTERNAL_TYPE:this.isCalDav()?"caldav":""}getConnectionLinks(){return main_core.Type.isArray(this.data.connectionLinks)?this.data.connectionLinks:[]}externalTypeIsLocal(){return this.getExternalType()===calendar_sectionmanager.SectionManager.EXTERNAL_TYPE_LOCAL||this.isCompanyCalendar()||this.isGroupCalendar()}isPrimaryForConnection(){return!this.externalTypeIsLocal()&&this.getConnectionLinks().find((e=>e.isPrimary==="Y"))}isActive(){return this.data.ACTIVE!=="N"}getType(){return this.type}getOwnerId(){return this.ownerId}getConnectionIdList(){const e=[];let t=parseInt(this.data.CAL_DAV_CON,10);if(t){e.push(t)}return e}updateListAfterDelete(){const e=calendar_util.Util.getCalendarContext().sectionManager;let t=true;let i;for(let n=0;n<e.sections.length;n++){i=e.sections[n];if(i.id!==this.id&&i.belongsToView()&&!i.isGoogle()&&!i.isIcloud()&&!i.isOffice365()&&!i.isCalDav()&&!i.isArchive()){t=false;break}}const n=calendar_util.Util.getCalendarContext();if(!n||t){return calendar_util.Util.getBX().reload()}n.reload()}isCollab(){return this.data["IS_COLLAB"]}}class CalendarTaskSection extends CalendarSection{constructor(e={},{type:t,userId:i,ownerId:n}){const s="#ff5b55";let a=false;let o=main_core.Loc.getMessage("EC_SEC_USER_TASK_DEFAULT");if(t==="user"&&i===n){o=main_core.Loc.getMessage("EC_SEC_MY_TASK_DEFAULT");a=true}else if(t==="group"){o=main_core.Loc.getMessage("EC_SEC_GROUP_TASK_DEFAULT")}super({ID:"tasks",NAME:e.name||o,COLOR:e.color||s,PERM:{edit_section:true,view_full:true,view_time:true,view_title:true}});this.isUserTaskSection=a}isPseudo(){return true}taskSectionBelongToUser(){return this.isUserTaskSection}updateData(e){super.updateData(e);this.id=e.ID}}class SectionManager{constructor(e,t){this.setSections(e.sections);this.setConfig(t);this.addTaskSection();this.sortSections();main_core_events.EventEmitter.subscribeOnce("BX.Calendar.Section:delete",(e=>{this.deleteSectionHandler(e.data.sectionId)}));this.reloadDataDebounce=main_core.Runtime.debounce(this.reloadData,SectionManager.RELOAD_DELAY,this)}setSections(e=[]){this.sections=[];this.sectionIndex={};e.forEach((e=>{const t=new CalendarSection(e);if(t.canDo("view_time")){this.sections.push(t);this.sectionIndex[t.getId()]=this.sections.length-1}}))}sortSections(){this.sectionIndex={};this.sections=this.sections.sort(((e,t)=>{if(main_core.Type.isFunction(e.isPseudo)&&e.isPseudo()){return 1}else if(main_core.Type.isFunction(t.isPseudo)&&t.isPseudo()){return-1}return e.name.localeCompare(t.name)}));this.sections.forEach(((e,t)=>{this.sectionIndex[e.getId()]=t}))}setConfig(e){this.setHiddenSections(e.hiddenSections);this.calendarType=e.type;this.ownerId=e.ownerId;this.ownerName=e.ownerName||"";this.userId=e.userId;this.defaultSectionAccess=e.new_section_access||{};this.sectionAccessTasks=e.sectionAccessTasks;this.showTasks=e.showTasks;this.customizationData=e.sectionCustomization||{};this.meetSectionId=parseInt(e.meetSectionId,10)}addTaskSection(){if(this.showTasks){const e=new CalendarTaskSection(this.customizationData["tasks"+this.ownerId],{type:this.calendarType,userId:this.userId,ownerId:this.ownerId});this.sections.push(e);this.sectionIndex[e.id]=this.sections.length-1}}getCalendarType(){return this.calendarType}handlePullChanges(e){if(e.command==="delete_section"){const t=parseInt(e.fields.ID,10);if(this.sectionIndex[t]){this.deleteSectionHandler(t);calendar_util.Util.getBX().Event.EventEmitter.emit("BX.Calendar.Section:pull-delete",new main_core.Event.BaseEvent({data:{sectionId:t}}))}else{this.reloadDataDebounce()}}else if(e.command==="edit_section"){this.reloadDataDebounce();calendar_util.Util.getBX().Event.EventEmitter.emit("BX.Calendar:doRefresh")}else if(e.command==="hidden_sections_updated"){this.setHiddenSections(e.hiddenSections);this.reloadDataDebounce()}else{this.reloadDataDebounce()}}reloadData(){BX.ajax.runAction("calendar.api.calendarajax.getSectionList",{data:{type:this.calendarType,ownerId:this.ownerId}}).then((e=>{this.setSections(e.data.sections||[]);this.sortSections();if(e.data.config){this.setConfig(config)}this.addTaskSection();calendar_util.Util.getBX().Event.EventEmitter.emit("BX.Calendar.Section:pull-reload-data")}))}getSections(){return this.sections}getSuperposedSectionList(){const e=[];for(let t=0;t<this.sections.length;t++){if(this.sections[t].isSuperposed()&&this.sections[t].isActive()){e.push(this.sections[t])}}return e}getSectionListForEdit(){const e=[];for(let t=0;t<this.sections.length;t++){if(this.sections[t].canDo("edit")&&!this.sections[t].isPseudo()&&this.sections[t].isActive()&&!this.sections[t].isLocationRoom()){e.push(this.sections[t])}}return e}getSection(e){return this.sections[this.sectionIndex[e]]||{}}getDefaultSectionName(){return main_core.Loc.getMessage("EC_DEFAULT_SECTION_NAME")}getDefaultSectionAccess(){return this.defaultSectionAccess}saveSection(e,t,i,n){return new Promise((s=>{var a;e=main_core.Type.isString(e)&&e.trim()?e.trim():main_core.Loc.getMessage("EC_SEC_SLIDER_NEW_SECTION");if(n.section.id);const o=n.section.id&&n.section.isPseudo();BX.ajax.runAction("calendar.api.calendarajax.editCalendarSection",{data:{analyticsLabel:{action:n.section.id?"editSection":"newSection",type:n.section.type||this.calendarType},id:n.section.id||0,name:e,type:n.section.type||this.calendarType,ownerId:n.section.ownerId||this.ownerId,color:t,access:i||null,userId:this.userId,customization:o?"Y":"N",external_type:n!=null&&(a=n.section)!=null&&a.id?n.section.getExternalType():"local"}}).then((e=>{if(o){BX.reload();return}const t=e.data.sectionList||[];this.setSections(t);this.sortSections();this.addTaskSection();calendar_util.Util.getBX().Event.EventEmitter.emit("BX.Calendar.Section:edit",new main_core.Event.BaseEvent({data:{sectionList:t}}));s(e.data)}),(e=>{BX.Calendar.Util.displayError(e.errors);s(e.data)}))}))}sectionIsShown(e){return!BX.util.in_array(e,this.hiddenSections)}getHiddenSections(){return this.hiddenSections}setHiddenSections(e){this.hiddenSections=[];if(main_core.Type.isArray(e)){e.forEach((e=>{this.hiddenSections.push(e==="tasks"?e:parseInt(e))}))}}saveHiddenSections(){const e=calendar_util.Util.getCalendarContext();const t=e.util.userIsOwner()?"hidden_sections":"hidden_sections_"+e.util.type;BX.userOptions.save("calendar",t,t,this.hiddenSections)}getSectionsInfo(){const e=[];const t=[];const i=[];const n=[];this.sections.forEach((s=>{if(s.isShown()&&this.calendarType==="location"&&s.type==="location"){if(s.isSuperposed()){t.push(s.id)}else{i.push(s.id)}e.push(s.id)}else if(s.isShown()&&this.calendarType!=="location"){if(s.isSuperposed()){t.push(s.id)}else{i.push(s.id)}e.push(s.id)}else{n.push(s.id)}}));return{superposed:t,active:i,hidden:n,allActive:e}}deleteSectionHandler(e){if(this.sectionIndex[e]!==undefined){this.sections=BX.util.deleteFromArray(this.sections,this.sectionIndex[e]);this.sectionIndex={};for(let e=0;e<this.sections.length;e++){this.sectionIndex[this.sections[e].id]=e}}}static getNewEntrySectionId(e=null,t=null){const i=calendar_util.Util.getCalendarContext();if(i&&!i.isExternalMode()){e=e||i.util.type;if(e==="location"){const e=i.sectionManager.getDefaultSection("user",i.util.userId);return parseInt(e==null?void 0:e.id,10)}else if(i.isCollabUser&&i.util.type==="user"){const e=i.sectionManager.getSections().find((e=>e.isCollab()));return parseInt(e==null?void 0:e.id,10)}else{const n=i.sectionManager.getDefaultSection(e,t);return parseInt(n==null?void 0:n.id,10)}}if(SectionManager.newEntrySectionId){return SectionManager.newEntrySectionId}return null}static setNewEntrySectionId(e){SectionManager.newEntrySectionId=parseInt(e)}static getSectionGroupList(e={}){let t=e.type,i=e.ownerId,n=e.userId,s=e.isCollabUser||false,a=e.isCollabContext||false,o=e.trackingUsersList||calendar_util.Util.getFollowedUserList(n),r=[],c;if(t==="user"){if(n===i){c=main_core.Loc.getMessage("EC_SEC_SLIDER_MY_CALENDARS_LIST")}else{c=main_core.Loc.getMessage("EC_SEC_SLIDER_USER_CALENDARS_LIST")}}else if(t==="group"){const e=s||a?"EC_SEC_SLIDER_COLLAB_CALENDARS_LIST":"EC_SEC_SLIDER_GROUP_CALENDARS_LIST";c=main_core.Loc.getMessage(e)}else if(t==="location"){c=main_core.Loc.getMessage("EC_SEC_SLIDER_TYPE_LOCATION_LIST")}else if(t==="resource"){c=main_core.Loc.getMessage("EC_SEC_SLIDER_TYPE_RESOURCE_LIST")}else{c=main_core.Loc.getMessage("EC_SEC_SLIDER_TITLE_COMP_CAL")}r.push({title:c,type:t,belongsToView:true});if(t!=="user"||n!==i){r.push({title:main_core.Loc.getMessage("EC_SEC_SLIDER_MY_CALENDARS_LIST"),type:"user",ownerId:n})}if(t!=="company"&&t!=="company_calendar"&&t!=="calendar_company"){r.push({title:main_core.Loc.getMessage("EC_SEC_SLIDER_TITLE_COMP_CAL"),type:"company"})}if(main_core.Type.isArray(o)){o.forEach((e=>{if(parseInt(e.ID)!==i||t!=="user"){r.push({title:BX.util.htmlspecialchars(e.FORMATTED_NAME),type:"user",ownerId:parseInt(e.ID)})}}))}r.push({title:main_core.Loc.getMessage("EC_SEC_SLIDER_POPUP_MENU_ADD_GROUP"),type:"group"});r.push({title:BX.message("EC_SEC_SLIDER_POPUP_MENU_ADD_COLLAB"),type:"collab"});r.push({title:main_core.Loc.getMessage("EC_SEC_SLIDER_TITLE_RESOURCE_CAL"),type:"resource"});r.push({title:main_core.Loc.getMessage("EC_SEC_SLIDER_TITLE_LOCATION_CAL"),type:"location"});return r}getSectionAccessTasks(){return this.sectionAccessTasks}getDefaultSection(e=null,t=null){let i=this.getSectionListForEdit();e=main_core.Type.isString(e)?e:this.calendarType;t=main_core.Type.isNumber(t)?t:this.ownerId;let n;if(e==="user"){const s=this.meetSectionId;n=i.find((i=>i.type===e&&i.ownerId===t&&i.id===s))}else{i=i.sort(((e,t)=>e.id-t.id))}if(!n){n=i.find((i=>i.type===e&&i.ownerId===t&&i.canDo("edit")))}return n}setDefaultSection(e){const t=this.getSection(parseInt(e,10));if(t&&t.type===this.calendarType&&t.ownerId===this.ownerId){const i=calendar_util.Util.getUserSettings();const n=this.calendarType+this.ownerId;if(i.defaultSections[n]!==t.id){i.defaultSections[n]=t.id;calendar_util.Util.setUserSettings(i);BX.ajax.runAction("calendar.api.calendarajax.updateDefaultSectionId",{data:{key:n,sectionId:e}})}}}static saveDefaultSectionId(e,t={}){const i=calendar_util.Util.getCalendarContext();if(i){i.sectionManager.setDefaultSection(e)}else{if(main_core.Type.isArray(t.sections)&&t.calendarType&&t.ownerId){const i=t.sections.find((i=>{const n=parseInt(i.ID||i.id,10);const s=parseInt(i.OWNER_ID||i.ownerId,10);const a=i.CAL_TYPE||i.type;return n===parseInt(e,10)&&s===parseInt(t.ownerId,10)&&a===t.calendarType}));if(i){const i=calendar_util.Util.getUserSettings();const n=t.calendarType+t.ownerId;if(i&&i.defaultSections[n]!==e){i.defaultSections[n]=e;calendar_util.Util.setUserSettings(i);SectionManager.newEntrySectionId=e;BX.ajax.runAction("calendar.api.calendarajax.updateDefaultSectionId",{data:{key:n,sectionId:e}})}}}}}static getSectionExternalConnection(e,t){const i=calendar_util.Util.getCalendarContext();const n=e.getConnectionLinks();let s=undefined;let a=undefined;let o=n.length?parseInt(n[0].id):parseInt(e.data.CAL_DAV_CON,10);if(o&&i&&i.syncInterface){[s,a]=i.syncInterface.getProviderById(o);if(a&&(!n.length||a.getType()===t)){return a}}return null}}SectionManager.newEntrySectionId=null;SectionManager.EXTERNAL_TYPE_LOCAL="local";SectionManager.RELOAD_DELAY=1e3;exports.CalendarSection=CalendarSection;exports.SectionManager=SectionManager})(this.BX.Calendar=this.BX.Calendar||{},BX.Calendar,BX.Calendar,BX,BX.Event);
//# sourceMappingURL=sectionmanager.bundle.map.js

Youez - 2016 - github.com/yon3zu
LinuXploit