mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
improve
This commit is contained in:
+20
-20
@@ -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');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user