mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
remove sqlite and unused import
This commit is contained in:
@@ -59,7 +59,7 @@ export class AppComponent {
|
||||
|
||||
} else {
|
||||
try {
|
||||
this.sqliteservice.databaseConn();
|
||||
// this.sqliteservice.databaseConn();
|
||||
} catch (error) {
|
||||
|
||||
}
|
||||
|
||||
@@ -13,7 +13,6 @@ import { Storage } from '@ionic/storage';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { RochetChatConnectorService } from 'src/app/services/chat/rochet-chat-connector.service';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { RoleIdService } from 'src/app/services/role-id.service';
|
||||
import { ActiveTabService } from 'src/app/services/active-tab.service';
|
||||
import { Device } from '@capacitor/device';
|
||||
@@ -87,7 +86,6 @@ export class HomePage implements OnInit {
|
||||
private processservice: ProcessesService,
|
||||
public RouteService: RouteService,
|
||||
private NativeNotificationService: NativeNotificationService,
|
||||
private sqliteservice: SqliteService,
|
||||
private RochetChatConnectorService: RochetChatConnectorService,
|
||||
private NetworkServiceService: NetworkServiceService,
|
||||
public eventService: EventsService,
|
||||
@@ -288,7 +286,7 @@ export class HomePage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
this.sqliteservice.deleteAllTables();
|
||||
// this.sqliteservice.deleteAllTables();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -2,11 +2,8 @@ import { Component, OnInit } from '@angular/core';
|
||||
import { AlertController, ModalController, PopoverController, Platform, NavParams } from '@ionic/angular';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { EliminateEventPage } from 'src/app/modals/eliminate-event/eliminate-event.page';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { ExpedientTaskModalPageNavParamsTask } from 'src/app/models/ExpedientTaskModalPage';
|
||||
import { DocumentSetUpMeetingPage } from 'src/app/modals/document-set-up-meeting/document-set-up-meeting.page';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
@@ -60,15 +57,10 @@ export class ViewEventPage implements OnInit {
|
||||
private navParams: NavParams,
|
||||
private eventsService: EventsService,
|
||||
public alertController: AlertController,
|
||||
private iab: InAppBrowser,
|
||||
private processes: ProcessesService,
|
||||
public popoverController: PopoverController,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private router: Router,
|
||||
private toastService: ToastService,
|
||||
private RouteService: RouteService,
|
||||
public platform: Platform,
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService,
|
||||
private storage: StorageService,
|
||||
public ThemeService: ThemeService,
|
||||
@@ -133,14 +125,14 @@ export class ViewEventPage implements OnInit {
|
||||
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
|
||||
this.eventsService.getEvent(this.eventId).subscribe(res => {
|
||||
this.loadedEvent = res;
|
||||
this.addEventToDb(res);
|
||||
// this.addEventToDb(res);
|
||||
|
||||
loader.remove()
|
||||
}, (error) => {
|
||||
|
||||
|
||||
if (error.status === 0) {
|
||||
this.getFromDb();
|
||||
// this.getFromDb();
|
||||
} else {
|
||||
this.toastService.badRequest('Este evento já não existe na sua agenda')
|
||||
loader.remove()
|
||||
@@ -155,13 +147,13 @@ export class ViewEventPage implements OnInit {
|
||||
|
||||
this.eventsService.genericGetEvent(this.eventId, this.CalendarId).subscribe(res => {
|
||||
this.loadedEvent = res;
|
||||
this.addEventToDb(res);
|
||||
// this.addEventToDb(res);
|
||||
|
||||
loader.remove()
|
||||
}, (error) => {
|
||||
|
||||
if (error.status === 0) {
|
||||
this.getFromDb();
|
||||
// this.getFromDb();
|
||||
} else {
|
||||
this.toastService.badRequest('Este evento já não existe na sua agenda')
|
||||
loader.remove()
|
||||
@@ -380,36 +372,36 @@ export class ViewEventPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
addEventToDb(data) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
let event = {
|
||||
Attendees: JSON.stringify(data.Attendees) || JSON.stringify(''),
|
||||
Body: JSON.stringify(data.Body) || JSON.stringify(''),
|
||||
CalendarId: data.CalendarId,
|
||||
CalendarName: data.CalendarName,
|
||||
Category: data.Category,
|
||||
EndDate: data.EndDate,
|
||||
EventId: data.EventId,
|
||||
EventRecurrence: JSON.stringify(data.EventRecurrence) || JSON.stringify(''),
|
||||
EventType: data.EventType,
|
||||
HasAttachments: data.HasAttachments,
|
||||
IsAllDayEvent: data.IsAllDayEvent,
|
||||
IsMeeting: data.IsMeeting,
|
||||
IsRecurring: data.IsRecurring,
|
||||
Location: data.Location,
|
||||
Organizer: JSON.stringify(data.Organizer) || JSON.stringify(''),
|
||||
StartDate: data.StartDate,
|
||||
Subject: data.Subject,
|
||||
TimeZone: data.TimeZone
|
||||
}
|
||||
// addEventToDb(data) {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
// } else {
|
||||
// let event = {
|
||||
// Attendees: JSON.stringify(data.Attendees) || JSON.stringify(''),
|
||||
// Body: JSON.stringify(data.Body) || JSON.stringify(''),
|
||||
// CalendarId: data.CalendarId,
|
||||
// CalendarName: data.CalendarName,
|
||||
// Category: data.Category,
|
||||
// EndDate: data.EndDate,
|
||||
// EventId: data.EventId,
|
||||
// EventRecurrence: JSON.stringify(data.EventRecurrence) || JSON.stringify(''),
|
||||
// EventType: data.EventType,
|
||||
// HasAttachments: data.HasAttachments,
|
||||
// IsAllDayEvent: data.IsAllDayEvent,
|
||||
// IsMeeting: data.IsMeeting,
|
||||
// IsRecurring: data.IsRecurring,
|
||||
// Location: data.Location,
|
||||
// Organizer: JSON.stringify(data.Organizer) || JSON.stringify(''),
|
||||
// StartDate: data.StartDate,
|
||||
// Subject: data.Subject,
|
||||
// TimeZone: data.TimeZone
|
||||
// }
|
||||
|
||||
this.sqliteservice.updateEvent(event);
|
||||
}
|
||||
}
|
||||
// this.sqliteservice.updateEvent(event);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
getFromDb() {
|
||||
// getFromDb() {
|
||||
|
||||
}
|
||||
// }
|
||||
}
|
||||
|
||||
@@ -138,23 +138,23 @@ export class ViewEventPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
getEventsFromDB () {
|
||||
// getEventsFromDB () {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
this.storage.get('agendaResponse').then((events) => {
|
||||
resolve(events)
|
||||
})
|
||||
} else {
|
||||
this.sqliteservice.getAllEvents().then((events: any[] = []) => {
|
||||
resolve(events)
|
||||
// return new Promise((resolve, reject) => {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
// this.storage.get('agendaResponse').then((events) => {
|
||||
// resolve(events)
|
||||
// })
|
||||
// } else {
|
||||
// this.sqliteservice.getAllEvents().then((events: any[] = []) => {
|
||||
// resolve(events)
|
||||
|
||||
})
|
||||
}
|
||||
}).catch ((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
// })
|
||||
// }
|
||||
// }).catch ((error) => {
|
||||
// console.error(error);
|
||||
// });
|
||||
// }
|
||||
|
||||
|
||||
close() {
|
||||
@@ -193,7 +193,7 @@ export class ViewEventPage implements OnInit {
|
||||
this.eventsService.getEvent(this.eventId).subscribe(res => {
|
||||
|
||||
this.loadedEvent = res;
|
||||
this.addEventToDb(res);
|
||||
// this.addEventToDb(res);
|
||||
|
||||
loader.remove()
|
||||
}, (error) => {
|
||||
@@ -220,7 +220,7 @@ export class ViewEventPage implements OnInit {
|
||||
res.Body.Text = div.innerText
|
||||
this.loadedEvent = res;
|
||||
|
||||
this.addEventToDb(res);
|
||||
// this.addEventToDb(res);
|
||||
|
||||
loader.remove()
|
||||
}, (error) => {
|
||||
@@ -511,36 +511,36 @@ export class ViewEventPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
addEventToDb(data) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
this.ionicStorage.set('eventDetails', data).then(() => {
|
||||
// addEventToDb(data) {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
// this.ionicStorage.set('eventDetails', data).then(() => {
|
||||
|
||||
})
|
||||
} else {
|
||||
let event = {
|
||||
Attendees: JSON.stringify(data.Attendees) || JSON.stringify(''),
|
||||
Body: JSON.stringify(data.Body) || JSON.stringify(''),
|
||||
CalendarId: data.CalendarId,
|
||||
CalendarName: data.CalendarName,
|
||||
Category: data.Category,
|
||||
EndDate: data.EndDate,
|
||||
EventId: data.EventId,
|
||||
EventRecurrence: JSON.stringify(data.EventRecurrence) || JSON.stringify(''),
|
||||
EventType: data.EventType,
|
||||
HasAttachments: data.HasAttachments,
|
||||
IsAllDayEvent: data.IsAllDayEvent,
|
||||
IsMeeting: data.IsMeeting,
|
||||
IsRecurring: data.IsRecurring,
|
||||
Location: data.Location,
|
||||
Organizer: JSON.stringify(data.Organizer) || JSON.stringify(''),
|
||||
StartDate: data.StartDate,
|
||||
Subject: data.Subject,
|
||||
TimeZone: data.TimeZone
|
||||
}
|
||||
// })
|
||||
// } else {
|
||||
// let event = {
|
||||
// Attendees: JSON.stringify(data.Attendees) || JSON.stringify(''),
|
||||
// Body: JSON.stringify(data.Body) || JSON.stringify(''),
|
||||
// CalendarId: data.CalendarId,
|
||||
// CalendarName: data.CalendarName,
|
||||
// Category: data.Category,
|
||||
// EndDate: data.EndDate,
|
||||
// EventId: data.EventId,
|
||||
// EventRecurrence: JSON.stringify(data.EventRecurrence) || JSON.stringify(''),
|
||||
// EventType: data.EventType,
|
||||
// HasAttachments: data.HasAttachments,
|
||||
// IsAllDayEvent: data.IsAllDayEvent,
|
||||
// IsMeeting: data.IsMeeting,
|
||||
// IsRecurring: data.IsRecurring,
|
||||
// Location: data.Location,
|
||||
// Organizer: JSON.stringify(data.Organizer) || JSON.stringify(''),
|
||||
// StartDate: data.StartDate,
|
||||
// Subject: data.Subject,
|
||||
// TimeZone: data.TimeZone
|
||||
// }
|
||||
|
||||
this.sqliteservice.updateEvent(event);
|
||||
}
|
||||
}
|
||||
// this.sqliteservice.updateEvent(event);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
getFromDb() {
|
||||
|
||||
+112
-111
@@ -425,108 +425,109 @@ export class ChatPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
getDirectMessagesDB() {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
this.storageservice.get("rooms").then((rooms) =>{
|
||||
// getDirectMessagesDB() {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
// this.storageservice.get("rooms").then((rooms) =>{
|
||||
|
||||
this.userDirectMessages = rooms.sort((a, b) => {
|
||||
var dateA = new Date(a._updatedAt).getTime();
|
||||
var dateB = new Date(b._updatedAt).getTime();
|
||||
return dateB - dateA;
|
||||
});
|
||||
//
|
||||
// this.userDirectMessages = rooms.sort((a, b) => {
|
||||
// var dateA = new Date(a._updatedAt).getTime();
|
||||
// var dateB = new Date(b._updatedAt).getTime();
|
||||
// return dateB - dateA;
|
||||
// });
|
||||
// //
|
||||
|
||||
//
|
||||
}).catch((error) => {
|
||||
console.error('storage getdirectmessagedb: ',error)
|
||||
})
|
||||
// //
|
||||
// }).catch((error) => {
|
||||
// console.error('storage getdirectmessagedb: ',error)
|
||||
// })
|
||||
|
||||
this.storageservice.get('chatusers').then((users) => {
|
||||
this.dmUsers = users.filter(data => data.username != SessionStore.user.UserName);
|
||||
}).catch((error) => {
|
||||
console.error('storage getchatusers: ',error)
|
||||
})
|
||||
} else {
|
||||
this.sqlservice.getAllChatRoom().then((rooms: any) => {
|
||||
//
|
||||
let roomsArray = [];
|
||||
rooms.forEach(element => {
|
||||
let roomListDB = {
|
||||
_id: element.Id,
|
||||
uids: this.isJson(element.Uids),
|
||||
usernames: this.isJson(element.Usernames),
|
||||
lastMessage: this.isJson(element.LastMessage),
|
||||
_updatedAt: element.UpdatedAt
|
||||
}
|
||||
if(element.customFields == "undefined") {
|
||||
roomsArray.push(roomListDB)
|
||||
}
|
||||
});
|
||||
// this.storageservice.get('chatusers').then((users) => {
|
||||
// this.dmUsers = users.filter(data => data.username != SessionStore.user.UserName);
|
||||
// }).catch((error) => {
|
||||
// console.error('storage getchatusers: ',error)
|
||||
// })
|
||||
// }
|
||||
// // else {
|
||||
// // this.sqlservice.getAllChatRoom().then((rooms: any) => {
|
||||
// // //
|
||||
// // let roomsArray = [];
|
||||
// // rooms.forEach(element => {
|
||||
// // let roomListDB = {
|
||||
// // _id: element.Id,
|
||||
// // uids: this.isJson(element.Uids),
|
||||
// // usernames: this.isJson(element.Usernames),
|
||||
// // lastMessage: this.isJson(element.LastMessage),
|
||||
// // _updatedAt: element.UpdatedAt
|
||||
// // }
|
||||
// // if(element.customFields == "undefined") {
|
||||
// // roomsArray.push(roomListDB)
|
||||
// // }
|
||||
// // });
|
||||
|
||||
this.userDirectMessages = roomsArray.sort((a, b) => {
|
||||
var dateA = new Date(a._updatedAt).getTime();
|
||||
var dateB = new Date(b._updatedAt).getTime();
|
||||
return dateB - dateA;
|
||||
});
|
||||
//
|
||||
// // this.userDirectMessages = roomsArray.sort((a, b) => {
|
||||
// // var dateA = new Date(a._updatedAt).getTime();
|
||||
// // var dateB = new Date(b._updatedAt).getTime();
|
||||
// // return dateB - dateA;
|
||||
// // });
|
||||
// // //
|
||||
|
||||
//
|
||||
})
|
||||
// // //
|
||||
// // })
|
||||
|
||||
this.sqlservice.getAllChatUsers().then((userslist: any) => {
|
||||
//
|
||||
let chatusersArray = [];
|
||||
userslist.forEach(element => {
|
||||
// // this.sqlservice.getAllChatUsers().then((userslist: any) => {
|
||||
// // //
|
||||
// // let chatusersArray = [];
|
||||
// // userslist.forEach(element => {
|
||||
|
||||
let userListDB = {
|
||||
_id: element.Id,
|
||||
name: element.Name,
|
||||
username: element.Username
|
||||
}
|
||||
// // let userListDB = {
|
||||
// // _id: element.Id,
|
||||
// // name: element.Name,
|
||||
// // username: element.Username
|
||||
// // }
|
||||
|
||||
chatusersArray.push(userListDB);
|
||||
});
|
||||
// // chatusersArray.push(userListDB);
|
||||
// // });
|
||||
|
||||
this.dmUsers = chatusersArray.filter(data => data.username != SessionStore.user.UserName);
|
||||
// // this.dmUsers = chatusersArray.filter(data => data.username != SessionStore.user.UserName);
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
// // })
|
||||
// // }
|
||||
// }
|
||||
|
||||
transformDataRoomList(data) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
let roomsArray = [];
|
||||
data.forEach(element => {
|
||||
let roomList = {
|
||||
_id: element._id,
|
||||
uids: element.uids,
|
||||
usernames: element.usernames,
|
||||
lastMessage: element.lastMessage,
|
||||
_updatedAt: element._updatedAt
|
||||
}
|
||||
// transformDataRoomList(data) {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
// let roomsArray = [];
|
||||
// data.forEach(element => {
|
||||
// let roomList = {
|
||||
// _id: element._id,
|
||||
// uids: element.uids,
|
||||
// usernames: element.usernames,
|
||||
// lastMessage: element.lastMessage,
|
||||
// _updatedAt: element._updatedAt
|
||||
// }
|
||||
|
||||
//
|
||||
roomsArray.push(roomList)
|
||||
});
|
||||
// //
|
||||
// roomsArray.push(roomList)
|
||||
// });
|
||||
|
||||
this.storageservice.remove('rooms');
|
||||
this.storageservice.store('rooms', roomsArray);
|
||||
// this.storageservice.remove('rooms');
|
||||
// this.storageservice.store('rooms', roomsArray);
|
||||
|
||||
} else {
|
||||
data.forEach(element => {
|
||||
let roomList = {
|
||||
id: element._id,
|
||||
uids: element.uids,
|
||||
usernames: element.usernames,
|
||||
lastMessage: element.lastMessage,
|
||||
updatedat: element._updatedAt
|
||||
}
|
||||
// } else {
|
||||
// data.forEach(element => {
|
||||
// let roomList = {
|
||||
// id: element._id,
|
||||
// uids: element.uids,
|
||||
// usernames: element.usernames,
|
||||
// lastMessage: element.lastMessage,
|
||||
// updatedat: element._updatedAt
|
||||
// }
|
||||
|
||||
//
|
||||
this.sqlservice.addChatListRoom(roomList);
|
||||
});
|
||||
}
|
||||
}
|
||||
// //
|
||||
// // this.sqlservice.addChatListRoom(roomList);
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
|
||||
async transformDataUserList(users) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
@@ -552,7 +553,7 @@ export class ChatPage implements OnInit {
|
||||
username: element.username
|
||||
}
|
||||
//
|
||||
this.sqlservice.addChatListUsers(chatusers);
|
||||
// this.sqlservice.addChatListUsers(chatusers);
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -605,30 +606,30 @@ export class ChatPage implements OnInit {
|
||||
console.error('storage getgrupDb: ',error)
|
||||
})
|
||||
} else {
|
||||
this.sqlservice.getAllChatRoom().then((rooms: any) => {
|
||||
// this.sqlservice.getAllChatRoom().then((rooms: any) => {
|
||||
|
||||
let roomsArray = [];
|
||||
rooms.forEach(element => {
|
||||
let fddf = this.isJson(element.LastMessage);
|
||||
let roomListDB = {
|
||||
_id: element.Id,
|
||||
customFields: this.isJson(element.customFields),
|
||||
name: element.name,
|
||||
lastMessage: this.isJson(element.LastMessage),
|
||||
_updatedAt: element.UpdatedAt
|
||||
}
|
||||
if(element.customFields != "undefined") {
|
||||
roomsArray.push(roomListDB)
|
||||
}
|
||||
});
|
||||
// let roomsArray = [];
|
||||
// rooms.forEach(element => {
|
||||
// let fddf = this.isJson(element.LastMessage);
|
||||
// let roomListDB = {
|
||||
// _id: element.Id,
|
||||
// customFields: this.isJson(element.customFields),
|
||||
// name: element.name,
|
||||
// lastMessage: this.isJson(element.LastMessage),
|
||||
// _updatedAt: element.UpdatedAt
|
||||
// }
|
||||
// if(element.customFields != "undefined") {
|
||||
// roomsArray.push(roomListDB)
|
||||
// }
|
||||
// });
|
||||
|
||||
this.allGroups = roomsArray.sort((a, b) => {
|
||||
var dateA = new Date(a._updatedAt).getTime();
|
||||
var dateB = new Date(b._updatedAt).getTime();
|
||||
return dateB - dateA;
|
||||
});
|
||||
//
|
||||
})
|
||||
// this.allGroups = roomsArray.sort((a, b) => {
|
||||
// var dateA = new Date(a._updatedAt).getTime();
|
||||
// var dateB = new Date(b._updatedAt).getTime();
|
||||
// return dateB - dateA;
|
||||
// });
|
||||
// //
|
||||
// })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -669,7 +670,7 @@ export class ChatPage implements OnInit {
|
||||
updatedat: element._updatedAt
|
||||
}
|
||||
|
||||
this.sqlservice.addChatListRoom(roomList);
|
||||
// this.sqlservice.addChatListRoom(roomList);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -142,7 +142,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
this.setStatus('online');
|
||||
this.getChatMembers();
|
||||
|
||||
this.getRoomMessageDB(this.roomId);
|
||||
// this.getRoomMessageDB(this.roomId);
|
||||
this.getGroupContacts({});
|
||||
|
||||
}
|
||||
@@ -891,38 +891,38 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
*/
|
||||
|
||||
getRoomMessageDB(roomId) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
this.sqlservice.getAllChatMSG(roomId).then((msg: any) => {
|
||||
// getRoomMessageDB(roomId) {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
// } else {
|
||||
// this.sqlservice.getAllChatMSG(roomId).then((msg: any) => {
|
||||
|
||||
let chatmsgArray = [];
|
||||
let array = []
|
||||
msg.forEach(element => {
|
||||
// let chatmsgArray = [];
|
||||
// let array = []
|
||||
// msg.forEach(element => {
|
||||
|
||||
|
||||
let msgChat = {
|
||||
_id: element.Id,
|
||||
attachments: this.isJson(element.Attachments),
|
||||
channels: this.isJson(element.Channels),
|
||||
file: this.isJson(element.File),
|
||||
mentions: this.isJson(element.Mentions),
|
||||
msg: element.Msg,
|
||||
rid: element.Rid,
|
||||
ts: element.Ts,
|
||||
u: this.isJson(element.U),
|
||||
_updatedAt: element.UpdatedAt,
|
||||
image_url: this.isJson(element.image_url)
|
||||
}
|
||||
// let msgChat = {
|
||||
// _id: element.Id,
|
||||
// attachments: this.isJson(element.Attachments),
|
||||
// channels: this.isJson(element.Channels),
|
||||
// file: this.isJson(element.File),
|
||||
// mentions: this.isJson(element.Mentions),
|
||||
// msg: element.Msg,
|
||||
// rid: element.Rid,
|
||||
// ts: element.Ts,
|
||||
// u: this.isJson(element.U),
|
||||
// _updatedAt: element.UpdatedAt,
|
||||
// image_url: this.isJson(element.image_url)
|
||||
// }
|
||||
|
||||
chatmsgArray.push(msgChat)
|
||||
});
|
||||
// chatmsgArray.push(msgChat)
|
||||
// });
|
||||
|
||||
// this.messages = chatmsgArray;
|
||||
// // this.messages = chatmsgArray;
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
|
||||
isJson(str) {
|
||||
try {
|
||||
@@ -956,7 +956,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}, */
|
||||
}
|
||||
|
||||
this.sqlservice.addChatMSG(chatmsg)
|
||||
// this.sqlservice.addChatMSG(chatmsg)
|
||||
|
||||
});
|
||||
}
|
||||
@@ -979,7 +979,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
//this.messages = msgOnly.reverse();
|
||||
//
|
||||
this.transformDataMSG(msgOnly.reverse());
|
||||
this.getRoomMessageDB(this.roomId);
|
||||
// this.getRoomMessageDB(this.roomId);
|
||||
// Reconnect in one second
|
||||
if (this.route.url != "/home/chat") {
|
||||
|
||||
|
||||
@@ -895,37 +895,37 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}
|
||||
|
||||
|
||||
getRoomMessageDB(roomId) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
this.sqlservice.getAllChatMSG(roomId).then((msg: any) => {
|
||||
// getRoomMessageDB(roomId) {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
// } else {
|
||||
// this.sqlservice.getAllChatMSG(roomId).then((msg: any) => {
|
||||
|
||||
let chatmsgArray = [];
|
||||
msg.forEach(element => {
|
||||
// let chatmsgArray = [];
|
||||
// msg.forEach(element => {
|
||||
|
||||
|
||||
let msgChat = {
|
||||
_id: element.Id,
|
||||
attachments: this.isJson(element.Attachments),
|
||||
channels: this.isJson(element.Channels),
|
||||
file: this.isJson(element.File),
|
||||
mentions: this.isJson(element.Mentions),
|
||||
msg: element.Msg,
|
||||
rid: element.Rid,
|
||||
ts: element.Ts,
|
||||
u: this.isJson(element.U),
|
||||
_updatedAt: element.UpdatedAt,
|
||||
image_url: this.isJson(element.image_url)
|
||||
}
|
||||
// let msgChat = {
|
||||
// _id: element.Id,
|
||||
// attachments: this.isJson(element.Attachments),
|
||||
// channels: this.isJson(element.Channels),
|
||||
// file: this.isJson(element.File),
|
||||
// mentions: this.isJson(element.Mentions),
|
||||
// msg: element.Msg,
|
||||
// rid: element.Rid,
|
||||
// ts: element.Ts,
|
||||
// u: this.isJson(element.U),
|
||||
// _updatedAt: element.UpdatedAt,
|
||||
// image_url: this.isJson(element.image_url)
|
||||
// }
|
||||
|
||||
chatmsgArray.push(msgChat)
|
||||
});
|
||||
// chatmsgArray.push(msgChat)
|
||||
// });
|
||||
|
||||
|
||||
|
||||
})
|
||||
}
|
||||
}
|
||||
// })
|
||||
// }
|
||||
// }
|
||||
|
||||
isJson(str) {
|
||||
try {
|
||||
@@ -961,7 +961,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
||||
}, */
|
||||
}
|
||||
|
||||
this.sqlservice.addChatMSG(chatmsg)
|
||||
// this.sqlservice.addChatMSG(chatmsg)
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -8,9 +8,7 @@ import { ProcessesService } from '../../services/processes.service';
|
||||
import { ToDayEventStorage } from 'src/app/store/to-day-event-storage.service';
|
||||
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
|
||||
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { momentG } from 'src/plugin/momentG';
|
||||
import { ThemeService } from 'src/app/services/theme.service';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
@@ -82,7 +80,6 @@ export class EventsPage implements OnInit {
|
||||
private processes: ProcessesService,
|
||||
private modalController: ModalController,
|
||||
public platform: Platform,
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService,
|
||||
public ThemeService: ThemeService,
|
||||
private storage: Storage,
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { fullTask } from '../../../../models/dailyworktask.model';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
|
||||
import { Event } from '../../../../models/event.model';
|
||||
import { MenuController, ModalController, PopoverController } from '@ionic/angular';
|
||||
@@ -16,11 +13,8 @@ import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||
import { DespachosPrOptionsPage } from 'src/app/shared/popover/despachos-pr-options/despachos-pr-options.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { Location } from '@angular/common'
|
||||
import { DespachoService } from 'src/app/Rules/despacho.service';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
@@ -51,20 +45,13 @@ export class DespachoPrPage implements OnInit {
|
||||
constructor(
|
||||
private activateRoute: ActivatedRoute,
|
||||
private processes: ProcessesService,
|
||||
private iab: InAppBrowser,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private events: EventsService,
|
||||
private menu: MenuController,
|
||||
private router: Router,
|
||||
private modalController: ModalController,
|
||||
public popoverController: PopoverController,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private toastService: ToastService,
|
||||
private location: Location,
|
||||
private despachoService: DespachoService,
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService,
|
||||
private platform: Platform,
|
||||
public ThemeService: ThemeService,
|
||||
private RouteService: RouteService,
|
||||
public p: PermissionService,
|
||||
@@ -135,14 +122,14 @@ export class DespachoPrPage implements OnInit {
|
||||
}
|
||||
this.fulltask = res;
|
||||
|
||||
this.updateProcessOnDB(res);
|
||||
// this.updateProcessOnDB(res);
|
||||
console.log('this.fulltask', this.fulltask)
|
||||
let thedate = new Date(this.task.CreateDate);
|
||||
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
||||
|
||||
|
||||
this.processes.GetTaskParticipants(this.task.FolderId).subscribe(users => {
|
||||
this.updateProcessInterveners(users)
|
||||
// this.updateProcessInterveners(users)
|
||||
this.intervenientes = users.filter(user => {
|
||||
return user.Type == 'I';
|
||||
});
|
||||
@@ -172,19 +159,19 @@ export class DespachoPrPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
updateProcessOnDB(res) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
this.sqliteservice.updateProcess(res);
|
||||
}
|
||||
}
|
||||
// updateProcessOnDB(res) {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
// } else {
|
||||
// this.sqliteservice.updateProcess(res);
|
||||
// }
|
||||
// }
|
||||
|
||||
updateProcessInterveners(users) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
this.sqliteservice.updateProcessInterveners(JSON.stringify(this.serialNumber), JSON.stringify(users))
|
||||
}
|
||||
}
|
||||
// updateProcessInterveners(users) {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
// } else {
|
||||
// this.sqliteservice.updateProcessInterveners(JSON.stringify(this.serialNumber), JSON.stringify(users))
|
||||
// }
|
||||
// }
|
||||
|
||||
getFromDB() {
|
||||
|
||||
|
||||
@@ -7,14 +7,10 @@ import { ModalController } from '@ionic/angular';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
|
||||
import { BookMeetingModalPage } from 'src/app/pages/gabinete-digital/expediente/book-meeting-modal/book-meeting-modal.page';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { DespachoPage } from 'src/app/pages/gabinete-digital/despachos/despacho/despacho.page';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { NavigationStart, Router } from '@angular/router';
|
||||
import { __awaiter } from 'tslib';
|
||||
import { DespachosprStore } from 'src/app/store/despachospr-store.service';
|
||||
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
@@ -70,9 +66,7 @@ export class DespachosPrPage implements OnInit {
|
||||
private processes: ProcessesService,
|
||||
private modalController: ModalController,
|
||||
private alertService: AlertService,
|
||||
private authService: AuthService,
|
||||
private router: Router,
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService,
|
||||
private sortService: SortService,
|
||||
public ThemeService: ThemeService,
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Event } from '../../../../models/event.model';
|
||||
import { MenuController, ModalController, PopoverController } from '@ionic/angular';
|
||||
@@ -17,9 +16,6 @@ import { fullTask } from 'src/app/models/dailyworktask.model';
|
||||
import { AttachmentList } from 'src/app/models/Excludetask';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
@@ -55,7 +51,6 @@ export class DespachoPage implements OnInit {
|
||||
|
||||
constructor(private activateRoute: ActivatedRoute,
|
||||
private processes: ProcessesService,
|
||||
private iab: InAppBrowser,
|
||||
private menu: MenuController,
|
||||
private modalController: ModalController,
|
||||
public popoverController: PopoverController,
|
||||
@@ -64,8 +59,6 @@ export class DespachoPage implements OnInit {
|
||||
private despachoService: DespachoService,
|
||||
private RouteService: RouteService,
|
||||
public p: PermissionService,
|
||||
private sqliteservice: SqliteService,
|
||||
private platform: Platform,
|
||||
private backgroundservice: BackgroundService,
|
||||
public ThemeService: ThemeService,
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
@@ -133,14 +126,14 @@ export class DespachoPage implements OnInit {
|
||||
"Deadline": res.deadline
|
||||
}
|
||||
|
||||
this.updateProcessOnDB(res);
|
||||
// this.updateProcessOnDB(res);
|
||||
this.fulltask = res;
|
||||
|
||||
let thedate = new Date(this.task.CreateDate);
|
||||
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
||||
|
||||
this.processes.GetTaskParticipants(this.task.FolderID).subscribe(users => {
|
||||
this.updateProcessInterveners(users)
|
||||
// this.updateProcessInterveners(users)
|
||||
|
||||
|
||||
this.intervenientes = users.filter(user => {
|
||||
@@ -154,7 +147,7 @@ export class DespachoPage implements OnInit {
|
||||
});
|
||||
}, (error) => {
|
||||
if (error.status == 0) {
|
||||
this.getFromDb();
|
||||
// this.getFromDb();
|
||||
} else {
|
||||
try {
|
||||
this.goBack()
|
||||
@@ -166,23 +159,23 @@ export class DespachoPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
updateProcessOnDB(res) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
this.sqliteservice.updateProcess(res);
|
||||
}
|
||||
}
|
||||
// updateProcessOnDB(res) {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
// } else {
|
||||
// this.sqliteservice.updateProcess(res);
|
||||
// }
|
||||
// }
|
||||
|
||||
updateProcessInterveners(users) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
this.sqliteservice.updateProcessInterveners(JSON.stringify(this.serialnumber), JSON.stringify(users))
|
||||
}
|
||||
}
|
||||
// updateProcessInterveners(users) {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
// } else {
|
||||
// this.sqliteservice.updateProcessInterveners(JSON.stringify(this.serialnumber), JSON.stringify(users))
|
||||
// }
|
||||
// }
|
||||
|
||||
getFromDb() {
|
||||
// getFromDb() {
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
async viewDocument(docId: string, Document) {
|
||||
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
import { Component, Input, OnInit } from '@angular/core';
|
||||
import { NavigationEnd, Router } from '@angular/router';
|
||||
import { customTask, DailyWorkTask } from '../../../models/dailyworktask.model';
|
||||
import { DailyWorkTask } from '../../../models/dailyworktask.model';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { DeplomasStore } from 'src/app/store/deplomas.service';
|
||||
import { TaskService } from 'src/app/services/task.service'
|
||||
@@ -37,10 +34,7 @@ export class DiplomasAssinarPage implements OnInit {
|
||||
|
||||
constructor(
|
||||
private processes:ProcessesService,
|
||||
private modalController: ModalController,
|
||||
private alertService: AlertService,
|
||||
private router: Router,
|
||||
private sortService: SortService,
|
||||
public ThemeService: ThemeService,
|
||||
public TaskService: TaskService,
|
||||
private RouteService: RouteService,) {
|
||||
|
||||
@@ -2,8 +2,6 @@ import { Component, Input, OnInit } from '@angular/core';
|
||||
import { NavigationEnd, Router } from '@angular/router';
|
||||
import { customTask, DailyWorkTask } from '../../../models/dailyworktask.model';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
@@ -37,8 +35,6 @@ export class DiplomasGerarPage implements OnInit {
|
||||
|
||||
constructor(
|
||||
private processes:ProcessesService,
|
||||
private modalController: ModalController,
|
||||
private alertService: AlertService,
|
||||
private router: Router,
|
||||
private sortService: SortService,
|
||||
public ThemeService: ThemeService,
|
||||
|
||||
@@ -126,13 +126,13 @@ export class DiplomaPage implements OnInit {
|
||||
"activityInstanceName": res.activityInstanceName,
|
||||
}
|
||||
this.fulltask = res;
|
||||
this.updateProcessOnDB(res)
|
||||
// this.updateProcessOnDB(res)
|
||||
|
||||
let thedate = new Date(this.task.CreateDate);
|
||||
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
||||
|
||||
this.processes.GetTaskParticipants(this.task.FolderId).subscribe(users => {
|
||||
this.updateProcessInterveners(users)
|
||||
// this.updateProcessInterveners(users)
|
||||
this.intervenientes = users.filter(user => {
|
||||
return user.Type == 'I';
|
||||
});
|
||||
@@ -157,18 +157,19 @@ export class DiplomaPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
updateProcessOnDB(res) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
this.sqliteservice.updateProcess(res);
|
||||
}
|
||||
}
|
||||
updateProcessInterveners(users) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
this.sqliteservice.updateProcessInterveners(JSON.stringify(this.serialNumber), JSON.stringify(users))
|
||||
}
|
||||
}
|
||||
// updateProcessOnDB(res) {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
// } else {
|
||||
// this.sqliteservice.updateProcess(res);
|
||||
// }
|
||||
// }
|
||||
// updateProcessInterveners(users) {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
// } else {
|
||||
// this.sqliteservice.updateProcessInterveners(JSON.stringify(this.serialNumber), JSON.stringify(users))
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
getFromDb() {
|
||||
|
||||
|
||||
@@ -1,12 +1,8 @@
|
||||
import { Component, OnDestroy, OnInit } from '@angular/core';
|
||||
import { ActivatedRoute, NavigationStart, Router } from '@angular/router';
|
||||
import { DailyWorkTask } from '../../../models/dailyworktask.model';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { DeplomasStore } from 'src/app/store/deplomas.service';
|
||||
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
|
||||
@@ -42,10 +38,7 @@ export class DiplomasPage implements OnInit, OnDestroy {
|
||||
private processes: ProcessesService,
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservice: BackgroundService,
|
||||
private sortService: SortService,
|
||||
public ThemeService: ThemeService,
|
||||
public p: PermissionService,
|
||||
public TaskService: TaskService,
|
||||
private RouteService: RouteService,
|
||||
|
||||
@@ -6,11 +6,8 @@ import { ModalController } from '@ionic/angular';
|
||||
import { ApproveEventModalPage } from './approve-event-modal/approve-event-modal.page';
|
||||
import { NavigationStart, Router } from '@angular/router';
|
||||
import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service';
|
||||
import { Location } from '@angular/common';
|
||||
|
||||
import { SqliteService } from '../../../services/sqlite.service';
|
||||
import { BackgroundService } from '../../../services/background.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { RouteService } from 'src/app/services/route.service';
|
||||
@@ -54,14 +51,10 @@ export class EventListPage implements OnInit {
|
||||
private processes: ProcessesService,
|
||||
private modalController: ModalController,
|
||||
private router: Router,
|
||||
private location: Location,
|
||||
private sqliteservice: SqliteService,
|
||||
private platform: Platform,
|
||||
private sortService: SortService,
|
||||
private backgroundservice: BackgroundService,
|
||||
public ThemeService: ThemeService,
|
||||
private RouteService: RouteService,
|
||||
private storage: Storage,
|
||||
public eventService: EventsService,
|
||||
) { }
|
||||
|
||||
|
||||
+98
-98
@@ -123,111 +123,111 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
this.toastService.presentToast('Não foi possível fazer login');
|
||||
}
|
||||
|
||||
updateProcessDB(res) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
this.storage.set('expediente_details',res).then(() =>{
|
||||
// updateProcessDB(res) {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
// this.storage.set('expediente_details',res).then(() =>{
|
||||
|
||||
})
|
||||
} else {
|
||||
this.sqliteservice.updateProcess(res)
|
||||
}
|
||||
}
|
||||
// })
|
||||
// } else {
|
||||
// //this.sqliteservice.updateProcess(res)
|
||||
// }
|
||||
// }
|
||||
|
||||
getFromDB() {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
this.storage.get('expediente_details').then((process) => {
|
||||
this.task = {
|
||||
"SerialNumber": process.serialNumber,
|
||||
"Folio": process.workflowInstanceDataFields.Subject,
|
||||
"Senders": process.originator || process.originator,
|
||||
"CreateDate": momentG(new Date(process.taskStartDate), 'yyyy-MM-dd HH:mm:ss'),
|
||||
"DocumentURL": process.workflowInstanceDataFields.ViewerRequest,
|
||||
"Remetente": process.workflowInstanceDataFields.Sender,
|
||||
"Note": process.workflowInstanceDataFields.TaskMessage || process.workflowInstanceDataFields.Note,
|
||||
"FolderId": process.workflowInstanceDataFields.FolderID,
|
||||
"FsId": process.workflowInstanceDataFields.FsId,
|
||||
"DocId": process.workflowInstanceDataFields.DocID,
|
||||
"WorkflowName": process.workflowDisplayName,
|
||||
"Status": process.workflowInstanceDataFields.Status,
|
||||
"DispatchNumber": process.workflowInstanceDataFields.DispatchNumber,
|
||||
"AttachmentsProcessLastInstanceID": process.workflowInstanceDataFields.AttachmentsProcessLastInstanceID,
|
||||
"InstanceID": process.workflowInstanceDataFields.InstanceID
|
||||
}
|
||||
// getFromDB() {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
// this.storage.get('expediente_details').then((process) => {
|
||||
// this.task = {
|
||||
// "SerialNumber": process.serialNumber,
|
||||
// "Folio": process.workflowInstanceDataFields.Subject,
|
||||
// "Senders": process.originator || process.originator,
|
||||
// "CreateDate": momentG(new Date(process.taskStartDate), 'yyyy-MM-dd HH:mm:ss'),
|
||||
// "DocumentURL": process.workflowInstanceDataFields.ViewerRequest,
|
||||
// "Remetente": process.workflowInstanceDataFields.Sender,
|
||||
// "Note": process.workflowInstanceDataFields.TaskMessage || process.workflowInstanceDataFields.Note,
|
||||
// "FolderId": process.workflowInstanceDataFields.FolderID,
|
||||
// "FsId": process.workflowInstanceDataFields.FsId,
|
||||
// "DocId": process.workflowInstanceDataFields.DocID,
|
||||
// "WorkflowName": process.workflowDisplayName,
|
||||
// "Status": process.workflowInstanceDataFields.Status,
|
||||
// "DispatchNumber": process.workflowInstanceDataFields.DispatchNumber,
|
||||
// "AttachmentsProcessLastInstanceID": process.workflowInstanceDataFields.AttachmentsProcessLastInstanceID,
|
||||
// "InstanceID": process.workflowInstanceDataFields.InstanceID
|
||||
// }
|
||||
|
||||
this.fulltask = {
|
||||
Documents: process.Documents,
|
||||
actions: process.actions,
|
||||
activityInstanceName: process.activityInstanceName,
|
||||
formURL: process.formURL,
|
||||
interveners: process.interveners,
|
||||
originator: process.originator,
|
||||
serialNumber: process.serialNumber,
|
||||
taskStartDate: process.taskStartDate,
|
||||
TaskStartDate: process.taskStartDate,
|
||||
totalDocuments: process.totalDocuments,
|
||||
workflowDisplayName: process.workflowDisplayName,
|
||||
workflowID: process.workflowID,
|
||||
workflowInstanceDataFields: process.workflowInstanceDataFields,
|
||||
workflowInstanceFolio: process.workflowInstanceFolio,
|
||||
workflowInstanceID: process.workflowInstanceID,
|
||||
workflowName: process.workflowName,
|
||||
}
|
||||
})
|
||||
} else {
|
||||
this.platform.ready().then(() => {
|
||||
this.onlinecheck = false;
|
||||
this.sqliteservice.getProcessById(this.serialNumber).then((process) => {
|
||||
// this.fulltask = {
|
||||
// Documents: process.Documents,
|
||||
// actions: process.actions,
|
||||
// activityInstanceName: process.activityInstanceName,
|
||||
// formURL: process.formURL,
|
||||
// interveners: process.interveners,
|
||||
// originator: process.originator,
|
||||
// serialNumber: process.serialNumber,
|
||||
// taskStartDate: process.taskStartDate,
|
||||
// TaskStartDate: process.taskStartDate,
|
||||
// totalDocuments: process.totalDocuments,
|
||||
// workflowDisplayName: process.workflowDisplayName,
|
||||
// workflowID: process.workflowID,
|
||||
// workflowInstanceDataFields: process.workflowInstanceDataFields,
|
||||
// workflowInstanceFolio: process.workflowInstanceFolio,
|
||||
// workflowInstanceID: process.workflowInstanceID,
|
||||
// workflowName: process.workflowName,
|
||||
// }
|
||||
// })
|
||||
// } else {
|
||||
// this.platform.ready().then(() => {
|
||||
// this.onlinecheck = false;
|
||||
// this.sqliteservice.getProcessById(this.serialNumber).then((process) => {
|
||||
|
||||
|
||||
var workflow = JSON.parse(process[0].workflowInstanceDataFields);
|
||||
var origina
|
||||
if (process[0].originator === "undefined") {
|
||||
origina = ""
|
||||
} else {
|
||||
origina = JSON.parse(process[0].originator)
|
||||
}
|
||||
// var workflow = JSON.parse(process[0].workflowInstanceDataFields);
|
||||
// var origina
|
||||
// if (process[0].originator === "undefined") {
|
||||
// origina = ""
|
||||
// } else {
|
||||
// origina = JSON.parse(process[0].originator)
|
||||
// }
|
||||
|
||||
this.task = {
|
||||
"SerialNumber": process[0].serialNumber,
|
||||
"Folio": workflow.Subject,
|
||||
"Senders": origina.email || process[0].originator,
|
||||
"CreateDate": momentG(new Date(process[0].taskStartDate), 'yyyy-MM-dd HH:mm:ss'),
|
||||
"DocumentURL": workflow.ViewerRequest,
|
||||
"Remetente": workflow.Sender,
|
||||
"Note": workflow.TaskMessage || workflow.Note,
|
||||
"FolderId": workflow.FolderID,
|
||||
"FsId": workflow.FsId,
|
||||
"DocId": workflow.DocID,
|
||||
"WorkflowName": process[0].workflowDisplayName,
|
||||
"Status": workflow.Status,
|
||||
"DispatchNumber": workflow.DispatchNumber,
|
||||
"AttachmentsProcessLastInstanceID": workflow.AttachmentsProcessLastInstanceID,
|
||||
"InstanceID": workflow.InstanceID
|
||||
}
|
||||
// this.task = {
|
||||
// "SerialNumber": process[0].serialNumber,
|
||||
// "Folio": workflow.Subject,
|
||||
// "Senders": origina.email || process[0].originator,
|
||||
// "CreateDate": momentG(new Date(process[0].taskStartDate), 'yyyy-MM-dd HH:mm:ss'),
|
||||
// "DocumentURL": workflow.ViewerRequest,
|
||||
// "Remetente": workflow.Sender,
|
||||
// "Note": workflow.TaskMessage || workflow.Note,
|
||||
// "FolderId": workflow.FolderID,
|
||||
// "FsId": workflow.FsId,
|
||||
// "DocId": workflow.DocID,
|
||||
// "WorkflowName": process[0].workflowDisplayName,
|
||||
// "Status": workflow.Status,
|
||||
// "DispatchNumber": workflow.DispatchNumber,
|
||||
// "AttachmentsProcessLastInstanceID": workflow.AttachmentsProcessLastInstanceID,
|
||||
// "InstanceID": workflow.InstanceID
|
||||
// }
|
||||
|
||||
this.fulltask = {
|
||||
Documents: JSON.parse(process[0].Documents),
|
||||
actions: JSON.parse(process[0].actions),
|
||||
activityInstanceName: process[0].activityInstanceName,
|
||||
formURL: process[0].formURL,
|
||||
interveners: process[0].interveners,
|
||||
originator: JSON.parse(process[0].originator),
|
||||
serialNumber: process[0].serialNumber,
|
||||
taskStartDate: process[0].taskStartDate,
|
||||
totalDocuments: process[0].totalDocuments,
|
||||
workflowDisplayName: process[0].workflowDisplayName,
|
||||
workflowID: process[0].workflowID,
|
||||
workflowInstanceDataFields: JSON.parse(process[0].workflowInstanceDataFields),
|
||||
workflowInstanceFolio: process[0].workflowInstanceFolio,
|
||||
workflowInstanceID: process[0].workflowInstanceID,
|
||||
workflowName: process[0].workflowName,
|
||||
}
|
||||
// this.fulltask = {
|
||||
// Documents: JSON.parse(process[0].Documents),
|
||||
// actions: JSON.parse(process[0].actions),
|
||||
// activityInstanceName: process[0].activityInstanceName,
|
||||
// formURL: process[0].formURL,
|
||||
// interveners: process[0].interveners,
|
||||
// originator: JSON.parse(process[0].originator),
|
||||
// serialNumber: process[0].serialNumber,
|
||||
// taskStartDate: process[0].taskStartDate,
|
||||
// totalDocuments: process[0].totalDocuments,
|
||||
// workflowDisplayName: process[0].workflowDisplayName,
|
||||
// workflowID: process[0].workflowID,
|
||||
// workflowInstanceDataFields: JSON.parse(process[0].workflowInstanceDataFields),
|
||||
// workflowInstanceFolio: process[0].workflowInstanceFolio,
|
||||
// workflowInstanceID: process[0].workflowInstanceID,
|
||||
// workflowName: process[0].workflowName,
|
||||
// }
|
||||
|
||||
})
|
||||
})
|
||||
}
|
||||
// })
|
||||
// })
|
||||
// }
|
||||
|
||||
}
|
||||
// }
|
||||
|
||||
|
||||
async approve(note: string, documents: any) {
|
||||
@@ -382,7 +382,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
}
|
||||
|
||||
this.fulltask = res;
|
||||
this.updateProcessDB(res)
|
||||
// this.updateProcessDB(res)
|
||||
|
||||
let thedate = new Date(this.task.CreateDate);
|
||||
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
|
||||
@@ -401,7 +401,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
}, (error) => {
|
||||
|
||||
if (error.status == 0) {
|
||||
this.getFromDB();
|
||||
// this.getFromDB();
|
||||
} else {
|
||||
try {
|
||||
this.httpErroHandle.httpStatusHandle(error)
|
||||
|
||||
@@ -1,17 +1,13 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import { Event } from '../../../../models/event.model';
|
||||
import { AnimationController, MenuController, ModalController, PopoverController } from '@ionic/angular';
|
||||
import { MenuController, ModalController, PopoverController } from '@ionic/angular';
|
||||
import { ViewEventPage } from 'src/app/pages/agenda/view-event/view-event.page';
|
||||
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { ExpedientTaskModalPage } from '../../expediente/expedient-task-modal/expedient-task-modal.page';
|
||||
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||
import { OptsExpedientePrPage } from 'src/app/shared/popover/opts-expediente-pr/opts-expediente-pr.page';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
@@ -51,16 +47,11 @@ export class ExpedientePrPage implements OnInit {
|
||||
|
||||
constructor(
|
||||
private processes: ProcessesService,
|
||||
private iab: InAppBrowser,
|
||||
private events: EventsService,
|
||||
private menu: MenuController,
|
||||
private modalController: ModalController,
|
||||
public popoverController: PopoverController,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private userAuth: AuthService,
|
||||
private animationController: AnimationController,
|
||||
private toastService: ToastService,
|
||||
private attachmentsService: AttachmentsService,
|
||||
private RouteService: RouteService,
|
||||
public ThemeService: ThemeService,
|
||||
private httpErroHandle: HttpErrorHandle,
|
||||
|
||||
@@ -4,9 +4,7 @@ import { CalendarComponent } from 'ionic2-calendar';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ExpedienteDetailPage } from 'src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
||||
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
@@ -46,8 +44,6 @@ export class ExpedientesPrPage implements OnInit {
|
||||
constructor(
|
||||
private processes:ProcessesService,
|
||||
private modalController: ModalController,
|
||||
private alertService: AlertService,
|
||||
private authService: AuthService,
|
||||
private router: Router,
|
||||
private RouteService: RouteService,
|
||||
public ThemeService: ThemeService,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { Component, ElementRef, OnInit, ViewChild } from '@angular/core';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import {NavigationEnd, NavigationExtras, Router, NavigationStart } from '@angular/router';
|
||||
import {NavigationEnd, NavigationExtras, Router } from '@angular/router';
|
||||
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { ExpedientsPage } from 'src/app/shared/gabinete-digital/expedients/expedients.page';
|
||||
@@ -10,21 +9,14 @@ import { EventsToApprovePage } from 'src/app/shared/gabinete-digital/events-to-a
|
||||
import { WaitForDomService } from 'src/app/services/dom/wait-for-dom.service';
|
||||
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
|
||||
|
||||
import { DespachoService } from 'src/app/Rules/despacho.service';
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { ThemeService } from 'src/app/services/theme.service';
|
||||
|
||||
import { SqliteService } from '../../services/sqlite.service';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
import { SortService } from 'src/app/services/functions/sort.service';
|
||||
import { Storage } from '@ionic/storage';
|
||||
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { NotificationsService } from 'src/app/services/notifications.service'
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { TaskService } from 'src/app/services/task.service'
|
||||
|
||||
@Component({
|
||||
@@ -108,21 +100,13 @@ export class GabineteDigitalPage implements OnInit {
|
||||
@ViewChild('scroll') scroll: ElementRef;
|
||||
|
||||
constructor(
|
||||
private processesbackend: ProcessesService,
|
||||
private modalController: ModalController,
|
||||
private router: Router,
|
||||
public waitForDomService: WaitForDomService,
|
||||
private despachoRule: DespachoService,
|
||||
private sqliteservice: SqliteService,
|
||||
private platform: Platform,
|
||||
private backgroundservice: BackgroundService,
|
||||
public ThemeService: ThemeService,
|
||||
private sortService: SortService,
|
||||
private storage: Storage,
|
||||
public p: PermissionService,
|
||||
public NotificationsService: NotificationsService,
|
||||
public eventService: EventsService,
|
||||
private httpErroHandle: HttpErrorHandle,
|
||||
public TaskService: TaskService
|
||||
) {
|
||||
|
||||
@@ -144,9 +128,9 @@ export class GabineteDigitalPage implements OnInit {
|
||||
setTimeout(() => {
|
||||
this.dynamicSearch()
|
||||
}, 2000)
|
||||
setTimeout(() => {
|
||||
this.dynamicSearch()
|
||||
}, 4000)
|
||||
// setTimeout(() => {
|
||||
// this.dynamicSearch()
|
||||
// }, 4000)
|
||||
setTimeout(() => {
|
||||
this.dynamicSearch()
|
||||
}, 6000)
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { Event } from '../../../../models/event.model';
|
||||
import { AnimationController, MenuController, ModalController, PopoverController } from '@ionic/angular';
|
||||
import { MenuController, ModalController, PopoverController } from '@ionic/angular';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
||||
import { BookMeetingModalPage } from '../../expediente/book-meeting-modal/book-meeting-modal.page';
|
||||
@@ -12,14 +11,11 @@ import { DelegarPage } from 'src/app/modals/delegar/delegar.page';
|
||||
import { DarParecerPage } from 'src/app/modals/dar-parecer/dar-parecer.page';
|
||||
import { AddNotePage } from 'src/app/modals/add-note/add-note.page';
|
||||
import { RequestOptionsPage } from 'src/app/shared/popover/request-options/request-options.page';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||
import { ToastService } from 'src/app/services/toast.service';
|
||||
import { ForwardPage } from 'src/app/modals/forward/forward.page';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { PedidoService } from 'src/app/Rules/pedido.service';
|
||||
|
||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||
import { PedidoService } from 'src/app/Rules/pedido.service';
|
||||
import { BackgroundService } from 'src/app/services/background.service';
|
||||
|
||||
import { PermissionService } from 'src/app/services/permission.service';
|
||||
@@ -65,9 +61,7 @@ export class PedidoPage implements OnInit {
|
||||
public p: PermissionService,
|
||||
private RouteService: RouteService,
|
||||
private pedidoService: PedidoService,
|
||||
private sqliteservice: SqliteService,
|
||||
private backgroundservices: BackgroundService,
|
||||
private platform: Platform,
|
||||
public ThemeService: ThemeService,
|
||||
private dataService: DataService,
|
||||
private htppErroHandle: HttpErrorHandle,
|
||||
@@ -138,7 +132,7 @@ export class PedidoPage implements OnInit {
|
||||
"Deadline": res.deadline,
|
||||
}
|
||||
|
||||
this.updateProcess(res);
|
||||
// this.updateProcess(res);
|
||||
}
|
||||
else if (res.workflowDisplayName == 'Pedido de Deferimento') {
|
||||
|
||||
@@ -163,7 +157,7 @@ export class PedidoPage implements OnInit {
|
||||
"activityInstanceName": res.activityInstanceName,
|
||||
"Status": res.workflowInstanceDataFields.Status,
|
||||
}
|
||||
this.updateProcess(res)
|
||||
// this.updateProcess(res)
|
||||
}
|
||||
|
||||
let thedate = new Date(res.taskStartDate);
|
||||
@@ -171,7 +165,7 @@ export class PedidoPage implements OnInit {
|
||||
|
||||
this.processes.GetTaskParticipants(res.workflowInstanceDataFields.FolderID).subscribe((users = []) => {
|
||||
|
||||
this.updateProcessInterveners(users)
|
||||
// this.updateProcessInterveners(users)
|
||||
this.intervenientes = users.filter(user => {
|
||||
return user.Type == 'I';
|
||||
});
|
||||
@@ -182,7 +176,7 @@ export class PedidoPage implements OnInit {
|
||||
this.getDocumentDetails(res.workflowInstanceDataFields.FolderID, '361');
|
||||
}, (error) => {
|
||||
if (error.status == 0) {
|
||||
this.getfromDb();
|
||||
// this.getfromDb();
|
||||
} else {
|
||||
this.htppErroHandle.httpsSucessMessagge(error)
|
||||
try {
|
||||
@@ -200,22 +194,22 @@ export class PedidoPage implements OnInit {
|
||||
return this.taskArrayActions.includes(str);
|
||||
}
|
||||
|
||||
updateProcess(res) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
this.sqliteservice.updateProcess(res);
|
||||
}
|
||||
}
|
||||
// updateProcess(res) {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
// } else {
|
||||
// this.sqliteservice.updateProcess(res);
|
||||
// }
|
||||
// }
|
||||
|
||||
updateProcessInterveners(users) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
this.sqliteservice.updateProcessInterveners(JSON.stringify(this.serialnumber), JSON.stringify(users));
|
||||
}
|
||||
}
|
||||
// updateProcessInterveners(users) {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
// } else {
|
||||
// this.sqliteservice.updateProcessInterveners(JSON.stringify(this.serialnumber), JSON.stringify(users));
|
||||
// }
|
||||
// }
|
||||
|
||||
getfromDb() {
|
||||
}
|
||||
// getfromDb() {
|
||||
// }
|
||||
|
||||
getDocumentDetails(forlderId: string, applicationId: string) {
|
||||
this.processes.GetDocumentDetails(forlderId, applicationId).subscribe(res => {
|
||||
|
||||
@@ -190,7 +190,7 @@ export class PedidosPage implements OnInit {
|
||||
let task = this.customTaskPipe.transform(element);
|
||||
this.parecerList.push(task);
|
||||
});
|
||||
this.addPedidoToDb(this.parecerList);
|
||||
// this.addPedidoToDb(this.parecerList);
|
||||
|
||||
this.listToPresentparecerList = this.sortService.sortDate(this.parecerList, 'CreateDate')
|
||||
this.pedidosstorage.resetparecer(this.listToPresentparecerList);
|
||||
@@ -221,7 +221,6 @@ export class PedidosPage implements OnInit {
|
||||
this.deferimentoList.push(task);
|
||||
}
|
||||
});
|
||||
this.addPedidoToDb(this.deferimentoList);
|
||||
this.listToPresentdeferimentoList = this.sortService.sortDate(this.deferimentoList, 'CreateDate')
|
||||
this.pedidosstorage.resetdeferimento(this.listToPresentdeferimentoList);
|
||||
});
|
||||
@@ -235,12 +234,12 @@ export class PedidosPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
addPedidoToDb(pedido) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
this.sqliteservice.addProcess(pedido);
|
||||
}
|
||||
}
|
||||
// addPedidoToDb(pedido) {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
// } else {
|
||||
// this.sqliteservice.addProcess(pedido);
|
||||
// }
|
||||
// }
|
||||
|
||||
getFromDb() {
|
||||
|
||||
|
||||
@@ -52,10 +52,6 @@ export class PendentesPage implements OnInit {
|
||||
private processes: ProcessesService,
|
||||
private alertService: AlertService,
|
||||
private router: Router,
|
||||
private authService: AuthService,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private sqliteservice: SqliteService,
|
||||
private platform: Platform,
|
||||
private backgroundservices: BackgroundService,
|
||||
private sortService: SortService,
|
||||
private storage: Storage,
|
||||
|
||||
@@ -165,12 +165,12 @@ export class PublicationsPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
addActionToDB(folder) {
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
this.sqliteservice.addactions(folder);
|
||||
}
|
||||
}
|
||||
// addActionToDB(folder) {
|
||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
// } else {
|
||||
// this.sqliteservice.addactions(folder);
|
||||
// }
|
||||
// }
|
||||
|
||||
|
||||
getPublicationFolderMap(events: any):PublicationFolder[] {
|
||||
|
||||
@@ -1,728 +1,11 @@
|
||||
import { Injectable } from '@angular/core';
|
||||
import { Platform } from '@ionic/angular';
|
||||
import { SQLite, SQLiteObject } from '@ionic-native/sqlite/ngx';
|
||||
//import { Platform } from '@ionic/angular';
|
||||
//import { SQLite, SQLiteObject } from '@ionic-native/sqlite/ngx';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class SqliteService {
|
||||
|
||||
private dbInstance: SQLiteObject;
|
||||
readonly db_name: string = "gabinetedigital.db";
|
||||
readonly events: string = "Events";
|
||||
readonly expedientes: string = "Expedientes";
|
||||
readonly allprocess: string = "ALLPROCESS";
|
||||
readonly actions: string = "ACTIONS";
|
||||
readonly publications: string = "PUBLICATIONS";
|
||||
readonly chatlistroom: string = "CHATLISTROOM";
|
||||
readonly chatlistUsers: string = "CHATLISTUSERS";
|
||||
readonly chatmsg: string = "CHATMSG";
|
||||
EVENTS: Array<any>;
|
||||
EXPEDIENTES: Array<any>;
|
||||
ALLPROCESS: Array<any>;
|
||||
PROCESS: Array<any>;
|
||||
ALLACTIONS: Array<any>;
|
||||
ALLChatROOM: Array<any>;
|
||||
ALLChatUSERs: Array<any>;
|
||||
ALLCHATMSG: Array<any>;
|
||||
|
||||
constructor(private platform: Platform,
|
||||
private sqlite: SQLite) {
|
||||
this.databaseConn();
|
||||
}
|
||||
|
||||
databaseConn() {
|
||||
|
||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||
} else {
|
||||
|
||||
this.platform.ready().then(async () => {
|
||||
|
||||
this.sqlite.create({
|
||||
name: this.db_name,
|
||||
location: 'default'
|
||||
}).then(async (sqLite: SQLiteObject) => {
|
||||
this.dbInstance = sqLite;
|
||||
|
||||
await sqLite.executeSql(`
|
||||
CREATE TABLE IF NOT EXISTS ${this.events} (
|
||||
EventId varchar(255) PRIMARY KEY,
|
||||
Subject varchar(255),
|
||||
HasAttachments BIT,
|
||||
Location varchar(255),
|
||||
CalendarId varchar(255),
|
||||
CalendarName varchar(255),
|
||||
StartDate varchar(255),
|
||||
EndDate varchar(255),
|
||||
EventType varchar(255),
|
||||
Attendees Text,
|
||||
IsMeeting BIT,
|
||||
IsRecurring BIT,
|
||||
IsAllDayEvent BIT,
|
||||
AppointmentState INTERGER,
|
||||
TimeZone varchar(255),
|
||||
Organizer Text,
|
||||
Category varchar(255),
|
||||
EventRecurrence Text,
|
||||
Attachments Text,
|
||||
Body Text,
|
||||
Profile varchar(255),
|
||||
HumanDate varchar(255)
|
||||
)`, [])
|
||||
.then((res) => {
|
||||
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
|
||||
await sqLite.executeSql(`
|
||||
CREATE TABLE IF NOT EXISTS ${this.expedientes} (
|
||||
serialNumber varchar(255) PRIMARY KEY,
|
||||
workflowInstanceFolio varchar(255),
|
||||
Documents Text,
|
||||
actions Text,
|
||||
activityInstanceName varchar(255),
|
||||
formURL varchar(255),
|
||||
originator Text,
|
||||
taskStartDate varchar(255),
|
||||
totalDocuments INTERGER,
|
||||
workflowDisplayName varchar(255),
|
||||
workflowID INTERGER,
|
||||
workflowInstanceDataFields Text,
|
||||
workflowInstanceID INTERGER,
|
||||
workflowName varchar(255)
|
||||
)`, [])
|
||||
.then((res) => {
|
||||
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
|
||||
await sqLite.executeSql(`
|
||||
CREATE TABLE IF NOT EXISTS ${this.allprocess} (
|
||||
serialNumber varchar(255) PRIMARY KEY,
|
||||
workflowInstanceFolio varchar(255),
|
||||
Documents Text,
|
||||
actions Text,
|
||||
activityInstanceName varchar(255),
|
||||
formURL varchar(255),
|
||||
originator Text,
|
||||
taskStartDate varchar(255),
|
||||
totalDocuments INTERGER,
|
||||
workflowDisplayName varchar(255),
|
||||
workflowID INTERGER,
|
||||
workflowInstanceDataFields Text,
|
||||
workflowInstanceID INTERGER,
|
||||
workflowName varchar(255),
|
||||
interveners Text
|
||||
)`, [])
|
||||
.then((res) => {
|
||||
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
|
||||
await sqLite.executeSql(`
|
||||
CREATE TABLE IF NOT EXISTS ${this.actions} (
|
||||
ProcessId INTERGER PRIMARY KEY,
|
||||
ActionType varchar(255),
|
||||
DateBegin varchar(255),
|
||||
DateEnd varchar(255),
|
||||
Detail varchar(255),
|
||||
Description varchar(255),
|
||||
publications Text,
|
||||
publicationsDetails Text
|
||||
)`, [])
|
||||
.then((res) => {
|
||||
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
|
||||
await sqLite.executeSql(`
|
||||
CREATE TABLE IF NOT EXISTS ${this.chatlistroom} (
|
||||
Id varchar(255) PRIMARY KEY,
|
||||
Uids Text,
|
||||
Usernames Text,
|
||||
LastMessage Text,
|
||||
UpdatedAt varchar(255),
|
||||
customFields Text,
|
||||
name varchar(255)
|
||||
)`, [])
|
||||
.then((res) => {
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
|
||||
await sqLite.executeSql(`
|
||||
CREATE TABLE IF NOT EXISTS ${this.chatlistUsers} (
|
||||
Id varchar(255) PRIMARY KEY,
|
||||
Name varchar(255),
|
||||
Username varchar(255)
|
||||
|
||||
)`, [])
|
||||
.then((res) => {
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
|
||||
await sqLite.executeSql(`
|
||||
CREATE TABLE IF NOT EXISTS ${this.chatmsg} (
|
||||
Id varchar(255) PRIMARY KEY,
|
||||
Attachments Text,
|
||||
Channels Text,
|
||||
File Text,
|
||||
Mentions Text,
|
||||
Msg varchar(255),
|
||||
Rid varchar(255),
|
||||
Ts varchar(255),
|
||||
U Text,
|
||||
UpdatedAt varchar(255),
|
||||
image_url Text
|
||||
)`, [])
|
||||
.then((res) => {
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
|
||||
|
||||
})
|
||||
.catch((error) => console.error(error));
|
||||
|
||||
|
||||
}).catch((error) => {
|
||||
console.error( error)
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
//addactions
|
||||
public addactions(data) {
|
||||
|
||||
this.dbInstance.executeSql(`
|
||||
INSERT OR IGNORE INTO ${this.actions} (ActionType,DateBegin,DateEnd,Description,Detail,ProcessId,publications,publicationsDetails)
|
||||
VALUES ('${data.ActionType}','${data.DateBegin}', '${data.DateEnd}','${data.Description}','${data.Detail}','${data.ProcessId}','${data.publications}','${data.publicationsDetails}')`, [])
|
||||
.then(() => {
|
||||
|
||||
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//addEvent
|
||||
public addEvent(data) {
|
||||
this.dbInstance.executeSql(`
|
||||
INSERT OR IGNORE INTO ${this.events} (EventId,Subject,HasAttachments,Location,CalendarId,CalendarName,StartDate,EndDate,EventType,Attendees,IsMeeting,IsRecurring,IsAllDayEvent,AppointmentState,TimeZone,Organizer,Category,EventRecurrence,Attachments,Body,Profile,HumanDate )
|
||||
VALUES ('${data.EventId}','${data.Subject}','${data.HasAttachments}','${data.Location}','${data.CalendarId}','${data.CalendarName}','${data.StartDate}','${data.EndDate}','${data.EventType}','${data.Attendees}','${data.IsMeeting}','${data.IsRecurring}',
|
||||
'${data.IsAllDayEvent}','${data.AppointmentState}','${data.TimeZone}','${data.Organizer}','${data.Category}','${data.EventRecurrence}','${data.Attachments}','${data.Body}','${data.Profile}','${data.HumanDate}')`, [])
|
||||
.then(() => {
|
||||
|
||||
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//addExpediente
|
||||
public addExpediente(data) {
|
||||
this.dbInstance.executeSql(`
|
||||
INSERT OR REPLACE INTO ${this.expedientes} (serialNumber,workflowInstanceFolio,Documents,actions,activityInstanceName,formURL,originator,taskStartDate,totalDocuments,workflowDisplayName,workflowID,workflowInstanceDataFields,workflowInstanceID,workflowName)
|
||||
VALUES ('${data.serialNumber}','${data.workflowInstanceFolio}', '${data.Documents}','${data.actions}','${data.activityInstanceName}','${data.formURL}','${data.originator}','${data.taskStartDate}','${data.totalDocuments}','${data.workflowDisplayName}','${data.workflowID}',
|
||||
'${data.workflowInstanceDataFields}','${data.workflowInstanceID}','${data.workflowName}')`, [])
|
||||
.then(() => {
|
||||
|
||||
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//addprocess
|
||||
public addProcess(data) {
|
||||
this.dbInstance.executeSql(`
|
||||
INSERT OR IGNORE INTO ${this.allprocess} (serialNumber,workflowInstanceFolio,Documents,actions,activityInstanceName,formURL,originator,taskStartDate,totalDocuments,workflowDisplayName,workflowID,workflowInstanceDataFields,workflowInstanceID,workflowName)
|
||||
VALUES ('${data.serialNumber}','${data.workflowInstanceFolio}', '${JSON.stringify(data.Documents)}','${JSON.stringify(data.actions)}','${data.activityInstanceName}','${data.formURL}','${JSON.stringify(data.originator)}','${data.taskStartDate}','${data.totalDocuments}','${data.workflowDisplayName}','${data.workflowID}',
|
||||
'${JSON.stringify(data.workflowInstanceDataFields)}','${data.workflowInstanceID}','${data.workflowName}')`, [])
|
||||
.then(() => {
|
||||
|
||||
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//chatlistroom
|
||||
public addChatListRoom(data) {
|
||||
|
||||
this.dbInstance.executeSql(`
|
||||
INSERT OR REPLACE INTO ${this.chatlistroom} (Id,Uids,Usernames,LastMessage,UpdatedAt,customFields,name)
|
||||
VALUES ('${data.id}','${JSON.stringify(data.uids)}','${JSON.stringify(data.usernames)}','${JSON.stringify(data.lastMessage)}','${data.updatedat}','${JSON.stringify(data.customFields)}','${data.name}')`, [])
|
||||
.then(() => {
|
||||
|
||||
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//chatlistusers
|
||||
public addChatListUsers(data) {
|
||||
|
||||
this.dbInstance.executeSql(`
|
||||
INSERT OR REPLACE INTO ${this.chatlistUsers} (Id,Name,Username)
|
||||
VALUES ('${data.id}','${data.name}','${data.username}')`, [])
|
||||
.then(() => {
|
||||
|
||||
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//chatlistusers
|
||||
public addChatMSG(data) {
|
||||
|
||||
this.dbInstance.executeSql(`
|
||||
INSERT OR IGNORE INTO ${this.chatmsg} (Id,Attachments,Channels,File,Mentions,Msg,Rid, Ts ,U, UpdatedAt)
|
||||
VALUES ('${data._id}','${JSON.stringify(data.attachments)}','${JSON.stringify(data.channels)}','${JSON.stringify(data.file)}','${JSON.stringify(data.mentions)}','${data.msg}','${data.rid}','${data.ts}','${JSON.stringify(data.u)}','${JSON.stringify(data._updatedAt)}')`, [])
|
||||
.then(() => {
|
||||
|
||||
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//updateevent
|
||||
public updateEvent(data) {
|
||||
this.dbInstance.executeSql(`
|
||||
INSERT OR REPLACE INTO ${this.events} (EventId,Subject,HasAttachments,Location,CalendarId,CalendarName,StartDate,EndDate,EventType,Attendees,IsMeeting,IsRecurring,IsAllDayEvent,AppointmentState,TimeZone,Organizer,Category,EventRecurrence,Attachments,Body,Profile,HumanDate )
|
||||
VALUES ('${data.EventId}','${data.Subject}','${data.HasAttachments}','${data.Location}','${data.CalendarId}','${data.CalendarName}','${data.StartDate}','${data.EndDate}','${data.EventType}','${data.Attendees}','${data.IsMeeting}','${data.IsRecurring}',
|
||||
'${data.IsAllDayEvent}','${data.AppointmentState}','${data.TimeZone}','${data.Organizer}','${data.Category}','${data.EventRecurrence}','${data.Attachments}','${data.Body}','${data.Profile}','${data.HumanDate}')`, [])
|
||||
.then(() => {
|
||||
|
||||
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//updateActions
|
||||
public updateactions(id, data) {
|
||||
try {
|
||||
|
||||
this.dbInstance.executeSql(`
|
||||
UPDATE ${this.actions} SET publications = ? WHERE ProcessId = ${id}`, [data])
|
||||
.then(() => {
|
||||
|
||||
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
} catch(error) {}
|
||||
|
||||
}
|
||||
|
||||
//updatePublicationsDetails
|
||||
public updatePublicationsDetails(id, data) {
|
||||
try {
|
||||
|
||||
this.dbInstance.executeSql(`
|
||||
UPDATE ${this.actions} SET publicationsDetails = ? WHERE ProcessId = ${id}`, [data])
|
||||
.then(() => {
|
||||
|
||||
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
} catch(error) {}
|
||||
|
||||
}
|
||||
|
||||
//updateChatMsg
|
||||
public updateChatMsg(id, data) {
|
||||
let jsonId = JSON.stringify(id)
|
||||
let jsondata = JSON.stringify(data)
|
||||
try {
|
||||
|
||||
this.dbInstance.executeSql(`
|
||||
UPDATE ${this.chatmsg} SET image_url = ? WHERE Id = ${jsonId}`, [jsondata])
|
||||
.then(() => {
|
||||
|
||||
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
} catch(error) {}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//updateprocess
|
||||
public updateProcess(data) {
|
||||
this.dbInstance.executeSql(`
|
||||
INSERT OR REPLACE INTO ${this.allprocess} (serialNumber,workflowInstanceFolio,Documents,actions,activityInstanceName,formURL,originator,taskStartDate,totalDocuments,workflowDisplayName,workflowID,workflowInstanceDataFields,workflowInstanceID,workflowName)
|
||||
VALUES ('${data.serialNumber}','${data.workflowInstanceFolio}', '${JSON.stringify(data.Documents)}','${JSON.stringify(data.actions)}','${data.activityInstanceName}','${data.formURL}','${JSON.stringify(data.originator)}','${data.taskStartDate}','${data.totalDocuments}','${data.workflowDisplayName}','${data.workflowID}',
|
||||
'${JSON.stringify(data.workflowInstanceDataFields)}','${data.workflowInstanceID}','${data.workflowName}')`, [])
|
||||
.then(() => {
|
||||
|
||||
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//updateAttachment
|
||||
updateUser(id, document,) {
|
||||
let data = [document];
|
||||
return this.dbInstance.executeSql(`UPDATE ${this.allprocess} SET Documents = ? WHERE serialNumber = ${id}`, [document]).then(() => {
|
||||
|
||||
})
|
||||
}
|
||||
//updateAttachment
|
||||
updateProcessInterveners(id, interveners,) {
|
||||
let data = [document];
|
||||
return this.dbInstance.executeSql(`UPDATE ${this.allprocess} SET interveners = ? WHERE serialNumber = ${id}`, [interveners]).then(() => {
|
||||
|
||||
})
|
||||
}
|
||||
//getAllEvents
|
||||
getAllEvents() {
|
||||
var hashattachment = false;
|
||||
var ismeeting = false;
|
||||
var isrecurring = false;
|
||||
var isallday = false;
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.events}`, []).then((res) => {
|
||||
this.EVENTS = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
if (res.rows.item(i).HasAttachments === "true") {
|
||||
hashattachment = true
|
||||
}
|
||||
if (res.rows.item(i).IsMeeting === "true") {
|
||||
ismeeting = true
|
||||
}
|
||||
if (res.rows.item(i).IsRecurring === "true") {
|
||||
isrecurring = true
|
||||
}
|
||||
if (res.rows.item(i).IsAllDayEvent === "true") {
|
||||
isallday = true
|
||||
}
|
||||
let event = {
|
||||
EventId: res.rows.item(i).EventId,
|
||||
HasAttachments: hashattachment,
|
||||
Subject: res.rows.item(i).Subject,
|
||||
Location: res.rows.item(i).Location,
|
||||
CalendarId: res.rows.item(i).CalendarId,
|
||||
CalendarName: res.rows.item(i).CalendarName,
|
||||
StartDate: res.rows.item(i).StartDate,
|
||||
EndDate: res.rows.item(i).EndDate,
|
||||
EventType: res.rows.item(i).EventType,
|
||||
Attendees: res.rows.item(i).Attendees,
|
||||
IsMeeting: ismeeting,
|
||||
IsRecurring: isrecurring,
|
||||
IsAllDayEvent: isallday,
|
||||
AppointmentState: res.rows.item(i).AppointmentState,
|
||||
TimeZone: res.rows.item(i).TimeZone,
|
||||
Organizer: res.rows.item(i).Organizer,
|
||||
Category: res.rows.item(i).Category,
|
||||
EventRecurrence: res.rows.item(i).EventRecurrence,
|
||||
Attachments: res.rows.item(i).Attachments,
|
||||
Profile: res.rows.item(i).Profile,
|
||||
HumanDate: res.rows.item(i).HumanDate
|
||||
|
||||
}
|
||||
this.EVENTS.push(event);
|
||||
}
|
||||
|
||||
return this.EVENTS;
|
||||
}
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
getAllExpedientes() {
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.expedientes}`, []).then((res) => {
|
||||
this.EXPEDIENTES = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.EXPEDIENTES.push(res.rows.item(i));
|
||||
}
|
||||
return this.EXPEDIENTES;
|
||||
}
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
getAllProcess() {
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.allprocess}`, []).then((res) => {
|
||||
this.ALLPROCESS = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.ALLPROCESS.push(res.rows.item(i));
|
||||
}
|
||||
return this.ALLPROCESS;
|
||||
}
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//getAllAtions
|
||||
getAllActions() {
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.actions}`, []).then((res) => {
|
||||
this.ALLACTIONS = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.ALLACTIONS.push(res.rows.item(i));
|
||||
}
|
||||
return this.ALLACTIONS;
|
||||
}
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//getAllChatRoom
|
||||
getAllChatRoom() {
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.chatlistroom}`, []).then((res) => {
|
||||
this.ALLChatROOM = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.ALLChatROOM.push(res.rows.item(i));
|
||||
}
|
||||
return this.ALLChatROOM;
|
||||
}
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//getAllChatUsers
|
||||
getAllChatUsers() {
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.chatlistUsers}`, []).then((res) => {
|
||||
this.ALLChatUSERs = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.ALLChatUSERs.push(res.rows.item(i));
|
||||
}
|
||||
return this.ALLChatUSERs;
|
||||
}
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//getAllChatMSG
|
||||
getAllChatMSG(roomId) {
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.chatmsg} WHERE Rid = ?`, [roomId]).then((res) => {
|
||||
this.ALLCHATMSG = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.ALLCHATMSG.push(res.rows.item(i));
|
||||
}
|
||||
return this.ALLCHATMSG;
|
||||
}
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
//getlistOfEventAprove
|
||||
getListOfEventAprove(process, type) {
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.allprocess} WHERE workflowDisplayName = ? OR workflowDisplayName = ? `, [process, type]).then((res) => {
|
||||
this.ALLPROCESS = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.ALLPROCESS.push(res.rows.item(i));
|
||||
}
|
||||
return this.ALLPROCESS;
|
||||
}
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//getDespachosProcess
|
||||
getDespachosProcess(process) {
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.allprocess} WHERE activityInstanceName = ?`, [process]).then((res) => {
|
||||
this.ALLPROCESS = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.ALLPROCESS.push(res.rows.item(i));
|
||||
}
|
||||
return this.ALLPROCESS;
|
||||
}
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//getprocessByworkflow
|
||||
getprocessByworkflow(process) {
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.allprocess} WHERE workflowDisplayName = ? `, [process]).then((res) => {
|
||||
this.ALLPROCESS = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.ALLPROCESS.push(res.rows.item(i));
|
||||
|
||||
}
|
||||
return this.ALLPROCESS;
|
||||
}
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//getprocessByworkflowpedido
|
||||
getprocessByworkflowpedido(process, process2) {
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.allprocess} WHERE workflowDisplayName = ? OR workflowDisplayName = ? `, [process, process2]).then((res) => {
|
||||
this.ALLPROCESS = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.ALLPROCESS.push(res.rows.item(i));
|
||||
}
|
||||
return this.ALLPROCESS;
|
||||
}
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
getProcessById(serial) {
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.allprocess} WHERE serialNumber = ? `, [serial]).then((res) => {
|
||||
this.PROCESS = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.PROCESS.push(res.rows.item(i))
|
||||
}
|
||||
return this.PROCESS;
|
||||
}
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
//getActionById
|
||||
getActionById(id) {
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.actions} WHERE ProcessId = ? `, [id]).then((res) => {
|
||||
this.ALLACTIONS = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
this.ALLACTIONS.push(res.rows.item(i))
|
||||
}
|
||||
return this.ALLACTIONS;
|
||||
}
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
//getEventBy id
|
||||
getEventById(id) {
|
||||
|
||||
var hashattachment = false;
|
||||
var ismeeting = false;
|
||||
var isrecurring = false;
|
||||
var isallday = false;
|
||||
var body;
|
||||
var attendes;
|
||||
var organizer;
|
||||
var eventrecurrence;
|
||||
var attachment;
|
||||
|
||||
return this.dbInstance.executeSql(`SELECT * FROM ${this.events} WHERE EventId = ? `, [id]).then((res) => {
|
||||
this.EVENTS = [];
|
||||
if (res.rows.length > 0) {
|
||||
for (var i = 0; i < res.rows.length; i++) {
|
||||
if (res.rows.item(i).HasAttachments === "true") {
|
||||
hashattachment = true
|
||||
}
|
||||
if (res.rows.item(i).IsMeeting === "true") {
|
||||
ismeeting = true
|
||||
}
|
||||
if (res.rows.item(i).IsRecurring === "true") {
|
||||
isrecurring = true
|
||||
}
|
||||
if (res.rows.item(i).IsAllDayEvent === "true") {
|
||||
isallday = true
|
||||
}
|
||||
/* if (res.rows.item(i).Body != "") {
|
||||
body = JSON.parse(res.rows.item(i).Body);
|
||||
}
|
||||
if (res.rows.item(i).Attendees !="") {
|
||||
attendes = JSON.parse(res.rows.item(i).Attendees);
|
||||
}
|
||||
if(res.rows.item(i).Organizer !=""){
|
||||
organizer = JSON.parse(res.rows.item(i).Organizer);
|
||||
}
|
||||
if(res.row.item(i).EventRecurrence != ""){
|
||||
eventrecurrence = JSON.parse(res.row.item(i).EventRecurrence);
|
||||
}
|
||||
if(res.row.item(i).Attachments != ""){
|
||||
attachment = JSON.parse(res.row.item(i).Attachments);
|
||||
}
|
||||
*/
|
||||
|
||||
let event = {
|
||||
EventId: res.rows.item(i).EventId,
|
||||
HasAttachments: hashattachment,
|
||||
Subject: res.rows.item(i).Subject,
|
||||
Location: res.rows.item(i).Location,
|
||||
CalendarId: res.rows.item(i).CalendarId,
|
||||
CalendarName: res.rows.item(i).CalendarName,
|
||||
StartDate: res.rows.item(i).StartDate,
|
||||
EndDate: res.rows.item(i).EndDate,
|
||||
EventType: res.rows.item(i).EventType,
|
||||
Attendees: res.rows.item(i).Attendees,
|
||||
IsMeeting: ismeeting,
|
||||
IsRecurring: isrecurring,
|
||||
IsAllDayEvent: isallday,
|
||||
Body: res.rows.item(i).Body,
|
||||
AppointmentState: res.rows.item(i).AppointmentState,
|
||||
TimeZone: res.rows.item(i).TimeZone,
|
||||
Organizer: res.rows.item(i).Organizer,
|
||||
Category: res.rows.item(i).Category,
|
||||
EventRecurrence: res.rows.item(i).EventRecurrence,
|
||||
Attachments: res.rows.item(i).Attachments
|
||||
}
|
||||
this.EVENTS.push(event);
|
||||
}
|
||||
|
||||
return this.EVENTS;
|
||||
}
|
||||
}, (e) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
deleteAllTables() {
|
||||
this.deleteeventsTable();
|
||||
this.deleteallprocessTable();
|
||||
this.deleteactionsTable();
|
||||
this.deletepublicationsTable();
|
||||
|
||||
|
||||
}
|
||||
|
||||
deleteeventsTable() {
|
||||
return this.dbInstance.executeSql("DELETE from "+ this.events).then((res) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
deleteallprocessTable() {
|
||||
return this.dbInstance.executeSql("DELETE from "+ this.allprocess).then((res) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
deleteactionsTable() {
|
||||
return this.dbInstance.executeSql("DELETE from "+ this.actions).then((res) => {
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
deletepublicationsTable() {
|
||||
return this.dbInstance.executeSql("DELETE from "+ this.publications).then((res) => {
|
||||
|
||||
});
|
||||
}
|
||||
// y
|
||||
}
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
export let versionData = {
|
||||
"shortSHA": "96684cd1c",
|
||||
"SHA": "96684cd1c2a1dfb66f772771ff4fb587c08de954",
|
||||
"shortSHA": "f7b54a04b",
|
||||
"SHA": "f7b54a04ba4d28c7c4b5839d06c2ba8f1dea784a",
|
||||
"branch": "feature/gabinete-search",
|
||||
"lastCommitAuthor": "'Peter Maquiran'",
|
||||
"lastCommitTime": "'Sun Jun 11 12:21:07 2023 +0100'",
|
||||
"lastCommitMessage": "fix update",
|
||||
"lastCommitNumber": "4973",
|
||||
"lastCommitTime": "'Sun Jun 11 12:44:51 2023 +0100'",
|
||||
"lastCommitMessage": "add performance",
|
||||
"lastCommitNumber": "4974",
|
||||
"change": "",
|
||||
"changeStatus": "On branch feature/gabinete-search\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.ts",
|
||||
"changeStatus": "On branch feature/gabinete-search\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/app.component.ts\n\tmodified: src/app/home/home.page.ts\n\tmodified: src/app/modals/view-event/view-event.page.ts\n\tmodified: src/app/pages/agenda/view-event/view-event.page.ts\n\tmodified: src/app/pages/chat/chat.page.ts\n\tmodified: src/app/pages/chat/group-messages/group-messages.page.ts\n\tmodified: src/app/pages/chat/messages/messages.page.ts\n\tmodified: src/app/pages/events/events.page.ts\n\tmodified: src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts\n\tmodified: src/app/pages/gabinete-digital/despachos-pr/despachos-pr.page.ts\n\tmodified: src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts\n\tmodified: src/app/pages/gabinete-digital/diplomas-assinar/diplomas-assinar.page.ts\n\tmodified: src/app/pages/gabinete-digital/diplomas-gerar/diplomas-gerar.page.ts\n\tmodified: src/app/pages/gabinete-digital/diplomas/diploma/diploma.page.ts\n\tmodified: src/app/pages/gabinete-digital/diplomas/diplomas.page.ts\n\tmodified: src/app/pages/gabinete-digital/event-list/event-list.page.ts\n\tmodified: src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts\n\tmodified: src/app/pages/gabinete-digital/expedientes-pr/expediente-pr/expediente-pr.page.ts\n\tmodified: src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts\n\tmodified: src/app/pages/gabinete-digital/gabinete-digital.page.ts\n\tmodified: src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts\n\tmodified: src/app/pages/gabinete-digital/pedidos/pedidos.page.ts\n\tmodified: src/app/pages/gabinete-digital/pendentes/pendentes.page.ts\n\tmodified: src/app/pages/publications/publications.page.ts\n\tmodified: src/app/services/sqlite.service.ts",
|
||||
"changeAuthor": "peter.maquiran"
|
||||
}
|
||||
Reference in New Issue
Block a user