mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Fix
This commit is contained in:
@@ -488,187 +488,78 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.showLoader = true;
|
||||
|
||||
if(window.innerWidth < 800){
|
||||
if(window.innerWidth < 800) {
|
||||
|
||||
// this.showTimeline = false;
|
||||
if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR' ) {
|
||||
this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).then(
|
||||
|
||||
switch (this.segment) {
|
||||
case "Combinado":
|
||||
//Inicializa o array eventSource
|
||||
(response:any) => {
|
||||
|
||||
if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR' ) {
|
||||
this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).then(
|
||||
// calendar
|
||||
this.CalendarStore.removeRange(startTime, endTime, 'md')
|
||||
|
||||
(response:any) => {
|
||||
// loop
|
||||
this.CalendarStore.pushEvent(response, 'md');
|
||||
|
||||
// calendar
|
||||
this.CalendarStore.removeRange(startTime, endTime, 'md')
|
||||
this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
||||
|
||||
// loop
|
||||
this.CalendarStore.pushEvent(response, 'md');
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
}).finally(()=>{
|
||||
this.showLoader = false;
|
||||
})
|
||||
|
||||
}
|
||||
else if(this.profile == "pr" && this.loggeduser.Profile == 'MDGPR') {
|
||||
|
||||
this.eventService.getAllSharedEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => {
|
||||
|
||||
this.CalendarStore.removeRange(startTime, endTime, 'pr')
|
||||
// calendar
|
||||
this.CalendarStore.pushEvent(response, 'pr');
|
||||
|
||||
this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
}).finally(()=>{
|
||||
this.showLoader = false;
|
||||
})
|
||||
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR') {
|
||||
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then(
|
||||
(response:any) => {
|
||||
|
||||
// clear the current month only
|
||||
this.CalendarStore.removeRange(startTime, endTime, 'pr')
|
||||
|
||||
this.CalendarStore.pushEvent(response, 'pr');
|
||||
|
||||
|
||||
this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
||||
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
|
||||
}).finally(()=>{
|
||||
this.showLoader = false;
|
||||
})
|
||||
}
|
||||
break;
|
||||
|
||||
case "Pessoal":
|
||||
//Inicializa o array eventSource
|
||||
if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') {
|
||||
this.eventService.getAllMdPessoalEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => {
|
||||
|
||||
this.CalendarStore.removeRange(startTime, endTime, 'md')
|
||||
|
||||
const eventsList = response.filter(data => data.CalendarName == "Pessoal");
|
||||
// loop
|
||||
this.CalendarStore.pushEvent(eventsList, 'md');
|
||||
|
||||
|
||||
this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
}).finally(()=>{
|
||||
this.showLoader = false;
|
||||
})
|
||||
|
||||
}
|
||||
else{
|
||||
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => {
|
||||
|
||||
this.CalendarStore.removeRange(startTime, endTime, 'pr')
|
||||
|
||||
const eventsList = response.filter(data => data.CalendarName == "Pessoal");
|
||||
this.CalendarStore.pushEvent(eventsList, 'pr');
|
||||
|
||||
this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
||||
this.TimelinePRList = this.listBoxService.list(this.CalendarStore.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
||||
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
}).finally(()=>{
|
||||
this.showLoader = false;
|
||||
})
|
||||
}
|
||||
break;
|
||||
|
||||
case "Oficial":
|
||||
|
||||
//Inicializa o array eventSource
|
||||
const eventsList = [];
|
||||
|
||||
if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') {
|
||||
this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((res:any) => {
|
||||
|
||||
this.CalendarStore.removeRange(startTime, endTime, 'md')
|
||||
|
||||
const eventsList = res.filter(data => data.CalendarName == "Oficial");
|
||||
|
||||
this.CalendarStore.pushEvent(eventsList, 'md');
|
||||
|
||||
|
||||
this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {})
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
}).finally(()=>{
|
||||
this.showLoader = false;
|
||||
})
|
||||
} else {
|
||||
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((res:any) => {
|
||||
|
||||
// this.eventSource=[];
|
||||
|
||||
this.CalendarStore.removeRange(startTime, endTime, 'pr')
|
||||
|
||||
const eventsList = res.filter(data => data.CalendarName == "Oficial");
|
||||
this.CalendarStore.pushEvent(eventsList, 'pr');
|
||||
|
||||
|
||||
this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
||||
this.TimelinePRList = this.listBoxService.list(this.CalendarStore.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
||||
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
}).finally(()=>{
|
||||
this.showLoader = false;
|
||||
})
|
||||
}
|
||||
break;
|
||||
}).finally(()=>{
|
||||
this.showLoader = false;
|
||||
})
|
||||
|
||||
}
|
||||
else if(this.profile == "pr" && this.loggeduser.Profile == 'MDGPR') {
|
||||
|
||||
this.eventService.getAllSharedEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => {
|
||||
|
||||
this.CalendarStore.removeRange(startTime, endTime, 'pr')
|
||||
// calendar
|
||||
this.CalendarStore.pushEvent(response, 'pr');
|
||||
|
||||
this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
}).finally(()=>{
|
||||
this.showLoader = false;
|
||||
})
|
||||
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR') {
|
||||
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then(
|
||||
(response:any) => {
|
||||
|
||||
// clear the current month only
|
||||
this.CalendarStore.removeRange(startTime, endTime, 'pr')
|
||||
|
||||
this.CalendarStore.pushEvent(response, 'pr');
|
||||
|
||||
|
||||
this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
||||
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
|
||||
}).finally(()=>{
|
||||
this.showLoader = false;
|
||||
})
|
||||
}
|
||||
|
||||
} else {
|
||||
// calendar
|
||||
|
||||
@@ -779,7 +670,6 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
updateEventListBox() {
|
||||
|
||||
|
||||
if(window.innerWidth < 800){
|
||||
|
||||
switch (this.segment) {
|
||||
|
||||
Reference in New Issue
Block a user