This commit is contained in:
Peter Maquiran
2022-05-27 13:36:37 +01:00
parent 304975d823
commit ce7cee0876
25 changed files with 131 additions and 234 deletions
+1
View File
@@ -458,6 +458,7 @@
<app-view-event *ngIf="mobileComponent.showEventDetails"
[profile]="profile"
[eventId]="selectedEventId"
[CalendarId]="selectedEventCalendarId"
(viewEventDetailDismiss)="viewEventDetailDismiss($event)"
[eventAttendees]="contacts"
></app-view-event>
+8 -18
View File
@@ -3,7 +3,7 @@ import { CalendarComponent } from 'ionic2-calendar';
import { AlertController, ModalController, Platform } from '@ionic/angular';
import { EventsService } from 'src/app/services/events.service';
import { Event } from '../../models/event.model';
import { Router, NavigationEnd } from '@angular/router';
import { Router, NavigationEnd, NavigationExtras } from '@angular/router';
import { momentG } from 'src/plugin/momentG';
import { DomSanitizer } from "@angular/platform-browser";
import { EventPerson } from 'src/app/models/eventperson.model';
@@ -106,6 +106,7 @@ export class AgendaPage implements OnInit {
selectedEvent: Event;
selectedEventId: string | number;
selectedEventCalendarId : string | number;
postEvent: any;
// temporary data
@@ -311,6 +312,7 @@ export class AgendaPage implements OnInit {
this.viewingEventObject = event;
this.selectedEventId = event.id;
this.selectedEventCalendarId = event?.['event']?.CalendarId;
this.cloneAllmobileComponent();
@@ -1251,24 +1253,12 @@ export class AgendaPage implements OnInit {
// open component
async viewEventDetail(eventId: any) {
this.router.navigate(['/home/agenda', eventId, 'agenda']);
/*
const CalendarId = this.selectedEventCalendarId
const modal = await this.modalCtrl.create({
component: ViewEventPage,
componentProps:{
eventId: eventId,
adding: this.adding
},
cssClass: 'modal modal-desktop',
backdropDismiss: false
});
await modal.present();
modal.onDidDismiss().then((res)=>{
if(res){
// this.viewEventDetailDismiss(res);
}
}); */
let navigationExtras: NavigationExtras = { queryParams: { CalendarId } }
this.router.navigate(['/home/agenda/',eventId,'agenda'], navigationExtras);
}
// open component
@@ -40,6 +40,7 @@ export class ViewEventPage implements OnInit {
profile: string;
eventId: string;
CalendarId: string;
caller: string;
customDate: any;
today: any;
@@ -53,6 +54,7 @@ export class ViewEventPage implements OnInit {
task: ExpedientTaskModalPageNavParamsTask;
LoadedDocument: any = null;
sesseionStora = SessionStore
constructor(
private modalController: ModalController,
/* private navParams: NavParams, */
@@ -71,12 +73,20 @@ export class ViewEventPage implements OnInit {
private ionicStorage: Storage,
private CalendarService: CalendarService
) {
this.isEventEdited = false;
this.loadedEvent = new Event();
this.eventBody = { BodyType: "1", Text: "" };
this.loadedEvent.Body = this.eventBody;
this.activatedRoute.paramMap.subscribe(params => {
this.eventId = params['params'].eventId;
const urlParams = new URLSearchParams(window.location.search);
this.CalendarId = urlParams.get('CalendarId');
this.eventId = this.eventId.replace(' ', '')
if (params["params"].caller) {
this.caller = (params["params"].caller);
}
@@ -176,13 +186,10 @@ export class ViewEventPage implements OnInit {
this.loadedEvent = res;
this.addEventToDb(res);
/* this.today = new Date(res.StartDate);
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); */
loader.remove()
}, (error) => {
if (error.status === 0) {
this.getFromDb();
} else {
@@ -195,22 +202,15 @@ export class ViewEventPage implements OnInit {
});
} else {
const event = this.CalendarService.eventSource.find((ele) => ele.id == this.eventId)
//
if(event?.CalendarId) {
this.eventsService.genericGetEvent(this.eventId, event.CalendarId).subscribe(res => {
if(this.CalendarId) {
this.eventsService.genericGetEvent(this.eventId, this.CalendarId).subscribe(res => {
this.loadedEvent = res;
this.addEventToDb(res);
/* this.today = new Date(res.StartDate);
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); */
loader.remove()
}, (error) => {
if (error.status === 0) {
this.getFromDb();
} else {
@@ -225,8 +225,6 @@ export class ViewEventPage implements OnInit {
}
}
deleteEvent() {