mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
offline angenda and actions
This commit is contained in:
@@ -108,14 +108,14 @@ export class EventsPage implements OnInit {
|
||||
|
||||
});
|
||||
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
/* if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
try {
|
||||
this.sqliteservice.databaseConn();
|
||||
} catch (error) {
|
||||
console.log("Error creating local database: ", error)
|
||||
}
|
||||
}
|
||||
} */
|
||||
|
||||
}
|
||||
|
||||
@@ -324,52 +324,6 @@ export class EventsPage implements OnInit {
|
||||
|
||||
getEventsFromLocalDb() {
|
||||
|
||||
window.addEventListener('online',() => {
|
||||
this.showGreeting();
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationEnd && event.url == '/home/events') {
|
||||
this.RefreshEvents();
|
||||
setTimeout(() => {
|
||||
this.LoadList();
|
||||
}, 1500)
|
||||
}
|
||||
});
|
||||
this.hideSearch();
|
||||
})
|
||||
|
||||
window.addEventListener('offline', () => {
|
||||
this.sqliteservice.getAllEvents().then((event:any[]) => {
|
||||
this.listToPresent = event
|
||||
this.totalEvent = this.listToPresent.length
|
||||
this.currentEvent = this.listToPresent[0].Subject
|
||||
this.currentHoursMinutes = this.listToPresent[0].StartDate
|
||||
console.log("All events from local,", event)
|
||||
})
|
||||
|
||||
this.sqliteservice.getprocessByworkflow("Expediente").then((process: any[]) => {
|
||||
var expedientlist = [];
|
||||
process.forEach((element) => {
|
||||
let task = {
|
||||
CreateDate: element.taskStartDate,
|
||||
DocumentsQty: element.totalDocuments,
|
||||
Senders: JSON.parse(element.workflowInstanceDataFields).Sender,
|
||||
SerialNumber: element.serialNumber,
|
||||
Status: JSON.parse(element.workflowInstanceDataFields).Status,
|
||||
Subject: JSON.parse(element.workflowInstanceDataFields).Subject,
|
||||
WorkflowName: element.workflowDisplayName,
|
||||
activityInstanceName: element.activityInstanceName,
|
||||
taskStartDate: element.taskStartDate,
|
||||
}
|
||||
expedientlist.push(task);
|
||||
})
|
||||
const ExpedienteTask = expedientlist.map(e => this.expedienteTaskPipe.transform(e))
|
||||
this.listToPresentexpediente = ExpedienteTask;
|
||||
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
if (synchro.connected === true) {
|
||||
this.showGreeting();
|
||||
|
||||
@@ -382,7 +336,8 @@ export class EventsPage implements OnInit {
|
||||
}
|
||||
});
|
||||
this.hideSearch();
|
||||
} else {
|
||||
} else {
|
||||
this.platform.ready().then(async () => {
|
||||
this.sqliteservice.getAllEvents().then((event:any[]) => {
|
||||
this.listToPresent = event
|
||||
this.totalEvent = this.listToPresent.length
|
||||
@@ -412,6 +367,7 @@ export class EventsPage implements OnInit {
|
||||
|
||||
|
||||
})
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user