mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
viewer hot-fix
This commit is contained in:
@@ -4,7 +4,7 @@ import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { Event } from 'src/app/models/event.model'
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||
import { SearchDocumentDetails, SearchFolderDetails, SearchFolderDetailsDocuments, SearchList } from 'src/app/models/search-document';
|
||||
import { SearchDocumentDetails, SearchFolderDetails, SearchList } from 'src/app/models/search-document';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { AttendeesPageModal } from 'src/app/pages/events/attendees/attendees.page';
|
||||
@@ -14,7 +14,6 @@ import * as _moment from 'moment';
|
||||
import * as _rollupMoment from 'moment';
|
||||
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
||||
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||
import { DocumentService } from 'src/app/Rules/document.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { EventService } from 'src/app/services/rules/event.service';
|
||||
import { EventPipe } from 'src/app/pipes/event.pipe';
|
||||
@@ -62,7 +61,6 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
EventRecurrenceType = '-1'
|
||||
showLoader = false
|
||||
|
||||
|
||||
@ViewChild('picker') picker: any;
|
||||
@ViewChild('fim') fim: any;
|
||||
@ViewChild('inicio') inicio: any;
|
||||
@@ -97,34 +95,30 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
private navParams: NavParams,
|
||||
authService: AuthService,
|
||||
private toastService: ToastService,
|
||||
private documentService: DocumentService,
|
||||
private calendarService: EventsService,
|
||||
private eventService: EventService
|
||||
) {
|
||||
) {
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
this.document = this.navParams.get('document')
|
||||
this.subject = this.navParams.get('subject')
|
||||
|
||||
this.loggeduser = authService.ValidatedUser;
|
||||
this.document = this.navParams.get('document')
|
||||
this.subject = this.navParams.get('subject')
|
||||
this.postData = new Event();
|
||||
this.postData.Body ={ BodyType : "1", Text : ""};
|
||||
|
||||
this.postData = new Event();
|
||||
this.postData.Body ={ BodyType : "1", Text : ""};
|
||||
this.postData.Subject = this.subject
|
||||
this.postData.CalendarName = "Oficial";
|
||||
|
||||
this.postData.Subject = this.subject
|
||||
this.postData.CalendarName = "Oficial";
|
||||
|
||||
this.postData.Category = 'Reunião'
|
||||
this.postData.Category = 'Reunião'
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.adding = "intervenient";
|
||||
this.setDefaultTime()
|
||||
this.getRecurrenceTypes();
|
||||
console.log(this.document);
|
||||
|
||||
}
|
||||
|
||||
getRecurrenceTypes() {
|
||||
this.calendarService.getRecurrenceTypes().subscribe(res=>{
|
||||
this.calendarService.getRecurrenceTypes().subscribe( res=> {
|
||||
this.recurringTypes = res;
|
||||
});
|
||||
}
|
||||
@@ -178,43 +172,12 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
|
||||
let Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
|
||||
var Attachments: addAttachment[] = []
|
||||
let folder: SearchFolderDetails = this.document
|
||||
let document: SearchDocumentDetails = this.document
|
||||
|
||||
/* if(folder.Documents) {
|
||||
this.document.Documents.forEach( (_folder: SearchFolderDetailsDocuments) => {
|
||||
Attachments.push({
|
||||
ApplicationId: 361,
|
||||
Source: 1,
|
||||
SourceId: _folder['docID'] || _folder['docId'] || _folder.DocId,
|
||||
SourceTitle: _folder.Assunto,
|
||||
})
|
||||
});
|
||||
} else {
|
||||
Attachments.push({
|
||||
ApplicationId: 8,
|
||||
Source: 1,
|
||||
SourceId: document['docID'] || document['docId'] || document.DocId,
|
||||
SourceTitle: document.Assunto
|
||||
})
|
||||
}
|
||||
|
||||
this.attachments.forEach((e)=> {
|
||||
Attachments.push({
|
||||
ApplicationId: e.ApplicationType,
|
||||
Source: 1,
|
||||
SourceId: e.Id,
|
||||
SourceTitle: e.Assunto
|
||||
})
|
||||
}) */
|
||||
|
||||
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,
|
||||
SourceId: e.DocId || e.docID || e.docId || e.SourceId,
|
||||
SourceName: e.Assunto
|
||||
})
|
||||
})
|
||||
@@ -223,13 +186,11 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
this.docs.push({
|
||||
ApplicationId: this.document.ApplicationId || this.document.ApplicationType,
|
||||
Source: 1,
|
||||
SourceId: this.document.DocId || this.document.docID || this.document.docId,
|
||||
SourceId: this.document.DocId || this.document.docID || this.document.docId || this.document.SourceId,
|
||||
SourceName: this.document.Assunto
|
||||
})
|
||||
}
|
||||
|
||||
console.log(this.docs);
|
||||
|
||||
let postEvent = {
|
||||
EventId: '',
|
||||
Subject: this.postData.Subject,
|
||||
@@ -255,28 +216,17 @@ export class DocumentSetUpMeetingPage implements OnInit {
|
||||
Attachments: this.docs,
|
||||
}
|
||||
|
||||
console.log(postEvent);
|
||||
|
||||
|
||||
const laoder = this.toastService.loading()
|
||||
|
||||
this.eventService.create({ body: postEvent, calendar: this.postData.CalendarName }).subscribe(async (respose) => {
|
||||
const res: any = respose;
|
||||
const eventId: string = res
|
||||
|
||||
/* const DocumentToSave = this.attachments.map((e) => {
|
||||
return this.eventPipe.AttactSearchResult(e, eventId, {})
|
||||
});
|
||||
|
||||
await DocumentToSave.forEach(async (attachments, i) => {
|
||||
await this.eventService.addAttachment(attachments).toPromise();
|
||||
}); */
|
||||
|
||||
this.toastService.successMessage('Reunião criada')
|
||||
laoder.remove()
|
||||
this.toastService.successMessage('Reunião criada')
|
||||
this.modalController.dismiss()
|
||||
},(error) => {
|
||||
}, (error) => {
|
||||
laoder.remove()
|
||||
this.toastService.badRequest('Não foi possível marcar a reunião');
|
||||
}, ()=>{
|
||||
laoder.remove()
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user