mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
save
This commit is contained in:
@@ -23,7 +23,7 @@ export class EditEventPage implements OnInit {
|
||||
validateFrom = false
|
||||
public endMinDate = new Date(new Date().getTime() + 15 * 60000);
|
||||
public minDate = new Date().toISOString().slice(0,10)
|
||||
|
||||
|
||||
postEvent: Event;
|
||||
isRecurring:string;
|
||||
isEventEdited: boolean;
|
||||
@@ -45,7 +45,7 @@ export class EditEventPage implements OnInit {
|
||||
taskParticipantsCc: any = [];
|
||||
adding: "intervenient" | "CC" = "intervenient";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
showAttendees = false;
|
||||
@@ -94,9 +94,9 @@ export class EditEventPage implements OnInit {
|
||||
else {
|
||||
this.isRecurring = "Repete";
|
||||
}
|
||||
|
||||
|
||||
this.getAttachments(this.postEvent.EventId);
|
||||
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -114,9 +114,9 @@ export class EditEventPage implements OnInit {
|
||||
setTimeout(() => {
|
||||
this.selectedRecurringType = this.postEvent.EventRecurrence.Type.toString();
|
||||
}, 500);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
close() {
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
@@ -168,17 +168,17 @@ export class EditEventPage implements OnInit {
|
||||
IsRecurring: new FormControl(this.postEvent.IsRecurring, [
|
||||
Validators.required
|
||||
]),
|
||||
|
||||
|
||||
// participantes: new FormControl(this.taskParticipantsCc.concat(this.taskParticipants), [
|
||||
// Validators.required
|
||||
// ]),
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
save() {
|
||||
|
||||
|
||||
this.injectValidation()
|
||||
this.runValidation()
|
||||
|
||||
@@ -186,13 +186,13 @@ export class EditEventPage implements OnInit {
|
||||
if(this.selectedRecurringType != '-1'){
|
||||
this.postEvent.EventRecurrence.Type = this.selectedRecurringType;
|
||||
}
|
||||
|
||||
|
||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc)
|
||||
try{
|
||||
console.log(this.postEvent);
|
||||
this.postEvent.EventRecurrence.Type = this.selectedRecurringType;
|
||||
|
||||
/* this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
|
||||
|
||||
this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
|
||||
if(this.initCalendarName != this.postEvent.CalendarName){
|
||||
let body = {
|
||||
"EventId": this.postEvent.EventId,
|
||||
@@ -205,7 +205,7 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
}, error => {
|
||||
this.toastService.badRequest()
|
||||
}); */
|
||||
});
|
||||
|
||||
this.isEventEdited = true;
|
||||
this.goBack();
|
||||
@@ -222,10 +222,10 @@ export class EditEventPage implements OnInit {
|
||||
saveDocument() {
|
||||
|
||||
this.loadedEventAttachments.forEach((e)=>{
|
||||
|
||||
|
||||
const id: any = e.Id
|
||||
const remove = e['remove']
|
||||
|
||||
|
||||
if ( id == 'add') {
|
||||
//data.selected
|
||||
const DocumentToSave = {
|
||||
@@ -270,7 +270,7 @@ export class EditEventPage implements OnInit {
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
|
||||
|
||||
if(data){
|
||||
data = data['data'];
|
||||
|
||||
@@ -290,7 +290,7 @@ export class EditEventPage implements OnInit {
|
||||
this.taskParticipants = data;
|
||||
this.postEvent.Attendees = data;
|
||||
}
|
||||
|
||||
|
||||
setIntervenientCC(data){
|
||||
this.taskParticipantsCc = data;
|
||||
}
|
||||
@@ -310,25 +310,25 @@ export class EditEventPage implements OnInit {
|
||||
this.taskParticipantsCc = taskParticipantsCc;
|
||||
}
|
||||
|
||||
|
||||
|
||||
getAttachments(eventId: string){
|
||||
this.attachmentsService.getAttachmentsById(eventId).subscribe(res=>{
|
||||
this.loadedEventAttachments = res;
|
||||
console.log('res', res);
|
||||
console.log('res', res);
|
||||
});
|
||||
}
|
||||
|
||||
deleteAttachment(attachmentID: string, index) {
|
||||
|
||||
const id: any = this.loadedEventAttachments[index].Id
|
||||
|
||||
|
||||
if(id == 'add') {
|
||||
this.loadedEventAttachments = this.loadedEventAttachments.filter((e,i)=> i!=index)
|
||||
} else {
|
||||
this.loadedEventAttachments[index]['remove'] = true
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
async getDoc() {
|
||||
@@ -368,4 +368,4 @@ export class EditEventPage implements OnInit {
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user