mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
improve
This commit is contained in:
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user