|
|
|
@@ -25,7 +25,7 @@ import { LoginUserRespose } from 'src/app/models/user.model';
|
|
|
|
|
import { DateAdapter } from '@angular/material/core';
|
|
|
|
|
import { ToastService } from 'src/app/services/toast.service';
|
|
|
|
|
import { eventSource } from 'src/app/models/agenda/eventSource';
|
|
|
|
|
import { CalendarService } from 'src/app/store/calendar.service';
|
|
|
|
|
import { CalendarStore } from 'src/app/store/calendar.service';
|
|
|
|
|
import { ListBoxService } from 'src/app/services/agenda/list-box.service';
|
|
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
@@ -102,8 +102,8 @@ export class AgendaPage implements OnInit {
|
|
|
|
|
postEvent: any;
|
|
|
|
|
|
|
|
|
|
// temporary data
|
|
|
|
|
taskParticipants: any = [];
|
|
|
|
|
taskParticipantsCc: any = [];
|
|
|
|
|
taskParticipants: any[] = [];
|
|
|
|
|
taskParticipantsCc: any[] = [];
|
|
|
|
|
adding: "intervenient" | "CC" = "intervenient";
|
|
|
|
|
|
|
|
|
|
@ViewChild(CalendarComponent) myCal: CalendarComponent;
|
|
|
|
@@ -153,6 +153,7 @@ export class AgendaPage implements OnInit {
|
|
|
|
|
yearNum;
|
|
|
|
|
|
|
|
|
|
dropdownScrollWeal = false
|
|
|
|
|
CalendarStore = CalendarStore
|
|
|
|
|
|
|
|
|
|
constructor(
|
|
|
|
|
private alertCtrl: AlertController,
|
|
|
|
@@ -165,7 +166,6 @@ export class AgendaPage implements OnInit {
|
|
|
|
|
authService: AuthService,
|
|
|
|
|
private dateAdapter: DateAdapter<any>,
|
|
|
|
|
private toastService: ToastService,
|
|
|
|
|
public calendarService: CalendarService,
|
|
|
|
|
private listBoxService: ListBoxService
|
|
|
|
|
) {
|
|
|
|
|
this.dateAdapter.setLocale('es');
|
|
|
|
@@ -481,12 +481,12 @@ export class AgendaPage implements OnInit {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// calendar
|
|
|
|
|
this.calendarService.removeRange(startTime, endTime, 'md')
|
|
|
|
|
this.CalendarStore.removeRange(startTime, endTime, 'md')
|
|
|
|
|
|
|
|
|
|
// loop
|
|
|
|
|
this.calendarService.pushEvent(response, 'md');
|
|
|
|
|
this.CalendarStore.pushEvent(response, 'md');
|
|
|
|
|
|
|
|
|
|
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
|
|
|
|
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();
|
|
|
|
@@ -503,11 +503,11 @@ export class AgendaPage implements OnInit {
|
|
|
|
|
|
|
|
|
|
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.calendarService.removeRange(startTime, endTime, 'pr')
|
|
|
|
|
this.CalendarStore.removeRange(startTime, endTime, 'pr')
|
|
|
|
|
// calendar
|
|
|
|
|
this.calendarService.pushEvent(response, 'pr');
|
|
|
|
|
this.CalendarStore.pushEvent(response, 'pr');
|
|
|
|
|
|
|
|
|
|
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
|
|
|
|
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();
|
|
|
|
@@ -528,12 +528,12 @@ export class AgendaPage implements OnInit {
|
|
|
|
|
// this.eventSource=[];
|
|
|
|
|
|
|
|
|
|
// clear the current month only
|
|
|
|
|
this.calendarService.removeRange(startTime, endTime, 'pr')
|
|
|
|
|
this.CalendarStore.removeRange(startTime, endTime, 'pr')
|
|
|
|
|
|
|
|
|
|
this.calendarService.pushEvent(response, 'pr');
|
|
|
|
|
this.CalendarStore.pushEvent(response, 'pr');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
|
|
|
|
this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.myCal.update();
|
|
|
|
@@ -554,14 +554,14 @@ export class AgendaPage implements OnInit {
|
|
|
|
|
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.calendarService.removeRange(startTime, endTime, 'md')
|
|
|
|
|
this.CalendarStore.removeRange(startTime, endTime, 'md')
|
|
|
|
|
|
|
|
|
|
const eventsList = response.filter(data => data.CalendarName == "Pessoal");
|
|
|
|
|
// loop
|
|
|
|
|
this.calendarService.pushEvent(eventsList, 'md');
|
|
|
|
|
this.CalendarStore.pushEvent(eventsList, 'md');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
|
|
|
|
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();
|
|
|
|
@@ -576,12 +576,12 @@ export class AgendaPage implements OnInit {
|
|
|
|
|
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.calendarService.removeRange(startTime, endTime, 'pr')
|
|
|
|
|
this.CalendarStore.removeRange(startTime, endTime, 'pr')
|
|
|
|
|
|
|
|
|
|
const eventsList = response.filter(data => data.CalendarName == "Pessoal");
|
|
|
|
|
this.calendarService.pushEvent(eventsList, 'pr');
|
|
|
|
|
this.CalendarStore.pushEvent(eventsList, 'pr');
|
|
|
|
|
|
|
|
|
|
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
|
|
|
|
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();
|
|
|
|
@@ -603,14 +603,14 @@ export class AgendaPage implements OnInit {
|
|
|
|
|
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.calendarService.removeRange(startTime, endTime, 'md')
|
|
|
|
|
this.CalendarStore.removeRange(startTime, endTime, 'md')
|
|
|
|
|
|
|
|
|
|
const eventsList = res.filter(data => data.CalendarName == "Oficial");
|
|
|
|
|
|
|
|
|
|
this.calendarService.pushEvent(eventsList, 'md');
|
|
|
|
|
this.CalendarStore.pushEvent(eventsList, 'md');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {})
|
|
|
|
|
this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {})
|
|
|
|
|
|
|
|
|
|
this.myCal.update();
|
|
|
|
|
this.myCal.loadEvents();
|
|
|
|
@@ -626,13 +626,13 @@ export class AgendaPage implements OnInit {
|
|
|
|
|
|
|
|
|
|
// this.eventSource=[];
|
|
|
|
|
|
|
|
|
|
this.calendarService.removeRange(startTime, endTime, 'pr')
|
|
|
|
|
this.CalendarStore.removeRange(startTime, endTime, 'pr')
|
|
|
|
|
|
|
|
|
|
const eventsList = res.filter(data => data.CalendarName == "Oficial");
|
|
|
|
|
this.calendarService.pushEvent(eventsList, 'pr');
|
|
|
|
|
this.CalendarStore.pushEvent(eventsList, 'pr');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
|
|
|
|
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();
|
|
|
|
@@ -658,12 +658,12 @@ export class AgendaPage implements OnInit {
|
|
|
|
|
|
|
|
|
|
let eventsList = response;
|
|
|
|
|
|
|
|
|
|
this.calendarService.removeRange(startTime, endTime, 'md')
|
|
|
|
|
this.CalendarStore.removeRange(startTime, endTime, 'md')
|
|
|
|
|
|
|
|
|
|
// loop
|
|
|
|
|
this.calendarService.pushEvent(eventsList, 'md');
|
|
|
|
|
this.CalendarStore.pushEvent(eventsList, 'md');
|
|
|
|
|
|
|
|
|
|
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
|
|
|
|
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();
|
|
|
|
@@ -688,11 +688,11 @@ export class AgendaPage implements OnInit {
|
|
|
|
|
let eventsList = response;
|
|
|
|
|
|
|
|
|
|
// clear the current month only
|
|
|
|
|
this.calendarService.removeRange(startTime, endTime, 'pr')
|
|
|
|
|
this.CalendarStore.removeRange(startTime, endTime, 'pr')
|
|
|
|
|
|
|
|
|
|
this.calendarService.pushEvent(eventsList, 'pr');
|
|
|
|
|
this.CalendarStore.pushEvent(eventsList, 'pr');
|
|
|
|
|
|
|
|
|
|
this.TimelinePRList = this.listBoxService.list(this.calendarService.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();
|
|
|
|
@@ -726,11 +726,11 @@ export class AgendaPage implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// clear the current month only
|
|
|
|
|
this.calendarService.removeRange(startTime, endTime, 'pr')
|
|
|
|
|
this.CalendarStore.removeRange(startTime, endTime, 'pr')
|
|
|
|
|
|
|
|
|
|
this.calendarService.pushEvent(eventsList, 'pr');
|
|
|
|
|
this.CalendarStore.pushEvent(eventsList, 'pr');
|
|
|
|
|
|
|
|
|
|
this.TimelinePRList = this.listBoxService.list(this.calendarService.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();
|
|
|
|
@@ -757,8 +757,8 @@ export class AgendaPage implements OnInit {
|
|
|
|
|
|
|
|
|
|
updateEventListBox() {
|
|
|
|
|
|
|
|
|
|
this.TimelinePRList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
|
|
|
|
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', 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.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -841,13 +841,13 @@ export class AgendaPage implements OnInit {
|
|
|
|
|
if(this.profile == "mdgpr") {
|
|
|
|
|
this.profile ="pr";
|
|
|
|
|
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
|
|
|
|
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
|
|
|
|
this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
this.profile ="mdgpr";
|
|
|
|
|
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
|
|
|
|
this.TimelineMDList = this.listBoxService.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
|
|
|
|
this.TimelineMDList = this.listBoxService.list(this.CalendarStore.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, {segment:this.segment, selectedDate: this.eventSelectedDate})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
@@ -1026,6 +1026,9 @@ export class AgendaPage implements OnInit {
|
|
|
|
|
EditApproveEventDismiss() {
|
|
|
|
|
this.cloneAllmobileComponent();
|
|
|
|
|
this.mobileComponent.showEditEventToApprove = true;
|
|
|
|
|
|
|
|
|
|
this.taskParticipants = []
|
|
|
|
|
this.taskParticipantsCc = []
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async cloneAllmobileComponent() {
|
|
|
|
@@ -1105,12 +1108,18 @@ export class AgendaPage implements OnInit {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async setIntervenient(data) {
|
|
|
|
|
this.taskParticipants = removeDuplicate(data)
|
|
|
|
|
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
this.taskParticipants = removeDuplicate(data)
|
|
|
|
|
}, 10)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async setIntervenientCC(data) {
|
|
|
|
|
this.taskParticipantsCc = removeDuplicate(data)
|
|
|
|
|
setTimeout(()=>{
|
|
|
|
|
this.taskParticipantsCc = removeDuplicate(data)
|
|
|
|
|
}, 10)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Emitters
|
|
|
|
|