From a6517da1e0113ab52901613bcd4a7e33e186fe3c Mon Sep 17 00:00:00 2001 From: Peter Maquiran Date: Tue, 31 Oct 2023 16:26:50 +0100 Subject: [PATCH] fix create event from viewer --- .../document-set-up-meeting.page.ts | 61 +++++++++++-------- .../book-meeting-modal.page.html | 20 +++--- src/environments/environment.ts | 2 +- 3 files changed, 48 insertions(+), 35 deletions(-) diff --git a/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts b/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts index 1c215bc05..b3a1b1aee 100644 --- a/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts +++ b/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts @@ -117,14 +117,45 @@ export class DocumentSetUpMeetingPage implements OnInit { this.document = this.navParams.get('document') if(Array.isArray(this.document)) { - this.attachments = this.document + const E = this.document + this.document = [] + E.forEach((e)=> { + this.document.push({ + ApplicationId: e.ApplicationId || e.ApplicationType, + Source: 1, + SourceId: e.DocId || e.docID || e.docId || e.SourceId || e.Id, + SourceName: e.Assunto || e.attachments, + DocDate: e.CreateDate, + Data: e.Data, + Assunto: e.Description, + ...e + }) + }) + } else if (this.document) { + + const E = this.document + this.document = [] + this.document.push({ + ApplicationId: E.ApplicationId || E.ApplicationType, + Source: 1, + SourceId: E.DocId || E.docID || E.docId || E.SourceId || E.Id, + SourceName: E.Assunto || E.attachments, + DocDate: E.CreateDate, + Data: E.Data, + Assunto: E.Description, + ...E + }) } else { - this.attachments = [this.document] + this.document = [] } - this.document = [] + if(Array.isArray(this.document)) { + this.attachments = this.document + } else { + this.attachments = [this.document] + } this.subject = this.navParams.get('subject') @@ -277,25 +308,6 @@ export class DocumentSetUpMeetingPage implements OnInit { let Attendees = this.taskParticipants.concat(this.taskParticipantsCc); - if(this.document.Documents) { - this.document.Documents.forEach((e)=> { - this.docs.push({ - ApplicationId: e.ApplicationId || e.ApplicationType, - Source: 1, - SourceId: e.DocId || e.docID || e.docId || e.SourceId || e.Id, - SourceName: e.Assunto - }) - }) - } - else{ - this.docs.push({ - ApplicationId: this.document.ApplicationId || this.document.ApplicationType, - Source: 1, - SourceId: this.document.DocId || this.document.docID || this.document.docId || this.document.SourceId || this.document.Id, - SourceName: this.document.Assunto - }) - } - let postEvent = { EventId: '', Subject: this.postData.Subject, @@ -318,10 +330,11 @@ export class DocumentSetUpMeetingPage implements OnInit { Type: this.EventRecurrenceType, LastOccurrence: this.Occurrence, }, - // Attachments: this.docs, + Attachments: this.attachments, } - const laoder = this.toastService.loading() + const laoder = this.toastService.loading(); + this.eventService.create({ body: postEvent, calendar: this.postData.CalendarName }).subscribe(async (respose) => { laoder.remove(); diff --git a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.html b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.html index 78a9fcbcc..d85b437e1 100644 --- a/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.html +++ b/src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page.html @@ -17,7 +17,7 @@
- +
O campo deve ter pelo menos 4 caracteres. @@ -34,12 +34,12 @@ - +
{{ environment.agendaPR}}
@@ -47,7 +47,7 @@
Agenda do {{calendars.Fullname}}
Minha agenda
- +
@@ -72,16 +72,16 @@
- + Agenda {{ calendars }} - + - +
@@ -195,7 +195,7 @@ [stepHour]="stepHour" [stepMinute]="stepMinute" [stepSecond]="stepSecond" [touchUi]="touchUi" - + > @@ -232,7 +232,7 @@
-
+
@@ -241,7 +241,7 @@
-
+
diff --git a/src/environments/environment.ts b/src/environments/environment.ts index e2d79dff9..1618c4dec 100644 --- a/src/environments/environment.ts +++ b/src/environments/environment.ts @@ -4,4 +4,4 @@ import { doneITDev } from './suport/doneIt' import { DevDev } from './suport/dev' -export const environment: Environment = oaprDev \ No newline at end of file +export const environment: Environment = DevDev