mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-10-12 23:37:15 +00:00
fix(calendar): Fix calendar green dot stucks in original day when browser is opened for days and day changed
This commit is contained in:
1 parent
7b711eabb3
commit
650ca16ff7
6 files changed
+23
-17
No files matched your search
@@ -1,2 +1,2 @@
|
||||
!function(){"use strict";function e(e,a,n){e.state("calendars",{url:"/calendar",views:{calendars:{templateUrl:"UIxCalMainView",controller:"CalendarsController",controllerAs:"app"}},resolve:{stateCalendars:r}}).state("calendars.view",{url:"/{view:(?:day|week|month|multicolumnday)}/{day:[0-9]{8}}",views:{calendarView:{templateUrl:function(e){return e.view+"view?day="+e.day},controller:"CalendarController",controllerAs:"calendar"}},resolve:{stateEventsBlocks:t}}),a.rules.when("/calendar/day",function(){return"/calendar/day/"+(new Date).getDayString()}),a.rules.when("/calendar/multicolumnday",function(){return"/calendar/multicolumnday/"+(new Date).getDayString()}),a.rules.when("/calendar/week",function(){return"/calendar/week/"+(new Date).getDayString()}),a.rules.when("/calendar/month",function(){return"/calendar/month/"+(new Date).getDayString()}),a.rules.otherwise("/calendar/week")}function r(e){return e.$calendars||e.$findAll(window.calendarsData)}function t(e,a,n){return a.$eventsBlocksForView(e.view,e.day.asDate()).then(function(e){return _.forEach(e,function(e){e.id&&(e.calendar=new n({id:e.id,name:e.calendarName}))}),e})}function a(e,a,n,r,t,l){if(e.DebugEnabled||t.defaultErrorHandler(function(){}),n.onError({to:"calendars.**"},function(e){"calendars"==e.to().name||e.ignored()||(a.error("transition error to "+e.to().name+": "+e.error().detail),t.go({state:"calendars"}))}),0===r.url().length){var e="/calendar/",n=/(.+)view/.exec(l.settings.Calendar.View),o=(e+=n?n[1]:"week",new Date);if(l.defaults.SOGoCalendarWeekdays)for(var i=["SU","MO","TU","WE","TH","FR","SA"],d=i[o.getDay()];l.defaults.SOGoCalendarWeekdays.indexOf(d)<0;)o.addDays(1),d=i[o.getDay()];e+="/"+o.getDayString(),r.replace().url(e)}}angular.module("SOGo.SchedulerUI",["ngCookies","ui.router","angularFileUpload","sgCkeditor","SOGo.Common","SOGo.PreferencesUI","SOGo.ContactsUI","SOGo.MailerUI","as.sortable"]).config(e).run(a),e.$inject=["$stateProvider","$urlServiceProvider","$mdThemingProvider"],r.$inject=["Calendar"],t.$inject=["$stateParams","Component","Calendar"],a.$inject=["$window","$log","$transitions","$location","$state","Preferences"]}();
|
||||
!function(){"use strict";function e(e,a,n){e.state("calendars",{url:"/calendar",views:{calendars:{templateUrl:"UIxCalMainView",controller:"CalendarsController",controllerAs:"app"}},resolve:{stateCalendars:r}}).state("calendars.view",{url:"/{view:(?:day|week|month|multicolumnday)}/{day:[0-9]{8}}",views:{calendarView:{templateUrl:function(e){return e.view+"view?day="+e.day+"¤tday="+String((new Date).getFullYear())+String((new Date).getMonth()+1).padStart(2,"0")+String((new Date).getDate()).padStart(2,"0")},controller:"CalendarController",controllerAs:"calendar"}},resolve:{stateEventsBlocks:t}}),a.rules.when("/calendar/day",function(){return"/calendar/day/"+(new Date).getDayString()}),a.rules.when("/calendar/multicolumnday",function(){return"/calendar/multicolumnday/"+(new Date).getDayString()}),a.rules.when("/calendar/week",function(){return"/calendar/week/"+(new Date).getDayString()}),a.rules.when("/calendar/month",function(){return"/calendar/month/"+(new Date).getDayString()}),a.rules.otherwise("/calendar/week")}function r(e){return e.$calendars||e.$findAll(window.calendarsData)}function t(e,a,n){return a.$eventsBlocksForView(e.view,e.day.asDate()).then(function(e){return _.forEach(e,function(e){e.id&&(e.calendar=new n({id:e.id,name:e.calendarName}))}),e})}function a(e,a,n,r,t,l){if(e.DebugEnabled||t.defaultErrorHandler(function(){}),n.onError({to:"calendars.**"},function(e){"calendars"==e.to().name||e.ignored()||(a.error("transition error to "+e.to().name+": "+e.error().detail),t.go({state:"calendars"}))}),0===r.url().length){var e="/calendar/",n=/(.+)view/.exec(l.settings.Calendar.View),o=(e+=n?n[1]:"week",new Date);if(l.defaults.SOGoCalendarWeekdays)for(var i=["SU","MO","TU","WE","TH","FR","SA"],d=i[o.getDay()];l.defaults.SOGoCalendarWeekdays.indexOf(d)<0;)o.addDays(1),d=i[o.getDay()];e+="/"+o.getDayString(),r.replace().url(e)}}angular.module("SOGo.SchedulerUI",["ngCookies","ui.router","angularFileUpload","sgCkeditor","SOGo.Common","SOGo.PreferencesUI","SOGo.ContactsUI","SOGo.MailerUI","as.sortable"]).config(e).run(a),e.$inject=["$stateProvider","$urlServiceProvider","$mdThemingProvider"],r.$inject=["Calendar"],t.$inject=["$stateParams","Component","Calendar"],a.$inject=["$window","$log","$transitions","$location","$state","Preferences"]}();
|
||||
//# sourceMappingURL=Scheduler.js.map
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"Scheduler.js","sources":["Scheduler/Scheduler.app.js"],"names":["configure","$stateProvider","$urlServiceProvider","$mdThemingProvider","state","url","views","calendars","templateUrl","controller","controllerAs","resolve","stateCalendars","calendarView","$stateParams","view","day","stateEventsBlocks","rules","when","Date","getDayString","otherwise","Calendar","$calendars","$findAll","window","calendarsData","Component","$eventsBlocksForView","asDate","then","_","forEach","id","calendar","name","calendarName","runBlock","$window","$log","$transitions","$location","$state","Preferences","DebugEnabled","defaultErrorHandler","onError","to","transition","ignored","error","detail","go","length","exec","settings","View","now","defaults","SOGoCalendarWeekdays","weekDays","weekDay","getDay","indexOf","addDays","replace","angular","module","config","run","$inject"],"mappings":"AAGA,CAAA,WACE,aAUA,SAASA,EAAUC,EAAgBC,EAAqBC,GACtDF,EACGG,MAAM,YAAa,CAClBC,IAAK,YACLC,MAAO,CACLC,UAAW,CACTC,YAAa,iBACbC,WAAY,sBACZC,aAAc,KAChB,CACF,EACAC,QAAS,CACPC,eAAgBA,CAClB,CACF,CAAC,EACAR,MAAM,iBAAkB,CACvBC,IAAK,2DAGLC,MAAO,CACLO,aAAc,CACZL,YAAa,SAASM,GAKpB,OAAOA,EAAaC,KAAO,YAAcD,EAAaE,GACxD,EACAP,WAAY,qBACZC,aAAc,UAChB,CACF,EACAC,QAAS,CACPM,kBAAmB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OAAc,CAEhC,IAAIjD,EAAM,aACNU,EAAO,WAAWwC,KAAKX,EAAYY,SAASjC,SAASkC,IAAI,EAMzDC,GAJFrD,GADEU,EACKA,EAAK,GAEL,OAEC,IAAIK,MACd,GAAIwB,EAAYe,SAASC,qBAGvB,IAFA,IAAIC,EAAW,CAAC,KAAM,KAAM,KAAM,KAAM,KAAM,KAAM,MAChDC,EAAUD,EAASH,EAAIK,OAAO,GAC3BnB,EAAYe,SAASC,qBAAqBI,QAAQF,CAAO,EAAI,GAClEJ,EAAIO,QAAQ,CAAC,EACbH,EAAUD,EAASH,EAAIK,OAAO,GAGlC1D,GAAO,IAAMqD,EAAIrC,aAAa,EAC9BqB,EAAUwB,QAAQ,EAAE7D,IAAIA,CAAG,CAC7B,CACF,CAvIA8D,QAAQC,OAAO,mBAAoB,CAAC,YAAa,YAAa,oBAAqB,aAAc,cAAe,qBAAsB,kBAAmB,gBAAiB,cAAc,EACrLC,OAAOrE,CAAS,EAChBsE,IAAIhC,CAAQ,EAKftC,EAAUuE,QAAU,CAAC,iBAAkB,sBAAuB,sBAmE9D3D,EAAe2D,QAAU,CAAC,YAQ1BtD,EAAkBsD,QAAU,CAAC,eAAgB,YAAa,YAmB1DjC,EAASiC,QAAU,CAAC,UAAW,OAAQ,eAAgB,YAAa,SAAU,cAoC/E,EAAE"}
|
||||
{"version":3,"file":"Scheduler.js","sources":["Scheduler/Scheduler.app.js"],"names":["configure","$stateProvider","$urlServiceProvider","$mdThemingProvider","state","url","views","calendars","templateUrl","controller","controllerAs","resolve","stateCalendars","calendarView","$stateParams","view","day","String","Date","getFullYear","getMonth","padStart","getDate","stateEventsBlocks","rules","when","getDayString","otherwise","Calendar","$calendars","$findAll","window","calendarsData","Component","$eventsBlocksForView","asDate","then","_","forEach","id","calendar","name","calendarName","runBlock","$window","$log","$transitions","$location","$state","Preferences","DebugEnabled","defaultErrorHandler","onError","to","transition","ignored","error","detail","go","length","exec","settings","View","now","defaults","SOGoCalendarWeekdays","weekDays","weekDay","getDay","indexOf","addDays","replace","angular","module","config","run","$inject"],"mappings":"AAGA,CAAA,WACE,aAUA,SAASA,EAAUC,EAAgBC,EAAqBC,GACtDF,EACGG,MAAM,YAAa,CAClBC,IAAK,YACLC,MAAO,CACLC,UAAW,CACTC,YAAa,iBACbC,WAAY,sBACZC,aAAc,KAChB,CACF,EACAC,QAAS,CACPC,eAAgBA,CAClB,CACF,CAAC,EACAR,MAAM,iBAAkB,CACvBC,IAAK,2DAGLC,MAAO,CACLO,aAAc,CACZL,YAAa,SAAUM,GAKrB,OAAOA,EAAaC,KAAO,YAAcD,EAAaE,IAAM,eAAiBC,QAAO,IAAKC,MAAQC,YAAY,CAAC,EAAIF,QAAQ,IAAKC,MAAQE,SAAS,EAAI,CAAE,EAAEC,SAAS,EAAG,GAAG,EAAIJ,QAAQ,IAAKC,MAAQI,QAAS,CAAC,EAAED,SAAS,EAAG,GAAG,CAC7N,EACAZ,WAAY,qBACZC,aAAc,UAChB,CACF,EACAC,QAAS,CACPY,kBAAmBA,CACrB,CACF,CAAC,EAEHrB,EAAoBsB,MAAMC,KAAK,gBAAiB,WAG9C,MAAO,kBADG,IAAIP,MACgBQ,aAAa,CAC7C,CAAC,EACDxB,EAAoBsB,MAAMC,KAAK,2BAA4B,WAGzD,MAAO,6BADG,IAAIP,MAC2BQ,aAAa,CACxD,CAAC,EACDxB,EAAoBsB,MAAMC,KAAK,iBAAkB,WAG/C,MAAO,mBADG,IAAIP,MACiBQ,aAAa,CAC9C,CAAC,EACDxB,EAAoBsB,MAAMC,KAAK,kBAAmB,WAGhD,MAAO,oBADG,IAAIP,MACkBQ,aAAa,CAC/C,CAAC,EAIDxB,EAAoBsB,MAAMG,UAAU,gBAAgB,CACtD,CAMA,SAASf,EAAegB,GACtB,OAAOA,EAASC,YAAcD,EAASE,SAASC,OAAOC,aAAa,CACtE,CAMA,SAAST,EAAkBT,EAAcmB,EAAWL,GAElD,OAAOK,EAAUC,qBAAqBpB,EAAaC,KAAMD,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,OAAO1E,CAAS,EAChB2E,IAAIhC,CAAQ,EAKf3C,EAAU4E,QAAU,CAAC,iBAAkB,sBAAuB,sBAmE9DhE,EAAegE,QAAU,CAAC,YAQ1BrD,EAAkBqD,QAAU,CAAC,eAAgB,YAAa,YAmB1DjC,EAASiC,QAAU,CAAC,UAAW,OAAQ,eAAgB,YAAa,SAAU,cAoC/E,EAAE"}
|
||||
@@ -1,2 +1,2 @@
|
||||
!function(){"use strict";function d(e){this.component=e,this.component.attendees&&_.forEach(this.component.attendees,function(e){e.image=d.$gravatar(e.email,32)}),this.workDaysOnly=!0,this.slotStartTimeLimit=new Date,this.slotStartTimeLimit.setMinutes(0),this.slotStartTimeLimit.setHours(d.dayStartHour),this.slotEndTimeLimit=new Date,this.slotEndTimeLimit.setMinutes(0),this.slotEndTimeLimit.setHours(d.dayEndHour),this.$days=[],this.$futureFreebusyData={},this.updateFreeBusyCoverage(),this.updateFreeBusy(),0==this.$days.length&&this.getDays()}d.$factory=["$q","$timeout","$log","sgSettings","Attendees_ROLES","Preferences","User","Card","Gravatar","Resource",function(e,t,n,i,a,o,r,s,c,l){return angular.extend(d,{$q:e,$timeout:t,$log:n,$settings:i,$User:r,$Preferences:o,$Card:s,$gravatar:c,$$resource:new l(i.activeUser("folderURL")+"Calendar",i.activeUser()),ROLES:a}),d.dayStartHour=parseInt(o.defaults.SOGoDayStartTime.split(":")[0]),d.dayEndHour=parseInt(o.defaults.SOGoDayEndTime.split(":")[0]),d}];try{angular.module("SOGo.SchedulerUI")}catch(e){angular.module("SOGo.SchedulerUI",["SOGo.Common"])}angular.module("SOGo.SchedulerUI").constant("Attendees_ROLES",{REQ_PARTICIPANT:"req-participant",OPT_PARTICIPANT:"opt-participant",NON_PARTICIPANT:"non-participant",CHAIR:"chair"}).factory("Attendees",d.$factory),d.timeToQuarters=function(e){return 4*e.getHours()+Math.ceil(e.getMinutes()/15)},d.prototype.getLength=function(){return this.component.attendees?this.component.attendees.length:0},d.prototype.initOrganizer=function(e){var t=this,e=e&&e.isSubscription?d.$User.$filter(e.owner).then(function(e){e=e[0];t.component.organizer={uid:e.uid,name:e.cn,email:e.c_email}}):(this.component.organizer||(this.component.organizer={uid:d.$settings.activeUser("login"),name:d.$settings.activeUser("identification"),email:d.$settings.activeUser("email")}),d.$q.when());e.then(function(){t.updateFreeBusyAttendee(t.component.organizer)})},d.prototype.add=function(e,t){var n,i,a=this,o=d.$q.when();return e&&((!this.component.attendees||t&&t.organizerCalendar)&&this.initOrganizer(t?t.organizerCalendar:null),e.$isList({expandable:!0})?o=(i=d.$Card.$find(e.container,e.c_name)).$id().then(function(e){_.forEach(i.refs,function(e){n={name:e.c_cn,email:e.$preferredEmail(t?t.partial:null),role:d.ROLES.REQ_PARTICIPANT,partstat:"needs-action",uid:e.c_uid,$avatarIcon:"person"},_.find(a.component.attendees,function(e){return e.email==n.email})||(n.image=d.$gravatar(n.email,32),a.component.attendees?a.component.attendees.push(n):a.component.attendees=[n],a.updateFreeBusyAttendee(n))})}):(n={uid:e.c_uid,domain:e.c_domain,isMSExchange:e.ismsexchange,isGroup:e.$isList(),isExpandableGroup:!1,isResource:e.isresource,name:e.c_cn,email:e.$$email,role:d.ROLES.REQ_PARTICIPANT,partstat:"needs-action",$avatarIcon:e.$avatarIcon},_.find(this.attendees,function(e){return e.email==n.email})||(e.$isList()&&d.$Preferences.defaults.SOGoLDAPGroupExpansionEnabled&&(o=e.$members().then(function(e){n.members=e,n.isExpandableGroup=!0})),n.image=d.$gravatar(n.email,32),this.component.attendees?_.findIndex(this.component.attendees,{email:n.email})<0&&this.component.attendees.push(n):this.component.attendees=[n],this.updateFreeBusyAttendee(n)))),o},d.prototype.nextRole=function(t){var e=_.values(d.ROLES),n=_.findIndex(e,function(e){return t.role===e});t.role=e[++n%4]},d.prototype.hasAttendee=function(e){var t=_.find(this.component.attendees,function(t){return _.find(e.emails,function(e){return e.value==t.email})});return angular.isDefined(t)},d.prototype.remove=function(t){var e=_.findIndex(this.component.attendees,function(e){return e.email==t.email});-1<e&&this.component.attendees.splice(e,1),delete this.$futureFreebusyData[t.uid]},d.prototype.updateFreeBusyCoverage=function(){var o,r,s,e,c={};this.component.start&&this.component.end&&(o=new Date(this.component.start.getTime()),r=new Date(this.component.end.getTime()),this.component.isAllDay?(o.setHours(d.dayStartHour),o.setMinutes(0),r.setHours(d.dayEndHour),r.setMinutes(0),s=e=0):(s=parseInt(o.getMinutes()/15+.5),e=parseInt(r.getMinutes()/15+.5)),o.setMinutes(15*s),r.setMinutes(15*e),_.forEach(o.beginOfDay().daysUpTo(r.beginOfDay()),function(e,t){var n,i=(e=e<o?new Date(o.getTime()):e).getDate(),a=e.getDayString();if(a===o.getDayString())for(n=e.getHours().toString(),c[a]={},c[a][n]=[];0<s;)c[a][n].push(0),s--;else e=e.beginOfDay(),c[a]={};for(;e.getTime()<r.getTime()&&e.getDate()==i;)n=e.getHours().toString(),angular.isUndefined(c[a][n])&&(c[a][n]=[]),c[a][n].push(1),e.addMinutes(15)}),this.freebusy=c)},d.prototype.coversFreeBusy=function(e,t,n){return this.freebusy&&angular.isDefined(this.freebusy[e])&&angular.isDefined(this.freebusy[e][t])&&1==this.freebusy[e][t][n]},d.prototype.getDays=function(e){var t,n,i,a=this;return e?(t=e,(n=new Date(e.getTime())).addMinutes(this.component.delta)):(t=this.component.start,n=this.component.end),(0===this.$days.length||_.findIndex(this.$days,["getDayString",t.getDayString()])<0||_Line truncated
|
||||
!function(){"use strict";function d(e){this.component=e,this.component.attendees&&_.forEach(this.component.attendees,function(e){e.image=d.$gravatar(e.email,32)}),this.workDaysOnly=!0,this.slotStartTimeLimit=new Date,this.slotStartTimeLimit.setMinutes(0),this.slotStartTimeLimit.setHours(d.dayStartHour),this.slotEndTimeLimit=new Date,this.slotEndTimeLimit.setMinutes(0),this.slotEndTimeLimit.setHours(d.dayEndHour),this.$days=[],this.$futureFreebusyData={},this.updateFreeBusyCoverage(),this.updateFreeBusy(),0==this.$days.length&&this.getDays()}d.$factory=["$q","$timeout","$log","sgSettings","Attendees_ROLES","Preferences","User","Card","Gravatar","Resource",function(e,t,n,i,a,o,r,s,c,l){return angular.extend(d,{$q:e,$timeout:t,$log:n,$settings:i,$User:r,$Preferences:o,$Card:s,$gravatar:c,$$resource:new l(i.activeUser("folderURL")+"Calendar",i.activeUser()),ROLES:a}),d.dayStartHour=parseInt(o.defaults.SOGoDayStartTime.split(":")[0]),d.dayEndHour=parseInt(o.defaults.SOGoDayEndTime.split(":")[0]),d}];try{angular.module("SOGo.SchedulerUI")}catch(e){angular.module("SOGo.SchedulerUI",["SOGo.Common"])}angular.module("SOGo.SchedulerUI").constant("Attendees_ROLES",{REQ_PARTICIPANT:"req-participant",OPT_PARTICIPANT:"opt-participant",NON_PARTICIPANT:"non-participant",CHAIR:"chair"}).factory("Attendees",d.$factory),d.timeToQuarters=function(e){return 4*e.getHours()+Math.ceil(e.getMinutes()/15)},d.prototype.getLength=function(){return this.component.attendees?this.component.attendees.length:0},d.prototype.initOrganizer=function(e){var t=this,e=e&&e.isSubscription?d.$User.$filter(e.owner).then(function(e){e=e[0];t.component.organizer={uid:e.uid,name:e.cn,email:e.c_email}}):(this.component.organizer||(this.component.organizer={uid:d.$settings.activeUser("login"),name:d.$settings.activeUser("identification"),email:d.$settings.activeUser("email")}),d.$q.when());e.then(function(){t.updateFreeBusyAttendee(t.component.organizer)})},d.prototype.add=function(e,t){var n,i,a=this,o=d.$q.when();return e&&((!this.component.attendees||t&&t.organizerCalendar)&&this.initOrganizer(t?t.organizerCalendar:null),e.$isList({expandable:!0})?o=(i=d.$Card.$find(e.container,e.c_name)).$id().then(function(e){_.forEach(i.refs,function(e){n={name:e.c_cn,email:e.$preferredEmail(t?t.partial:null),role:d.ROLES.REQ_PARTICIPANT,partstat:"needs-action",uid:e.c_uid,$avatarIcon:"person"},_.find(a.component.attendees,function(e){return e.email==n.email})||(n.image=d.$gravatar(n.email,32),a.component.attendees?a.component.attendees.push(n):a.component.attendees=[n],a.updateFreeBusyAttendee(n))})}):(n={uid:e.c_uid,domain:e.c_domain,isMSExchange:e.ismsexchange,isGroup:e.$isList(),isExpandableGroup:!1,isResource:e.isresource,name:e.c_cn,email:e.$$email,role:d.ROLES.REQ_PARTICIPANT,partstat:"needs-action",$avatarIcon:e.$avatarIcon},_.find(this.attendees,function(e){return e.email==n.email})||(e.$isList()&&d.$Preferences.defaults.SOGoLDAPGroupExpansionEnabled&&(o=e.$members().then(function(e){n.members=e,n.isExpandableGroup=!0})),n.image=d.$gravatar(n.email,32),this.component.attendees?_.findIndex(this.component.attendees,{email:n.email})<0&&this.component.attendees.push(n):this.component.attendees=[n],this.updateFreeBusyAttendee(n)))),o},d.prototype.nextRole=function(t){var e=_.values(d.ROLES),n=_.findIndex(e,function(e){return t.role===e});t.role=e[++n%4]},d.prototype.hasAttendee=function(e){var t=_.find(this.component.attendees,function(t){return _.find(e.emails,function(e){return e.value==t.email})});return angular.isDefined(t)},d.prototype.remove=function(t){var e=_.findIndex(this.component.attendees,function(e){return e.email==t.email});-1<e&&this.component.attendees.splice(e,1),delete this.$futureFreebusyData[t.uid]},d.prototype.updateFreeBusyCoverage=function(){var o,r,s,e,c={};this.component.start&&this.component.end&&(o=new Date(this.component.start.getTime()),r=new Date(this.component.end.getTime()),this.component.isAllDay?(o.setHours(d.dayStartHour),o.setMinutes(0),r.setHours(d.dayEndHour),r.setMinutes(0),s=e=0):(s=parseInt(o.getMinutes()/15+.5),e=parseInt(r.getMinutes()/15+.5)),o.setMinutes(15*s),r.setMinutes(15*e),_.forEach(o.beginOfDay().daysUpTo(r.beginOfDay()),function(e,t){var n,i=(e=e<o?new Date(o.getTime()):e).getDate(),a=e.getDayString();if(a===o.getDayString())for(n=e.getHours().toString(),c[a]={},c[a][n]=[];0<s;)c[a][n].push(0),s--;else e=e.beginOfDay(),c[a]={};for(;e.getTime()<r.getTime()&&e.getDate()==i;)n=e.getHours().toString(),angular.isUndefined(c[a][n])&&(c[a][n]=[]),c[a][n].push(1),e.addMinutes(15)}),this.freebusy=c)},d.prototype.coversFreeBusy=function(e,t,n){return this.freebusy&&angular.isDefined(this.freebusy[e])&&angular.isDefined(this.freebusy[e][t])&&1==this.freebusy[e][t][n]},d.prototype.getDays=function(e){var t,n,i,a=this;return e?(t=e,(n=new Date(e.getTime())).addMinutes(this.component.delta)):(t=this.component.start,n=this.component.end),(0===this.$days.length||_.findIndex(this.$days,["getDayString",t.getDayString()])<0||_Line truncated
|
||||
//# sourceMappingURL=Scheduler.services.js.map
|
||||
@@ -1 +1 @@
|
||||
{"version":3,"file":"Scheduler.services.js","sources":["Scheduler/Attendees.service.js","Scheduler/Calendar.service.js","Scheduler/Component.service.js","Scheduler/CalendarController.js","Scheduler/CalendarListController.js","Scheduler/CalendarsController.js","Scheduler/ComponentController.js","Scheduler/sgCalendarDay.directive.js","Scheduler/sgCalendarDayBlock.directive.js","Scheduler/sgCalendarDayTable.directive.js","Scheduler/sgCalendarGhost.directive.js","Scheduler/sgCalendarListEvent.directive.js","Scheduler/sgCalendarListItem.directive.js","Scheduler/sgCalendarMonthDay.directive.js","Scheduler/sgCalendarMonthEvent.directive.js","Scheduler/sgCalendarPrintStylesheet.directive.js","Scheduler/sgCalendarScrollView.directive.js","Scheduler/sgCategoryStylesheet.directive.js","Scheduler/sgDraggableCalendarBlock.directive.js","Scheduler/sgFreebusy.directive.js","Scheduler/sgFreebusyDay.directive.js","Scheduler/sgNowLine.directive.js"],"names":["Attendees","component","this","attendees","_","forEach","attendee","image","$gravatar","email","workDaysOnly","slotStartTimeLimit","Date","setMinutes","setHours","dayStartHour","slotEndTimeLimit","dayEndHour","$days","$futureFreebusyData","updateFreeBusyCoverage","updateFreeBusy","length","getDays","$factory","$q","$timeout","$log","Settings","ROLES","Preferences","User","Card","Gravatar","Resource","angular","extend","$settings","$User","$Preferences","$Card","$$resource","activeUser","parseInt","defaults","SOGoDayStartTime","split","SOGoDayEndTime","module","e","constant","REQ_PARTICIPANT","OPT_PARTICIPANT","NON_PARTICIPANT","CHAIR","factory","timeToQuarters","dateTime","getHours","Math","ceil","getMinutes","prototype","getLength","initOrganizer","calendar","_this","promise","isSubscription","$filter","owner","then","results","organizer","uid","name","cn","c_email","when","updateFreeBusyAttendee","add","card","options","list","organizerCalendar","$isList","expandable","$find","container","c_name","$id","listId","refs","ref","c_cn","$preferredEmail","partial","role","partstat","c_uid","$avatarIcon","find","o","push","domain","c_domain","isMSExchange","ismsexchange","isGroup","isExpandableGroup","isResource","isresource","$$email","SOGoLDAPGroupExpansionEnabled","$members","members","findIndex","nextRole","roles","values","index","hasAttendee","emails","value","isDefined","remove","currentAttendee","splice","roundedStart","roundedEnd","startQuarter","endQuarter","freebusy","start","end","getTime","isAllDay","beginOfDay","daysUpTo","date","hourKey","currentDay","getDate","dayKey","getDayString","toString","isUndefined","addMinutes","coversFreeBusy","day","hour","quarter","refDate","sd","ed","formatFcn","delta","addDays","$mdDateLocaleProvider","formatDate","$dateFormat","SOGoLongDateFormat","stringWithSeparator","promises","filter","all","resource","days","params","sday","map","eday","userResource","intersection","keys","fetch","data","i","forwardFindDate","currentStart","foundDate","maxOffset","endLimit","duration","offset","firstStep","floor","currentEntries","indexOf","startLimit","foundTime","testDuration","setTime","forwardAdjustCurrentStart","getDay","backwardFindDate","lastIndexOf","testOffset","debug","backwardAdjustCurrentStart","findSlot","direction","findDate","adjustCurrentStart","clone","setSeconds","step","catch","err","mergeFreebusy","startDay","j","attendeeEntries","flatMap","count","reject","l","Calendar","futureCalendarData","init","id","newCalendarData","create","$unwrap","Component","Acl","$Component","$$Acl","$view","EventDragDayLength","EventDragHorizontalOffset","ConflictHTTPErrorCode","$defaultCalendar","SOGoDefaultCalendar","$findAll","active","$add","isWebCalendar","$webcalendars","$subscriptions","$calendars","sibling","localeCompare","settings","FoldersOrder","saveFoldersOrder","$reloadAll","writable","contextId","calendars","union","isOwned","acls","objectCreator","calendarData","group","login","$get","$getIndex","$subscribe","path","$addWebCalendar","url","d","defer","urls","webCalendarURL","post","isEditable","isRemote","JSON","stringify","undefined","resolve","response","status","reloadWebCalendars","$error","statusText","$deleteComponents","components","pid","uids","saveFoldersActivation","ids","request","folders","color","$acl","isSuperUser","$shadowData","$omit","$futureCalendarData","getClassName","base","$rename","$save","$delete","$reset","key","save","setCredentials","username","password","export","realOwnerId","type","filename","webDavICSURL","ownerPaths","substring","join","open","$setActivation","$getComponent","componentId","recurrenceId","isError","isObject","copy","futureComponentData","newComponentData","newguid","isNew","$rootScope","Component_STATUS","STATUS","$Attendees","timeFormat","$query","search","$queryEvents","sort","asc","filterpopup","$queryTasks","$refreshTimeout","$ghost","EventsFilterState","TasksFilterState","EventsSortingState","TasksSortingState","show_completed","ShowCompletedTasks","$categories","SOGoCaleLine truncated
|
||||
{"version":3,"file":"Scheduler.services.js","sources":["Scheduler/Attendees.service.js","Scheduler/Calendar.service.js","Scheduler/Component.service.js","Scheduler/CalendarController.js","Scheduler/CalendarListController.js","Scheduler/CalendarsController.js","Scheduler/ComponentController.js","Scheduler/sgCalendarDay.directive.js","Scheduler/sgCalendarDayBlock.directive.js","Scheduler/sgCalendarDayTable.directive.js","Scheduler/sgCalendarGhost.directive.js","Scheduler/sgCalendarListEvent.directive.js","Scheduler/sgCalendarListItem.directive.js","Scheduler/sgCalendarMonthDay.directive.js","Scheduler/sgCalendarMonthEvent.directive.js","Scheduler/sgCalendarPrintStylesheet.directive.js","Scheduler/sgCalendarScrollView.directive.js","Scheduler/sgCategoryStylesheet.directive.js","Scheduler/sgDraggableCalendarBlock.directive.js","Scheduler/sgFreebusy.directive.js","Scheduler/sgFreebusyDay.directive.js","Scheduler/sgNowLine.directive.js"],"names":["Attendees","component","this","attendees","_","forEach","attendee","image","$gravatar","email","workDaysOnly","slotStartTimeLimit","Date","setMinutes","setHours","dayStartHour","slotEndTimeLimit","dayEndHour","$days","$futureFreebusyData","updateFreeBusyCoverage","updateFreeBusy","length","getDays","$factory","$q","$timeout","$log","Settings","ROLES","Preferences","User","Card","Gravatar","Resource","angular","extend","$settings","$User","$Preferences","$Card","$$resource","activeUser","parseInt","defaults","SOGoDayStartTime","split","SOGoDayEndTime","module","e","constant","REQ_PARTICIPANT","OPT_PARTICIPANT","NON_PARTICIPANT","CHAIR","factory","timeToQuarters","dateTime","getHours","Math","ceil","getMinutes","prototype","getLength","initOrganizer","calendar","_this","promise","isSubscription","$filter","owner","then","results","organizer","uid","name","cn","c_email","when","updateFreeBusyAttendee","add","card","options","list","organizerCalendar","$isList","expandable","$find","container","c_name","$id","listId","refs","ref","c_cn","$preferredEmail","partial","role","partstat","c_uid","$avatarIcon","find","o","push","domain","c_domain","isMSExchange","ismsexchange","isGroup","isExpandableGroup","isResource","isresource","$$email","SOGoLDAPGroupExpansionEnabled","$members","members","findIndex","nextRole","roles","values","index","hasAttendee","emails","value","isDefined","remove","currentAttendee","splice","roundedStart","roundedEnd","startQuarter","endQuarter","freebusy","start","end","getTime","isAllDay","beginOfDay","daysUpTo","date","hourKey","currentDay","getDate","dayKey","getDayString","toString","isUndefined","addMinutes","coversFreeBusy","day","hour","quarter","refDate","sd","ed","formatFcn","delta","addDays","$mdDateLocaleProvider","formatDate","$dateFormat","SOGoLongDateFormat","stringWithSeparator","promises","filter","all","resource","days","params","sday","map","eday","userResource","intersection","keys","fetch","data","i","forwardFindDate","currentStart","foundDate","maxOffset","endLimit","duration","offset","firstStep","floor","currentEntries","indexOf","startLimit","foundTime","testDuration","setTime","forwardAdjustCurrentStart","getDay","backwardFindDate","lastIndexOf","testOffset","debug","backwardAdjustCurrentStart","findSlot","direction","findDate","adjustCurrentStart","clone","setSeconds","step","catch","err","mergeFreebusy","startDay","j","attendeeEntries","flatMap","count","reject","l","Calendar","futureCalendarData","init","id","newCalendarData","create","$unwrap","Component","Acl","$Component","$$Acl","$view","EventDragDayLength","EventDragHorizontalOffset","ConflictHTTPErrorCode","$defaultCalendar","SOGoDefaultCalendar","$findAll","active","$add","isWebCalendar","$webcalendars","$subscriptions","$calendars","sibling","localeCompare","settings","FoldersOrder","saveFoldersOrder","$reloadAll","writable","contextId","calendars","union","isOwned","acls","objectCreator","calendarData","group","login","$get","$getIndex","$subscribe","path","$addWebCalendar","url","d","defer","urls","webCalendarURL","post","isEditable","isRemote","JSON","stringify","undefined","resolve","response","status","reloadWebCalendars","$error","statusText","$deleteComponents","components","pid","uids","saveFoldersActivation","ids","request","folders","color","$acl","isSuperUser","$shadowData","$omit","$futureCalendarData","getClassName","base","$rename","$save","$delete","$reset","key","save","setCredentials","username","password","export","realOwnerId","type","filename","webDavICSURL","ownerPaths","substring","join","open","$setActivation","$getComponent","componentId","recurrenceId","isError","isObject","copy","futureComponentData","newComponentData","newguid","isNew","$rootScope","Component_STATUS","STATUS","$Attendees","timeFormat","$query","search","$queryEvents","sort","asc","filterpopup","$queryTasks","$refreshTimeout","$ghost","EventsFilterState","TasksFilterState","EventsSortingState","TasksSortingState","show_completed","ShowCompletedTasks","$categories","SOGoCaleLine truncated
|
||||
@@ -175,7 +175,13 @@
|
||||
var date = newDate? newDate.getDayString() : angular.element($event.currentTarget).attr('date');
|
||||
if (newDate)
|
||||
_formatDate(newDate);
|
||||
|
||||
if (isToday) {
|
||||
var d = new Date();
|
||||
date = String(d.getFullYear()) + String((d.getMonth() + 1)).padStart(2, '0') + String((d.getDate())).padStart(2, '0');
|
||||
}
|
||||
$state.go('calendars.view', { day: date });
|
||||
|
||||
// Refresh calendar data if click on today
|
||||
if (isToday) {
|
||||
$rootScope.$emit('calendars:list');
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/* -*- Mode: javascript; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
||||
/* JavaScript for SOGo.SchedulerUI module */
|
||||
|
||||
(function() {
|
||||
(function () {
|
||||
'use strict';
|
||||
|
||||
angular.module('SOGo.SchedulerUI', ['ngCookies', 'ui.router', 'angularFileUpload', 'sgCkeditor', 'SOGo.Common', 'SOGo.PreferencesUI', 'SOGo.ContactsUI', 'SOGo.MailerUI', 'as.sortable'])
|
||||
@@ -33,12 +33,12 @@
|
||||
//deepStateRedirect: true,
|
||||
views: {
|
||||
calendarView: {
|
||||
templateUrl: function($stateParams) {
|
||||
templateUrl: function ($stateParams) {
|
||||
// UI/Templates/SchedulerUI/UIxCalDayView.wox or
|
||||
// UI/Templates/SchedulerUI/UIxCalWeekView.wox or
|
||||
// UI/Templates/SchedulerUI/UIxCalMonthView.wox or
|
||||
// UI/Templates/SchedulerUI/UIxCalMulticolumnDayView.wox
|
||||
return $stateParams.view + 'view?day=' + $stateParams.day;
|
||||
return $stateParams.view + 'view?day=' + $stateParams.day + '¤tday=' + String((new Date()).getFullYear()) + String(((new Date()).getMonth() + 1)).padStart(2, '0') + String(((new Date()).getDate())).padStart(2, '0');
|
||||
},
|
||||
controller: 'CalendarController',
|
||||
controllerAs: 'calendar'
|
||||
@@ -49,22 +49,22 @@
|
||||
}
|
||||
});
|
||||
|
||||
$urlServiceProvider.rules.when('/calendar/day', function() {
|
||||
$urlServiceProvider.rules.when('/calendar/day', function () {
|
||||
// If no date is specified, show today
|
||||
var now = new Date();
|
||||
return '/calendar/day/' + now.getDayString();
|
||||
});
|
||||
$urlServiceProvider.rules.when('/calendar/multicolumnday', function() {
|
||||
$urlServiceProvider.rules.when('/calendar/multicolumnday', function () {
|
||||
// If no date is specified, show today
|
||||
var now = new Date();
|
||||
return '/calendar/multicolumnday/' + now.getDayString();
|
||||
});
|
||||
$urlServiceProvider.rules.when('/calendar/week', function() {
|
||||
$urlServiceProvider.rules.when('/calendar/week', function () {
|
||||
// If no date is specified, show today's week
|
||||
var now = new Date();
|
||||
return '/calendar/week/' + now.getDayString();
|
||||
});
|
||||
$urlServiceProvider.rules.when('/calendar/month', function() {
|
||||
$urlServiceProvider.rules.when('/calendar/month', function () {
|
||||
// If no date is specified, show today's month
|
||||
var now = new Date();
|
||||
return '/calendar/month/' + now.getDayString();
|
||||
@@ -90,8 +90,8 @@
|
||||
function stateEventsBlocks($stateParams, Component, Calendar) {
|
||||
// See CalendarController.js
|
||||
return Component.$eventsBlocksForView($stateParams.view, $stateParams.day.asDate())
|
||||
.then(function(views) {
|
||||
_.forEach(views, function(view) {
|
||||
.then(function (views) {
|
||||
_.forEach(views, function (view) {
|
||||
if (view.id) {
|
||||
// Note: this can't be done in Component service since it would make Component dependent on
|
||||
// the Calendar service and create a circular dependency
|
||||
@@ -108,12 +108,12 @@
|
||||
runBlock.$inject = ['$window', '$log', '$transitions', '$location', '$state', 'Preferences'];
|
||||
function runBlock($window, $log, $transitions, $location, $state, Preferences) {
|
||||
if (!$window.DebugEnabled)
|
||||
$state.defaultErrorHandler(function() {
|
||||
$state.defaultErrorHandler(function () {
|
||||
// Don't report any state error
|
||||
});
|
||||
$transitions.onError({ to: 'calendars.**' }, function(transition) {
|
||||
$transitions.onError({ to: 'calendars.**' }, function (transition) {
|
||||
if (transition.to().name != 'calendars' &&
|
||||
!transition.ignored()) {
|
||||
!transition.ignored()) {
|
||||
$log.error('transition error to ' + transition.to().name + ': ' + transition.error().detail);
|
||||
$state.go({ state: 'calendars' });
|
||||
}
|
||||
@@ -121,7 +121,7 @@
|
||||
if ($location.url().length === 0) {
|
||||
// Restore user's last view
|
||||
var url = '/calendar/',
|
||||
view = /(.+)view/.exec(Preferences.settings.Calendar.View);
|
||||
view = /(.+)view/.exec(Preferences.settings.Calendar.View);
|
||||
if (view)
|
||||
url += view[1];
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user