芝麻web文件管理V1.00
编辑当前文件:/home/pulsehostuk9/www/cloud.pulsehost.co.uk/static/js/Tasks.app.0e85e9d911a7d497dca0.min.js
"use strict";(self.webpackChunkafterlogic_aurora_platform=self.webpackChunkafterlogic_aurora_platform||[]).push([[4167],{vdUg:(e,t,s)=>{var i=s("a7T2"),n=s("M4cL"),o=s("p09A"),r=s("KC/L"),a=s("REt5"),l=s("9kOp"),c=s("dfnr"),h=s("oUN1");function u(e,t,s,a,c,h,u,d,p,m,y){this.active=o.observable(!1),this.fSelectCallback=t||function(){},this.fDeleteCallback=s||function(){},this.fDblClickCallback=!l.isMobile()&&a?a:function(){},this.fEnterCallback=c||function(){},this.bResetCheckedOnClick=!!u,this.bCheckOnSelect=!!d,this.bUnselectOnCtrl=!!p,this.bDisableMultiplySelection=!!m,this.bChangeOnSelect=void 0===y||!!y,this.useKeyboardKeys=o.observable(!1),this.list=o.observableArray([]),e&&e.subscribe&&e.subscribe((function(e){this.list(e)}),this),this.multiplyLineFactor=h,this.oLast=null,this.oListScope=null,this.oScrollScope=null,this.iTimer=0,this.iFactor=1,this.KeyUp=Enums.Key.Up,this.KeyDown=Enums.Key.Down,this.KeyLeft=Enums.Key.Up,this.KeyRight=Enums.Key.Down,this.multiplyLineFactor&&(this.multiplyLineFactor.subscribe?this.multiplyLineFactor.subscribe((function(e){this.iFactor=0
"function"==typeof t.isEqual?t.isEqual(e):t===e))||this.itemSelected(null)}),this),this.listCheckedOrSelected=o.computed({read:function(){var e=this.itemSelected(),t=this.listChecked();return 0
t}),this),this.onKeydownBound=i.bind(this.onKeydown,this)}u.prototype.iTimer=0,u.prototype.bResetCheckedOnClick=!1,u.prototype.bCheckOnSelect=!1,u.prototype.bUnselectOnCtrl=!1,u.prototype.bDisableMultiplySelection=!1,u.prototype.getLastOrSelected=function(){var e=0,t=null;return i.each(this.list(),(function(s){s&&i.isFunction(s.checked)&&(s.checked()&&e++,s.selected()&&(t=s))})),0===e&&t?t:this.oLast},u.prototype.unbind=function(){this.active(!1),this.itemSelected()&&this.itemSelected().selected(!1),n(document).off("keydown",this.onKeydownBound),n(this.oListScope).off()},u.prototype.initOnApplyBindings=function(e,t,s,i,r){this.active(!0),n(document).on("keydown",this.onKeydownBound),this.oListScope=i,this.oScrollScope=r,this.sActionSelector=e,this.sSelectableSelector=t,this.sCheckboxSelector=s;var a=this,l=function(e,t,s){var i=0,n=0,o=null,r=!1,l=!1,c=[],h=!1;if(t=t||null,s&&s.shiftKey&&null!==t&&null!==e&&t!==e)for(c=a.list(),h=t.checked(),i=0,n=c.length;i
250||i>1||(e.preventDefault(),n(this).trigger("dblclick"))}})),n(this.oListScope).on("click",e,(function(e){var t=!0,s=null,i=a.getLastOrSelected(),n=o.dataFor(this);n&&e&&(e.shiftKey?(t=!1,a.bDisableMultiplySelection||(null===a.oLast&&(a.oLast=n),n.checked(!n.checked()),l(i,n,e))):(e.ctrlKey||e.metaKey)&&(t=!1,a.bDisableMultiplySelection||(a.oLast=n,!(s=a.itemSelected())||s.checked()||n.checked()||s.checked(!0),a.bUnselectOnCtrl&&n===a.itemSelected()?(n.checked(!n.selected()),a.itemSelected(null)):n.checked(!n.checked()))),t&&a.selectionFunc(n))})),n(this.oListScope).on("click",s,(function(e){var t=o.dataFor(this);t&&e&&!a.bDisableMultiplySelection&&(e.shiftKey?(null===a.oLast&&(a.oLast=t),l(a.getLastOrSelected(),t,e)):a.oLast=t),e&&e.stopPropagation&&e.stopPropagation()})),n(this.oListScope).on("dblclick",s,(function(e){e&&e.stopPropagation&&e.stopPropagation()}))},u.prototype.getResultSelection=function(e,t){var s=this,o=!1,r=!1,a=null,l=this.iFactor,c=!!this.multiplyLineFactor,h=0,u=0,d=[];if(!e&&-1
=0;h--)if(e===d[h]){0>(h-=l)&&(h+=l),a=d[h];break}return a},u.prototype.shiftClickResult=function(e,t,s){if(t){var o=!!this.multiplyLineFactor,r=!1,a=!1;-1
=i&&t<=i+s-o||(t
i+s?this.oScrollScope.scrollTop(t+o+20-s):this.oScrollScope.scrollTop(t-20),0))},e.exports=u},jNBr:(e,t,s)=>{var i=s("sdEb"),n=s("H20a"),o=s("REt5"),r=s("OfVV");function a(){this.iTimeStampInUTC=0,this.oMoment=null}a.prototype.parse=function(e){this.iTimeStampInUTC=e,this.oMoment=i.unix(this.iTimeStampInUTC)},a.prototype.setDate=function(e,t,s){this.oMoment=i([e,t,s])},a.prototype.getTimeFormat=function(){return r.timeFormat()===window.Enums.TimeFormat.F24?"HH:mm":"hh:mm A"},a.prototype.getFullDate=function(){return this.getDate()+" "+this.getTime()},a.prototype.getMidDate=function(){return this.getShortDate(!0)},a.prototype.getShortDate=function(e){var t="",s=null;return this.oMoment&&((s=i()).format("L")===this.oMoment.format("L")?t=this.oMoment.format(this.getTimeFormat()):(t=s.clone().subtract(1,"days").format("L")===this.oMoment.format("L")?n.i18n("COREWEBCLIENT/LABEL_YESTERDAY"):r.UserSelectsDateFormat?this.oMoment.format(o.getDateFormatForMoment(r.dateFormat())):s.year()===this.oMoment.year()?this.oMoment.format("MMM D"):this.oMoment.format("MMM D, YYYY"),e&&(t+=", "+this.oMoment.format(this.getTimeFormat())))),t},a.prototype.getDate=function(){var e="ddd, MMM D, YYYY";return r.UserSelectsDateFormat&&(e="ddd, "+o.getDateFormatForMoment(r.dateFormat())),this.oMoment?this.oMoment.format(e):""},a.prototype.getTime=function(){return this.oMoment?this.oMoment.format(this.getTimeFormat()):""},a.prototype.getTimeStampInUTC=function(){return this.iTimeStampInUTC},e.exports=a},yKBN:(e,t,s)=>{var i=s("a7T2"),n=s("M4cL"),o=s("p09A"),r=s("REt5"),a=s("9kOp");function l(e,t){this.bShown=!1,this.currentPage=o.observable(1),this.count=o.observable(e),this.perPage=o.observable(t),this.firstPage=o.observable(1),this.lastPage=o.observable(1),this.pagesCount=o.computed((function(){var e=this.perPage()>0?Math.ceil(this.count()/this.perPage()):0;return e>0?e:1}),this),o.computed((function(){var e=20,t=4,s=this.pagesCount(),i=this.currentPage(),n=i,o=i;if(s>1)for(;e--,1
o&&(o++,t--),0!==t)&&0!==e;);this.firstPage(n),this.lastPage(o)}),this),this.visibleFirst=o.computed((function(){return this.firstPage()>1}),this),this.visibleLast=o.computed((function(){return this.lastPage()
this.pagesCount()&&this.currentPage(this.pagesCount())},l.prototype.setPage=function(e,t){this.perPage(t),e>this.pagesCount()?this.currentPage(this.pagesCount()):this.currentPage(e)},l.prototype.clickPage=function(e){var t=e.number;t<1&&(t=1),t>this.pagesCount()&&(t=this.pagesCount()),this.currentPage(t)},l.prototype.clickFirstPage=function(){this.currentPage(1)},l.prototype.clickPreviousPage=function(){var e=this.currentPage()-1;e<1&&(e=1),this.currentPage(e)},l.prototype.clickNextPage=function(){var e=this.currentPage()+1;e>this.pagesCount()&&(e=this.pagesCount()),this.currentPage(e)},l.prototype.clickLastPage=function(){this.currentPage(this.pagesCount())},e.exports=l},lcuU:(e,t,s)=>{e.exports=function(e){var t=s("9kOp"),i=s("TdEd"),n="tasks";if(t.isUserNormalOrTenant()&&i.isModuleEnabled("CalendarWebclient")){var o=s("H20a"),r=null;return{getScreens:function(){var e={};return e[n]=function(){return s("Jwba")},e},getHeaderItem:function(){if(null===r){var e=s("C5H3");r=new e(o.i18n("TASKS/ACTION_SHOW_TASKS"))}return{item:r,name:n}}}}return null}},Jwba:(e,t,s)=>{var i=s("a7T2"),n=s("M4cL"),o=s("p09A"),r=s("sdEb"),a=s("H20a"),l=s("KC/L"),c=s("REt5"),h=s("EFhx"),u=s("/QeJ"),d=s("doeu"),p=s("vdUg"),m=s("yKBN"),y=s("oUN1"),f=s("OfVV"),k=s("k+x/"),b=s("6prR"),g=s("ZC11");function C(){this.saveCommand=c.createCommand(this,this.executeSave),this.removeCommand=c.createCommand(this,this.executeRemove),this.calendars=new k({onCalendarCollectionChange:function(){},onCalendarActiveChange:function(){}}),d.call(this,"Tasks"),this.iItemsPerPage=20,this.browserTitle=o.observable(a.i18n("TASKS/HEADING_BROWSER_TAB")),this.tasksList=o.observableArray([]),this.hiddenTasksList=o.observableArray([]),this.selectedItem=o.observable(null),this.isSearchFocused=o.observable(!1),this.searchInput=o.observable(""),this.selector=new p(this.tasksList,i.bind(this.viewItem,this),this.executeRemove,i.bind(this.taskClickCallback,this)),this.searchClick=o.observable(!1),this.isSearch=o.computed((function(){return""!==this.searchInput()&&this.searchClick()}),this),this.pageSwitcherLocked=o.observable(!1),this.oPageSwitcher=new m(0,this.iItemsPerPage),this.oPageSwitcher.currentPage.subscribe((function(e){this.currentPage(e),this.getTasks()}),this),this.currentPage=o.observable(1),this.loadingList=o.observable(!1),this.preLoadingList=o.observable(!1),this.loadingList.subscribe((function(e){this.preLoadingList(e)}),this),this.sTimeFormat=o.computed((function(){return f.timeFormat()===Enums.TimeFormat.F24?"HH:mm":"hh:mm A"}),this),this.isEmptyList=o.computed((function(){return 0===this.tasksList().length}),this),this.searchText=o.observable(""),this.showCompleted=o.observable(!1),this.actionCompletedText=o.computed((function(){return this.showCompleted()?a.i18n("TASKS/ACTION_HIDE_COMPLETED"):a.i18n("TASKS/ACTION_SHOW_COMPLETED")}),this)}s("okSt"),i.extendOwn(C.prototype,d.prototype),C.prototype.ViewTemplate="Tasks_MainView",C.prototype.ViewConstructorName="CMainView",C.prototype.onShow=function(){this.getCalendars()},C.prototype.getCalendars=function(){this.loadingList(!0),h.send("Calendar","GetCalendars",null,this.onGetCalendarsResponse,this)},C.prototype.onGetCalendarsResponse=function(e,t){var s=[],n=[],o=null,r=null,a=this;e.Result&&(i.each(e.Result.Calendars,(function(t){if(!(o=this.calendars.parseCalendar(t)).isShared()&&!o.subscribed()&&(s.push(o.id),r=this.calendars.getCalendarById(o.id),(this.needsToReload||(r&&r.sSyncToken)!==(o&&o.sSyncToken))&&(o=this.calendars.parseAndAddCalendar(t)))){var c=o.id;o.active.subscribe((function(e){i.each(a.tasksList(),(function(t){t.calendarId===c&&t.visible(e)}))}),o),o.davUrl(l.pString(e.Result.ServerUrl)),n.push(o.id)}}),this),this.calendars.expunge(s),this.getTasks(s))},C.prototype.getTasks=function(e){this.loadingList(!0),h.send("Calendar","GetTasks",{CalendarIds:e,Completed:this.showCompleted(),Search:this.searchInput()},this.onGetTasksResponse,this)},C.prototype.prepareTask=function(e){var t=this,s=t.calendars.getCalendarById(e.calendarId),n=c.getDateFormatForMoment(f.dateFormat());if(e.visibleDate=o.observable(""),e.withDate=!1,e.start&&e.end){e.withDate=!0,e.start=r(e.start),e.end=r(e.end);var a=e.start.clone(),l=e.end.clone();l&&e.allDay&&l.subtract(1,"days");var h=0===l.diff(a,"days"),u=0===l.diff(a,"minutes"),d=t.getDateWithoutYearIfMonthWord(a.format(n)),p=h?"":" - "+t.getDateWithoutYearIfMonthWord(l.format(n)),m=e.allDay?"":", "+a.format(this.sTimeFormat()),k=e.allDay||u?"":(h?" - ":", ")+l.format(this.sTimeFormat());e.visibleDate(d+m+p+k)}return void 0===e.excluded&&(e.excluded=!1),void 0===e.rrule&&(e.rrule=!1),e.selected=o.observable(e.selected),e.checked=o.observable(e.status),e.visible=o.observable(s.active()),e.color=s.color,e.checked.subscribe((function(s){e.status=s;var n=i.bind((function(i){i!==Enums.CalendarEditRecurrenceEvent.None?(i===Enums.CalendarEditRecurrenceEvent.AllEvents&&e.rrule&&(e.start=r.unix(e.rrule.startBase),e.end=r.unix(e.rrule.endBase)),e.allEvents=i,t.updateTask(e)):e.checked(!s)}),this);e.rrule&&e.rrule.until&&(e.rrule.until=r.unix(e.rrule.until).utc().hour(0).minute(0).second(0).unix());var o=t.calendars.getCalendarById(e.calendarId);e.rrule&&!o.subscribed()?e.excluded?(e.allEvents=Enums.CalendarEditRecurrenceEvent.OnlyThisInstance,t.updateTask(e)):y.showPopup(g,[n]):(e.allEvents=Enums.CalendarEditRecurrenceEvent.AllEvents,t.updateTask(e))})),e},C.prototype.getTaskFromList=function(e){return i.find(this.tasksList(),(function(t){return t.id===e}))},C.prototype.onGetTasksResponse=function(e){var t=e.Result,s=this;if(t){var n=l.isNonEmptyArray(t)?i.compact(i.map(t,(function(e){return s.prepareTask(e)}))):[];this.tasksList(n),this.sortTasksList(),this.loadingList(!1)}},C.prototype.viewItem=function(e){this.selectedItem(e)},C.prototype.onBind=function(){this.selector.initOnApplyBindings(".sales_sub_list .item",".sales_sub_list .selected.item",".sales_sub_list .selected.item",n(".sales_list",this.$viewDom),n(".sales_list_scroll.scroll-inner",this.$viewDom))},C.prototype.searchSubmit=function(){""!==this.searchInput()?this.searchText(a.i18n("TASKS/INFO_SEARCH_RESULT",{SEARCH:this.searchInput()})):this.searchText(""),this.searchClick(!0),this.tasksList([]),this.getCalendars()},C.prototype.onClearSearchClick=function(){this.searchInput(""),this.searchText(""),this.searchClick(!1),this.searchSubmit()},C.prototype.createTaskInCurrentCalendar=function(){this.calendars.pickCurrentCalendar(),this.createTaskToday(this.calendars.currentCal())},C.prototype.createTaskToday=function(e){this.openTaskPopup(e,null,null,!1)},C.prototype.openTaskPopup=function(e,t,s,n){e&&y.showPopup(b,[{CallbackSave:i.bind(this.createTask,this),CallbackDelete:null,Calendars:this.calendars,SelectedCalendar:e?e.id:0,Start:t,End:s,AllDay:n,TimeFormat:this.sTimeFormat(),DateFormat:f.dateFormat(),Type:"VTODO",IsTaskApp:!0}])},C.prototype.getParamsFromEventData=function(e){var t=null;return e.rrule&&(t={byDays:e.rrule.byDays,count:e.rrule.count,end:l.pInt(e.rrule.end),interval:l.pInt(e.rrule.interval),period:l.pInt(e.rrule.period),until:l.pInt(e.rrule.until),weekNum:e.rrule.weekNum}),{id:e.id,uid:e.uid,calendarId:e.calendarId,newCalendarId:e.newCalendarId||e.calendarId,subject:e.subject,allDay:e.allDay?1:0,location:e.location,description:e.description,alarms:e.alarms?JSON.stringify(e.alarms):"[]",attendees:e.attendees?JSON.stringify(e.attendees):"[]",owner:e.owner,recurrenceId:e.recurrenceId,excluded:e.excluded,allEvents:e.allEvents,modified:e.modified?1:0,start:e.withDate?e.start.local().toDate():null,end:e.withDate?e.end.local().toDate():null,startTS:e.withDate?e.start.unix():null,endTS:e.withDate?(e.end,e.end.unix()):null,rrule:t?JSON.stringify(t):null,type:e.type,status:e.status,withDate:e.withDate}},C.prototype.createTask=function(e){var t=this.getParamsFromEventData(e);t.calendarId=e.newCalendarId,h.send("Calendar","CreateEvent",t,this.onCreateTaskResponse,this)},C.prototype.sortTasksList=function(){this.tasksList(this.tasksList().sort((function(e,t){return e.withDate||t.withDate?e.withDate?null!==e.startTS&&null!==t.startTS?e.startTS===t.startTS?0:e.startTS>t.startTS?1:-1:void 0:-1:e.lastModified===t.lastModified?0:e.lastModified>t.lastModified?-1:1})))},C.prototype.onCreateTaskResponse=function(e){var t=e.Result;t?(t.Events.forEach((e=>{var t=this.prepareTask(e);this.tasksList.push(t)})),this.sortTasksList()):u.showErrorByCode(e)},C.prototype.taskClickCallback=function(e){var t=i.bind((function(t){var s={ID:e.id,Uid:e.uid,RecurrenceId:e.recurrenceId,Calendars:this.calendars,SelectedCalendar:e.calendarId,AllDay:e.allDay,Location:e.location,Description:e.description,Subject:e.subject,Alarms:e.alarms,Attendees:e.attendees,RRule:e.rrule,Excluded:e.excluded,Owner:e.owner,Appointment:!1,OwnerName:e.ownerName,TimeFormat:this.sTimeFormat(),DateFormat:f.dateFormat(),AllEvents:t,CallbackSave:i.bind(this.updateTask,this),CallbackDelete:i.bind(this.executeRemove,this),Type:e.type,Status:e.status,IsTaskApp:!0};t!==Enums.CalendarEditRecurrenceEvent.None&&(t===Enums.CalendarEditRecurrenceEvent.AllEvents&&e.rrule?(s.Start=r.unix(e.rrule.startBase),s.End=r.unix(e.rrule.endBase)):(e.start&&(s.Start=e.start.clone(),s.Start=s.Start.local()),e.end&&(s.End=e.end.clone(),s.End=s.End.local())),y.showPopup(b,[s]))}),this),s=this.calendars.getCalendarById(e.calendarId);e.rrule&&!s.subscribed()?e.excluded?t(Enums.CalendarEditRecurrenceEvent.OnlyThisInstance):y.showPopup(g,[t]):t(Enums.CalendarEditRecurrenceEvent.AllEvents)},C.prototype.addTask=function(e){e&&!this.taskExists(e.id)&&this.tasksList.push(this.prepareTask(e))},C.prototype.getTask=function(e){return i.find(this.tasksList(),(function(t){return t.id===e}),this)},C.prototype.taskExists=function(e){return!!this.getTask(e)},C.prototype.removeTask=function(e){this.tasksList(i.filter(this.tasksList(),(function(t){return t.id!==e}),this))},C.prototype.removeTaskByUid=function(e,t){this.tasksList(i.filter(this.tasksList(),(function(s){return s.uid!==e||t&&s.excluded}),this))},C.prototype.updateTask=function(e){var t=this.getParamsFromEventData(e);h.send("Calendar","UpdateEvent",t,this.onUpdateTaskResponse,this)},C.prototype.onUpdateTaskResponse=function(e,t){var s=e.Result,n=t.Parameters;if(this.calendars.getCalendarById(n&&n.calendarId),s){var o=this.getTask(n.id);(o&&o.rrule||n.rrule)&&n.allEvents===Enums.CalendarEditRecurrenceEvent.AllEvents?this.removeTaskByUid(n.uid,!0):this.removeTask(n.id),i.each(e.Result.Events,(function(e){this.addTask(e)}),this),(o=this.getTask(n.id))&&this.selector.itemSelected(o),this.sortTasksList()}else u.showErrorByCode(e)},C.prototype.executeRemove=function(e){h.send("Calendar","DeleteEvent",this.getParamsFromEventData(e),this.onDeleteTaskResponse,this)},C.prototype.onDeleteTaskResponse=function(e,t){if(e.Result){var s=t.Parameters;s.allEvents===Enums.CalendarEditRecurrenceEvent.OnlyThisInstance?this.removeTask(s.id):this.removeTaskByUid(s.uid)}else u.showErrorByCode(e)},C.prototype.getDateWithoutYearIfMonthWord=function(e){var t=e.split(" "),s=r().format("YYYY");return 3===t.length&&s===t[2]?t[0]+" "+t[1]:e},C.prototype.onShowCompletedClick=function(){this.showCompleted(!this.showCompleted()),this.searchSubmit()},e.exports=new C}}]);