diff --git a/src/app/modals/profile/profile.page.ts b/src/app/modals/profile/profile.page.ts index 634a59c3f..a5ea4a616 100644 --- a/src/app/modals/profile/profile.page.ts +++ b/src/app/modals/profile/profile.page.ts @@ -219,7 +219,7 @@ export class ProfilePage implements OnInit { logout() { SessionStore.setInativity(false) - + SessionStore.setUrlBeforeInactivity(this.router.url) setTimeout(() => { this.router.navigateByUrl('/', { replaceUrl: true }); }, 100) diff --git a/src/app/services/events.service.ts b/src/app/services/events.service.ts index a3a0d8983..c23d4678e 100644 --- a/src/app/services/events.service.ts +++ b/src/app/services/events.service.ts @@ -301,6 +301,10 @@ export class EventsService { params = params.set("conflictResolutionMode", conflictResolutionMode.toString()); params = params.set("sendInvitationsOrCancellationsMode", sendInvitationsOrCancellationsMode.toString()); + params.set('CalendarId', event.CalendarId) + params.set('CalendarName', event.CalendarName) + this.headers['CalendarId'] = event.CalendarId + this.headers['CalendarName'] = event.CalendarName let options = { headers: this.headers, diff --git a/src/app/shared/agenda/edit-event/edit-event.page.html b/src/app/shared/agenda/edit-event/edit-event.page.html index 6056f6b6a..ddea0f9c0 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.html +++ b/src/app/shared/agenda/edit-event/edit-event.page.html @@ -116,8 +116,8 @@ @@ -144,8 +144,8 @@ @@ -195,7 +195,7 @@ @@ -213,41 +213,7 @@ -
-
-
- -
-
- - {{recurring.Description}} - -
-
-
-
-
-
- -
-
- - - -
-
-
@@ -317,7 +283,7 @@
-
+
diff --git a/src/app/shared/agenda/edit-event/edit-event.page.ts b/src/app/shared/agenda/edit-event/edit-event.page.ts index f4c28947b..2106c2e83 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.ts +++ b/src/app/shared/agenda/edit-event/edit-event.page.ts @@ -66,18 +66,10 @@ export class EditEventPage implements OnInit { @Output() setIntervenientCC = new EventEmitter(); @Output() clearPostEvent = new EventEmitter(); - public dateControlStart = new FormControl(moment("DD MM YYYY hh")); - public dateControlEnd = new FormControl(moment("DD MM YYYY hh")); showLoader = false - get dateStart () { - return this.dateControlStart.value - } - get dateEnd () { - return this.dateControlEnd.value - } @ViewChild('picker') picker: any; @ViewChild('fim') fim: any; @@ -89,9 +81,6 @@ export class EditEventPage implements OnInit { { value: false, label: 'False' } ]; - get dateOccurrence () { - return this.dateControlOccurrence.value - } public listColors = ['primary', 'accent', 'warn']; public stepHours = [1, 2, 3, 4, 5]; public stepMinutes = [1, 5, 10, 15, 20, 25]; @@ -109,6 +98,7 @@ export class EditEventPage implements OnInit { ngOnInit() { this.dateControlOccurrence = new FormControl(moment(this.postEvent.EventRecurrence.LastOccurrence)); + this.postEvent.EventRecurrence.Type = '-1' if(!this.restoreTemporaryData()) { // clear @@ -148,9 +138,7 @@ export class EditEventPage implements OnInit { } } - this.getAttachments(this.postEvent.EventId); - this.restoreDatepickerData(); this.getRecurrenceTypes(); this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString(); @@ -202,19 +190,13 @@ export class EditEventPage implements OnInit { Categories: new FormControl(this.postEvent.Category, [ Validators.required ]), - dateStart: new FormControl(this.dateStart, [ - Validators.required - ]), - dateEnd: new FormControl(this.dateEnd, [ - Validators.required - ]), - dateOccurrence: new FormControl(this.dateOccurrence, [ + dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type, [ Validators.required ]), participantes: new FormControl(this.taskParticipants, [ // Validators.required ]), - Date: new FormControl( new Date(this.dateControlStart.value).toLocaleString() < new Date(this.dateControlEnd.value).toLocaleString()? 'ok': null,[ + Date: new FormControl( new Date(this.postEvent.StartDate).toLocaleString('pt') < new Date(this.postEvent.EndDate).toLocaleString('pt')? 'ok': null,[ Validators.required ]), @@ -264,7 +246,6 @@ export class EditEventPage implements OnInit { return false } - this.getDatepickerData() this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc); if(!this.postEvent.EventRecurrence.hasOwnProperty('Type')) { @@ -360,25 +341,10 @@ export class EditEventPage implements OnInit { } - getDatepickerData() { - if (this.postEvent) { - this.postEvent.StartDate = this.dateStart - this.postEvent.EndDate = this.dateEnd - this.postEvent.EventRecurrence.LastOccurrence = this.dateOccurrence - } - } - restoreDatepickerData() { - if (this.postEvent) { - this.dateControlStart = new FormControl(moment(this.postEvent.StartDate)); - this.dateControlEnd = new FormControl(moment(this.postEvent.EndDate)); - } - } saveTemporaryData() { - this.getDatepickerData() - window['temp.path:/home/agenda/edit-event.component.ts'] = { postEvent: this.postEvent, eventBody: this.eventBody, @@ -395,8 +361,6 @@ export class EditEventPage implements OnInit { this.eventBody = restoredData.eventBody this.segment = restoredData.segment - this.restoreDatepickerData() - return true; } else { return false;