This commit is contained in:
Peter Maquiran
2022-04-13 15:55:50 +01:00
parent 8970d4579d
commit b9031c71dd
5 changed files with 75 additions and 30 deletions
@@ -127,11 +127,12 @@ export class BookMeetingModalPage implements OnInit {
private navParams: NavParams,
private processes:ProcessesService,
private attachmentsService: AttachmentsService,
private calendarService: EventsService,
public calendarService: EventsService,
authService: AuthService,
private toastService: ToastService,
private activatedRoute: ActivatedRoute,
public ThemeService: ThemeService
public ThemeService: ThemeService,
) {
this.taskParticipants = [];
this.loggeduser = authService.ValidatedUser;
@@ -149,6 +150,18 @@ export class BookMeetingModalPage implements OnInit {
this.postData.Category = 'Reunião'
if(this.calendarService.hasOwnCalendar == false || !this.calendarService.hasSharedCalendar == false) {
if(this.calendarService.hasOwnCalendar == false && this.calendarService.hasSharedCalendar == true) {
this.CalendarName = 'sharedCalendar'
} else if (this.calendarService.hasOwnCalendar == true && this.calendarService.hasSharedCalendar == false) {
this.CalendarName = 'myCalendar'
}
}
}
ngOnInit() {
@@ -265,19 +278,12 @@ export class BookMeetingModalPage implements OnInit {
if(this.task.FsId == '8') {
const loader = this.toastService.loading()
try {
switch (this.loggeduser.Profile) {
case 'MDGPR':
await this.calendarService.postExpedientEvent(this.task.DocId, this.postData, "md",this.task.SerialNumber, this.task.FsId).toPromise();
break;
case 'PR':
await this.calendarService.postExpedientEvent(this.task.DocId, this.postData, "pr",this.task.SerialNumber, this.task.FsId).toPromise()
break;
}
await this.calendarService.genericPostExpedientEvent(this.task.DocId, this.postData, "",this.task.SerialNumber, this.task.FsId, this.CalendarName).toPromise();
this.modalController.dismiss();
// this.distartExpedientModal();
this.toastService._successMessage('Reunião criada');
} catch (error) {
@@ -293,15 +299,9 @@ export class BookMeetingModalPage implements OnInit {
const loader = this.toastService.loading()
try {
switch (this.loggeduser.Profile) {
case 'MDGPR':
await this.calendarService.createTaskEvent(this.task.FolderID | this.task.FolderId, this.postData, "md",this.task.SerialNumber, this.task.FsId).toPromise();
break;
case 'PR':
await this.calendarService.createTaskEvent(this.task.FolderID | this.task.FolderId, this.postData, "pr",this.task.SerialNumber, this.task.FsId).toPromise();
break;
}
await this.calendarService.genericCreateTaskEvent(this.task.FolderID | this.task.FolderId, this.postData, "",this.task.SerialNumber, this.task.FsId, this.CalendarName).toPromise();
this.close();
this.toastService._successMessage('Reunião criada');