This commit is contained in:
Peter Maquiran
2022-05-02 14:36:08 +01:00
157 changed files with 1076 additions and 1144 deletions
@@ -16,5 +16,8 @@
"sound" "sound"
] ]
} }
},
"server": {
"url": "http://192.168.0.62:8101"
} }
} }
+1 -1
View File
@@ -142,7 +142,7 @@ export class DespachoService {
"AttachmentList" :documents, "AttachmentList" :documents,
} }
} }
console.log(body);
return this.processes.CompleteTask(body) return this.processes.CompleteTask(body)
} }
+3 -9
View File
@@ -200,7 +200,6 @@ export class HomePage implements OnInit {
logDeviceInfo = async () => { logDeviceInfo = async () => {
const info = await Device.getInfo(); const info = await Device.getInfo();
console.log('Device info',info);
}; };
get pathname(){ get pathname(){
@@ -237,40 +236,35 @@ export class HomePage implements OnInit {
this.eventservice.editEvent(element, 2, 3).subscribe((res) => { this.eventservice.editEvent(element, 2, 3).subscribe((res) => {
this.storage.remove('eventEdit') this.storage.remove('eventEdit')
//this.sqliteservice.deleteeventsTable(); //this.sqliteservice.deleteeventsTable();
console.log('eventEdit synchnize', res)
}) })
}); });
}) })
} catch (error) { } catch (error) {
console.log('error synch eventedit') console.log(error)
} }
try { try {
await this.storage.get('eventDelete').then((req) => { await this.storage.get('eventDelete').then((req) => {
JSON.parse(req).forEach(element => { JSON.parse(req).forEach(element => {
console.log('DELETE data SYNC', element)
this.eventservice.deleteEvent(element.eventid, element.eventDeleteType, element.calendarName).subscribe((res) => { this.eventservice.deleteEvent(element.eventid, element.eventDeleteType, element.calendarName).subscribe((res) => {
this.storage.remove('eventDelete') this.storage.remove('eventDelete')
console.log('eventDelete synchnize', res)
}) })
}); });
}) })
} catch (error) { } catch (error) {
console.log('error delete event synch') console.log(error)
} }
try { try {
await this.storage.get('event-listRever').then((req) => { await this.storage.get('event-listRever').then((req) => {
JSON.parse(req).forEach(element => { JSON.parse(req).forEach(element => {
console.log('REVER data SYNC', element)
this.processservice.PostTaskAction(element).subscribe((res) => { this.processservice.PostTaskAction(element).subscribe((res) => {
this.storage.remove('event-listRever') this.storage.remove('event-listRever')
console.log('event-listRever synchnize', res)
}) })
}); });
}) })
} catch (error) { } catch (error) {
console.log('error event-list rever synch') console.log(error)
} }
this.sqliteservice.deleteAllTables(); this.sqliteservice.deleteAllTables();
-3
View File
@@ -26,9 +26,6 @@ export class AddNotePage implements OnInit {
} }
ngOnInit() { ngOnInit() {
console.log( this.navParams);
console.log(this.hideThisFeature);
} }
@@ -37,7 +37,6 @@ export class ChatOptionsFeaturesPage implements OnInit {
) { ) {
this.members = this.navParams.get('members'); this.members = this.navParams.get('members');
console.log(this.members);
this.attendees = this.members.map((val)=>{ this.attendees = this.members.map((val)=>{
return { return {
Name: val.name, Name: val.name,
@@ -48,7 +47,6 @@ export class ChatOptionsFeaturesPage implements OnInit {
} }
ngOnInit() { ngOnInit() {
console.log(this.attendees);
} }
@@ -66,7 +64,6 @@ export class ChatOptionsFeaturesPage implements OnInit {
} }
attachDocument(){ attachDocument(){
console.log('Anexar Documento');
} }
@@ -99,7 +96,6 @@ export class ChatOptionsFeaturesPage implements OnInit {
input.onchange = async () => { input.onchange = async () => {
const file = this.fileLoaderService.getFirstFile(input) const file = this.fileLoaderService.getFirstFile(input)
console.log(file);
const imageData = await this.fileToBase64Service.convert(file) const imageData = await this.fileToBase64Service.convert(file)
this.capturedImage = imageData; this.capturedImage = imageData;
@@ -120,11 +116,11 @@ export class ChatOptionsFeaturesPage implements OnInit {
} }
this.chatService.sendMessage(body).subscribe(res=> { this.chatService.sendMessage(body).subscribe(res=> {
// console.log(res); //
},(error) => { },(error) => {
}); });
//console.log(this.capturedImage) //
}; };
} }
@@ -146,7 +142,6 @@ export class ChatOptionsFeaturesPage implements OnInit {
} }
this.chatService.sendMessage(body).subscribe(res=> { this.chatService.sendMessage(body).subscribe(res=> {
console.log(res);
},(error) => { },(error) => {
@@ -159,7 +154,7 @@ export class ChatOptionsFeaturesPage implements OnInit {
//If group is private call getGroupMembers //If group is private call getGroupMembers
if(this.room.t === 'p'){ if(this.room.t === 'p'){
this.chatService.getGroupMembers(this.roomId).subscribe(res=>{ this.chatService.getGroupMembers(this.roomId).subscribe(res=>{
console.log(res);
this.members = res['members']; this.members = res['members'];
this.showLoader = false; this.showLoader = false;
}); });
@@ -167,7 +162,7 @@ export class ChatOptionsFeaturesPage implements OnInit {
//Otherwise call getChannelMembers for públic groups //Otherwise call getChannelMembers for públic groups
else{ else{
this.chatService.getChannelMembers(this.roomId).subscribe(res=>{ this.chatService.getChannelMembers(this.roomId).subscribe(res=>{
console.log(res);
this.members = res['members']; this.members = res['members'];
this.showLoader = false; this.showLoader = false;
}); });
@@ -189,13 +184,11 @@ export class ChatOptionsFeaturesPage implements OnInit {
if(res){ if(res){
const data = res.data; const data = res.data;
this.documents.push(data.selected); this.documents.push(data.selected);
console.log(res.data);
} }
}); });
} }
async bookMeeting() { async bookMeeting() {
console.log(this.attendees);
if( window.innerWidth <= 800){ if( window.innerWidth <= 800){
this.popoverController.dismiss(); this.popoverController.dismiss();
@@ -175,9 +175,7 @@ export class CreateProcessPage implements OnInit {
} }
onSelectedTypesChanged(ev:any){ onSelectedTypesChanged(ev:any){
console.log(ev);
if(ev.length > 1){ if(ev.length > 1){
console.log(ev.filter(data => data != '99999850'));
this.selectedTypes = ev.filter(data => data != '99999850'); this.selectedTypes = ev.filter(data => data != '99999850');
} }
if(ev.length == 0){ if(ev.length == 0){
@@ -282,8 +280,6 @@ export class CreateProcessPage implements OnInit {
UsersSelected: attendees, UsersSelected: attendees,
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
} }
console.log('this.postData', this.postData, this.taskType);
console.log(this.task.activityInstanceName);
try { try {
await this.processes.postDespatcho(this.postData).toPromise(); await this.processes.postDespatcho(this.postData).toPromise();
@@ -308,7 +304,6 @@ export class CreateProcessPage implements OnInit {
UsersSelected: attendees, UsersSelected: attendees,
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
} }
console.log(this.postData);
try { try {
if(this.task.activityInstanceName == 'Tarefa de Despacho' || this.task.activityInstanceName == 'Reexecutar Despacho') { if(this.task.activityInstanceName == 'Tarefa de Despacho' || this.task.activityInstanceName == 'Reexecutar Despacho') {
@@ -338,7 +333,6 @@ export class CreateProcessPage implements OnInit {
UsersSelected: attendees, UsersSelected: attendees,
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
} }
console.log(this.postData);
try { try {
await this.pedidoService.createDeferimento(this.postData).toPromise(); await this.pedidoService.createDeferimento(this.postData).toPromise();
@@ -369,7 +363,6 @@ export class CreateProcessPage implements OnInit {
UsersSelected: attendees, UsersSelected: attendees,
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
} }
console.log('this.postData', this.postData, this.taskType);
if(this.postData.DispatchFolder.Message){ if(this.postData.DispatchFolder.Message){
try { try {
@@ -399,7 +392,6 @@ export class CreateProcessPage implements OnInit {
UsersSelected: attendees, UsersSelected: attendees,
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
} }
console.log(this.postData);
try { try {
@@ -430,7 +422,6 @@ export class CreateProcessPage implements OnInit {
UsersSelected: attendees, UsersSelected: attendees,
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
} }
console.log(this.postData);
try { try {
await this.pedidoService.createDeferimento(this.postData).toPromise(); await this.pedidoService.createDeferimento(this.postData).toPromise();
@@ -488,10 +479,9 @@ export class CreateProcessPage implements OnInit {
} }
} else { } else {
console.log('unexpected activityInstanceName', this.task) console.log('unexpected error')
} }
console.log(body);
try { try {
await this.processes.CompleteTask(body).toPromise(); await this.processes.CompleteTask(body).toPromise();
@@ -598,7 +588,6 @@ export class CreateProcessPage implements OnInit {
await modal.present(); await modal.present();
modal.onDidDismiss().then(res=>{ modal.onDidDismiss().then(res=>{
if(res['data']=='close'){ if(res['data']=='close'){
console.log('Expedient Discard closed');
this.modalController.dismiss(res['data']) this.modalController.dismiss(res['data'])
} }
@@ -634,7 +623,6 @@ export class CreateProcessPage implements OnInit {
} }
async viewExpedientDetail() { async viewExpedientDetail() {
console.log(this.profile);
let classs; let classs;
if( window.innerWidth <= 800){ if( window.innerWidth <= 800){
@@ -30,8 +30,6 @@ export class DarParecerPage implements OnInit {
} }
ngOnInit() { ngOnInit() {
console.log(this.serialNumber
);
} }
@@ -62,7 +60,6 @@ export class DarParecerPage implements OnInit {
}, },
"AttachmentList": docs, "AttachmentList": docs,
} }
console.log(body);
const loader = this.toastService.loading() const loader = this.toastService.loading()
-4
View File
@@ -72,7 +72,6 @@ export class DelegarPage implements OnInit {
ngOnInit() { ngOnInit() {
this.adding = "intervenient"; this.adding = "intervenient";
console.log(this.task);
} }
@@ -100,13 +99,10 @@ export class DelegarPage implements OnInit {
"Comment": this.note, "Comment": this.note,
"DelegatedUserEmail": this.taskParticipants[0].EmailAddress, "DelegatedUserEmail": this.taskParticipants[0].EmailAddress,
} }
console.log(body);
const loader = this.toastService.loading() const loader = this.toastService.loading()
this.processes.DelegateTask(body).subscribe(res=>{ this.processes.DelegateTask(body).subscribe(res=>{
console.log(res);
this.toastService._successMessage('Processo delegado') this.toastService._successMessage('Processo delegado')
this.close(); this.close();
}, },
@@ -60,7 +60,6 @@ export class DocumentDetailPage implements OnInit {
async LoadDocumentDetails() { async LoadDocumentDetails() {
this.processes.GetDocumentDetails(this.docId, this.applicationId).subscribe(res=>{ this.processes.GetDocumentDetails(this.docId, this.applicationId).subscribe(res=>{
console.log(res);
this.LoadedDocument = res; this.LoadedDocument = res;
@@ -68,7 +67,6 @@ export class DocumentDetailPage implements OnInit {
let thedate = new Date(this.LoadedDocument.DateDispatch || this.LoadedDocument.DocDate); let thedate = new Date(this.LoadedDocument.DateDispatch || this.LoadedDocument.DocDate);
console.log(res)
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]); this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
let task: ExpedientTaskModalPageNavParamsTask let task: ExpedientTaskModalPageNavParamsTask
@@ -80,7 +78,7 @@ export class DocumentDetailPage implements OnInit {
} else if (document.ApplicationID == 8 || document.ApplicationId == 8) { } else if (document.ApplicationID == 8 || document.ApplicationId == 8) {
} else { } else {
console.log('unexpected ApplicationID') console.log('unexpected id')
} }
@@ -99,7 +97,6 @@ export class DocumentDetailPage implements OnInit {
} }
this.DocumentTask = Object.assign(task, res) this.DocumentTask = Object.assign(task, res)
console.log('this.DocumentTask = DocumentTask', this.DocumentTask)
}); });
@@ -207,7 +204,6 @@ export class DocumentDetailPage implements OnInit {
} }
async openBookMeetingModal() { async openBookMeetingModal() {
console.log(this.LoadedDocument);
let classs; let classs;
if( window.innerWidth < 701) { if( window.innerWidth < 701) {
@@ -271,8 +267,7 @@ export class DocumentDetailPage implements OnInit {
} else if(res.data.component == 'openExpedientActionsModal') { } else if(res.data.component == 'openExpedientActionsModal') {
this.openExpedientActionsModal(res.data.taskAction) this.openExpedientActionsModal(res.data.taskAction)
} else { } else {
console.log(res.data) console.log('not found')
console.log('component not found')
} }
}); });
} }
@@ -186,7 +186,6 @@ export class DocumentSetUpMeetingPage implements OnInit {
}) })
} }
else{ else{
console.log(this.document);
this.docs.push({ this.docs.push({
ApplicationId: this.document.ApplicationId || this.document.ApplicationType, ApplicationId: this.document.ApplicationId || this.document.ApplicationType,
Source: 1, Source: 1,
@@ -34,7 +34,7 @@ export class DocumentViewerPage implements OnInit {
this.processes.getFileBase64(this.DocId).subscribe((res: any) => { this.processes.getFileBase64(this.DocId).subscribe((res: any) => {
console.log(res)
this.pdfSrc= 'data:application/pdf;base64,'+ res.file this.pdfSrc= 'data:application/pdf;base64,'+ res.file
this.fileName = res.name this.fileName = res.name
-3
View File
@@ -68,7 +68,6 @@ export class ForwardPage implements OnInit {
ngOnInit() { ngOnInit() {
this.adding = "intervenient"; this.adding = "intervenient";
console.log(this.task);
} }
@@ -147,9 +146,7 @@ export class ForwardPage implements OnInit {
"FolderId": this.task.FolderId, "FolderId": this.task.FolderId,
"AttachmentList" :docs, "AttachmentList" :docs,
} }
console.log(body);
this.processes.CompleteParecerPrTask(body).subscribe(res=>{ this.processes.CompleteParecerPrTask(body).subscribe(res=>{
console.log(res);
this.toastService._successMessage('Processo delegado'); this.toastService._successMessage('Processo delegado');
this.goBack(); this.goBack();
}, },
@@ -101,7 +101,6 @@ async getIconGallery(){
document.querySelector('img').addEventListener('click',removeImage) document.querySelector('img').addEventListener('click',removeImage)
}) })
function removeImage(ev){ function removeImage(ev){
console.log(ev.target, ev.currentTarget)
let img = ev.currentTarget let img = ev.currentTarget
let src = ev.target.closest('.img') let src = ev.target.closest('.img')
src?.parentElement.removeChild(src) src?.parentElement.removeChild(src)
-12
View File
@@ -48,8 +48,6 @@ export class ProfilePage implements OnInit {
this.loggeduser = authService.ValidatedUser; this.loggeduser = authService.ValidatedUser;
console.log(this.loggeduser.RoleDescription)
} }
ngOnInit() { ngOnInit() {
@@ -82,13 +80,11 @@ export class ProfilePage implements OnInit {
async getNotificationData() { async getNotificationData() {
this.storageservice.get("Notifications").then((value) => { this.storageservice.get("Notifications").then((value) => {
console.log("Init get store", value)
this.DataArray = [] this.DataArray = []
value.forEach((element, i) => { value.forEach((element, i) => {
let notificationObject; let notificationObject;
if (element.data) { if (element.data) {
console.log("ARaaAA", element)
notificationObject = { notificationObject = {
index: i, index: i,
title: element.title, title: element.title,
@@ -125,12 +121,9 @@ export class ProfilePage implements OnInit {
this.DataArray.push(notificationObject) this.DataArray.push(notificationObject)
}); });
this.notificationdata = this.DataArray this.notificationdata = this.DataArray
console.log("Notificaaa", this.notificationdata)
}) })
console.log("Notificaaa", this.notificationdata)
/* await new Promise(resolve => setTimeout(resolve, 1000)); /* await new Promise(resolve => setTimeout(resolve, 1000));
await this.getNotificationData(); */ await this.getNotificationData(); */
console.log('Timer badge count')
} }
@@ -140,14 +133,12 @@ export class ProfilePage implements OnInit {
var am_pm = date.getHours() >= 12 ? "pm" : "am"; var am_pm = date.getHours() >= 12 ? "pm" : "am";
var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes(); var minutes = date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
let time = hours + ":" + minutes /* + " " + am_pm */; let time = hours + ":" + minutes /* + " " + am_pm */;
console.log('Formate', time)
return time; return time;
} }
notificatinsRoutes = (index, Service, Object, IdObject, FolderId) => { notificatinsRoutes = (index, Service, Object, IdObject, FolderId) => {
if (Service === "agenda" && IdObject.length > 10) { if (Service === "agenda" && IdObject.length > 10) {
console.log("Id Lenght", IdObject.length)
this.zone.run(() => this.router.navigate(['/home/agenda', IdObject, 'agenda'])); this.zone.run(() => this.router.navigate(['/home/agenda', IdObject, 'agenda']));
} }
else if (Service === "gabinete-digital" && Object === "expediente") { else if (Service === "gabinete-digital" && Object === "expediente") {
@@ -201,15 +192,12 @@ export class ProfilePage implements OnInit {
} }
deleteNotification(index) { deleteNotification(index) {
console.log("Delete notification first stata", this.notificationdata)
this.notificationdata = this.notificationdata.filter(item => item.index != index); this.notificationdata = this.notificationdata.filter(item => item.index != index);
this.storageservice.store("Notifications", JSON.stringify(this.notificationdata)).then(() => { this.storageservice.store("Notifications", JSON.stringify(this.notificationdata)).then(() => {
this.storageservice.get("Notifications").then((value) => { this.storageservice.get("Notifications").then((value) => {
console.log("notfication state", value,)
}); });
}); });
console.log("Delete notification last stata", this.notificationdata)
} }
@@ -33,7 +33,6 @@ export class SetRoomOwnerPage implements OnInit {
} }
ngOnInit() { ngOnInit() {
console.log(this.members);
} }
@@ -63,7 +62,6 @@ export class SetRoomOwnerPage implements OnInit {
let res:any = await this.wsChatMethodsService.addRoomOwner(this.roomId, user._id); let res:any = await this.wsChatMethodsService.addRoomOwner(this.roomId, user._id);
console.log(res);
if(res.error){ if(res.error){
if(res.error.error == 'error-user-already-owner'){ if(res.error.error == 'error-user-already-owner'){
@@ -40,7 +40,6 @@ export class ViewDocumentPage implements OnInit {
this.file.title = 'Sem Título' this.file.title = 'Sem Título'
} }
console.log(this.task)
} }
@@ -79,7 +78,7 @@ export class ViewDocumentPage implements OnInit {
} else if(res.data.component == 'openExpedientActionsModal') { } else if(res.data.component == 'openExpedientActionsModal') {
this.openExpedientActionsModal(res.data.taskAction) this.openExpedientActionsModal(res.data.taskAction)
} else { } else {
console.log('component not found') console.log('not found')
} }
} }
@@ -89,7 +89,6 @@ export class ViewEventPage implements OnInit {
JSON.parse(req).forEach(element => { JSON.parse(req).forEach(element => {
this.eventsService.editEvent(element, 2, 3).subscribe((res) => { this.eventsService.editEvent(element, 2, 3).subscribe((res) => {
this.storage.remove('eventEdit') this.storage.remove('eventEdit')
console.log('eventEdit synchnize', res)
}) })
}); });
}) })
@@ -97,7 +96,6 @@ export class ViewEventPage implements OnInit {
JSON.parse(req).forEach(element => { JSON.parse(req).forEach(element => {
this.eventsService.editEvent(element, 2, 3).subscribe((res) => { this.eventsService.editEvent(element, 2, 3).subscribe((res) => {
this.storage.remove('eventDelete') this.storage.remove('eventDelete')
console.log('eventEdit synchnize', res)
}) })
}); });
}) })
@@ -132,14 +130,11 @@ export class ViewEventPage implements OnInit {
this.eventsService.getEvent(this.eventId).subscribe(res => { this.eventsService.getEvent(this.eventId).subscribe(res => {
this.loadedEvent = res; this.loadedEvent = res;
this.addEventToDb(res); this.addEventToDb(res);
console.log('Loaded one event', res)
/* this.today = new Date(res.StartDate); /* this.today = new Date(res.StartDate);
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); */ this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); */
loader.remove() loader.remove()
}, (error) => { }, (error) => {
console.log('errorstatus ss',error.status)
if (error.status === 0) { if (error.status === 0) {
this.getFromDb(); this.getFromDb();
} else { } else {
@@ -190,7 +185,6 @@ export class ViewEventPage implements OnInit {
}); });
await modal.present(); await modal.present();
modal.onDidDismiss().then((res) => { modal.onDidDismiss().then((res) => {
console.log(res);
if (res) { if (res) {
setTimeout(() => { setTimeout(() => {
@@ -217,7 +211,6 @@ export class ViewEventPage implements OnInit {
}); });
await modal.present(); await modal.present();
modal.onDidDismiss().then((res) => { modal.onDidDismiss().then((res) => {
console.log(res);
if (res) { if (res) {
setTimeout(() => { setTimeout(() => {
@@ -231,7 +224,6 @@ export class ViewEventPage implements OnInit {
} }
async editEvent() { async editEvent() {
console.log(this.loadedEvent);
let classs; let classs;
if (window.innerWidth <= 800) { if (window.innerWidth <= 800) {
@@ -271,7 +263,6 @@ export class ViewEventPage implements OnInit {
const applicationId: any = this.loadedEvent.Attachments[this.dicIndex].ApplicationId const applicationId: any = this.loadedEvent.Attachments[this.dicIndex].ApplicationId
const selectedDoc = this.loadedEvent.Attachments[this.dicIndex] const selectedDoc = this.loadedEvent.Attachments[this.dicIndex]
console.log('selectedDoc', selectedDoc)
this.task = { this.task = {
serialNumber: '', serialNumber: '',
@@ -389,7 +380,6 @@ export class ViewEventPage implements OnInit {
const loader = this.toastService.loading(); const loader = this.toastService.loading();
this.sqliteservice.getEventById(this.eventId).then((event) => { this.sqliteservice.getEventById(this.eventId).then((event) => {
let arrayevent = []; let arrayevent = [];
console.log('EVENT ATTENDEES',event[0].Attendees)
let elemet = { let elemet = {
Attendees: (typeof JSON.parse(event[0].Attendees) === 'undefined') ? "" : JSON.parse(event[0].Attendees), Attendees: (typeof JSON.parse(event[0].Attendees) === 'undefined') ? "" : JSON.parse(event[0].Attendees),
Body: JSON.parse(event[0].Body) || "", Body: JSON.parse(event[0].Body) || "",
@@ -412,7 +402,6 @@ export class ViewEventPage implements OnInit {
} }
arrayevent.push(elemet); arrayevent.push(elemet);
this.loadedEvent = arrayevent[0]; this.loadedEvent = arrayevent[0];
console.log("Event ditails local,", elemet)
}) })
loader.remove() loader.remove()
} }
@@ -36,10 +36,8 @@ export class ViewMediaPage implements OnInit {
} }
ngOnInit() { ngOnInit() {
console.log(this.image)
this.base64Sanitize = this.sanitizer.bypassSecurityTrustResourceUrl(this.image); this.base64Sanitize = this.sanitizer.bypassSecurityTrustResourceUrl(this.image);
console.log(this.base64Sanitize)
} }
+24 -27
View File
@@ -300,7 +300,6 @@ export class AgendaPage implements OnInit {
// show information about the clicked event in timeline // show information about the clicked event in timeline
eventClicked(event: CalendarEvent): void { eventClicked(event: CalendarEvent): void {
/* console.log('Event clicked', event); */
//clear //clear
this.setIntervenient([]); this.setIntervenient([]);
@@ -370,7 +369,6 @@ export class AgendaPage implements OnInit {
} }
onTimeSelected = (ev: { selectedTime: Date, events: any[] }) => { onTimeSelected = (ev: { selectedTime: Date, events: any[] }) => {
// console.log('Selected time: ' + ev.selectedTime + ', hasEvents: ' + (ev.events !== undefined && ev.events.length !== 0));
this.eventSelectedDate2 = ev.selectedTime; this.eventSelectedDate2 = ev.selectedTime;
} }
@@ -410,7 +408,7 @@ export class AgendaPage implements OnInit {
// if (startTimeSamp < endTimeSamp && endDay == 29 && (endMinutes + endHours) == 0) { // if (startTimeSamp < endTimeSamp && endDay == 29 && (endMinutes + endHours) == 0) {
// // console.log(id, (endMinutes + endHours)) // //
// classs.push(`calendar-event-border`); // classs.push(`calendar-event-border`);
// } // }
@@ -521,7 +519,6 @@ export class AgendaPage implements OnInit {
this.eventService.getAllMdEvents(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59')).then( this.eventService.getAllMdEvents(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59')).then(
(response: any) => { (response: any) => {
// console.log('ALL MD EVENTS', response);
this.addEventToDB(response, "md"); this.addEventToDB(response, "md");
@@ -531,13 +528,11 @@ export class AgendaPage implements OnInit {
// loop // loop
this.CalendarStore.pushEvent(response, 'md'); this.CalendarStore.pushEvent(response, 'md');
// console.log('CALENDAR STORE', this.CalendarStore.eventSource)
this.listToPresent = this.CalendarStore.eventSource this.listToPresent = this.CalendarStore.eventSource
this.trasnformData(response, 'md'); this.trasnformData(response, 'md');
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate }) this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
// console.log('check list to present data', this.listToPresent);
this.myCal.update(); this.myCal.update();
this.myCal.loadEvents(); this.myCal.loadEvents();
@@ -566,7 +561,7 @@ export class AgendaPage implements OnInit {
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate }) this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
// console.log('check list to present data', this.listToPresent); //
this.myCal.update(); this.myCal.update();
this.myCal.loadEvents(); this.myCal.loadEvents();
@@ -584,7 +579,6 @@ export class AgendaPage implements OnInit {
else if (this.loggeduser.Profile == 'PR') { else if (this.loggeduser.Profile == 'PR') {
this.eventService.getAllPrEvents(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59')).then( this.eventService.getAllPrEvents(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59')).then(
(response: any) => { (response: any) => {
// console.log('ALL EVENT PR', response)
this.addEventToDB(response, "pr"); this.addEventToDB(response, "pr");
// clear the current month only // clear the current month only
@@ -598,7 +592,7 @@ export class AgendaPage implements OnInit {
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate }) this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
// console.log('check list to present data', this.listToPresent); //
this.myCal.update(); this.myCal.update();
this.myCal.loadEvents(); this.myCal.loadEvents();
@@ -619,7 +613,6 @@ export class AgendaPage implements OnInit {
this.eventService.getAllOwnEvents(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59')).then( this.eventService.getAllOwnEvents(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59')).then(
(response: any) => { (response: any) => {
// ('ALL MD EVENTS', response);
this.addEventToDB(response, "md"); this.addEventToDB(response, "md");
@@ -629,13 +622,13 @@ export class AgendaPage implements OnInit {
// loop // loop
this.CalendarStore.pushEvent(response, 'md'); this.CalendarStore.pushEvent(response, 'md');
// console.log('CALENDAR STORE', this.CalendarStore.eventSource)
this.listToPresent = this.CalendarStore.eventSource this.listToPresent = this.CalendarStore.eventSource
this.trasnformData(response, 'md'); this.trasnformData(response, 'md');
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate }) this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
// console.log('check list to present data', this.listToPresent); //
this.myCal.update(); this.myCal.update();
this.myCal.loadEvents(); this.myCal.loadEvents();
@@ -662,7 +655,7 @@ export class AgendaPage implements OnInit {
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate }) this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
// console.log('check list to present data', this.listToPresent); //
this.myCal.update(); this.myCal.update();
this.myCal.loadEvents(); this.myCal.loadEvents();
@@ -699,7 +692,7 @@ export class AgendaPage implements OnInit {
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate }) this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
// console.log('check list to present data', this.listToPresent); //
this.myCal.update(); this.myCal.update();
this.myCal.loadEvents(); this.myCal.loadEvents();
@@ -735,7 +728,7 @@ export class AgendaPage implements OnInit {
this.TimelinePRList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate }) this.TimelinePRList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
// console.log('check list to present data', this.listToPresent); //
this.myCal.update(); this.myCal.update();
this.myCal.loadEvents(); this.myCal.loadEvents();
@@ -781,7 +774,7 @@ export class AgendaPage implements OnInit {
this.TimelinePRList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate }) this.TimelinePRList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
// console.log('check list to present data', this.listToPresent); //
this.myCal.update(); this.myCal.update();
this.myCal.loadEvents(); this.myCal.loadEvents();
@@ -845,6 +838,8 @@ export class AgendaPage implements OnInit {
} }
} }
if(this.loggeduser.SharedCalendars.length != 0) { if(this.loggeduser.SharedCalendars.length != 0) {
@@ -863,6 +858,8 @@ export class AgendaPage implements OnInit {
this.TimelinePRList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate }) this.TimelinePRList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
//
this.myCal.update(); this.myCal.update();
this.myCal.loadEvents(); this.myCal.loadEvents();
@@ -896,7 +893,7 @@ export class AgendaPage implements OnInit {
} }
trasnformData(response, profile) { trasnformData(response, profile) {
// console.log('Transform ', response)
response.forEach(element => { response.forEach(element => {
let event = { let event = {
startTime: new Date(element.StartDate), startTime: new Date(element.StartDate),
@@ -910,14 +907,14 @@ export class AgendaPage implements OnInit {
this.array.push(event) this.array.push(event)
}); });
this.listToPresent = this.array; this.listToPresent = this.array;
// console.log('LIST TO PRESET', this.listToPresent)
} }
//Deve ser removido para ficar só um method transform //Deve ser removido para ficar só um method transform
trasnformDataDB(response) { trasnformDataDB(response) {
if(response) { if(response) {
// console.log('Transform ', response)
response.forEach(element => { response.forEach(element => {
let event = { let event = {
startTime: new Date(element.StartDate), startTime: new Date(element.StartDate),
@@ -931,7 +928,7 @@ export class AgendaPage implements OnInit {
this.array.push(event) this.array.push(event)
}); });
this.listToPresent = this.array; this.listToPresent = this.array;
// console.log('LIST TO PRESET', this.listToPresent)
} }
} }
@@ -957,7 +954,7 @@ export class AgendaPage implements OnInit {
}); });
this.storage.set('agendaResponse',responseArray).then(() => { this.storage.set('agendaResponse',responseArray).then(() => {
// console.log('Agenda data saved')
}) })
} else { } else {
if (response.length > 0) { if (response.length > 0) {
@@ -984,7 +981,7 @@ export class AgendaPage implements OnInit {
} }
getFromDB() { getFromDB() {
// console.log('ALL EVENTS FROM DB AGENDA OFFLINE')
if (this.platform.is('desktop') || this.platform.is('mobileweb')) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.get('agendaResponse').then((events) => { this.storage.get('agendaResponse').then((events) => {
this.trasnformDataDB(events) this.trasnformDataDB(events)
@@ -998,7 +995,7 @@ export class AgendaPage implements OnInit {
}) })
} else { } else {
this.sqliteservice.getAllEvents().then((events: any[]) => { this.sqliteservice.getAllEvents().then((events: any[]) => {
// console.log('ALL EVENTS FROM DB', events)
let eventArray = []; let eventArray = [];
this.trasnformDataDB(events) this.trasnformDataDB(events)
@@ -1128,7 +1125,7 @@ export class AgendaPage implements OnInit {
this.updateEventListBox() this.updateEventListBox()
} else { } else {
// console.log('not valid ' + a)
} }
@@ -1136,7 +1133,7 @@ export class AgendaPage implements OnInit {
changeMonth = (month) => { changeMonth = (month) => {
const a = this.calendar.currentDate; const a = this.calendar.currentDate;
// console.log(a)
const isInvalidDate = (dateString) => JSON.stringify(new Date(dateString)) === 'null'; const isInvalidDate = (dateString) => JSON.stringify(new Date(dateString)) === 'null';
@@ -1153,7 +1150,7 @@ export class AgendaPage implements OnInit {
this.updateEventListBox() this.updateEventListBox()
} else { } else {
// console.log('not valid ' + a)
} }
} }
@@ -1255,7 +1252,7 @@ export class AgendaPage implements OnInit {
async viewEventDetail(eventId: any) { async viewEventDetail(eventId: any) {
this.router.navigate(['/home/agenda', eventId, 'agenda']); this.router.navigate(['/home/agenda', eventId, 'agenda']);
/* console.log(this.profile); /*
const modal = await this.modalCtrl.create({ const modal = await this.modalCtrl.create({
component: ViewEventPage, component: ViewEventPage,
@@ -98,7 +98,7 @@ export class EditEventPage implements OnInit {
this.isEventEdited = false; this.isEventEdited = false;
/* this.postEvent.EventRecurrence = { Type:'-1', LastOccurrence:''}; */ /* this.postEvent.EventRecurrence = { Type:'-1', LastOccurrence:''}; */
this.postEvent = this.navParams.get('event'); this.postEvent = this.navParams.get('event');
// console.log(this.postEvent);
this.caller = this.navParams.get('caller'); this.caller = this.navParams.get('caller');
this.initCalendarName = this.postEvent.CalendarName; this.initCalendarName = this.postEvent.CalendarName;
@@ -159,21 +159,21 @@ export class EditEventPage implements OnInit {
} }
goBack() { goBack() {
// console.log(this.caller);
this.router.navigate(['/home',this.caller]); this.router.navigate(['/home',this.caller]);
} }
getRecurrenceTypes() { getRecurrenceTypes() {
this.eventsService.getRecurrenceTypes().subscribe(res=>{ this.eventsService.getRecurrenceTypes().subscribe(res=>{
// console.log(res);
this.recurringTypes = res; this.recurringTypes = res;
}); });
} }
onSelectedRecurringChanged(ev?:any) { onSelectedRecurringChanged(ev?:any) {
// console.log(ev);
if(ev.length > 1){ if(ev.length > 1){
// console.log(ev.filter(data => data != '-1'));
this.selectedRecurringType = ev.filter(data => data != '-1'); this.selectedRecurringType = ev.filter(data => data != '-1');
} }
if(ev.length == 0){ if(ev.length == 0){
@@ -219,7 +219,7 @@ export class EditEventPage implements OnInit {
openInicio() { openInicio() {
let input: any = document.querySelector('#new-inicio') let input: any = document.querySelector('#new-inicio')
if(input) { if(input) {
// console.log(input)
input.click() input.click()
} }
} }
@@ -418,7 +418,7 @@ export class EditEventPage implements OnInit {
getAttachments(eventId: string){ getAttachments(eventId: string){
this.attachmentsService.getAttachmentsById(eventId).subscribe(res=>{ this.attachmentsService.getAttachmentsById(eventId).subscribe(res=>{
this.loadedEventAttachments = res; this.loadedEventAttachments = res;
// console.log('res', res);
}); });
} }
@@ -465,7 +465,7 @@ export class EditEventPage implements OnInit {
SerialNumber: '', SerialNumber: '',
} }
// console.log( this.loadedEventAttachments)
this.loadedEventAttachments.push(ApplicationIdDocumentToSave) this.loadedEventAttachments.push(ApplicationIdDocumentToSave)
} }
@@ -49,7 +49,7 @@ export class EventActionsPopoverPage implements OnInit {
async approveTask() { async approveTask() {
let body = { "serialNumber": this.serialNumber, "action": "Aprovar" } let body = { "serialNumber": this.serialNumber, "action": "Aprovar" }
console.log(body);
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {
@@ -82,7 +82,7 @@ export class EventActionsPopoverPage implements OnInit {
modal.onDidDismiss() modal.onDidDismiss()
.then( async (res) => { .then( async (res) => {
console.log(res.data);
if(res.data !== ''){ if(res.data !== ''){
let body = { "serialNumber": this.serialNumber, let body = { "serialNumber": this.serialNumber,
@@ -91,7 +91,7 @@ export class EventActionsPopoverPage implements OnInit {
"ReviewUserComment": res.data, "ReviewUserComment": res.data,
} }
} }
console.log(body);
const loader = this.toastService.loading() const loader = this.toastService.loading()
@@ -114,7 +114,7 @@ export class EventActionsPopoverPage implements OnInit {
async rejeitar(){ async rejeitar(){
let body = { "serialNumber": this.serialNumber, "action": "Rejeitar" } let body = { "serialNumber": this.serialNumber, "action": "Rejeitar" }
console.log(body);
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {
@@ -124,8 +124,8 @@ export class NewEventPage implements OnInit {
this.CalendarName = this.loggeduser.Profile; this.CalendarName = this.loggeduser.Profile;
this.selectedRecurringType = "-1"; this.selectedRecurringType = "-1";
console.log(this.postEvent);
console.log(this.selectedSegment);
this.getRecurrenceTypes(); this.getRecurrenceTypes();
@@ -181,7 +181,7 @@ export class NewEventPage implements OnInit {
} }
}; };
console.log(this.postEvent);
} }
@@ -193,15 +193,15 @@ export class NewEventPage implements OnInit {
getRecurrenceTypes() { getRecurrenceTypes() {
this.eventService.getRecurrenceTypes().subscribe(res=>{ this.eventService.getRecurrenceTypes().subscribe(res=>{
console.log(res);
this.recurringTypes = res; this.recurringTypes = res;
}); });
} }
onSelectedRecurringChanged(ev:any){ onSelectedRecurringChanged(ev:any){
console.log(ev);
if(ev.length > 1){ if(ev.length > 1){
console.log(ev.filter(data => data != '-1'));
this.selectedRecurringType = ev.filter(data => data != '-1'); this.selectedRecurringType = ev.filter(data => data != '-1');
} }
if(ev.length == 0){ if(ev.length == 0){
@@ -255,7 +255,7 @@ export class NewEventPage implements OnInit {
openInicio() { openInicio() {
let input: any = document.querySelector('#new-inicio') let input: any = document.querySelector('#new-inicio')
if(input) { if(input) {
console.log(input)
input.click() input.click()
} }
} }
@@ -300,16 +300,16 @@ export class NewEventPage implements OnInit {
if(this.loggeduser.Profile == 'MDGPR') { if(this.loggeduser.Profile == 'MDGPR') {
console.log(this.loggeduser.Profile);
console.log(this.postEvent);
eventId = await this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).toPromise(); eventId = await this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).toPromise();
console.log(eventId);
} }
else if(this.loggeduser.Profile == 'PR') { else if(this.loggeduser.Profile == 'PR') {
console.log(this.loggeduser.Profile);
eventId = await this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).toPromise(); eventId = await this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).toPromise();
} else { } else {
@@ -333,7 +333,7 @@ export class NewEventPage implements OnInit {
try { try {
await this.attachmentsService.setEventAttachmentById(attachments).toPromise(); await this.attachmentsService.setEventAttachmentById(attachments).toPromise();
} catch(error) { } catch(error) {
console.log('document not save')
} }
}); });
@@ -100,7 +100,7 @@ export class ViewEventPage implements OnInit {
JSON.parse(req).forEach(element => { JSON.parse(req).forEach(element => {
this.eventsService.editEvent(element, 2, 3).subscribe((res) => { this.eventsService.editEvent(element, 2, 3).subscribe((res) => {
this.storage.remove('eventEdit') this.storage.remove('eventEdit')
console.log('eventEdit synchnize', res)
}) })
}); });
}) })
@@ -108,7 +108,7 @@ export class ViewEventPage implements OnInit {
JSON.parse(req).forEach(element => { JSON.parse(req).forEach(element => {
this.eventsService.editEvent(element, 2, 3).subscribe((res) => { this.eventsService.editEvent(element, 2, 3).subscribe((res) => {
this.storage.remove('eventDelete') this.storage.remove('eventDelete')
console.log('eventEdit synchnize', res)
}) })
}); });
}) })
@@ -175,13 +175,13 @@ export class ViewEventPage implements OnInit {
this.eventsService.getEvent(this.eventId).subscribe(res => { this.eventsService.getEvent(this.eventId).subscribe(res => {
this.loadedEvent = res; this.loadedEvent = res;
this.addEventToDb(res); this.addEventToDb(res);
console.log('Loaded one event', res)
/* this.today = new Date(res.StartDate); /* this.today = new Date(res.StartDate);
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); */ this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); */
loader.remove() loader.remove()
}, (error) => { }, (error) => {
console.log('errorstatus ss',error.status)
if (error.status === 0) { if (error.status === 0) {
this.getFromDb(); this.getFromDb();
@@ -197,19 +197,19 @@ export class ViewEventPage implements OnInit {
const event = this.CalendarService.eventSource.find((ele) => ele.id == this.eventId) const event = this.CalendarService.eventSource.find((ele) => ele.id == this.eventId)
// console.log('View event details', event) //
if(event?.CalendarId) { if(event?.CalendarId) {
this.eventsService.genericGetEvent(this.eventId, event.CalendarId).subscribe(res => { this.eventsService.genericGetEvent(this.eventId, event.CalendarId).subscribe(res => {
this.loadedEvent = res; this.loadedEvent = res;
this.addEventToDb(res); this.addEventToDb(res);
console.log('Loaded one event', res)
/* this.today = new Date(res.StartDate); /* this.today = new Date(res.StartDate);
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); */ this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); */
loader.remove() loader.remove()
}, (error) => { }, (error) => {
console.log('errorstatus ss',error.status)
if (error.status === 0) { if (error.status === 0) {
this.getFromDb(); this.getFromDb();
@@ -288,7 +288,7 @@ export class ViewEventPage implements OnInit {
}); });
await modal.present(); await modal.present();
modal.onDidDismiss().then((res) => { modal.onDidDismiss().then((res) => {
console.log(res);
if (res) { if (res) {
setTimeout(() => { setTimeout(() => {
@@ -315,7 +315,7 @@ export class ViewEventPage implements OnInit {
}); });
await modal.present(); await modal.present();
modal.onDidDismiss().then((res) => { modal.onDidDismiss().then((res) => {
console.log(res);
if (res) { if (res) {
setTimeout(() => { setTimeout(() => {
@@ -329,7 +329,7 @@ export class ViewEventPage implements OnInit {
} }
async editEvent() { async editEvent() {
console.log(this.loadedEvent);
let classs; let classs;
if (window.innerWidth <= 800) { if (window.innerWidth <= 800) {
@@ -348,7 +348,7 @@ export class ViewEventPage implements OnInit {
}); });
await modal.present(); await modal.present();
modal.onDidDismiss().then((res) => { modal.onDidDismiss().then((res) => {
console.log(res);
if (res) { if (res) {
setTimeout(() => { setTimeout(() => {
@@ -370,7 +370,7 @@ export class ViewEventPage implements OnInit {
const applicationId: any = this.loadedEvent.Attachments[this.dicIndex].ApplicationId const applicationId: any = this.loadedEvent.Attachments[this.dicIndex].ApplicationId
const selectedDoc = this.loadedEvent.Attachments[this.dicIndex] const selectedDoc = this.loadedEvent.Attachments[this.dicIndex]
console.log('selectedDoc', selectedDoc)
this.task = { this.task = {
serialNumber: '', serialNumber: '',
@@ -458,7 +458,7 @@ export class ViewEventPage implements OnInit {
addEventToDb(data) { addEventToDb(data) {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.ionicStorage.set('eventDetails', data).then(() => { this.ionicStorage.set('eventDetails', data).then(() => {
console.log('Details event saved')
}) })
} else { } else {
let event = { let event = {
@@ -496,7 +496,7 @@ export class ViewEventPage implements OnInit {
} else { } else {
this.sqliteservice.getEventById(this.eventId).then((event) => { this.sqliteservice.getEventById(this.eventId).then((event) => {
let arrayevent = []; let arrayevent = [];
console.log('EVENT ATTENDEES',event[0].Attendees)
let elemet = { let elemet = {
Attendees: (typeof JSON.parse(event[0].Attendees) === 'undefined') ? "" : JSON.parse(event[0].Attendees), Attendees: (typeof JSON.parse(event[0].Attendees) === 'undefined') ? "" : JSON.parse(event[0].Attendees),
Body: JSON.parse(event[0].Body) || "", Body: JSON.parse(event[0].Body) || "",
@@ -519,7 +519,7 @@ export class ViewEventPage implements OnInit {
} }
arrayevent.push(elemet); arrayevent.push(elemet);
this.loadedEvent = arrayevent[0]; this.loadedEvent = arrayevent[0];
console.log("Event ditails local,", elemet)
}) })
} }
+39 -39
View File
@@ -137,7 +137,7 @@ export class ChatPage implements OnInit {
this.authService.userData$.subscribe((res: any) => { this.authService.userData$.subscribe((res: any) => {
this.loggedUser = res; this.loggedUser = res;
console.log(this.loggedUser);
}); });
this.hideRefreshButton(); this.hideRefreshButton();
@@ -168,7 +168,7 @@ export class ChatPage implements OnInit {
ngOnDestroy() { ngOnDestroy() {
this.setStatus('offline'); this.setStatus('offline');
this.dataService.set("newGroup", false); this.dataService.set("newGroup", false);
console.log('On Destroy')
} }
setStatus(status: string) { setStatus(status: string) {
@@ -177,7 +177,7 @@ export class ChatPage implements OnInit {
status: status, status: status,
} }
this.chatService.setUserStatus(body).subscribe(res => { this.chatService.setUserStatus(body).subscribe(res => {
console.log(res);
}) })
} }
@@ -210,7 +210,7 @@ export class ChatPage implements OnInit {
this.showGroupContacts = false; this.showGroupContacts = false;
this.showNewEvent = false; this.showNewEvent = false;
this.showAttendees = false; this.showAttendees = false;
console.log('All components closed!');
} }
showEmptyContainer() { showEmptyContainer() {
@@ -241,7 +241,7 @@ export class ChatPage implements OnInit {
} }
} }
openContactsPage() { openContactsPage() {
console.log('OK');
this.idSelected = ''; this.idSelected = '';
this.closeAllDesktopComponents(); this.closeAllDesktopComponents();
@@ -249,7 +249,7 @@ export class ChatPage implements OnInit {
this.selectContact(); this.selectContact();
} }
else { else {
console.log('here');
this.showContacts = true; this.showContacts = true;
} }
} }
@@ -283,7 +283,7 @@ export class ChatPage implements OnInit {
this.closeAllDesktopComponents(); this.closeAllDesktopComponents();
this.showEmptyComponent = false; this.showEmptyComponent = false;
this.roomId = rid; this.roomId = rid;
console.log(this.roomId);
this.showGroupMessages = true; this.showGroupMessages = true;
} }
} }
@@ -299,7 +299,7 @@ export class ChatPage implements OnInit {
this.groupRoomId = data.roomId; this.groupRoomId = data.roomId;
this.closeAllDesktopComponents(); this.closeAllDesktopComponents();
if (window.innerWidth < 701) { if (window.innerWidth < 701) {
console.log('Mobile');
} }
else { else {
this.showNewEvent = true; this.showNewEvent = true;
@@ -355,7 +355,7 @@ export class ChatPage implements OnInit {
let params = new HttpParams(); let params = new HttpParams();
params = params.set("types", "c"); params = params.set("types", "c");
this.chatService.customsRooms(params).subscribe(res => { this.chatService.customsRooms(params).subscribe(res => {
//console.log(res); //
}); });
} }
@@ -369,9 +369,9 @@ export class ChatPage implements OnInit {
var dateB = new Date(b._updatedAt).getTime(); var dateB = new Date(b._updatedAt).getTime();
return dateB - dateA; return dateB - dateA;
}); });
//console.log('DIRECTMESSAGE FROM DB', this.userDirectMessages); //
//console.log('ROOMS FROM DB', rooms) //
}) })
this.storageservice.get('chatusers').then((users) => { this.storageservice.get('chatusers').then((users) => {
@@ -379,7 +379,7 @@ export class ChatPage implements OnInit {
}) })
} else { } else {
this.sqlservice.getAllChatRoom().then((rooms: any) => { this.sqlservice.getAllChatRoom().then((rooms: any) => {
//console.log('ROOMS FROM DB', rooms) //
let roomsArray = []; let roomsArray = [];
rooms.forEach(element => { rooms.forEach(element => {
let roomListDB = { let roomListDB = {
@@ -399,16 +399,16 @@ export class ChatPage implements OnInit {
var dateB = new Date(b._updatedAt).getTime(); var dateB = new Date(b._updatedAt).getTime();
return dateB - dateA; return dateB - dateA;
}); });
//console.log('DIRECTMESSAGE FROM DB', this.userDirectMessages); //
//console.log('ROOMS FROM DB', rooms) //
}) })
this.sqlservice.getAllChatUsers().then((userslist: any) => { this.sqlservice.getAllChatUsers().then((userslist: any) => {
//console.log('USERS FOM DB 1', userslist) //
let chatusersArray = []; let chatusersArray = [];
userslist.forEach(element => { userslist.forEach(element => {
console.log('USERS FOM DB 2', element)
let userListDB = { let userListDB = {
_id: element.Id, _id: element.Id,
name: element.Name, name: element.Name,
@@ -436,7 +436,7 @@ export class ChatPage implements OnInit {
_updatedAt: element._updatedAt _updatedAt: element._updatedAt
} }
//console.log(' Web TRANSFORM ROOM LIST', roomList) //
roomsArray.push(roomList) roomsArray.push(roomList)
}); });
@@ -453,7 +453,7 @@ export class ChatPage implements OnInit {
updatedat: element._updatedAt updatedat: element._updatedAt
} }
//console.log('TRANSFORM ROOM LIST', roomList) //
this.sqlservice.addChatListRoom(roomList); this.sqlservice.addChatListRoom(roomList);
}); });
} }
@@ -463,26 +463,26 @@ export class ChatPage implements OnInit {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
let usersArray = []; let usersArray = [];
users.forEach(element => { users.forEach(element => {
//console.log('TRANSFORM USER CHAT 1', element) //
let chatusers = { let chatusers = {
_id: element._id, _id: element._id,
name: element.name, name: element.name,
username: element.username username: element.username
} }
//console.log('TRANSFORM USER CHAT 2', chatusers) //
usersArray.push(chatusers); usersArray.push(chatusers);
}); });
await this.storageservice.remove('chatusers'); await this.storageservice.remove('chatusers');
await this.storageservice.store('chatusers',usersArray); await this.storageservice.store('chatusers',usersArray);
} else { } else {
users.forEach(element => { users.forEach(element => {
//console.log('TRANSFORM USER CHAT 1', element) //
let chatusers = { let chatusers = {
id: element._id, id: element._id,
name: element.name, name: element.name,
username: element.username username: element.username
} }
//console.log('TRANSFORM USER CHAT 2', chatusers) //
this.sqlservice.addChatListUsers(chatusers); this.sqlservice.addChatListUsers(chatusers);
}); });
} }
@@ -499,12 +499,12 @@ export class ChatPage implements OnInit {
async getChatMembers() { async getChatMembers() {
//return await this.chatService.getMembers(roomId).toPromise(); //return await this.chatService.getMembers(roomId).toPromise();
this.chatService.getAllUsers().subscribe(res => { this.chatService.getAllUsers().subscribe(res => {
//console.log('chatusers', res); //
this.transformDataUserList(res['users']) this.transformDataUserList(res['users'])
/* if (this.platform.is('desktop') || this.platform.is('mobileweb')) { /* if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.dmUsers = res['users'].filter(data => data.username != this.loggedUserChat.me.username); this.dmUsers = res['users'].filter(data => data.username != this.loggedUserChat.me.username);
//console.log(this.dmUsers); //
}*/ }*/
}); });
@@ -520,7 +520,7 @@ export class ChatPage implements OnInit {
return dateB - dateA; return dateB - dateA;
}); });
console.log('GROUPS FROM DB', k)
this.allGroups = rooms.sort((a, b) => { this.allGroups = rooms.sort((a, b) => {
@@ -530,7 +530,7 @@ export class ChatPage implements OnInit {
}); });
//console.log('GROUPS FROM DB', this.allGroups) //
}) })
this.storageservice.get('chatusers').then((users) => { this.storageservice.get('chatusers').then((users) => {
@@ -559,15 +559,15 @@ export class ChatPage implements OnInit {
var dateB = new Date(b._updatedAt).getTime(); var dateB = new Date(b._updatedAt).getTime();
return dateB - dateA; return dateB - dateA;
}); });
//console.log('Group FROM DB', this.allGroups); //
}) })
/* this.sqlservice.getAllChatUsers().then((userslist: any) => { /* this.sqlservice.getAllChatUsers().then((userslist: any) => {
console.log('USERS FOM DB 1', userslist)
let chatusersArray = []; let chatusersArray = [];
userslist.forEach(element => { userslist.forEach(element => {
console.log('USERS FOM DB 2', element)
let userListDB = { let userListDB = {
_id: element.Id, _id: element.Id,
name: element.Name, name: element.Name,
@@ -598,7 +598,7 @@ export class ChatPage implements OnInit {
_updatedAt: element._updatedAt _updatedAt: element._updatedAt
} }
console.log(' Web TRANSFORM ROOM LIST', roomList)
groupsArray.push(roomList) groupsArray.push(roomList)
}); });
@@ -617,7 +617,7 @@ export class ChatPage implements OnInit {
updatedat: element._updatedAt updatedat: element._updatedAt
} }
console.log('TRANSFORM ROOM LIST', roomList)
this.sqlservice.addChatListRoom(roomList); this.sqlservice.addChatListRoom(roomList);
}); });
} }
@@ -626,7 +626,7 @@ export class ChatPage implements OnInit {
async getGroups(event?) { async getGroups(event?) {
this.result = this.chatService.getAllPrivateGroups().subscribe(async (res: any) => { this.result = this.chatService.getAllPrivateGroups().subscribe(async (res: any) => {
//console.log(res); //
this.showLoader = false; this.showLoader = false;
if (res.groups != 200) { if (res.groups != 200) {
@@ -634,7 +634,7 @@ export class ChatPage implements OnInit {
this.getGroupsDB(); this.getGroupsDB();
this.privateGroups = res.groups; this.privateGroups = res.groups;
console.log('Chat list group' , res);
/* this.result = this.chatService.getAllUserChannels().subscribe((res:any)=>{ /* this.result = this.chatService.getAllUserChannels().subscribe((res:any)=>{
this.publicGroups = res.channels; */ this.publicGroups = res.channels; */
//let all = this.privateGroups.concat(this.publicGroups); //let all = this.privateGroups.concat(this.publicGroups);
@@ -643,10 +643,10 @@ export class ChatPage implements OnInit {
var dateB = new Date(b._updatedAt).getTime(); var dateB = new Date(b._updatedAt).getTime();
return dateB - dateA; return dateB - dateA;
}); */ }); */
//console.log(this.allGroups); //
/* }); */ /* }); */
if (this.route.url != "/home/chat") { if (this.route.url != "/home/chat") {
//console.log("Timer message stop") //
} }
else { else {
//Check if modal is opened //Check if modal is opened
@@ -699,7 +699,7 @@ export class ChatPage implements OnInit {
}); });
await modal.present(); await modal.present();
modal.onDidDismiss().then((res) => { modal.onDidDismiss().then((res) => {
console.log(res.data);
this.modalController.dismiss(res.data); this.modalController.dismiss(res.data);
}); });
} }
@@ -707,7 +707,7 @@ export class ChatPage implements OnInit {
async openMessagesModal(roomId: any) { async openMessagesModal(roomId: any) {
this.closeAllDesktopComponents(); this.closeAllDesktopComponents();
//console.log(roomId); //
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: MessagesPage, component: MessagesPage,
@@ -722,7 +722,7 @@ export class ChatPage implements OnInit {
async openGroupMessagesModal(roomId: any) { async openGroupMessagesModal(roomId: any) {
console.log(roomId);
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: GroupMessagesPage, component: GroupMessagesPage,
@@ -737,7 +737,7 @@ export class ChatPage implements OnInit {
// this.crop.crop('path/to/image.jpg', {quality: 75}) // this.crop.crop('path/to/image.jpg', {quality: 75})
// .then( // .then(
// newImage => console.log('new image path is: ' + newImage), // newImage =>
// error => console.error('Error cropping image', error) // error => console.error('Error cropping image', error)
// ); // );
@@ -34,7 +34,7 @@ export class EditGroupPage implements OnInit {
getRoomInfo(){ getRoomInfo(){
this.chatService.getRoomInfo(this.roomId).subscribe(room=>{ this.chatService.getRoomInfo(this.roomId).subscribe(room=>{
this.room = room['room']; this.room = room['room'];
console.log(this.room);
this.groupName = this.room.name.split('-').join(' '); this.groupName = this.room.name.split('-').join(' ');
}); });
} }
@@ -55,7 +55,7 @@ export class EditGroupPage implements OnInit {
}); });
} }
else{ else{
console.log("Invalid name!");
} }
} }
_ionChange(event){ _ionChange(event){
@@ -72,13 +72,13 @@ export class EditGroupPage implements OnInit {
text: 'Ok', text: 'Ok',
cssClass: 'btn-cancel', cssClass: 'btn-cancel',
handler:(value:any)=>{ handler:(value:any)=>{
console.log('button done pressed');
this.selectedDuration = [ this.selectedDuration = [
value.days.value, value.days.value,
value.hours.value, value.hours.value,
value.minutes.value, value.minutes.value,
] ]
console.log(this.selectedDuration);
if(value.days.value != null && value.hours.value != null && value.minutes.value != null){ if(value.days.value != null && value.hours.value != null && value.minutes.value != null){
if(value.days.value > 0){ if(value.days.value > 0){
if(value.days.value == 1){ if(value.days.value == 1){
@@ -58,8 +58,8 @@ export class GroupContactsPage implements OnInit {
ngOnInit() { ngOnInit() {
this.loadUsers(); this.loadUsers();
this.getMembers(); this.getMembers();
console.log(this.groupName);
console.log(this.isGroupCreated);
} }
loadUsers(){ loadUsers(){
@@ -82,7 +82,7 @@ export class GroupContactsPage implements OnInit {
} }
return 0; return 0;
}); });
console.log(this.users);
this.showLoader = false; this.showLoader = false;
}); });
@@ -124,16 +124,16 @@ export class GroupContactsPage implements OnInit {
"roomId": this.room._id, "roomId": this.room._id,
"userId": data._id, "userId": data._id,
} }
console.log(body);
if(this.room.t == "p"){ if(this.room.t == "p"){
this.chatService.removeGroupMember(body).subscribe(res=>{ this.chatService.removeGroupMember(body).subscribe(res=>{
console.log(res);
this.getMembers(); this.getMembers();
}); });
} }
else if(this.room.t == "c"){ else if(this.room.t == "c"){
this.chatService.removeChannelMember(body).subscribe(res=>{ this.chatService.removeChannelMember(body).subscribe(res=>{
console.log(res);
this.getMembers(); this.getMembers();
}); });
} }
@@ -154,7 +154,7 @@ export class GroupContactsPage implements OnInit {
this.textSearch = event.detail.value; this.textSearch = event.detail.value;
} }
clicked(){ clicked(){
console.log('clicked');
} }
selectedContact(user:any){ selectedContact(user:any){
@@ -164,11 +164,11 @@ export class GroupContactsPage implements OnInit {
} }
addContacts(room:any){ addContacts(room:any){
console.log(room);
this.selectedUserList = this.users.filter(function(contact) { this.selectedUserList = this.users.filter(function(contact) {
return contact.isChecked == true; return contact.isChecked == true;
}); });
console.log( this.selectedUserList);
this.selectedUserList.forEach(user=>{ this.selectedUserList.forEach(user=>{
let body ={ let body ={
"roomId":room._id, "roomId":room._id,
@@ -176,7 +176,7 @@ export class GroupContactsPage implements OnInit {
} }
this.chatService.addUserToGroup(body).subscribe(res=>{ this.chatService.addUserToGroup(body).subscribe(res=>{
console.log(res['success']);
}); });
}); });
} }
@@ -191,7 +191,7 @@ export class GroupContactsPage implements OnInit {
async openGroupMessages(roomId:any){ async openGroupMessages(roomId:any){
this.close(); this.close();
console.log(roomId);
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: GroupMessagesPage, component: GroupMessagesPage,
componentProps: { componentProps: {
@@ -132,7 +132,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
} }
ngOnInit() { ngOnInit() {
console.log(this.roomId);
this.loggedUser = this.loggedUserChat; this.loggedUser = this.loggedUserChat;
this.getRoomInfo(); this.getRoomInfo();
this.scrollToBottom(); this.scrollToBottom();
@@ -142,7 +142,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.getRoomMessageDB(this.roomId); this.getRoomMessageDB(this.roomId);
this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => { this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => {
console.log('MEMBER', value)
}) })
VoiceRecorder.requestAudioRecordingPermission(); VoiceRecorder.requestAudioRecordingPermission();
//this.loadFiles(); //this.loadFiles();
@@ -154,7 +154,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
status: status, status: status,
} }
// this.chatService.setUserStatus(body).subscribe(res => { // this.chatService.setUserStatus(body).subscribe(res => {
// console.log(res); //
// }) // })
} }
@@ -221,19 +221,19 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
path: fileName, path: fileName,
directory: Directory.Data directory: Directory.Data
}) })
//console.log(audioFile); //
const base64sound = audioFile.data; const base64sound = audioFile.data;
//Converting base64 to blob //Converting base64 to blob
const base64 = await fetch(base64sound); const base64 = await fetch(base64sound);
//console.log(base64); //
const base64Response = await fetch(`data:audio/ogg;base64,${base64sound}`); const base64Response = await fetch(`data:audio/ogg;base64,${base64sound}`);
//console.log(base64Response); //
this.audioRecorded = base64Response.url; this.audioRecorded = base64Response.url;
console.log(this.audioRecorded);
} }
@@ -261,13 +261,13 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
stopRecording() { stopRecording() {
this.deleteRecording(); this.deleteRecording();
this.allowTyping = false; this.allowTyping = false;
console.log('Stop');
if (!this.recording) { if (!this.recording) {
return; return;
} }
this.recording = false; this.recording = false;
VoiceRecorder.stopRecording().then(async (result: RecordingData) => { VoiceRecorder.stopRecording().then(async (result: RecordingData) => {
console.log('==================================', result);
this.recording = false; this.recording = false;
if (result.value && result.value.recordDataBase64) { if (result.value && result.value.recordDataBase64) {
@@ -277,7 +277,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
//Save file //Save file
await this.storage.set('fileName', fileName) await this.storage.set('fileName', fileName)
this.storage.set('recordData', result).then(() => { this.storage.set('recordData', result).then(() => {
console.log('Audio recorded saved', result);
setTimeout(async () => { setTimeout(async () => {
this.loadFiles(); this.loadFiles();
@@ -337,7 +337,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}); });
await modal.present(); await modal.present();
modal.onDidDismiss().then((res) => { modal.onDidDismiss().then((res) => {
console.log(res);
}); });
} }
@@ -375,10 +375,10 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
async getChatMembers() { async getChatMembers() {
this.chatService.getAllUsers().subscribe(res => { this.chatService.getAllUsers().subscribe(res => {
console.log(res);
this.allUsers = res['users'].filter(data => data.username != SessionStore.user.UserName); this.allUsers = res['users'].filter(data => data.username != SessionStore.user.UserName);
console.log(this.allUsers);
}); });
} }
@@ -402,7 +402,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
//If group is private call getGroupMembers //If group is private call getGroupMembers
if (this.room.t === 'p') { if (this.room.t === 'p') {
this.chatService.getGroupMembers(this.roomId).subscribe(res => { this.chatService.getGroupMembers(this.roomId).subscribe(res => {
console.log(res);
this.members = res['members']; this.members = res['members'];
this.showLoader = false; this.showLoader = false;
}); });
@@ -410,7 +410,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
//Otherwise call getChannelMembers for públic groups //Otherwise call getChannelMembers for públic groups
else { else {
this.chatService.getChannelMembers(this.roomId).subscribe(res => { this.chatService.getChannelMembers(this.roomId).subscribe(res => {
console.log(res);
this.members = res['members']; this.members = res['members'];
this.showLoader = false; this.showLoader = false;
}); });
@@ -475,7 +475,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
//Converting base64 to blob //Converting base64 to blob
const encodedData = btoa(this.audioRecorded); const encodedData = btoa(this.audioRecorded);
const blob = this.base64toBlob(encodedData, recordData.value.mimeType) const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
console.log(blob)
const formData = new FormData(); const formData = new FormData();
formData.append("blobFile", blob); formData.append("blobFile", blob);
@@ -510,11 +510,11 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
await modal.present(); await modal.present();
modal.onDidDismiss().then(res => { modal.onDidDismiss().then(res => {
if (res.data == 'leave') { if (res.data == 'leave') {
console.log('saiu do grupo');
//this.wsChatMethodsService.subscribeToRoomUpdate(this.roomId, this.room); //this.wsChatMethodsService.subscribeToRoomUpdate(this.roomId, this.room);
} }
else if (res.data == 'cancel') { else if (res.data == 'cancel') {
console.log('cancel');
} }
else if (res.data == 'edit') { else if (res.data == 'edit') {
this.editGroup(this.roomId); this.editGroup(this.roomId);
@@ -593,7 +593,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
IsRequired: "true", IsRequired: "true",
} }
}); });
console.log(this.attendees);
this.popoverController.dismiss(); this.popoverController.dismiss();
if (window.innerWidth <= 1024) { if (window.innerWidth <= 1024) {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
@@ -700,16 +700,16 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
const file: any = await this.fileService.getFileFromDevice(types); const file: any = await this.fileService.getFileFromDevice(types);
console.log('Add file', JSON.stringify(await this.getBase64(file)))
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") { if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
const encodedData = btoa(JSON.stringify(await this.getBase64(file))); const encodedData = btoa(JSON.stringify(await this.getBase64(file)));
const blob = this.base64toBlob(encodedData, file.type) const blob = this.base64toBlob(encodedData, file.type)
console.log('Add Blob file', blob)
const formData = new FormData(); const formData = new FormData();
formData.append('blobFile', blob); formData.append('blobFile', blob);
console.log(formData)
this.wsChatMethodsService.getGroupRoom(roomId).send({ this.wsChatMethodsService.getGroupRoom(roomId).send({
file: { file: {
@@ -726,7 +726,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}); });
} else { } else {
console.log('File type invalid')
} }
} }
@@ -745,14 +745,14 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
resolve(reader.result) resolve(reader.result)
}; };
reader.onerror = function (error) { reader.onerror = function (error) {
console.log('Error: ', error);
}; };
}); });
} }
async openChatOptions(ev?: any) { async openChatOptions(ev?: any) {
console.log(this.members);
const roomId = this.roomId; const roomId = this.roomId;
const popover = await this.popoverController.create({ const popover = await this.popoverController.create({
@@ -768,7 +768,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}); });
await popover.present(); await popover.present();
await popover.onDidDismiss().then(async (res) => { await popover.onDidDismiss().then(async (res) => {
console.log(res['data']);
if (res['data'] == 'meeting') { if (res['data'] == 'meeting') {
this.bookMeeting(); this.bookMeeting();
} }
@@ -790,7 +790,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
} }
async addContacts() { async addContacts() {
console.log(this.members);
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: GroupContactsPage, component: GroupContactsPage,
@@ -821,7 +821,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}); });
await modal.present(); await modal.present();
modal.onDidDismiss().then((res) => { modal.onDidDismiss().then((res) => {
console.log(res.data);
this.getRoomInfo(); this.getRoomInfo();
//this.modalController.dismiss(res.data); //this.modalController.dismiss(res.data);
}); });
@@ -833,18 +833,18 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
buttons: [{ buttons: [{
text: 'Sair do grupo', text: 'Sair do grupo',
handler: () => { handler: () => {
console.log('Delete clicked');
} }
}, { }, {
text: 'Alterar nome do grupo1', text: 'Alterar nome do grupo1',
handler: () => { handler: () => {
console.log('Alterar nome do grupo');
this.openChangeGroupName() this.openChangeGroupName()
} }
}, { }, {
text: 'Apagar o grupo', text: 'Apagar o grupo',
handler: () => { handler: () => {
console.log('Play clicked');
} }
}, },
] ]
@@ -857,11 +857,11 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
} else { } else {
this.sqlservice.getAllChatMSG(roomId).then((msg: any) => { this.sqlservice.getAllChatMSG(roomId).then((msg: any) => {
console.log('ALL MSG DBBB', msg)
let chatmsgArray = []; let chatmsgArray = [];
let array = [] let array = []
msg.forEach(element => { msg.forEach(element => {
console.log('CHANNEL ELEMENT', element.channels)
let msgChat = { let msgChat = {
_id: element.Id, _id: element.Id,
@@ -881,7 +881,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
}); });
// this.messages = chatmsgArray; // this.messages = chatmsgArray;
console.log('GROUP CHAT MSG FROM DB', chatmsgArray)
}) })
} }
} }
@@ -939,18 +939,18 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
//this.loadMessages() //this.loadMessages()
let msgOnly = res['messages'].filter(data => data.t != 'au'); let msgOnly = res['messages'].filter(data => data.t != 'au');
//this.messages = msgOnly.reverse(); //this.messages = msgOnly.reverse();
// console.log('MOBILE MSG ROCKET',this.messages); //
this.transformDataMSG(msgOnly.reverse()); this.transformDataMSG(msgOnly.reverse());
this.getRoomMessageDB(this.roomId); this.getRoomMessageDB(this.roomId);
// Reconnect in one second // Reconnect in one second
if (this.route.url != "/home/chat") { if (this.route.url != "/home/chat") {
console.log("Timer message stop")
} else { } else {
//Check if modal is opened //Check if modal is opened
if (document.querySelector('.isGroupChatOpened')) { if (document.querySelector('.isGroupChatOpened')) {
await new Promise(resolve => setTimeout(resolve, 5000)); await new Promise(resolve => setTimeout(resolve, 5000));
await this.serverLongPull(); await this.serverLongPull();
console.log('Timer message running')
} }
} }
@@ -1040,18 +1040,18 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
} else { } else {
pathFile = this.file.externalRootDirectory pathFile = this.file.externalRootDirectory
} }
console.log(pdfString)
console.log(pathFile)
console.log(contentFile)
this.file this.file
.writeFile(pathFile, fileName, contentFile, { replace: true }) .writeFile(pathFile, fileName, contentFile, { replace: true })
.then(success => { .then(success => {
this.fileOpener this.fileOpener
.open(pathFile + fileName, 'application/pdf') .open(pathFile + fileName, 'application/pdf')
.then(() => console.log('File is opened')) .then(() => console.log())
.catch(e => console.log('Error opening file', e)); .catch(e => console.error(e))
}) })
.catch(e => console.log('Error writing file', e)) .catch(e => console.error(e))
} }
downloadFileMsg(msg: MessageService) { downloadFileMsg(msg: MessageService) {
@@ -1103,7 +1103,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
} }
async audioPreview(msg) { async audioPreview(msg) {
console.log(msg);
if (!msg.attachments[0].title_link || msg.attachments[0].title_link === null || msg.attachments[0].title_link === '') { if (!msg.attachments[0].title_link || msg.attachments[0].title_link === null || msg.attachments[0].title_link === '') {
this.downloadFileMsg(msg) this.downloadFileMsg(msg)
} else { } } else { }
@@ -55,7 +55,7 @@ export class ContactsPage implements OnInit {
headers: this.headers, headers: this.headers,
}; };
this.chatService.getAllUsers().subscribe((res:any)=>{ this.chatService.getAllUsers().subscribe((res:any)=>{
console.log('All users',res.users);
this.contacts = res.users.filter(data => data.username != this.sessionStore.user.UserName); this.contacts = res.users.filter(data => data.username != this.sessionStore.user.UserName);
this.users = this.contacts.sort((a,b) => { this.users = this.contacts.sort((a,b) => {
if(a.name < b.name){ if(a.name < b.name){
@@ -92,7 +92,7 @@ export class ContactsPage implements OnInit {
} }
clicked(){ clicked(){
console.log('clicked');
} }
createRoom(username:string){ createRoom(username:string){
@@ -100,29 +100,29 @@ export class ContactsPage implements OnInit {
username: username, username: username,
} }
this.chatService.createRoom(body).subscribe(res => { this.chatService.createRoom(body).subscribe(res => {
console.log(res);
this.room = res['room']; this.room = res['room'];
console.log(this.room._id);
this.getDirectMessage(this.room._id); this.getDirectMessage(this.room._id);
this.WsChatMethodsService.getAllRooms() this.WsChatMethodsService.getAllRooms()
}); });
} }
getDirectMessage(roomId:any){ getDirectMessage(roomId:any){
console.log(roomId);
this.chatService.getAllDirectMessages().subscribe(res=>{ this.chatService.getAllDirectMessages().subscribe(res=>{
let result = res['ims'].filter(data => data._id == roomId); let result = res['ims'].filter(data => data._id == roomId);
console.log(result[0]);
this.dm = result[0]; this.dm = result[0];
console.log(this.dm);
this.openModal(this.dm._id); this.openModal(this.dm._id);
}); });
} }
async openModal(roomId:any){ async openModal(roomId:any){
this.close(); this.close();
console.log(roomId);
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: MessagesPage, component: MessagesPage,
@@ -143,7 +143,7 @@ export class ContactsPage implements OnInit {
this.createRoom(username); this.createRoom(username);
//Get direct messages (dm) //Get direct messages (dm)
/* this.getDirectMessage(this.room._id); */ /* this.getDirectMessage(this.room._id); */
console.log(this.dm);
/* const modal = await this.modalController.create({ /* const modal = await this.modalController.create({
+33 -33
View File
@@ -134,7 +134,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
) { ) {
this.loggedUser = authService.ValidatedUserChat['data']; this.loggedUser = authService.ValidatedUserChat['data'];
this.roomId = this.navParams.get('roomId'); this.roomId = this.navParams.get('roomId');
console.log('ROOM ID', this.roomId)
window.onresize = (event) => { window.onresize = (event) => {
if (window.innerWidth > 701) { if (window.innerWidth > 701) {
@@ -142,7 +142,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
} }
} }
console.log(this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({}));
this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({}) this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({})
this.wsChatMethodsService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked this.wsChatMethodsService.getDmRoom(this.roomId).scrollDown = this.scrollToBottomClicked
@@ -157,7 +157,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
ngOnInit() { ngOnInit() {
this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => { this.wsChatMethodsService.getUserOfRoom(this.roomId).then((value) => {
console.log('MEMBER', value)
}) })
//this.loadFiles(); //this.loadFiles();
VoiceRecorder.requestAudioRecordingPermission(); VoiceRecorder.requestAudioRecordingPermission();
@@ -254,13 +254,13 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
stopRecording() { stopRecording() {
this.deleteRecording(); this.deleteRecording();
this.allowTyping = false; this.allowTyping = false;
console.log('Stop');
if (!this.recording) { if (!this.recording) {
return; return;
} }
this.recording = false; this.recording = false;
VoiceRecorder.stopRecording().then(async (result: RecordingData) => { VoiceRecorder.stopRecording().then(async (result: RecordingData) => {
console.log(result);
this.recording = false; this.recording = false;
if (result.value && result.value.recordDataBase64) { if (result.value && result.value.recordDataBase64) {
const recordData = result.value.recordDataBase64; const recordData = result.value.recordDataBase64;
@@ -269,7 +269,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
//Save file //Save file
this.storage.set('fileName', fileName); this.storage.set('fileName', fileName);
this.storage.set('recordData', result).then(() => { this.storage.set('recordData', result).then(() => {
console.log('Audio recorded saved');
}) })
} }
}) })
@@ -354,7 +354,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}); });
await modal.present(); await modal.present();
modal.onDidDismiss().then((res) => { modal.onDidDismiss().then((res) => {
console.log(res);
}); });
} }
@@ -422,12 +422,12 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`; this.audioRecorded = `data:${recordData.value.mimeType};base64,${recordData?.value?.recordDataBase64}`;
} }
console.log(this.audioRecorded);
//Converting base64 to blob //Converting base64 to blob
const encodedData = btoa(this.audioRecorded); const encodedData = btoa(this.audioRecorded);
const blob = this.base64toBlob(encodedData, recordData.value.mimeType) const blob = this.base64toBlob(encodedData, recordData.value.mimeType)
console.log(blob)
const formData = new FormData(); const formData = new FormData();
formData.append("blobFile", blob); formData.append("blobFile", blob);
@@ -450,7 +450,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
} }
viewDocument(file: any, url?: string) { viewDocument(file: any, url?: string) {
console.log()
if (file.type == "application/webtrix") { if (file.type == "application/webtrix") {
this.openViewDocumentModal(file); this.openViewDocumentModal(file);
} }
@@ -462,7 +462,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
/* playSound(url?:any){ /* playSound(url?:any){
alert('here') alert('here')
console.log(url);
//this.audioDownloaded = this.sanitiser.bypassSecurityTrustResourceUrl(url); //this.audioDownloaded = this.sanitiser.bypassSecurityTrustResourceUrl(url);
this.audioDownloaded = url; this.audioDownloaded = url;
} */ } */
@@ -601,7 +601,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
IsRequired: "true", IsRequired: "true",
} }
}); });
console.log(this.attendees);
this.popoverController.dismiss(); this.popoverController.dismiss();
if (window.innerWidth <= 1024) { if (window.innerWidth <= 1024) {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
@@ -635,7 +635,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
const blob = await base64.blob(); const blob = await base64.blob();
const formData = new FormData(); const formData = new FormData();
formData.append("blobFile", blob); formData.append("blobFile", blob);
console.log('ALL IMAGE', formData)
this.wsChatMethodsService.getDmRoom(roomId).send({ this.wsChatMethodsService.getDmRoom(roomId).send({
file: { file: {
@@ -715,9 +715,9 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
resultType: CameraResultType.Base64, resultType: CameraResultType.Base64,
source: CameraSource.Photos source: CameraSource.Photos
}); });
console.log('ADDFILECHAT', file)
//const imageData = await this.fileToBase64Service.convert(file) //const imageData = await this.fileToBase64Service.convert(file)
//console.log('ADDFILECHAT', imageData) //
const response = await fetch('data:image/jpeg;base64,' + file.base64String!); const response = await fetch('data:image/jpeg;base64,' + file.base64String!);
const blob = await response.blob(); const blob = await response.blob();
@@ -752,17 +752,17 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
const file: any = await this.fileService.getFileFromDevice(types); const file: any = await this.fileService.getFileFromDevice(types);
console.log('Add file', JSON.stringify(await this.getBase64(file)))
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") { if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
const encodedData = btoa(JSON.stringify(await this.getBase64(file))); const encodedData = btoa(JSON.stringify(await this.getBase64(file)));
const blob = this.base64toBlob(encodedData, file.type) const blob = this.base64toBlob(encodedData, file.type)
console.log('Add Blob file', blob)
const formData = new FormData(); const formData = new FormData();
formData.append('blobFile', blob); formData.append('blobFile', blob);
console.log(formData)
this.wsChatMethodsService.getDmRoom(roomId).send({ this.wsChatMethodsService.getDmRoom(roomId).send({
file: { file: {
@@ -778,7 +778,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
temporaryData: formData temporaryData: formData
}); });
} else { } else {
console.log('File type invalid')
} }
@@ -793,7 +793,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
resolve(reader.result) resolve(reader.result)
}; };
reader.onerror = function (error) { reader.onerror = function (error) {
console.log('Error: ', error);
}; };
}); });
@@ -801,7 +801,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
async openChatOptions(ev?: any) { async openChatOptions(ev?: any) {
const roomId = this.roomId const roomId = this.roomId
console.log('MOBILE CHAT OPTION', this.members);
const popover = await this.popoverController.create({ const popover = await this.popoverController.create({
component: ChatOptionsPopoverPage, component: ChatOptionsPopoverPage,
@@ -816,7 +816,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}); });
await popover.present(); await popover.present();
popover.onDidDismiss().then(async (res) => { popover.onDidDismiss().then(async (res) => {
console.log(res['data']);
if (res['data'] == 'meeting') { if (res['data'] == 'meeting') {
this.bookMeeting(); this.bookMeeting();
} }
@@ -843,11 +843,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
} else { } else {
this.sqlservice.getAllChatMSG(roomId).then((msg: any) => { this.sqlservice.getAllChatMSG(roomId).then((msg: any) => {
console.log('ALL MSG DBBB', msg)
let chatmsgArray = []; let chatmsgArray = [];
let array = [] let array = []
msg.forEach(element => { msg.forEach(element => {
console.log('CHANNEL ELEMENT', element.channels)
let msgChat = { let msgChat = {
_id: element.Id, _id: element.Id,
@@ -867,7 +867,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
}); });
console.log('CHAT MSG FROM DB', chatmsgArray)
}) })
} }
} }
@@ -958,18 +958,18 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
// } else { // } else {
// pathFile = this.file.externalRootDirectory // pathFile = this.file.externalRootDirectory
// } // }
// console.log(pdfString) //
// console.log(pathFile) //
// console.log(contentFile) //
// this.file // this.file
// .writeFile(pathFile, fileName, contentFile, { replace: true }) // .writeFile(pathFile, fileName, contentFile, { replace: true })
// .then(success => { // .then(success => {
// this.fileOpener // this.fileOpener
// .open(pathFile + fileName, type) // .open(pathFile + fileName, type)
// .then(() => console.log('File is opened')) // .then(() =>
// .catch(e => console.log('Error opening file', e)); // .catch(e =>
// }) // })
// .catch(e => console.log('Error writing file', e)) // .catch(e =>
} }
downloadFileFromBrowser(fileName: string, data: any): void { downloadFileFromBrowser(fileName: string, data: any): void {
@@ -982,7 +982,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
async openPreview(msg) { async openPreview(msg) {
console.log(msg);
if(msg.file.type === "application/webtrix") { if(msg.file.type === "application/webtrix") {
this.viewDocument(msg.file, msg.attachments.image_url) this.viewDocument(msg.file, msg.attachments.image_url)
@@ -1021,7 +1021,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
} }
async audioPreview(msg) { async audioPreview(msg) {
console.log(msg);
if (!msg.attachments[0].title_link || msg.attachments[0].title_link === null || msg.attachments[0].title_link === '') { if (!msg.attachments[0].title_link || msg.attachments[0].title_link === null || msg.attachments[0].title_link === '') {
this.downloadFileMsg(msg) this.downloadFileMsg(msg)
} else { } } else { }
@@ -86,8 +86,8 @@ export class ContactsPage implements OnInit {
} }
return 0; return 0;
}); });
console.log(res);
console.log(this.users);
}); */ }); */
this.users = this.contacts.sort((a,b) => { this.users = this.contacts.sort((a,b) => {
if(a.first < b.first){ if(a.first < b.first){
@@ -135,7 +135,7 @@ export class ContactsPage implements OnInit {
} }
clicked(){ clicked(){
console.log('clicked');
} }
async groupMessages(){ async groupMessages(){
@@ -44,7 +44,7 @@ export class NewGroupPage implements OnInit {
} }
ngOnInit() { ngOnInit() {
console.log(this.documents);
} }
_ionChange(event){ _ionChange(event){
@@ -62,7 +62,7 @@ export class NewGroupPage implements OnInit {
} }
async createGroup(){ async createGroup(){
console.log('NEW GROUP', SessionStore.user.UserName)
let name = this.groupName.split(' ').join('-'); let name = this.groupName.split(' ').join('-');
//Take out all special characters in string //Take out all special characters in string
name = name.normalize("NFD").replace(/[\u0300-\u036f]/g, ""); name = name.normalize("NFD").replace(/[\u0300-\u036f]/g, "");
@@ -75,11 +75,11 @@ export class NewGroupPage implements OnInit {
"countDownDate":this.thedate "countDownDate":this.thedate
} }
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields); res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
console.log(res);
} }
else{ else{
res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields); res = await this.wsChatMethodsService.createPrivateRoom(name, SessionStore.user.UserName, customFields);
console.log(res);
} }
this.isGroupCreated = true; this.isGroupCreated = true;
@@ -94,7 +94,7 @@ export class NewGroupPage implements OnInit {
this.close(); this.close();
let name = this.groupName.split(' ').join('-'); let name = this.groupName.split(' ').join('-');
console.log(name);
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: GroupContactsPage, component: GroupContactsPage,
@@ -130,7 +130,7 @@ export class NewGroupPage implements OnInit {
text: 'Ok', text: 'Ok',
cssClass: 'btn-cancel', cssClass: 'btn-cancel',
handler:(value:any)=>{ handler:(value:any)=>{
console.log('button done pressed');
let now = new Date(); let now = new Date();
this.thedate = new Date(now.getFullYear(), now.getMonth(), now.getDate() + value.days.value, now.getHours() + value.hours.value, now.getMinutes() + value.minutes.value, now.getSeconds(), now.getMilliseconds()); this.thedate = new Date(now.getFullYear(), now.getMonth(), now.getDate() + value.days.value, now.getHours() + value.hours.value, now.getMinutes() + value.minutes.value, now.getSeconds(), now.getMilliseconds());
@@ -139,7 +139,7 @@ export class NewGroupPage implements OnInit {
value.hours.value, value.hours.value,
value.minutes.value, value.minutes.value,
] ]
console.log(this.selectedDuration);
if(value.days.value != null && value.hours.value != null && value.minutes.value != null){ if(value.days.value != null && value.hours.value != null && value.minutes.value != null){
if(value.days.value > 0){ if(value.days.value > 0){
if(value.days.value == 1){ if(value.days.value == 1){
@@ -72,7 +72,7 @@ export class EditEventPage implements OnInit {
else{ else{
this.pageId = paramMap.get('eventId'); this.pageId = paramMap.get('eventId');
eventid = paramMap.get('eventId'); eventid = paramMap.get('eventId');
console.log(eventid);
} }
if (paramMap.has("caller")){ if (paramMap.has("caller")){
@@ -164,7 +164,7 @@ export class EditEventPage implements OnInit {
this.activatedRoute.paramMap.subscribe(paramMap =>{ this.activatedRoute.paramMap.subscribe(paramMap =>{
if (paramMap.has("profile")){ if (paramMap.has("profile")){
console.log(paramMap.get('profile'));
} }
}); });
@@ -192,7 +192,7 @@ export class EditEventPage implements OnInit {
{ {
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => { this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
this.loadedEventAttachments = res; this.loadedEventAttachments = res;
console.log(res);
}); });
} }
@@ -74,7 +74,7 @@ export class EventDetailModalPage implements OnInit {
else{ else{
this.pageId = paramMap.get('eventId'); this.pageId = paramMap.get('eventId');
eventid = paramMap.get('eventId'); eventid = paramMap.get('eventId');
console.log(eventid);
} }
if (paramMap.has("caller")){ if (paramMap.has("caller")){
@@ -190,10 +190,10 @@ export class EventDetailModalPage implements OnInit {
this.loadedEventAttachments = attachments; this.loadedEventAttachments = attachments;
}); */ }); */
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => { this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
console.log(res);
},(error) => { },(error) => {
console.log(error);
}); });
} }
@@ -72,7 +72,6 @@ export class EventDetailPage implements OnInit {
else{ else{
this.pageId = paramMap.get('eventId'); this.pageId = paramMap.get('eventId');
eventid = paramMap.get('eventId'); eventid = paramMap.get('eventId');
console.log(eventid);
} }
if (paramMap.has("caller")){ if (paramMap.has("caller")){
@@ -162,7 +161,6 @@ export class EventDetailPage implements OnInit {
this.activatedRoute.paramMap.subscribe(paramMap =>{ this.activatedRoute.paramMap.subscribe(paramMap =>{
if (paramMap.has("profile")){ if (paramMap.has("profile")){
console.log(paramMap.get('profile'));
} }
}); });
@@ -188,11 +186,9 @@ export class EventDetailPage implements OnInit {
loadAttachments() loadAttachments()
{ {
/* console.log(this.pageId); */
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => { this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
this.loadedEventAttachments = res; this.loadedEventAttachments = res;
console.log(res);
}); });
} }
+19 -20
View File
@@ -104,16 +104,15 @@ export class EventsPage implements OnInit {
private storage: Storage, private storage: Storage,
public p: PermissionService, public p: PermissionService,
) { ) {
/* this.existingScreenOrientation = this.screenOrientation.type; /* this.existingScreenOrientation = this.screenOrientation.type; */
console.log(this.existingScreenOrientation); */
this.loggeduser = authService.ValidatedUser; this.loggeduser = authService.ValidatedUser;
this.prEventList = null; this.prEventList = null;
this.platform.resize.subscribe(async () => { this.platform.resize.subscribe(async () => {
//console.log('Resize event detected'); //
// console.log('Resize event detected'); //
}); });
@@ -175,7 +174,7 @@ export class EventsPage implements OnInit {
// Lock to portrait // Lock to portrait
/* lockToPortrait() { /* lockToPortrait() {
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT); this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT);
console.log('set');
} */ } */
// Lock to landscape // Lock to landscape
@@ -191,7 +190,7 @@ export class EventsPage implements OnInit {
/* checkScreenOrientation() { /* checkScreenOrientation() {
if (window.innerWidth < 701) { if (window.innerWidth < 701) {
this.lockToPortrait(); this.lockToPortrait();
console.log('was here');
} }
else { else {
@@ -263,7 +262,7 @@ export class EventsPage implements OnInit {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.set('events', list).then(() => { this.storage.set('events', list).then(() => {
// console.log('Init events saved') //
}) })
} else { } else {
if (list.length > 0) { if (list.length > 0) {
@@ -308,7 +307,7 @@ export class EventsPage implements OnInit {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.set('process', list).then(() => { this.storage.set('process', list).then(() => {
// console.log('Init process saved') //
}) })
} else { } else {
if (list.length > 0) { if (list.length > 0) {
@@ -328,17 +327,17 @@ export class EventsPage implements OnInit {
// ('dateeeeee', dateToday) // ('dateeeeee', dateToday)
if (this.platform.is('desktop') || this.platform.is('mobileweb')) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.get('events').then((events: any[]) => { this.storage.get('events').then((events: any[]) => {
// console.log('Today events',events) //
let todayEvents = new Array() let todayEvents = new Array()
this.listToPresent = events this.listToPresent = events
this.totalEvent = this.listToPresent.length this.totalEvent = this.listToPresent.length
this.currentEvent = this.listToPresent[0].Subject this.currentEvent = this.listToPresent[0].Subject
this.currentHoursMinutes = this.listToPresent[0].StartDate this.currentHoursMinutes = this.listToPresent[0].StartDate
// console.log("All events from local,", events) //
}) })
this.storage.get('process').then((process: any[]) => { this.storage.get('process').then((process: any[]) => {
// console.log('OFOFOFOOF22222', process) //
const ExpedienteTask = process.map(e => this.expedienteTaskPipe.transform(e)) const ExpedienteTask = process.map(e => this.expedienteTaskPipe.transform(e))
this.listToPresentexpediente = ExpedienteTask; this.listToPresentexpediente = ExpedienteTask;
}) })
@@ -372,7 +371,7 @@ export class EventsPage implements OnInit {
Subject: element.Subject Subject: element.Subject
} }
let starteDate = momentG(new Date(element.StartDate), 'yyyy-MM-dd'); let starteDate = momentG(new Date(element.StartDate), 'yyyy-MM-dd');
// console.log('startTOdayyy', starteDate) //
if (dateToday == starteDate) { if (dateToday == starteDate) {
todayEvents.push(eventObject); todayEvents.push(eventObject);
} }
@@ -381,12 +380,12 @@ export class EventsPage implements OnInit {
this.totalEvent = this.listToPresent.length this.totalEvent = this.listToPresent.length
this.currentEvent = this.listToPresent[0].Subject this.currentEvent = this.listToPresent[0].Subject
this.currentHoursMinutes = this.listToPresent[0].StartDate this.currentHoursMinutes = this.listToPresent[0].StartDate
// console.log("All events from local,", event) //
}) })
this.sqliteservice.getprocessByworkflow("Expediente").then((process: any[]) => { this.sqliteservice.getprocessByworkflow("Expediente").then((process: any[]) => {
// console.log('OFOFOFOOF', process) //
if (process.length > 0 || process != undefined) { if (process.length > 0 || process != undefined) {
@@ -408,7 +407,7 @@ export class EventsPage implements OnInit {
} }
}) })
// console.log('OFOFOFOOF22222', expedientlist) //
const ExpedienteTask = expedientlist.map(e => this.expedienteTaskPipe.transform(e)) const ExpedienteTask = expedientlist.map(e => this.expedienteTaskPipe.transform(e))
this.listToPresentexpediente = ExpedienteTask; this.listToPresentexpediente = ExpedienteTask;
@@ -440,12 +439,12 @@ export class EventsPage implements OnInit {
changeProfile() { changeProfile() {
if (this.profile == "mdgpr") { if (this.profile == "mdgpr") {
// console.log('pr'); //
this.profile = "pr"; this.profile = "pr";
this.RefreshEvents(); this.RefreshEvents();
} }
else { else {
// console.log('mdgpr'); //
this.profile = "mdgpr"; this.profile = "mdgpr";
this.RefreshEvents(); this.RefreshEvents();
} }
@@ -457,7 +456,7 @@ export class EventsPage implements OnInit {
} }
async openEventDetail1(id: any) { async openEventDetail1(id: any) {
// console.log(id); //
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: EventDetailPage, component: EventDetailPage,
@@ -474,7 +473,7 @@ export class EventsPage implements OnInit {
LoadList() { LoadList() {
this.processes.GetTaskListExpediente(false).subscribe(result => { this.processes.GetTaskListExpediente(false).subscribe(result => {
// console.log("Expediente", result); //
this.addProcessToDb(result); this.addProcessToDb(result);
const ExpedienteTask = result.map(e => this.expedienteTaskPipe.transform(e)) const ExpedienteTask = result.map(e => this.expedienteTaskPipe.transform(e))
@@ -485,7 +484,7 @@ export class EventsPage implements OnInit {
}, ((error) => { }, ((error) => {
this.showLoader = false; this.showLoader = false;
// console.log('Getlist error', error) //
this.getEventsFromLocalDb(); this.getEventsFromLocalDb();
})); }));
} }
@@ -76,12 +76,12 @@ export class DespachoPrPage implements OnInit {
} }
}); });
console.log('DespachoPrPage SerialNumber', this.serialNumber)
} }
ngOnInit() { ngOnInit() {
this.profile = "mdgpr"; this.profile = "mdgpr";
console.log(this.serialNumber);
this.activateRoute.paramMap.subscribe(paramMap => { this.activateRoute.paramMap.subscribe(paramMap => {
if (!paramMap.has('SerialNumber')) { if (!paramMap.has('SerialNumber')) {
@@ -128,9 +128,9 @@ export class DespachoPrPage implements OnInit {
this.fulltask = res; this.fulltask = res;
console.log(this.task);
console.log('GetTask', res);
this.updateProcessOnDB(res); this.updateProcessOnDB(res);
let thedate = new Date(this.task.CreateDate); let thedate = new Date(this.task.CreateDate);
@@ -184,7 +184,7 @@ export class DespachoPrPage implements OnInit {
getFromDB() { getFromDB() {
this.sqliteservice.getProcessById(this.serialNumber).then((process: any[]) => { this.sqliteservice.getProcessById(this.serialNumber).then((process: any[]) => {
console.log('OFFLINE', process)
this.task = { this.task = {
"SerialNumber": process[0].serialNumber, "SerialNumber": process[0].serialNumber,
"Folio": JSON.parse(process[0].workflowInstanceDataFields).Subject, "Folio": JSON.parse(process[0].workflowInstanceDataFields).Subject,
@@ -200,7 +200,7 @@ export class DespachoPrPage implements OnInit {
"DeadlineType": JSON.parse(process[0].workflowInstanceDataFields).DeadlineType, "DeadlineType": JSON.parse(process[0].workflowInstanceDataFields).DeadlineType,
"activityInstanceName": process[0].activityInstanceName, "activityInstanceName": process[0].activityInstanceName,
} }
console.log("OFFLINE TASK", this.task)
let fulltak = { let fulltak = {
Documents: JSON.parse(process[0].Documents), Documents: JSON.parse(process[0].Documents),
actions: JSON.parse(process[0].actions), actions: JSON.parse(process[0].actions),
@@ -218,7 +218,7 @@ export class DespachoPrPage implements OnInit {
workflowName: process[0].workflowName workflowName: process[0].workflowName
} }
this.fulltask = fulltak; this.fulltask = fulltak;
console.log(this.task);
let thedate = new Date(this.task.CreateDate); let thedate = new Date(this.task.CreateDate);
this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]); this.customDate = this.days[thedate.getDay()] + ", " + thedate.getDate() + " de " + (this.months[thedate.getMonth()]);
@@ -423,7 +423,7 @@ export class DespachoPrPage implements OnInit {
await modal.present(); await modal.present();
modal.onDidDismiss().then(async (res) => { modal.onDidDismiss().then(async (res) => {
console.log(res);
if (res.data) { if (res.data) {
const DocumentToSave = res.data.documents.map((e) => { const DocumentToSave = res.data.documents.map((e) => {
@@ -479,9 +479,9 @@ export class DespachoPrPage implements OnInit {
}); });
await modal.present(); await modal.present();
modal.onDidDismiss().then(res => { modal.onDidDismiss().then(res => {
console.log(res['data']);
if (res['data'] == 'openDiscart') { if (res['data'] == 'openDiscart') {
console.log('open discart');
this.distartExpedientModal(); this.distartExpedientModal();
} }
@@ -553,7 +553,7 @@ export class DespachoPrPage implements OnInit {
} }
async distartExpedientModal() { async distartExpedientModal() {
console.log(this.fulltask);
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: DiscartExpedientModalPage, component: DiscartExpedientModalPage,
componentProps: { componentProps: {
@@ -569,7 +569,7 @@ export class DespachoPrPage implements OnInit {
modal.onDidDismiss().then(res => { modal.onDidDismiss().then(res => {
if (res['data'] == 'close') { if (res['data'] == 'close') {
this.close(); this.close();
/* console.log('2Expedient Discard closed2'); /*
this.close(); this.close();
this.openMenu(); */ this.openMenu(); */
} }
@@ -107,7 +107,7 @@ export class DespachosPrPage implements OnInit {
} }
openExpedientDetailPage(data) { openExpedientDetailPage(data) {
console.log(data);
} }
async LoadList() { async LoadList() {
@@ -118,7 +118,7 @@ export class DespachosPrPage implements OnInit {
let result = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise(); let result = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
this.despachoList = []; this.despachoList = [];
this.skeletonLoader = false; this.skeletonLoader = false;
console.log(result);
let despachosPr; let despachosPr;
let despachos = this.sortService.sortArrayByDate(result); let despachos = this.sortService.sortArrayByDate(result);
@@ -131,7 +131,7 @@ export class DespachosPrPage implements OnInit {
break; break;
} }
console.log(despachosPr);
despachosPr = despachosPr.filter(data => data.workflowInstanceDataFields.Status == "Active"); despachosPr = despachosPr.filter(data => data.workflowInstanceDataFields.Status == "Active");
despachosPr.forEach((element, index) => { despachosPr.forEach((element, index) => {
@@ -168,10 +168,10 @@ export class DespachosPrPage implements OnInit {
getFromDB() { getFromDB() {
this.sqliteservice.getAllProcess().then((all) => { this.sqliteservice.getAllProcess().then((all) => {
console.log('DESPACHO PR ALL', all)
}) })
this.sqliteservice.getprocessByworkflow('Despacho do Presidente da República').then(async (process: any[]) => { this.sqliteservice.getprocessByworkflow('Despacho do Presidente da República').then(async (process: any[]) => {
console.log('DESPACHO PR', process)
let despachosPr; let despachosPr;
switch (this.loggeduser.Profile) { switch (this.loggeduser.Profile) {
@@ -179,7 +179,7 @@ export class DespachosPrPage implements OnInit {
despachosPr = await process.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho"); despachosPr = await process.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
break; break;
case 'PR': case 'PR':
console.log(process);
despachosPr = await process.reverse().filter(data => data.activityInstanceName == "Concluir Despacho"); despachosPr = await process.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
break; break;
@@ -206,7 +206,7 @@ export class DespachosPrPage implements OnInit {
} }
this.despachoList.push(task); this.despachoList.push(task);
console.log(this.despachoList);
}); });
this.listToPresent = this.despachoList; this.listToPresent = this.despachoList;
@@ -222,7 +222,7 @@ export class DespachosPrPage implements OnInit {
} }
async viewExpedientDetail(serialNumber: any) { async viewExpedientDetail(serialNumber: any) {
console.log(this.profile);
let classs; let classs;
if (window.innerWidth <= 800) { if (window.innerWidth <= 800) {
@@ -242,7 +242,7 @@ export class DespachosPrPage implements OnInit {
}); });
await modal.present(); await modal.present();
modal.onDidDismiss().then((res) => { modal.onDidDismiss().then((res) => {
console.log('refresh list');
this.LoadList(); this.LoadList();
}); });
} }
@@ -130,7 +130,7 @@ export class DespachoPage implements OnInit {
async LoadTaskDetail(serial: string) { async LoadTaskDetail(serial: string) {
this.processes.GetTask(serial).subscribe((res: fullTask) => { this.processes.GetTask(serial).subscribe((res: fullTask) => {
console.log('despacho detail', res)
this.task = { this.task = {
"SerialNumber": res.serialNumber, "SerialNumber": res.serialNumber,
"Folio": res.workflowInstanceDataFields.Subject, "Folio": res.workflowInstanceDataFields.Subject,
@@ -157,14 +157,14 @@ export class DespachoPage implements OnInit {
this.processes.GetTaskParticipants(this.task.FolderID).subscribe(users => { this.processes.GetTaskParticipants(this.task.FolderID).subscribe(users => {
this.updateProcessInterveners(users) this.updateProcessInterveners(users)
console.log('interveniers online', users)
this.intervenientes = users.filter(user => { this.intervenientes = users.filter(user => {
console.log('interveniers online 2', users)
return user.Type == 'I'; return user.Type == 'I';
}); });
this.cc = users.filter(user => { this.cc = users.filter(user => {
console.log('interveniers online 3', users)
return user.Type == 'CC'; return user.Type == 'CC';
}); });
}); });
@@ -212,7 +212,7 @@ export class DespachoPage implements OnInit {
origina = JSON.parse(process[0].originator) origina = JSON.parse(process[0].originator)
} }
console.log('sqlite', process)
this.task = { this.task = {
"SerialNumber": process[0].serialNumber, "SerialNumber": process[0].serialNumber,
@@ -253,13 +253,13 @@ export class DespachoPage implements OnInit {
} }
this.fulltask = fulltak; this.fulltask = fulltak;
console.log('interveniers offline', intervine)
this.intervenientes = intervine.filter(user => { this.intervenientes = intervine.filter(user => {
console.log('interveniers offline 2', user)
return user.Type == 'I'; return user.Type == 'I';
}); });
this.cc = intervine.filter(user => { this.cc = intervine.filter(user => {
console.log('interveniers offline 3', user)
return user.Type == 'CC'; return user.Type == 'CC';
}); });
@@ -271,7 +271,7 @@ export class DespachoPage implements OnInit {
async viewDocument(docId: string, Document) { async viewDocument(docId: string, Document) {
console.log(this.fulltask)
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: ViewDocumentPage, component: ViewDocumentPage,
@@ -474,7 +474,7 @@ export class DespachoPage implements OnInit {
}); });
await modal.present(); await modal.present();
modal.onDidDismiss().then(async (res) => { modal.onDidDismiss().then(async (res) => {
console.log(res['data']);
if (res['data'] == 'openDiscart') { if (res['data'] == 'openDiscart') {
await this.distartExpedientModal(); await this.distartExpedientModal();
@@ -531,7 +531,7 @@ export class DespachoPage implements OnInit {
} }
async distartExpedientModal() { async distartExpedientModal() {
console.log(this.fulltask);
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: DiscartExpedientModalPage, component: DiscartExpedientModalPage,
componentProps: { componentProps: {
@@ -547,7 +547,7 @@ export class DespachoPage implements OnInit {
modal.onDidDismiss().then(res => { modal.onDidDismiss().then(res => {
if (res['data'] == 'close') { if (res['data'] == 'close') {
this.close(); this.close();
/* console.log('2Expedient Discard closed2'); /*
this.close(); this.close();
this.openMenu(); */ this.openMenu(); */
} }
@@ -68,7 +68,7 @@ export class DespachosPage implements OnInit {
await this.despachoRule.getList({ updateStore: true }).then((pre) => { await this.despachoRule.getList({ updateStore: true }).then((pre) => {
this.listToPresent = pre; this.listToPresent = pre;
// console.log('despachooo', pre) //
}).catch(() => { }).catch(() => {
this.getFromDb() this.getFromDb()
}) })
@@ -103,7 +103,7 @@ export class DespachosPage implements OnInit {
}); });
this.listToPresent = listtopresent; this.listToPresent = listtopresent;
console.log('Tarefas de despach', this.listToPresent)
}) })
} }
@@ -93,9 +93,9 @@ export class DiplomaAssinarPage implements OnInit {
} }
this.fulltask = res; this.fulltask = res;
console.log(this.task);
console.log('GetTask', res);
let thedate = new Date(this.task.CreateDate); let thedate = new Date(this.task.CreateDate);
this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]); this.customDate = this.days[thedate.getDay()]+ ", " + thedate.getDate() +" de " + ( this.months[thedate.getMonth()]);
@@ -107,7 +107,7 @@ export class DiplomaAssinarPage implements OnInit {
this.cc = users.filter(user=>{ this.cc = users.filter(user=>{
return user.Type == 'CC'; return user.Type == 'CC';
}); });
console.log(users);
}); });
this.getDocumentDetails(this.task.FolderId, '361'); this.getDocumentDetails(this.task.FolderId, '361');
@@ -155,8 +155,8 @@ export class DiplomaAssinarPage implements OnInit {
getDocumentDetails(forlderId:string, applicationId:string) { getDocumentDetails(forlderId:string, applicationId:string) {
this.processes.GetDocumentDetails(forlderId,applicationId).subscribe(res=>{ this.processes.GetDocumentDetails(forlderId,applicationId).subscribe(res=>{
this.attachments = res.Documents; this.attachments = res.Documents;
console.log(res['Documents']);
console.log(this.attachments);
}) })
} }
@@ -53,7 +53,7 @@ export class DiplomaPage implements OnInit {
public ThemeService: ThemeService public ThemeService: ThemeService
) { ) {
this.activatedRoute.paramMap.subscribe(params => { this.activatedRoute.paramMap.subscribe(params => {
// console.log(params["params"]); //
if (params["params"].SerialNumber) { if (params["params"].SerialNumber) {
this.serialNumber = params["params"].SerialNumber; this.serialNumber = params["params"].SerialNumber;
@@ -260,8 +260,8 @@ export class DiplomaPage implements OnInit {
getDocumentDetails(forlderId: string, applicationId: string) { getDocumentDetails(forlderId: string, applicationId: string) {
this.processes.GetDocumentDetails(forlderId, applicationId).subscribe(res => { this.processes.GetDocumentDetails(forlderId, applicationId).subscribe(res => {
this.attachments = res.Documents; this.attachments = res.Documents;
console.log(res['Documents']);
console.log(this.attachments);
}) })
} }
@@ -82,10 +82,10 @@ export class DiplomasPage implements OnInit, OnDestroy {
} }
/* async loadDiplomas(){ /* async loadDiplomas(){
console.log('Load');
this.activatedRoute.data.subscribe(data => { this.activatedRoute.data.subscribe(data => {
console.log(data['diplomas']);
switch (this.segment) { switch (this.segment) {
case 'validar': case 'validar':
@@ -157,12 +157,12 @@ export class DiplomasPage implements OnInit, OnDestroy {
async getTotalDocs(DocId: any) { async getTotalDocs(DocId: any) {
let res = await this.processes.GetDocumentDetails(DocId, '361').toPromise(); let res = await this.processes.GetDocumentDetails(DocId, '361').toPromise();
console.log(res.DocumentsTotal);
return res.DocumentsTotal; return res.DocumentsTotal;
} }
ngOnDestroy(): void { ngOnDestroy(): void {
console.log('8. on destroy called');
} }
segmentChanged(ev: any) { segmentChanged(ev: any) {
@@ -224,7 +224,7 @@ export class DiplomasPage implements OnInit, OnDestroy {
diplomasList.push(task); diplomasList.push(task);
}); });
console.log(diplomasList);
this.diplomasList = this.sortService.sortDate(diplomasList, 'taskStartDate'); this.diplomasList = this.sortService.sortDate(diplomasList, 'taskStartDate');
let diplomasAssinados = process.filter(data => data.activityInstanceName == "Diploma Assinado"); let diplomasAssinados = process.filter(data => data.activityInstanceName == "Diploma Assinado");
@@ -235,7 +235,7 @@ export class DiplomasPage implements OnInit, OnDestroy {
diplomasAssinadoList.push(task); diplomasAssinadoList.push(task);
}); });
console.log('diplomasAssinados', diplomasAssinados)
this.diplomasAssinadoList = this.sortService.sortDate(diplomasAssinadoList, 'taskStartDate') this.diplomasAssinadoList = this.sortService.sortDate(diplomasAssinadoList, 'taskStartDate')
}) })
@@ -74,10 +74,8 @@ export class ApproveEventModalPage implements OnInit {
getTask() { getTask() {
this.processes.GetTask(this.serialNumber).subscribe(res => { this.processes.GetTask(this.serialNumber).subscribe(res => {
console.log('GET TASK SERIALNUMBER: ', this.serialNumber,'Approve event',res);
this.loadedEvent = res; this.loadedEvent = res;
this.today = new Date(res.workflowInstanceDataFields.StartDate); this.today = new Date(res.workflowInstanceDataFields.StartDate);
console.log(new Date(this.today));
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
this.InstanceId = res.workflowInstanceDataFields.InstanceId this.InstanceId = res.workflowInstanceDataFields.InstanceId
@@ -89,7 +87,6 @@ export class ApproveEventModalPage implements OnInit {
viewDocument(docId:string, applicationId:string){ viewDocument(docId:string, applicationId:string){
this.processes.GetDocumentUrl(docId, applicationId).subscribe(res=>{ this.processes.GetDocumentUrl(docId, applicationId).subscribe(res=>{
console.log(res);
const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1"); const url: string = res.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
const browser = this.iab.create(url,"_blank"); const browser = this.iab.create(url,"_blank");
browser.show(); browser.show();
@@ -97,9 +94,7 @@ export class ApproveEventModalPage implements OnInit {
} }
async approveTask(serialNumber:string) { async approveTask(serialNumber:string) {
console.log('approveTask SERIALNUMBER: ', serialNumber)
let body = { "serialNumber": serialNumber, "action": "Aprovar" } let body = { "serialNumber": serialNumber, "action": "Aprovar" }
console.log(body);
const loader = this.toastService.loading() const loader = this.toastService.loading()
@@ -121,8 +116,6 @@ export class ApproveEventModalPage implements OnInit {
} }
emendTask(serialNumber:string){ emendTask(serialNumber:string){
console.log('emendTask: ',serialNumber)
/* console.log('Emendar'); */
this.menu.close(); this.menu.close();
this.openEmendMessageModal(serialNumber); this.openEmendMessageModal(serialNumber);
this.modalController.dismiss(null); this.modalController.dismiss(null);
@@ -153,7 +146,7 @@ export class ApproveEventModalPage implements OnInit {
async getAttachments() { async getAttachments() {
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise(); this.loadedAttachments = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
console.log(this.loadedAttachments);
} }
async openOptions(ev:any) { async openOptions(ev:any) {
@@ -191,7 +184,7 @@ export class ApproveEventModalPage implements OnInit {
} }
} }
//console.log(body); //
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {
@@ -63,7 +63,7 @@ export class ApproveEventPage implements OnInit {
private storage: Storage private storage: Storage
) { ) {
this.activatedRoute.paramMap.subscribe(params => { this.activatedRoute.paramMap.subscribe(params => {
// console.log(params["params"]); //
if (params["params"].serialNumber) { if (params["params"].serialNumber) {
this.serialNumber = params["params"].serialNumber; this.serialNumber = params["params"].serialNumber;
@@ -80,8 +80,8 @@ export class ApproveEventPage implements OnInit {
} }
ngOnInit() { ngOnInit() {
console.log(this.serialNumber);
console.log(this.caller);
this.getTask(); this.getTask();
this.backgroundservice.registerBackService('Online', () => { this.backgroundservice.registerBackService('Online', () => {
@@ -108,7 +108,7 @@ export class ApproveEventPage implements OnInit {
addProcessToDB(data) { addProcessToDB(data) {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.set('approve_event_detils', data).then(() => { this.storage.set('approve_event_detils', data).then(() => {
console.log('APPROVE EVENT DETAILS SAVED')
}) })
} else { } else {
this.sqliteservice.updateProcess(data); this.sqliteservice.updateProcess(data);
@@ -120,7 +120,7 @@ export class ApproveEventPage implements OnInit {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.get('approve_event_detils').then((event) => { this.storage.get('approve_event_detils').then((event) => {
this.loadedEvent = event this.loadedEvent = event
console.log('offline event', this.loadedEvent);
this.today = new Date(this.loadedEvent.workflowInstanceDataFields.StartDate); this.today = new Date(this.loadedEvent.workflowInstanceDataFields.StartDate);
@@ -128,13 +128,13 @@ export class ApproveEventPage implements OnInit {
let instanceId = this.loadedEvent.workflowInstanceDataFields.InstanceId; let instanceId = this.loadedEvent.workflowInstanceDataFields.InstanceId;
this.loadedAttachments = this.loadedEvent.Documents; this.loadedAttachments = this.loadedEvent.Documents;
console.log('Attatara', this.loadedAttachments)
}) })
} else { } else {
this.platform.ready().then(() => { this.platform.ready().then(() => {
this.sqliteservice.getProcessById(this.serialNumber).then((process) => { this.sqliteservice.getProcessById(this.serialNumber).then((process) => {
console.log('event aprove serial', process)
var doc; var doc;
var action = []; var action = [];
@@ -182,7 +182,7 @@ export class ApproveEventPage implements OnInit {
} }
this.loadedEvent = task this.loadedEvent = task
console.log('offline event', this.loadedEvent);
this.today = new Date(this.loadedEvent.workflowInstanceDataFields.StartDate); this.today = new Date(this.loadedEvent.workflowInstanceDataFields.StartDate);
@@ -190,13 +190,13 @@ export class ApproveEventPage implements OnInit {
let instanceId = this.loadedEvent.workflowInstanceDataFields.InstanceId; let instanceId = this.loadedEvent.workflowInstanceDataFields.InstanceId;
this.loadedAttachments = this.loadedEvent.Documents; this.loadedAttachments = this.loadedEvent.Documents;
console.log('Attatara', this.loadedAttachments)
}) })
}) })
} }
console.log('Offlineee')
} }
async getTask() { async getTask() {
@@ -204,7 +204,7 @@ export class ApproveEventPage implements OnInit {
this.loadedEvent = await this.processes.GetTask(this.serialNumber).toPromise(); this.loadedEvent = await this.processes.GetTask(this.serialNumber).toPromise();
this.addProcessToDB(this.loadedEvent) this.addProcessToDB(this.loadedEvent)
console.log(this.loadedEvent);
this.today = new Date(this.loadedEvent.workflowInstanceDataFields.StartDate); this.today = new Date(this.loadedEvent.workflowInstanceDataFields.StartDate);
@@ -217,7 +217,7 @@ export class ApproveEventPage implements OnInit {
async approveTask(serialNumber: string) { async approveTask(serialNumber: string) {
let body = { "serialNumber": serialNumber, "action": "Aprovar" } let body = { "serialNumber": serialNumber, "action": "Aprovar" }
console.log(body);
const loader = this.toastService.loading() const loader = this.toastService.loading()
@@ -246,7 +246,7 @@ export class ApproveEventPage implements OnInit {
} }
async emendTask(serialNumber: string) { async emendTask(serialNumber: string) {
console.log('Desktop');
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: EmendMessageModalPage, component: EmendMessageModalPage,
@@ -260,7 +260,7 @@ export class ApproveEventPage implements OnInit {
modal.onDidDismiss() modal.onDidDismiss()
.then(async (res) => { .then(async (res) => {
console.log(res.data);
if (res.data !== '') { if (res.data !== '') {
let body = { let body = {
@@ -270,14 +270,14 @@ export class ApproveEventPage implements OnInit {
"ReviewUserComment": res.data, "ReviewUserComment": res.data,
} }
} }
console.log(body);
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {
await this.processes.PostTaskAction(body).toPromise() await this.processes.PostTaskAction(body).toPromise()
.catch(() => { .catch(() => {
console.log('Send event to approve for revition')
this.offlineManager.storeRequestData('event-listRever', body); this.offlineManager.storeRequestData('event-listRever', body);
}); });
this.toastService._successMessage('Pedido enviado'); this.toastService._successMessage('Pedido enviado');
@@ -300,7 +300,7 @@ export class ApproveEventPage implements OnInit {
async rejeitar(serialNumber: string) { async rejeitar(serialNumber: string) {
let body = { "serialNumber": serialNumber, "action": "Rejeitar" } let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
console.log(body);
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {
await this.processes.PostTaskAction(body).toPromise(); await this.processes.PostTaskAction(body).toPromise();
@@ -366,7 +366,7 @@ export class ApproveEventPage implements OnInit {
await modal.present(); await modal.present();
modal.onDidDismiss().then(async (res) => { modal.onDidDismiss().then(async (res) => {
console.log(res.data);
if (res.data !== '') { if (res.data !== '') {
let body = { let body = {
@@ -376,7 +376,7 @@ export class ApproveEventPage implements OnInit {
"ReviewUserComment": res.data, "ReviewUserComment": res.data,
} }
} }
console.log(body);
const loader = this.toastService.loading() const loader = this.toastService.loading()
@@ -102,13 +102,13 @@ export class EventListPage implements OnInit {
this.eventsMDGPRList = this.sortService.sortDate(this.transformaDataDB(event), 'taskStartDate') this.eventsMDGPRList = this.sortService.sortDate(this.transformaDataDB(event), 'taskStartDate')
//this.eventsMDGPRList = this.eventsMDGPRList.filter(element => element.interveners != null) //this.eventsMDGPRList = this.eventsMDGPRList.filter(element => element.interveners != null)
console.log('MD event to aprove', this.eventsMDGPRList)
}) })
this.sqliteservice.getListOfEventAprove('Agenda Oficial PR', 'Agenda Pessoal PR').then((event: any[]) => { this.sqliteservice.getListOfEventAprove('Agenda Oficial PR', 'Agenda Pessoal PR').then((event: any[]) => {
this.eventsPRList = this.sortService.sortDate(this.transformaDataDB(event), 'taskStartDate') this.eventsPRList = this.sortService.sortDate(this.transformaDataDB(event), 'taskStartDate')
console.log('PR event to aprove', this.eventsPRList)
}) })
}) })
@@ -116,7 +116,7 @@ export class EventListPage implements OnInit {
} }
console.log('Offlineee')
} }
transformaDataDB(events) { transformaDataDB(events) {
@@ -154,16 +154,16 @@ export class EventListPage implements OnInit {
this.showLoader = true; this.showLoader = true;
this.skeletonLoader = true this.skeletonLoader = true
console.log(this.segment);
if (this.segment == 'MDGPR') { if (this.segment == 'MDGPR') {
let mdEventsOficial = await this.processes.GetTasksList('Agenda Oficial MDGPR', false).toPromise(); let mdEventsOficial = await this.processes.GetTasksList('Agenda Oficial MDGPR', false).toPromise();
let mdEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal MDGPR', false).toPromise(); let mdEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal MDGPR', false).toPromise();
this.eventsMDGPRList = mdEventsOficial.concat(mdEventsPessoal); this.eventsMDGPRList = mdEventsOficial.concat(mdEventsPessoal);
this.eventsMDGPRList = this.sortService.sortDate(this.eventsMDGPRList, 'taskStartDate') this.eventsMDGPRList = this.sortService.sortDate(this.eventsMDGPRList, 'taskStartDate')
this.eventsMDGPRList = this.sortService.sortArrayByDate(this.eventsMDGPRList) this.eventsMDGPRList = this.sortService.sortArrayByDate(this.eventsMDGPRList)
console.log('MD EVENT TO APROVE ONLINE',this.eventsMDGPRList)
this.storage.set('event-to-aproveMD',this.eventsMDGPRList).then(() => { this.storage.set('event-to-aproveMD',this.eventsMDGPRList).then(() => {
console.log(' EVENTMD TO APROVE SAVED')
}) })
//this.eventaprovacaostore.resetmd(this.sortService.sortArrayByDate(this.eventsMDGPRList).reverse()); //this.eventaprovacaostore.resetmd(this.sortService.sortArrayByDate(this.eventsMDGPRList).reverse());
} }
@@ -173,9 +173,9 @@ export class EventListPage implements OnInit {
this.eventsPRList = prEventsOficial.concat(prEventsPessoal); this.eventsPRList = prEventsOficial.concat(prEventsPessoal);
this.eventsPRList = this.sortService.sortDate(this.eventsPRList, 'taskStartDate') this.eventsPRList = this.sortService.sortDate(this.eventsPRList, 'taskStartDate')
this.eventsPRList = this.sortService.sortArrayByDate(this.eventsPRList) this.eventsPRList = this.sortService.sortArrayByDate(this.eventsPRList)
console.log('PR EVENT TO APROVE ONLINE',this.eventsPRList)
this.storage.set('event-to-aprovePR',this.eventsPRList).then(() => { this.storage.set('event-to-aprovePR',this.eventsPRList).then(() => {
console.log(' EVENTPR TO APROVE SAVED')
}) })
//this.eventaprovacaostore.resetpr(this.sortService.sortArrayByDate(this.eventsPRList).reverse()); //this.eventaprovacaostore.resetpr(this.sortService.sortArrayByDate(this.eventsPRList).reverse());
} }
@@ -202,7 +202,7 @@ export class EventListPage implements OnInit {
} }
goToEventToApproveDetail(serialNumber: string) { goToEventToApproveDetail(serialNumber: string) {
console.log(serialNumber);
/* let navigationExtras: NavigationExtras = { /* let navigationExtras: NavigationExtras = {
queryParams: { queryParams: {
@@ -272,7 +272,7 @@ export class BookMeetingModalPage implements OnInit {
} }
console.log(this.EventRecurrenceType)
if(this.task.FsId == '8') { if(this.task.FsId == '8') {
const loader = this.toastService.loading() const loader = this.toastService.loading()
@@ -114,7 +114,7 @@ export class ExpedientTaskModalPage implements OnInit {
this.loggeduser = userAuth.ValidatedUser; this.loggeduser = userAuth.ValidatedUser;
this.task = this.navParams.get('task'); this.task = this.navParams.get('task');
console.log('create dispatch with this data', this.task);
this.SearchFolder = this.navParams.get('SearchFolder'); this.SearchFolder = this.navParams.get('SearchFolder');
this.aplicationId = this.navParams.get('aplicationId') this.aplicationId = this.navParams.get('aplicationId')
@@ -145,7 +145,7 @@ export class ExpedientTaskModalPage implements OnInit {
this.postData.DispatchFolder.Subject = this.task.workflowInstanceDataFields.Subject; this.postData.DispatchFolder.Subject = this.task.workflowInstanceDataFields.Subject;
this.profile = this.navParams.get('profile'); this.profile = this.navParams.get('profile');
console.log(this.postData);
} }
async setAdding(type: "intervenient" | "CC") { async setAdding(type: "intervenient" | "CC") {
@@ -163,9 +163,9 @@ export class ExpedientTaskModalPage implements OnInit {
} }
onSelectedTypesChanged(ev:any) { onSelectedTypesChanged(ev:any) {
console.log(ev);
if(ev.length > 1){ if(ev.length > 1){
console.log(ev.filter(data => data != '99999850'));
this.selectedTypes = ev.filter(data => data != '99999850'); this.selectedTypes = ev.filter(data => data != '99999850');
} }
if(ev.length == 0){ if(ev.length == 0){
@@ -180,7 +180,7 @@ export class ExpedientTaskModalPage implements OnInit {
getSubjectType() { getSubjectType() {
this.processes.GetSubjectType().subscribe(res=>{ this.processes.GetSubjectType().subscribe(res=>{
console.log(res);
this.subjectTypes = res; this.subjectTypes = res;
}); });
} }
@@ -322,7 +322,7 @@ export class ExpedientTaskModalPage implements OnInit {
} }
} }
console.log(this.postData);
try { try {
@@ -336,7 +336,7 @@ export class ExpedientTaskModalPage implements OnInit {
loader.remove() loader.remove()
} }
console.log('this.taskResult', this.taskResult);
break; break;
case '1': // Parecer case '1': // Parecer
@@ -380,7 +380,7 @@ export class ExpedientTaskModalPage implements OnInit {
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
AttachmentList: docs AttachmentList: docs
} }
//console.log(this.postData); //
let action_deferimento = { let action_deferimento = {
"serialNumber": this.task.serialNumber, "serialNumber": this.task.serialNumber,
"action": "Tratado", "action": "Tratado",
@@ -401,7 +401,7 @@ export class ExpedientTaskModalPage implements OnInit {
loader.remove() loader.remove()
} }
console.log('this.taskResult', this.taskResult);
break; break;
} }
} }
@@ -421,7 +421,7 @@ export class ExpedientTaskModalPage implements OnInit {
DispatchFolder: this.dispatchFolder, DispatchFolder: this.dispatchFolder,
AttachmentList: docs, AttachmentList: docs,
} }
console.log(this.postData);
let action_despacho_pr = { let action_despacho_pr = {
"serialNumber": this.task.serialNumber, "serialNumber": this.task.serialNumber,
@@ -491,7 +491,7 @@ export class ExpedientTaskModalPage implements OnInit {
getAttachments() { getAttachments() {
this.attachmentsService.getAttachmentsBySerial(this.task.serialNumber).subscribe(res=>{ this.attachmentsService.getAttachmentsBySerial(this.task.serialNumber).subscribe(res=>{
this.loadedAttachments = res; this.loadedAttachments = res;
console.log(res);
}); });
} }
@@ -568,7 +568,7 @@ export class ExpedientTaskModalPage implements OnInit {
} }
async viewExpedientDetail() { async viewExpedientDetail() {
console.log(this.profile);
let classs; let classs;
if( window.innerWidth <= 800){ if( window.innerWidth <= 800){
@@ -588,7 +588,6 @@ export class ExpedientTaskModalPage implements OnInit {
}); });
await modal.present(); await modal.present();
modal.onDidDismiss().then((res)=>{ modal.onDidDismiss().then((res)=>{
/* console.log('!refresh list'); */
}); });
} }
@@ -92,8 +92,8 @@
<div class="aside-right flex-column height-100 overflow-y-auto"> <div class="aside-right flex-column height-100 overflow-y-auto">
<div class="buttons"> <div class="buttons">
<div *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="option-desc"> <div>Enviar para o PR</div> </div> <div *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="option-desc"> <div *ngIf="loggeduser.Profile == 'MDGPR'">Enviar para o PR</div> </div>
<button *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Avaliação Superior</button> <button *ngIf="!p.userPermission([p.permissionList.Gabinete.pr_tasks]) && loggeduser.Profile == 'MDGPR'" (click)="openAddNoteModal('Aprovar')" class="btn-cancel" shape="round" >Avaliação Superior</button>
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="option-desc"> <div>Solicitar revisão</div> </div> <div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" class="option-desc"> <div>Solicitar revisão</div> </div>
<button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks])" (click)="openAddNoteModal('Revisão')" class="btn-cancel" shape="round" >Mandar para Revisão</button>
<div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks]) || p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="option-desc"> <div>Outras opções</div> </div> <div *ngIf="p.userPermission([p.permissionList.Gabinete.md_tasks]) || p.userPermission([p.permissionList.Gabinete.pr_tasks])" class="option-desc"> <div>Outras opções</div> </div>
@@ -32,6 +32,8 @@ import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
import { DataService } from 'src/app/services/data.service'; import { DataService } from 'src/app/services/data.service';
import { RouteService } from 'src/app/services/route.service'; import { RouteService } from 'src/app/services/route.service';
import { Storage } from '@ionic/storage'; import { Storage } from '@ionic/storage';
import { LoginUserRespose } from 'src/app/models/user.model';
import { AuthService } from 'src/app/services/auth.service';
@Component({ @Component({
selector: 'app-expediente-detail', selector: 'app-expediente-detail',
@@ -61,6 +63,8 @@ export class ExpedienteDetailPage implements OnInit {
onlinecheck: boolean; onlinecheck: boolean;
loggeduser: LoginUserRespose;
constructor( constructor(
private processes: ProcessesService, private processes: ProcessesService,
private iab: InAppBrowser, private iab: InAppBrowser,
@@ -81,8 +85,10 @@ export class ExpedienteDetailPage implements OnInit {
private backgroundservice: BackgroundService, private backgroundservice: BackgroundService,
public ThemeService: ThemeService, public ThemeService: ThemeService,
private dataService: DataService, private dataService: DataService,
private storage: Storage private storage: Storage,
private userAuth: AuthService,
) { ) {
this.loggeduser = userAuth.ValidatedUser
this.activatedRoute.paramMap.subscribe(params => { this.activatedRoute.paramMap.subscribe(params => {
if (params["params"].SerialNumber) { if (params["params"].SerialNumber) {
this.serialNumber = params["params"].SerialNumber; this.serialNumber = params["params"].SerialNumber;
@@ -113,7 +119,7 @@ export class ExpedienteDetailPage implements OnInit {
updateProcessDB(res) { updateProcessDB(res) {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.set('expediente_details',res).then(() =>{ this.storage.set('expediente_details',res).then(() =>{
console.log('EXPEDIENTE DETAILS SAVED')
}) })
} else { } else {
this.sqliteservice.updateProcess(res) this.sqliteservice.updateProcess(res)
@@ -163,7 +169,7 @@ export class ExpedienteDetailPage implements OnInit {
this.platform.ready().then(() => { this.platform.ready().then(() => {
this.onlinecheck = false; this.onlinecheck = false;
this.sqliteservice.getProcessById(this.serialNumber).then((process) => { this.sqliteservice.getProcessById(this.serialNumber).then((process) => {
console.log("expedient ditail", process)
var workflow = JSON.parse(process[0].workflowInstanceDataFields); var workflow = JSON.parse(process[0].workflowInstanceDataFields);
var origina var origina
@@ -227,7 +233,7 @@ export class ExpedienteDetailPage implements OnInit {
"AttachmentList": documents, "AttachmentList": documents,
} }
console.log(body);
const loader = this.toastService.loading() const loader = this.toastService.loading()
@@ -287,7 +293,7 @@ export class ExpedienteDetailPage implements OnInit {
await modal.present(); await modal.present();
modal.onDidDismiss().then(res => { modal.onDidDismiss().then(res => {
console.log(res);
if (res.data) { if (res.data) {
const DocumentToSave = res.data.documents.map((e) => { const DocumentToSave = res.data.documents.map((e) => {
return { return {
@@ -355,7 +361,7 @@ export class ExpedienteDetailPage implements OnInit {
sendExpedienteToPending() { sendExpedienteToPending() {
this.processes.SetTaskToPending(this.serialNumber).subscribe(res => { this.processes.SetTaskToPending(this.serialNumber).subscribe(res => {
console.log(res);
this.toastService._successMessage('Processo enviado para pendentes') this.toastService._successMessage('Processo enviado para pendentes')
this.goBack(); this.goBack();
}, },
@@ -367,7 +373,7 @@ export class ExpedienteDetailPage implements OnInit {
async LoadTaskDetail(serial: string) { async LoadTaskDetail(serial: string) {
this.processes.GetTask(serial).subscribe(res => { this.processes.GetTask(serial).subscribe(res => {
console.log(res);
this.task = { this.task = {
"SerialNumber": res.serialNumber, "SerialNumber": res.serialNumber,
@@ -403,8 +409,8 @@ export class ExpedienteDetailPage implements OnInit {
}); });
}) })
console.log('this.task', this.task.InstanceID)
console.log('this.task.DocumentURL', this.fulltask)
}, (error) => { }, (error) => {
@@ -460,11 +466,11 @@ export class ExpedienteDetailPage implements OnInit {
// } // }
getAttachments(serialNumber) { getAttachments(serialNumber) {
console.log(serialNumber);
this.attachmentsService.getAttachmentsBySerial(serialNumber).subscribe(res => { this.attachmentsService.getAttachmentsBySerial(serialNumber).subscribe(res => {
this.attachments = res; this.attachments = res;
console.log('res', res);
}); });
} }
@@ -567,7 +573,7 @@ export class ExpedienteDetailPage implements OnInit {
await modal.present(); await modal.present();
modal.onDidDismiss().then(async (res) => { modal.onDidDismiss().then(async (res) => {
console.log(res['data']);
if (body == 'descartar') { if (body == 'descartar') {
if (res['data'] == 'Yes') { if (res['data'] == 'Yes') {
@@ -605,7 +611,7 @@ export class ExpedienteDetailPage implements OnInit {
} }
else if (res['data'] == 'No') { else if (res['data'] == 'No') {
console.log('Update');
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise(); await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
@@ -622,7 +628,7 @@ export class ExpedienteDetailPage implements OnInit {
} }
async openBookMeetingModal(task: any) { async openBookMeetingModal(task: any) {
console.log(task);
let classs; let classs;
if (window.innerWidth < 701) { if (window.innerWidth < 701) {
@@ -649,7 +655,7 @@ export class ExpedienteDetailPage implements OnInit {
} }
async viewEventDetail(eventId: any) { async viewEventDetail(eventId: any) {
console.log(this.profile);
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: ViewEventPage, component: ViewEventPage,
@@ -82,7 +82,7 @@ export class ExpedientePage implements OnInit {
this.addProcessTODb(task); this.addProcessTODb(task);
}); });
this.listToPresent = this.sortService.sortDate(this.taskslist, 'taskStartDate') this.listToPresent = this.sortService.sortDate(this.taskslist, 'taskStartDate')
console.log('expediente list', this.listToPresent)
this.skeletonLoader = false; this.skeletonLoader = false;
}, (error) => { }, (error) => {
@@ -108,14 +108,14 @@ export class ExpedientePage implements OnInit {
} }
goToExpediente(serialNumber: any) { goToExpediente(serialNumber: any) {
//console.log('ABRE'); //
this.router.navigate(['/home/gabinete-digital/expediente', serialNumber, 'gabinete-digital']); this.router.navigate(['/home/gabinete-digital/expediente', serialNumber, 'gabinete-digital']);
} }
addProcessTODb(task) { addProcessTODb(task) {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.set('gabinete-expediente',task).then(() => { this.storage.set('gabinete-expediente',task).then(() => {
console.log('GABINETE EXPEDIENTE SAVED')
}) })
} else { } else {
this.sqliteservice.addProcess(task); this.sqliteservice.addProcess(task);
@@ -131,7 +131,7 @@ export class ExpedientePage implements OnInit {
} else { } else {
this.taskslist = new Array(); this.taskslist = new Array();
this.sqliteservice.getprocessByworkflow("Expediente").then((expediente: any[]) => { this.sqliteservice.getprocessByworkflow("Expediente").then((expediente: any[]) => {
console.log("All expedientes from local,", expediente)
expediente.forEach((element) => { expediente.forEach((element) => {
@@ -134,7 +134,7 @@ export class ExpedientePrPage implements OnInit {
sendExpedienteToPending() { sendExpedienteToPending() {
this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{ this.processes.SetTaskToPending(this.serialnumber).subscribe(res=>{
console.log(res);
this.toastService._successMessage('Processo enviado para pendentes') this.toastService._successMessage('Processo enviado para pendentes')
this.goBack(); this.goBack();
}, },
@@ -239,11 +239,11 @@ export class ExpedientePrPage implements OnInit {
await modal.present(); await modal.present();
modal.onDidDismiss().then((res)=>{ modal.onDidDismiss().then((res)=>{
if(res){ if(res){
console.log(res);
const data = res.data; const data = res.data;
this.documents.push(data.selected); this.documents.push(data.selected);
console.log('RES'+ this.documents);
/* let body = { /* let body = {
"InstanceID":null, "InstanceID":null,
@@ -296,7 +296,7 @@ export class ExpedientePrPage implements OnInit {
"AttachmentList" :documents, "AttachmentList" :documents,
} }
console.log(body);
const loader = this.toastService.loading() const loader = this.toastService.loading()
@@ -355,7 +355,7 @@ export class ExpedientePrPage implements OnInit {
await modal.present(); await modal.present();
modal.onDidDismiss().then(res => { modal.onDidDismiss().then(res => {
console.log(res);
if(res.data){ if(res.data){
const DocumentToSave = res.data.documents.map((e:SearchList) => { const DocumentToSave = res.data.documents.map((e:SearchList) => {
return { return {
@@ -431,7 +431,7 @@ export class ExpedientePrPage implements OnInit {
await modal.present(); await modal.present();
modal.onDidDismiss().then( async (res)=>{ modal.onDidDismiss().then( async (res)=>{
console.log(res['data']);
if(body == 'descartar') { if(body == 'descartar') {
if(res['data']== 'Yes'){ if(res['data']== 'Yes'){
@@ -479,7 +479,7 @@ export class ExpedientePrPage implements OnInit {
this.goBack(); this.goBack();
} }
else if(res['data'] == 'No') { else if(res['data'] == 'No') {
console.log('Update');
const loader = this.toastService.loading() const loader = this.toastService.loading()
@@ -533,7 +533,7 @@ export class ExpedientePrPage implements OnInit {
} }
async viewEventDetail(eventId: any) { async viewEventDetail(eventId: any) {
console.log(this.profile);
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: ViewEventPage, component: ViewEventPage,
@@ -70,7 +70,7 @@ export class ExpedientesPrPage implements OnInit {
this.skeletonLoader = true this.skeletonLoader = true
this.processes.GetTaskListExpediente(false).subscribe(result => { this.processes.GetTaskListExpediente(false).subscribe(result => {
console.log(result);
this.skeletonLoader = false this.skeletonLoader = false
this.showLoader =false this.showLoader =false
this.taskslist = new Array(); this.taskslist = new Array();
@@ -79,7 +79,7 @@ export class ExpedientesPrPage implements OnInit {
let task = this.expedienteTaskPipe.transform(element) let task = this.expedienteTaskPipe.transform(element)
this.taskslist.push(task); this.taskslist.push(task);
}); });
console.log(this.taskslist);
this.taskslist = this.sortService.sortDate(this.taskslist, 'CreateDate') this.taskslist = this.sortService.sortDate(this.taskslist, 'CreateDate')
this.expedienteGdStore.reset(this.taskslist); this.expedienteGdStore.reset(this.taskslist);
@@ -117,7 +117,7 @@ export class ExpedientesPrPage implements OnInit {
}); });
await modal.present(); await modal.present();
modal.onDidDismiss().then((res)=>{ modal.onDidDismiss().then((res)=>{
console.log('refresh list');
this.LoadList(); this.LoadList();
}); });
} }
@@ -224,7 +224,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
this.platform.ready().then(() => { this.platform.ready().then(() => {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.set('GabineteProcess', data).then(() => { this.storage.set('GabineteProcess', data).then(() => {
console.log('Gabinete process saved')
}) })
} else { } else {
data.forEach(element => { data.forEach(element => {
@@ -257,7 +257,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
this.hideRefreshButton(); this.hideRefreshButton();
if (this.platform.is('desktop') || this.platform.is('mobileweb')) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.get('GabineteProcess').then((allprocess: any[]) => { this.storage.get('GabineteProcess').then((allprocess: any[]) => {
console.log('ALL PROCESS WEB',allprocess )
allprocess.forEach(element => { allprocess.forEach(element => {
let date = new Date(element.taskStartDate); let date = new Date(element.taskStartDate);
date.setMonth(date.getMonth() + 1); date.setMonth(date.getMonth() + 1);
@@ -318,7 +318,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
this.allProcessesList = this.sortService.sortDate(this.allProcessesList, 'CreateDate') this.allProcessesList = this.sortService.sortDate(this.allProcessesList, 'CreateDate')
}); });
console.log("All process from db ", allprocess)
}) })
} }
@@ -352,7 +352,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
if (totalDays == 0) { if (totalDays == 0) {
if (allday) { if (allday) {
customDate = this.getCustomDate(start) + ", " + this.getCustomHours(start) + " (todo dia)"; customDate = this.getCustomDate(start) + ", " + this.getCustomHours(start) + " (todo dia)";
console.log(customDate);
return customDate; return customDate;
} }
else { else {
@@ -415,7 +415,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
this.router.navigate(['/home/gabinete-digital/event-list/approve-event', serialNumber, 'gabinete-digital']); this.router.navigate(['/home/gabinete-digital/event-list/approve-event', serialNumber, 'gabinete-digital']);
} }
else { else {
console.log('cant find page for this task')
} }
} }
@@ -670,7 +670,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
} }
doRefresh(event) { doRefresh(event) {
console.log(event);
this.LoadCounts(); this.LoadCounts();
@@ -680,7 +680,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
}, 2000); }, 2000);
} }
else { else {
console.log('null');
} }
} }
@@ -71,7 +71,7 @@ export class PedidoPage implements OnInit {
this.loggeduser = authService.ValidatedUser; this.loggeduser = authService.ValidatedUser;
this.activatedRoute.paramMap.subscribe(params => { this.activatedRoute.paramMap.subscribe(params => {
// console.log(params["params"]); //
if (params["params"].SerialNumber) { if (params["params"].SerialNumber) {
this.serialnumber = params["params"].SerialNumber; this.serialnumber = params["params"].SerialNumber;
@@ -105,7 +105,7 @@ export class PedidoPage implements OnInit {
this.processes.GetTask(this.serialnumber).subscribe(res => { this.processes.GetTask(this.serialnumber).subscribe(res => {
this.fulltask = res this.fulltask = res
console.log('FULLTAK ONLINe', this.fulltask);
if (res.workflowDisplayName == 'Pedido de Parecer' || res.workflowDisplayName == 'Pedido de Parecer do Presidente') { if (res.workflowDisplayName == 'Pedido de Parecer' || res.workflowDisplayName == 'Pedido de Parecer do Presidente') {
@@ -130,7 +130,7 @@ export class PedidoPage implements OnInit {
"activityInstanceName": res.activityInstanceName, "activityInstanceName": res.activityInstanceName,
"Status": res.workflowInstanceDataFields.Status, "Status": res.workflowInstanceDataFields.Status,
} }
console.log(this.task);
this.updateProcess(res); this.updateProcess(res);
} }
else if (res.workflowDisplayName == 'Pedido de Deferimento') { else if (res.workflowDisplayName == 'Pedido de Deferimento') {
@@ -207,7 +207,7 @@ export class PedidoPage implements OnInit {
} else { } else {
this.sqliteservice.getProcessById(this.serialnumber).then((process) => { this.sqliteservice.getProcessById(this.serialnumber).then((process) => {
console.log('PROCESS BY ID', process, this.serialnumber)
let fulltak = { let fulltak = {
Documents: JSON.parse(process[0].Documents) || [], Documents: JSON.parse(process[0].Documents) || [],
@@ -227,7 +227,7 @@ export class PedidoPage implements OnInit {
} }
this.fulltask = fulltak; this.fulltask = fulltak;
console.log('FULLTAK OFFLINE', this.fulltask);
if (process[0].workflowDisplayName == 'Pedido de Parecer' || process[0].workflowDisplayName == 'Pedido de Parecer do Presidente') { if (process[0].workflowDisplayName == 'Pedido de Parecer' || process[0].workflowDisplayName == 'Pedido de Parecer do Presidente') {
let date = new Date(process[0].taskStartDate); let date = new Date(process[0].taskStartDate);
@@ -296,7 +296,7 @@ export class PedidoPage implements OnInit {
getDocumentDetails(forlderId: string, applicationId: string) { getDocumentDetails(forlderId: string, applicationId: string) {
this.processes.GetDocumentDetails(forlderId, applicationId).subscribe(res => { this.processes.GetDocumentDetails(forlderId, applicationId).subscribe(res => {
this.attachments = res.Documents; this.attachments = res.Documents;
console.log(res['Documents']);
}) })
} }
@@ -453,7 +453,7 @@ export class PedidoPage implements OnInit {
}); });
await modal.present(); await modal.present();
modal.onDidDismiss().then(res => { modal.onDidDismiss().then(res => {
console.log('Modal closed');
this.goBack(); this.goBack();
}); });
} }
@@ -522,7 +522,7 @@ export class PedidoPage implements OnInit {
// } // }
async distartExpedientModal() { async distartExpedientModal() {
console.log(this.fulltask);
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: DiscartExpedientModalPage, component: DiscartExpedientModalPage,
componentProps: { componentProps: {
@@ -538,7 +538,7 @@ export class PedidoPage implements OnInit {
modal.onDidDismiss().then(res => { modal.onDidDismiss().then(res => {
if (res['data'] == 'close') { if (res['data'] == 'close') {
this.close(); this.close();
/* console.log('2Expedient Discard closed2'); /*
this.close(); this.close();
this.openMenu(); */ this.openMenu(); */
} }
@@ -547,7 +547,7 @@ export class PedidoPage implements OnInit {
} }
async openDelegarModal(task: any) { async openDelegarModal(task: any) {
console.log(task);
let classs; let classs;
if (window.innerWidth <= 800) { if (window.innerWidth <= 800) {
@@ -596,7 +596,7 @@ export class PedidoPage implements OnInit {
} }
async openDarParecer(task: any) { async openDarParecer(task: any) {
console.log(task);
let classs; let classs;
if (window.innerWidth < 701) { if (window.innerWidth < 701) {
@@ -119,7 +119,7 @@ export class PedidosPage implements OnInit {
} }
openExpedientDetailPage(data) { openExpedientDetailPage(data) {
console.log(data);
this.openExpedientDetail.emit(data); this.openExpedientDetail.emit(data);
} }
@@ -136,7 +136,7 @@ export class PedidosPage implements OnInit {
let parecer = await this.processes.GetTasksList("Pedido de Parecer", false).toPromise(); let parecer = await this.processes.GetTasksList("Pedido de Parecer", false).toPromise();
let parecerPr = await this.processes.GetTasksList("Pedido de Parecer do Presidente", false).toPromise(); let parecerPr = await this.processes.GetTasksList("Pedido de Parecer do Presidente", false).toPromise();
console.log(parecerPr);
this.skeletonLoader = false this.skeletonLoader = false
@@ -177,7 +177,7 @@ export class PedidosPage implements OnInit {
this.skeletonLoader = false this.skeletonLoader = false
console.log(result);
this.deferimentoList = []; this.deferimentoList = [];
@@ -257,7 +257,7 @@ export class PedidosPage implements OnInit {
} }
}) })
this.listToPresentparecerList = this.sortService.sortArrayISODate(parecerlist); this.listToPresentparecerList = this.sortService.sortArrayISODate(parecerlist);
console.log('parecer', process)
}) })
this.sqliteservice.getprocessByworkflow("Pedido de Deferimento").then((process: any[]) => { this.sqliteservice.getprocessByworkflow("Pedido de Deferimento").then((process: any[]) => {
@@ -284,7 +284,7 @@ export class PedidosPage implements OnInit {
} }
}) })
this.listToPresentdeferimentoList = this.sortService.sortArrayISODate(deferimentolist); this.listToPresentdeferimentoList = this.sortService.sortArrayISODate(deferimentolist);
console.log('deferimento', process)
}) })
} }
@@ -107,7 +107,7 @@ export class PendentesPage implements OnInit {
pendentesList = this.sortService.sortDate(pendentesList, 'CreateDate'); pendentesList = this.sortService.sortDate(pendentesList, 'CreateDate');
this.listToPresent = pendentesList; this.listToPresent = pendentesList;
this.storage.set('pendente-list',pendentesList).then(() => { this.storage.set('pendente-list',pendentesList).then(() => {
console.log('Pendente list SAVED')
}) })
this.skeletonLoader = false; this.skeletonLoader = false;
@@ -130,7 +130,7 @@ export class PendentesPage implements OnInit {
this.platform.ready().then(() => { this.platform.ready().then(() => {
this.sqliteservice.getAllProcess().then((process: any[]) => { this.sqliteservice.getAllProcess().then((process: any[]) => {
var pendingList = [] var pendingList = []
console.log('Pendentes off off',process )
process.forEach(element => { process.forEach(element => {
var workflow = JSON.parse(element.workflowInstanceDataFields); var workflow = JSON.parse(element.workflowInstanceDataFields);
if (workflow.Status === "Pending") { if (workflow.Status === "Pending") {
@@ -151,7 +151,7 @@ export class PendentesPage implements OnInit {
pendingList = this.sortService.sortDate(pendingList, 'CreateDate'); pendingList = this.sortService.sortDate(pendingList, 'CreateDate');
this.listToPresent = pendingList; this.listToPresent = pendingList;
console.log('pendentes', pendingList)
}) })
}) })
@@ -195,7 +195,7 @@ export class PendentesPage implements OnInit {
this.router.navigate(['/home/gabinete-digital/despachos', SerialNumber, 'gabinete-digital']); this.router.navigate(['/home/gabinete-digital/despachos', SerialNumber, 'gabinete-digital']);
} }
else { else {
console.log('cant find page for this task', WorkflowName, activityInstanceName)
} }
} }
+4 -4
View File
@@ -57,9 +57,9 @@ export class InactivityPage implements OnInit {
// let circleHeight = document.querySelector('.circle')['offsetHeight'] // let circleHeight = document.querySelector('.circle')['offsetHeight']
// let circleWidth = document.querySelector('.circle')['offsetWidth'] // let circleWidth = document.querySelector('.circle')['offsetWidth']
// console.log(window.innerHeight, ' < ', containerHeight) //
// console.log(circleHeight) //
// document.querySelectorAll('.circle').forEach(e=>{ // document.querySelectorAll('.circle').forEach(e=>{
// e['style']['height'] = (circleHeight -1 )+'px' // e['style']['height'] = (circleHeight -1 )+'px'
@@ -163,10 +163,10 @@ export class InactivityPage implements OnInit {
if(this.code.length == 4) { if(this.code.length == 4) {
if(!SessionStore.hasPin) { if(!SessionStore.hasPin) {
// console.log('storePin') //
this.storePin() this.storePin()
} else { } else {
// console.log('pinLogin') //
this.pinLogin() this.pinLogin()
} }
} }
+2 -2
View File
@@ -48,7 +48,7 @@ export class LoginPage implements OnInit {
ngOnInit() { ngOnInit() {
this.storageservice.get('theme').then((theme) =>{ this.storageservice.get('theme').then((theme) =>{
console.log('LOGIN THEME',theme)
this.ThemeService.setTheme(theme) this.ThemeService.setTheme(theme)
}) })
} }
@@ -133,7 +133,7 @@ export class LoginPage implements OnInit {
this.changeProfileService.run(); this.changeProfileService.run();
console.log(attempt.ChatData)
if(attempt.ChatData){ if(attempt.ChatData){
await this.authService.loginChat(attempt.ChatData.data); await this.authService.loginChat(attempt.ChatData.data);
await this.authService.loginToChatWs(); await this.authService.loginToChatWs();
@@ -97,7 +97,7 @@ export class EditActionPage implements OnInit {
DateEnd: this.folder.DateEnd, DateEnd: this.folder.DateEnd,
ActionType: this.folder.ActionType, ActionType: this.folder.ActionType,
} }
console.log(body);
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {
@@ -90,7 +90,7 @@ export class NewActionPage implements OnInit {
} }
segmentChanged(ev: any) { segmentChanged(ev: any) {
console.log(ev.detail.value);
} }
get dateValid() { get dateValid() {
@@ -98,7 +98,6 @@ export class NewPublicationPage implements OnInit {
ngOnInit() { ngOnInit() {
this.setTitle(); this.setTitle();
console.log(this.folderId);
Filesystem.mkdir({ Filesystem.mkdir({
path: IMAGE_DIR, path: IMAGE_DIR,
directory: Directory.Data, directory: Directory.Data,
@@ -221,7 +220,6 @@ export class NewPublicationPage implements OnInit {
if (this.publicationType == '3') { if (this.publicationType == '3') {
console.log(this.navParams.get('publication'));
if (this.capturedImage != '') { if (this.capturedImage != '') {
this.publication = { this.publication = {
@@ -239,7 +237,6 @@ export class NewPublicationPage implements OnInit {
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {
console.log(this.publication);
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise() await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.toastService.successMessage("Publicação editada") this.toastService.successMessage("Publicação editada")
@@ -265,13 +262,10 @@ export class NewPublicationPage implements OnInit {
// FileBase64: this.publication.FileBase64, // FileBase64: this.publication.FileBase64,
// FileExtension: 'jpeg', // FileExtension: 'jpeg',
} }
/* console.log('Edit - keep image');
console.log(this.publication); */
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {
console.log(this.publication);
await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise() await this.publications.UpdatePublication(this.publication.ProcessId, this.publication).toPromise()
this.toastService.successMessage("Publicação criado") this.toastService.successMessage("Publicação criado")
@@ -295,8 +289,8 @@ export class NewPublicationPage implements OnInit {
FileExtension: 'jpeg', FileExtension: 'jpeg',
} }
console.log('Edit change image');
console.log(this.publication);
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {
@@ -315,8 +309,8 @@ export class NewPublicationPage implements OnInit {
else { else {
const date = formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss') const date = formatDate(new Date(), 'yyyy-MM-dd HH:mm:ss')
console.log(date);
console.log(this.folderId);
this.publication = { this.publication = {
@@ -334,7 +328,7 @@ export class NewPublicationPage implements OnInit {
const loader = this.toastService.loading() const loader = this.toastService.loading()
try { try {
console.log(this.publication);
await this.publications.CreatePublication(this.folderId, this.publication).toPromise(); await this.publications.CreatePublication(this.folderId, this.publication).toPromise();
this.close(); this.close();
this.toastService.successMessage("Publicação criado") this.toastService.successMessage("Publicação criado")
@@ -372,7 +366,7 @@ export class NewPublicationPage implements OnInit {
this.publicationTitle = 'Editar Publicação'; this.publicationTitle = 'Editar Publicação';
this.pub = this.navParams.get('publication'); this.pub = this.navParams.get('publication');
console.log(this.pub, 'pub')
} }
} }
@@ -395,7 +389,7 @@ export class NewPublicationPage implements OnInit {
resultType: CameraResultType.DataUrl, resultType: CameraResultType.DataUrl,
source: CameraSource.Camera source: CameraSource.Camera
}); });
console.log(image);
this.photo = this.sanitizer.bypassSecurityTrustResourceUrl(image && (image.dataUrl)); this.photo = this.sanitizer.bypassSecurityTrustResourceUrl(image && (image.dataUrl));
} */ } */
@@ -458,12 +452,12 @@ export class NewPublicationPage implements OnInit {
path: `${IMAGE_DIR}/${fileName}`, path: `${IMAGE_DIR}/${fileName}`,
directory: Directory.Data, directory: Directory.Data,
}).then(result => { }).then(result => {
console.log('ALL RESULTS', result.files)
let lastphoto = result.files[result.files.length - 1] let lastphoto = result.files[result.files.length - 1]
this.loadFileData(lastphoto); this.loadFileData(lastphoto);
}, },
async (err) => { async (err) => {
console.log('ERROR FILE DOSENT EXIST', err)
// Folder does not yet exists! // Folder does not yet exists!
await Filesystem.mkdir({ await Filesystem.mkdir({
path: IMAGE_DIR, path: IMAGE_DIR,
@@ -477,7 +471,7 @@ export class NewPublicationPage implements OnInit {
} }
async loadFileData(fileName: string) { async loadFileData(fileName: string) {
console.log('ALL PHOTOT FILE', fileName)
const loading = await this.loadingCtrl.create({ const loading = await this.loadingCtrl.create({
message: 'Loading data...', message: 'Loading data...',
@@ -497,7 +491,7 @@ export class NewPublicationPage implements OnInit {
data: `data:image/jpeg;base64,${readFile.data}`, data: `data:image/jpeg;base64,${readFile.data}`,
}); });
console.log('ALL IMAGE', this.images)
this.capturedImage = this.images[0].data this.capturedImage = this.images[0].data
@@ -512,12 +506,12 @@ export class NewPublicationPage implements OnInit {
this.imageCompress.compressFile(image, orientation, 50, 50,).then(() => { this.imageCompress.compressFile(image, orientation, 50, 50,).then(() => {
this.imgResultBeforeCompress = image; this.imgResultBeforeCompress = image;
console.log('Size in bytes was:', this.imageCompress.byteCount(image));
this.imageCompress.compressFile(image, orientation, 50, 50).then( this.imageCompress.compressFile(image, orientation, 50, 50).then(
result => { result => {
this.imgResultAfterCompress = result; this.imgResultAfterCompress = result;
console.log('Size in bytes is now:', this.imageCompress.byteCount(result));
} }
); );
}) })
@@ -527,11 +521,11 @@ export class NewPublicationPage implements OnInit {
//this.imgResultBeforeCompress = image;s //this.imgResultBeforeCompress = image;s
this.imageCompress.getOrientation(this.capturedImage).then((orientation) => { this.imageCompress.getOrientation(this.capturedImage).then((orientation) => {
console.log('Size in bytes was:', this.imageCompress.byteCount(this.capturedImage));
this.imageCompress.compressFile(this.capturedImage, orientation, 90, 90).then( this.imageCompress.compressFile(this.capturedImage, orientation, 90, 90).then(
result => { result => {
this.capturedImage = result; this.capturedImage = result;
console.log('Size in bytes is now:', this.imageCompress.byteCount(result));
} }
); );
@@ -48,7 +48,6 @@ export class PublicationDetailPage implements OnInit {
} }
ngOnInit() { ngOnInit() {
/* console.log(this.publication.FileBase64); */
this.getPublicationDetail(); this.getPublicationDetail();
} }
doRefresh(event) { doRefresh(event) {
@@ -61,10 +60,8 @@ export class PublicationDetailPage implements OnInit {
getPublicationDetail() { getPublicationDetail() {
this.showLoader = true; this.showLoader = true;
console.log(this.publicationId);
/* console.log(this.folderId); */
this.publications.GetPublicationById(this.publicationId).subscribe(res=>{ this.publications.GetPublicationById(this.publicationId).subscribe(res=>{
console.log(res);
/* this.publication = res; */ /* this.publication = res; */
this.publication = { this.publication = {
DateIndex: res.DateIndex, DateIndex: res.DateIndex,
@@ -111,7 +108,7 @@ export class PublicationDetailPage implements OnInit {
async editPost(publicationType:any) { async editPost(publicationType:any) {
console.log(this.publication);
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: NewPublicationPage, component: NewPublicationPage,
componentProps:{ componentProps:{
@@ -148,7 +148,7 @@ export class PublicationsPage implements OnInit {
this.getFromDB() this.getFromDB()
this.publications.GetPublicationFolderList().subscribe(async res => { this.publications.GetPublicationFolderList().subscribe(async res => {
console.log('accoes', res)
let publicationsEventFolderList = new Array(); let publicationsEventFolderList = new Array();
let publicationsTravelFolderList = new Array(); let publicationsTravelFolderList = new Array();
@@ -170,7 +170,7 @@ export class PublicationsPage implements OnInit {
publicationsEventFolderList.push(folder); publicationsEventFolderList.push(folder);
} }
else { else {
console.log('Viagem', folder)
publicationsTravelFolderList.push(folder); publicationsTravelFolderList.push(folder);
} }
@@ -194,7 +194,7 @@ export class PublicationsPage implements OnInit {
} }
addActionToStorage(events, viagens) { addActionToStorage(events, viagens) {
console.log('actionsWEBDB', events, viagens)
if (this.platform.is('desktop') || this.platform.is('mobileweb')) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
this.storage.set('actionsEvents', events); this.storage.set('actionsEvents', events);
this.storage.set('actionsViagens', viagens); this.storage.set('actionsViagens', viagens);
@@ -215,7 +215,7 @@ export class PublicationsPage implements OnInit {
this.publicationsEventFolderList = new Array(); this.publicationsEventFolderList = new Array();
this.publicationsTravelFolderList = new Array(); this.publicationsTravelFolderList = new Array();
this.storage.get('actionsEvents').then((events) => { this.storage.get('actionsEvents').then((events) => {
console.log('actionsEvents', events)
events.forEach(data => { events.forEach(data => {
let folder: PublicationFolder = { let folder: PublicationFolder = {
ProcessId: data.ProcessId, ProcessId: data.ProcessId,
@@ -231,7 +231,7 @@ export class PublicationsPage implements OnInit {
}); });
}); });
this.storage.get('actionsViagens').then((viagens) => { this.storage.get('actionsViagens').then((viagens) => {
console.log('actionsViagens', viagens)
viagens.forEach(data => { viagens.forEach(data => {
let folder: PublicationFolder = { let folder: PublicationFolder = {
ProcessId: data.ProcessId, ProcessId: data.ProcessId,
@@ -249,7 +249,7 @@ export class PublicationsPage implements OnInit {
} else { } else {
this.sqliteservice.getAllActions().then((actions: any[]) => { this.sqliteservice.getAllActions().then((actions: any[]) => {
console.log('offline publi', actions)
this.publicationsEventFolderList = new Array(); this.publicationsEventFolderList = new Array();
this.publicationsTravelFolderList = new Array(); this.publicationsTravelFolderList = new Array();
@@ -516,7 +516,7 @@ export class PublicationsPage implements OnInit {
// this.crop.crop('path/to/image.jpg', {quality: 75}) // this.crop.crop('path/to/image.jpg', {quality: 75})
// .then( // .then(
// newImage => console.log('new image path is: ' + newImage), // newImage =>
// error => console.error('Error cropping image', error) // error => console.error('Error cropping image', error)
// ); // );
@@ -33,11 +33,11 @@ export class PublicationDetailPage implements OnInit {
) { ) {
this.activatedRoute.paramMap.subscribe(params => { this.activatedRoute.paramMap.subscribe(params => {
console.log(params);
if(params["params"]) { if(params["params"]) {
this.folderId = params["params"].folderId; this.folderId = params["params"].folderId;
this.publicationId = params["params"].publicationId; this.publicationId = params["params"].publicationId;
// console.log(params["params"]); //
} }
}); });
@@ -56,7 +56,6 @@ export class PublicationDetailPage implements OnInit {
} }
ngOnInit() { ngOnInit() {
/* console.log(this.publication.FileBase64); */
this.getPublicationDetail(); this.getPublicationDetail();
} }
doRefresh(event) { doRefresh(event) {
@@ -69,10 +68,9 @@ export class PublicationDetailPage implements OnInit {
getPublicationDetail(){ getPublicationDetail(){
this.showLoader = true; this.showLoader = true;
console.log(this.publicationId);
/* console.log(this.folderId); */
this.publications.GetPublicationById(this.publicationId).subscribe(res=>{ this.publications.GetPublicationById(this.publicationId).subscribe(res=>{
console.log(res);
/* this.publication = res; */ /* this.publication = res; */
this.publication = { this.publication = {
DateIndex: res.DateIndex, DateIndex: res.DateIndex,
@@ -126,7 +124,7 @@ export class PublicationDetailPage implements OnInit {
} }
async editPost(publicationType:any) { async editPost(publicationType:any) {
console.log(this.publication);
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: NewPublicationPage, component: NewPublicationPage,
componentProps:{ componentProps:{
@@ -48,11 +48,11 @@ export class ViewPublicationsPage implements OnInit {
this.item = new PublicationFolder(); this.item = new PublicationFolder();
this.activatedRoute.paramMap.subscribe(params => { this.activatedRoute.paramMap.subscribe(params => {
console.log(params);
if (params["params"]) { if (params["params"]) {
this.folderId = params["params"].folderId; this.folderId = params["params"].folderId;
// console.log(params["params"]); //
} }
window['app-view-publications-page-doRefresh'] = this.doRefresh window['app-view-publications-page-doRefresh'] = this.doRefresh
@@ -114,7 +114,7 @@ export class ViewPublicationsPage implements OnInit {
getPublicationDetail() { getPublicationDetail() {
this.publications.GetPresidentialAction(this.folderId).subscribe(res => { this.publications.GetPresidentialAction(this.folderId).subscribe(res => {
console.log(res);
this.item = res; this.item = res;
this.sqliteservice.updatePublicationsDetails(this.folderId, JSON.stringify(res)); this.sqliteservice.updatePublicationsDetails(this.folderId, JSON.stringify(res));
}); });
@@ -128,7 +128,7 @@ export class ViewPublicationsPage implements OnInit {
// this.publications.GetIdsPublicationsImages(this.id).subscribe(res => { // this.publications.GetIdsPublicationsImages(this.id).subscribe(res => {
// console.log(this.id) //
// this.publicationList = new Array(); // this.publicationList = new Array();
@@ -138,31 +138,31 @@ export class ViewPublicationsPage implements OnInit {
const folderId = this.folderId const folderId = this.folderId
this.publications.GetPublicationsImages(this.folderId).subscribe(res => { this.publications.GetPublicationsImages(this.folderId).subscribe(res => {
console.log('publications ids', res)
this.publicationList = new Array(); this.publicationList = new Array();
/* for(let i = 0; i < res.length; i++) { /* for(let i = 0; i < res.length; i++) {
this.publications.GetPublicationById(res[i]).subscribe(ress => { this.publications.GetPublicationById(res[i]).subscribe(ress => {
console.log('publications by ids', ress)
let item: Publication = this.publicationPipe.itemList(ress) let item: Publication = this.publicationPipe.itemList(ress)
console.log('publications by ids 2', item)
this.publicationList.push(item); this.publicationList.push(item);
}) })
} */ } */
res.forEach(element => { res.forEach(element => {
console.log('publications elements', element)
this.publications.GetPublicationById(element).subscribe(ress => { this.publications.GetPublicationById(element).subscribe(ress => {
console.log('publications by ids', ress)
let item: Publication = this.publicationPipe.itemList(ress) let item: Publication = this.publicationPipe.itemList(ress)
console.log('publications by ids 2', item)
this.publicationList.push(item); this.publicationList.push(item);
}) })
}); });
console.log('PUBLICATIONS IMAGEs',this.publicationList)
this.sqliteservice.updateactions(this.folderId, JSON.stringify(this.publicationList)); this.sqliteservice.updateactions(this.folderId, JSON.stringify(this.publicationList));
console.log('PUBLICATIONS IMAGEs',this.publicationList)
this.getpublication = this.publicationList; this.getpublication = this.publicationList;
this.showLoader = false; this.showLoader = false;
@@ -170,7 +170,7 @@ export class ViewPublicationsPage implements OnInit {
/* this.publicationList = new Array(); /* this.publicationList = new Array();
res.forEach(element => { res.forEach(element => {
console.log('getPublications', element)
let item: Publication = this.publicationPipe.itemList(element) let item: Publication = this.publicationPipe.itemList(element)
this.publicationList.push(item); this.publicationList.push(item);
}); });
@@ -190,15 +190,15 @@ export class ViewPublicationsPage implements OnInit {
this.getFromDB(); this.getFromDB();
this.publications.GetPublications(this.folderId).subscribe(res => { this.publications.GetPublications(this.folderId).subscribe(res => {
console.log(this.folderId)
this.publicationList = new Array(); this.publicationList = new Array();
res.forEach(element => { res.forEach(element => {
console.log('getPublications', element)
let item: Publication = this.publicationPipe.itemList(element) let item: Publication = this.publicationPipe.itemList(element)
this.publicationList.push(item); this.publicationList.push(item);
console.log('getPublications 222', item)
}); });
this.sqliteservice.updateactions(this.folderId, JSON.stringify(this.publicationList)); this.sqliteservice.updateactions(this.folderId, JSON.stringify(this.publicationList));
@@ -233,7 +233,7 @@ export class ViewPublicationsPage implements OnInit {
getFromDB() { getFromDB() {
this.sqliteservice.getActionById(this.folderId).then((publications) => { this.sqliteservice.getActionById(this.folderId).then((publications) => {
console.log('publications', publications)
/* let item = { /* let item = {
ActionType: publications[0].ActionType, ActionType: publications[0].ActionType,
DateBegin: publications[0].DateBegin, DateBegin: publications[0].DateBegin,
@@ -32,7 +32,6 @@ export class OrganicEntityPage implements OnInit {
getOrganicEntity(){ getOrganicEntity(){
this.OrganicEntityService.getOrganicEntity().subscribe(res=>{ this.OrganicEntityService.getOrganicEntity().subscribe(res=>{
console.log(res)
this.organicEntities = res; this.organicEntities = res;
this.showOrganicEntities = res this.showOrganicEntities = res
}); });
+4 -4
View File
@@ -82,7 +82,7 @@ export class SearchPage implements OnInit {
} else if (this.currentPath == '/home/publications') { } else if (this.currentPath == '/home/publications') {
this.type = "AccoesPresidenciais" this.type = "AccoesPresidenciais"
} else { } else {
console.log('search bug!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!')
} }
} }
} }
@@ -148,7 +148,7 @@ export class SearchPage implements OnInit {
this.list = list this.list = list
console.log(this.list)
const elem = document.documentElement.querySelector('.most-searched-word-container'); const elem = document.documentElement.querySelector('.most-searched-word-container');
@@ -219,7 +219,7 @@ export class SearchPage implements OnInit {
this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender
,this.searchOrganicEntiry, this.searchDocTypeId, '0').subscribe(res=>{ ,this.searchOrganicEntiry, this.searchDocTypeId, '0').subscribe(res=>{
console.log(res);
res.Categories.forEach( e => { res.Categories.forEach( e => {
e['Active'] = false; e['Active'] = false;
@@ -478,7 +478,7 @@ export class SearchPage implements OnInit {
this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender
,this.searchOrganicEntiry, this.searchDocTypeId, '386').subscribe(res=>{ ,this.searchOrganicEntiry, this.searchDocTypeId, '386').subscribe(res=>{
console.log(res);
res.Categories.forEach( e => { res.Categories.forEach( e => {
e['Active'] = false; e['Active'] = false;
@@ -49,7 +49,6 @@ export class SenderPage implements OnInit {
} }
selectUser(username:string){ selectUser(username:string){
console.log(username);
this.selectedUser = username; this.selectedUser = username;
this.close(this.selectedUser); this.close(this.selectedUser);
} }
+1 -1
View File
@@ -22,7 +22,7 @@ export class AESEncrypt {
//Decrypting the string contained in cipherParams using the PBKDF2 key //Decrypting the string contained in cipherParams using the PBKDF2 key
var decrypted = CryptoJS.AES.encrypt(encryptData, key128Bits1000Iterations, { mode: CryptoJS.mode.CBC, iv: iv, padding: CryptoJS.pad.Pkcs7 }); var decrypted = CryptoJS.AES.encrypt(encryptData, key128Bits1000Iterations, { mode: CryptoJS.mode.CBC, iv: iv, padding: CryptoJS.pad.Pkcs7 });
// console.log('AES encrypt',decrypted.toString()); //
return decrypted.toString(); return decrypted.toString();
} }
+1 -1
View File
@@ -34,7 +34,7 @@ export class ListBoxService {
list(eventSource: EventListStore[], profile: 'md' | 'pr' | 'all', rangeStartDate, randEndDate, {segment = 'Combinado', selectedDate= null}) { list(eventSource: EventListStore[], profile: 'md' | 'pr' | 'all', rangeStartDate, randEndDate, {segment = 'Combinado', selectedDate= null}) {
// console.log('eventSource', eventSource ,'rangeStartDate', new Date(rangeStartDate).toLocaleDateString('pt') , 'randEndDate', new Date(randEndDate).toLocaleDateString('pt')) //
// // filter range // // filter range
// if(selectedDate) { // if(selectedDate) {
+1 -1
View File
@@ -51,7 +51,7 @@ export class AlertService {
role: 'cancel', role: 'cancel',
cssClass: 'secondary', cssClass: 'secondary',
handler: () => { handler: () => {
//console.log('Confirm Cancel'); //
} }
}, { }, {
text: 'Apagar', text: 'Apagar',
@@ -13,12 +13,12 @@ export class AppProcessStatusService {
private events() { private events() {
document.addEventListener('pause', () => { document.addEventListener('pause', () => {
// console.log('App going to background'); //
this.status = 'pause' this.status = 'pause'
}); });
document.addEventListener('resume', () => { document.addEventListener('resume', () => {
// console.log('App going to background'); //
this.status = 'resume' this.status = 'resume'
}); });
} }
+3 -3
View File
@@ -25,7 +25,7 @@ export class AttachmentsService {
uploadFile(formData:any) { uploadFile(formData:any) {
console.log('UPLOAD file', formData)
//const geturl = environment.apiURL + 'Tasks/DelegateTask'; //const geturl = environment.apiURL + 'Tasks/DelegateTask';
const geturl = environment.apiURL + 'ObjectServer/UploadFiles'; const geturl = environment.apiURL + 'ObjectServer/UploadFiles';
@@ -82,8 +82,8 @@ export class AttachmentsService {
).subscribe((fileBlob: Uint8Array) => { ).subscribe((fileBlob: Uint8Array) => {
/** File - @ionic-native/file/ngx */ /** File - @ionic-native/file/ngx */
vm.file.writeFile(downloadPath, "YourFileName.pdf", fileBlob, {replace: true}); vm.file.writeFile(downloadPath, "YourFileName.pdf", fileBlob, {replace: true});
console.log(downloadPath +"/"+"YourFileName.pdf")
console.log(fileBlob)
}); });
} }
+18 -18
View File
@@ -80,7 +80,7 @@ export class AuthService {
try { try {
response = await this.http.post<LoginUserRespose>(environment.apiURL + "UserAuthentication/Login", '', this.opts).toPromise(); response = await this.http.post<LoginUserRespose>(environment.apiURL + "UserAuthentication/Login", '', this.opts).toPromise();
console.log(response);
if(saveSession) { if(saveSession) {
this.SetSession(response, user) this.SetSession(response, user)
@@ -96,8 +96,8 @@ export class AuthService {
SetSession(response: LoginUserRespose, user:UserForm) { SetSession(response: LoginUserRespose, user:UserForm) {
const session: UserSession = Object.assign(SessionStore.user, response) const session: UserSession = Object.assign(SessionStore.user, response)
console.log('SETSESSION', response, user)
console.log('SETSESSION 2', session)
if (response) { if (response) {
@@ -132,7 +132,7 @@ export class AuthService {
session.BasicAuthKey = user.BasicAuthKey session.BasicAuthKey = user.BasicAuthKey
console.log(session)
SessionStore.reset(session) SessionStore.reset(session)
this.ValidatedUser = SessionStore.user; this.ValidatedUser = SessionStore.user;
@@ -164,13 +164,13 @@ export class AuthService {
let responseChat = await this.httpService.post('login', postData).toPromise(); let responseChat = await this.httpService.post('login', postData).toPromise();
if(responseChat) { if(responseChat) {
console.log()
this.ValidatedUserChat = responseChat; this.ValidatedUserChat = responseChat;
localStorage.setItem('userChat', JSON.stringify(responseChat)); localStorage.setItem('userChat', JSON.stringify(responseChat));
this.storageService.store(AuthConnstants.AUTH, responseChat); this.storageService.store(AuthConnstants.AUTH, responseChat);
} }
else{ else{
console.log('Network error');
this.presentAlert('Network error'); this.presentAlert('Network error');
} }
@@ -185,22 +185,22 @@ export class AuthService {
loginToChatWs() { loginToChatWs() {
setTimeout(()=>{ setTimeout(()=>{
console.log('loginToChatWs')
this.WsChatService.connect(); this.WsChatService.connect();
this.WsChatService.login().then((message: any) => { this.WsChatService.login().then((message: any) => {
console.log('loginToChatWs',message)
SessionStore.user.RochetChatUserId = message.result.id SessionStore.user.RochetChatUserId = message.result.id
SessionStore.save() SessionStore.save()
// console.log('user session', SessionStore.user) //
this.WsChatService.setStatus('online') this.WsChatService.setStatus('online')
// alert('wsLogin') // alert('wsLogin')
}).catch((message) => { }).catch((message) => {
console.log('rocket chat login failed', message)
// alert('ws login failed') // alert('ws login failed')
}) })
@@ -216,9 +216,9 @@ export class AuthService {
let guid: any = await this.AttachmentsService.uploadFile(formData).toPromise() let guid: any = await this.AttachmentsService.uploadFile(formData).toPromise()
message.file.guid = guid.path message.file.guid = guid.path
console.log('========================================',guid)
// await this.storage.set(guid.path, message.file.image_url).then(() => { // await this.storage.set(guid.path, message.file.image_url).then(() => {
// console.log('add picture to chat IMAGE SAVED') //
// // message.getFileFromDb() // // message.getFileFromDb()
// }); // });
@@ -226,7 +226,7 @@ export class AuthService {
return true return true
} catch(e) { } catch(e) {
console.log('failed to upload to server', e)
return false return false
} }
@@ -240,7 +240,7 @@ export class AuthService {
return true return true
} catch(e) { } catch(e) {
console.log(e)
return false return false
} }
} }
@@ -251,16 +251,16 @@ export class AuthService {
this.NfService.downloadFileMsg = async (message: MessageService, room?: RoomService) => { this.NfService.downloadFileMsg = async (message: MessageService, room?: RoomService) => {
// console.log('FILE TYPE', message.file.type) //
let downloadFile = ""; let downloadFile = "";
if (message.file.type == "application/img") { if (message.file.type == "application/img") {
const event: any = await this.AttachmentsService.downloadFile(message.file.guid).toPromise(); const event: any = await this.AttachmentsService.downloadFile(message.file.guid).toPromise();
console.log('FILE TYPE 22', message.file.guid)
if (event.type === HttpEventType.DownloadProgress) { if (event.type === HttpEventType.DownloadProgress) {
//this.downloadProgess = Math.round((100 * event.loaded) / event.total); //this.downloadProgess = Math.round((100 * event.loaded) / event.total);
// console.log('FILE TYPE 33', message.file.type) //
return true return true
} else if (event.type === HttpEventType.Response) { } else if (event.type === HttpEventType.Response) {
downloadFile = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '')); downloadFile = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
@@ -272,7 +272,7 @@ export class AuthService {
} }
await this.storage.set(message.file.guid, downloadFile).then(() => { await this.storage.set(message.file.guid, downloadFile).then(() => {
// console.log('IMAGE SAVED') //
}); });
return true return true
} }
+1 -1
View File
@@ -13,7 +13,7 @@ export class CameraService {
return new Promise<Photo>(async (resolve, reject)=>{ return new Promise<Photo>(async (resolve, reject)=>{
console.log('add camera to picture')
const image = await Camera.getPhoto({ const image = await Camera.getPhoto({
quality: 50, quality: 50,
+4 -4
View File
@@ -38,7 +38,7 @@ export class ChatService {
if(this.p.userPermission(this.p.permissionList.Chat.access)) { if(this.p.userPermission(this.p.permissionList.Chat.access)) {
// console.log(this.loggedUserChat) //
this.headers = this.headers.set('X-User-Id', this.loggedUserChat.userId); this.headers = this.headers.set('X-User-Id', this.loggedUserChat.userId);
this.headers = this.headers.set('X-Auth-Token', this.loggedUserChat.authToken); this.headers = this.headers.set('X-Auth-Token', this.loggedUserChat.authToken);
this.options = { this.options = {
@@ -210,7 +210,7 @@ export class ChatService {
/* GROUPS */ /* GROUPS */
addGroup(body:any){ addGroup(body:any){
console.log(body);
return this.http.post(environment.apiChatUrl+'groups.create', body, this.options); return this.http.post(environment.apiChatUrl+'groups.create', body, this.options);
} }
setGroupCustomFields(body:any){ setGroupCustomFields(body:any){
@@ -320,7 +320,7 @@ export class ChatService {
} }
async subscribe(roomId:any) { async subscribe(roomId:any) {
console.log('Subcrive')
let params = new HttpParams(); let params = new HttpParams();
params = params.set("roomId", roomId); params = params.set("roomId", roomId);
let opts = { let opts = {
@@ -329,7 +329,7 @@ export class ChatService {
} }
this.http.get(environment.apiChatUrl+'im.messages', opts).subscribe(async res => { this.http.get(environment.apiChatUrl+'im.messages', opts).subscribe(async res => {
console.log("Subcrive", res)
if (res == 502) { if (res == 502) {
// Connection timeout // Connection timeout
+12 -12
View File
@@ -32,7 +32,7 @@ export class ChatStorageService {
}) })
this.storage.set('chatmsg' + roomId, messages).then((value) => { this.storage.set('chatmsg' + roomId, messages).then((value) => {
// console.log('MSG SAVED ON STORAGE', value) //
}); });
}) })
@@ -66,7 +66,7 @@ export class ChatStorageService {
await this.storage.set('chatmsg' + roomId, messages) await this.storage.set('chatmsg' + roomId, messages)
} else { } else {
// console.log('failed to update', identificator, ':',ChatMessage) //
} }
}) })
@@ -101,14 +101,14 @@ export class ChatStorageService {
messages[index] = Object.assign(messages[index], ChatMessage) messages[index] = Object.assign(messages[index], ChatMessage)
// if(messages[index].msg.includes('***********')) { // if(messages[index].msg.includes('***********')) {
// console.log('storage update') //
// console.log(JSON.stringify(messages[index])) //
// console.log(JSON.stringify(ChatMessage)) //
// } // }
await this.storage.set('chatmsg' + roomId, messages) await this.storage.set('chatmsg' + roomId, messages)
} else { } else {
console.log('failed to update', identificator)
} }
}) })
@@ -130,10 +130,10 @@ export class ChatStorageService {
delete ChatMessage.temporaryData delete ChatMessage.temporaryData
messages.push(ChatMessage) messages.push(ChatMessage)
console.log('no ID')
await this.storage.set('chatmsg' + roomId, messages) await this.storage.set('chatmsg' + roomId, messages)
// console.log('add to DB', ChatMessage) //
} else { } else {
const find = messages.find((message)=> { const find = messages.find((message)=> {
@@ -144,9 +144,9 @@ export class ChatStorageService {
delete ChatMessage.temporaryData delete ChatMessage.temporaryData
messages.push(ChatMessage) messages.push(ChatMessage)
await this.storage.set('chatmsg' + roomId, messages) await this.storage.set('chatmsg' + roomId, messages)
// console.log('add to DB', ChatMessage) //
} else { } else {
console.log('duplicate')
} }
} }
@@ -166,7 +166,7 @@ export class ChatStorageService {
delete ChatMessage.temporaryData delete ChatMessage.temporaryData
messages.push(ChatMessage) messages.push(ChatMessage)
// console.log('add to DB') //
} else { } else {
const find = messages.find((message)=> { const find = messages.find((message)=> {
@@ -176,7 +176,7 @@ export class ChatStorageService {
if(!find) { if(!find) {
delete ChatMessage.temporaryData delete ChatMessage.temporaryData
messages.push(ChatMessage) messages.push(ChatMessage)
// console.log('add to DB') //
} }
+3 -3
View File
@@ -242,14 +242,14 @@ export class MessageService {
} else if (this.file.type != "application/img") { } else if (this.file.type != "application/img") {
downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''); downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
console.log(downloadFile)
} /* else if (this.file.type == 'application/audio') { } /* else if (this.file.type == 'application/audio') {
downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''); downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
} else if (this.file.type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document') { } else if (this.file.type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document') {
downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''); downloadFile = new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), '');
} */ } */
console.log('Download file ',downloadFile )
this.attachments[0] = { this.attachments[0] = {
image_url: downloadFile, image_url: downloadFile,
@@ -331,7 +331,7 @@ export class MessageService {
async save() { async save() {
const message = this.getChatObj() const message = this.getChatObj()
console.log(message);
await MessageModel.update(message) await MessageModel.update(message)
+5 -5
View File
@@ -242,12 +242,12 @@ export class RoomService {
if (typeof args[1] != 'object') { if (typeof args[1] != 'object') {
this.userThatIsTyping = this.usernameToDisplayName(args[0]) this.userThatIsTyping = this.usernameToDisplayName(args[0])
console.log(this.userThatIsTyping, 'this.userThatIsTyping')
this.isTyping = args[1] this.isTyping = args[1]
this.otherUserType = args[1] this.otherUserType = args[1]
this.readAllMessage() this.readAllMessage()
// console.log(JSON.stringify(args)) //
// alert(JSON.stringify(args)) // alert(JSON.stringify(args))
} else if(args[0]?.method == 'viewMessage' || args[1]?.method == 'viewMessage') { } else if(args[0]?.method == 'viewMessage' || args[1]?.method == 'viewMessage') {
@@ -255,7 +255,7 @@ export class RoomService {
} else if(args[0]?.method == 'deleteMessage' || args[1]?.method == 'deleteMessage') { } else if(args[0]?.method == 'deleteMessage' || args[1]?.method == 'deleteMessage') {
// alert('delete') // alert('delete')
// console.log(args[0], 'receive delete message::()') //
this.deleteMessage(args[1]?.method?._id) this.deleteMessage(args[1]?.method?._id)
} else { } else {
@@ -395,7 +395,7 @@ export class RoomService {
return true return true
} else { } else {
// console.log(_id,'==',this.messages[i]?._id, false) //
} }
} }
@@ -612,7 +612,7 @@ export class RoomService {
await this.WsChatService.loadHistory(this.id, limit).then( async (chatHistory:chatHistory) => { await this.WsChatService.loadHistory(this.id, limit).then( async (chatHistory:chatHistory) => {
// console.log('load chatHistory', JSON.stringify(chatHistory)) //
const messagesId = this.messages.map((message)=> message._id) const messagesId = this.messages.map((message)=> message._id)
+1 -1
View File
@@ -13,7 +13,7 @@ export class WebsocketService {
public connect(url): Rx.Subject<MessageEvent> { public connect(url): Rx.Subject<MessageEvent> {
if(!this.subject){ if(!this.subject){
this.subject = this.create(url); this.subject = this.create(url);
console.log("Sucessful connect :"+url);
} }
return this.subject; return this.subject;
} }
@@ -152,7 +152,7 @@ export class WsChatMethodsService {
try { try {
const rooms = await this.storage.get('Rooms'); const rooms = await this.storage.get('Rooms');
console.log('restore',rooms)
if(rooms) { if(rooms) {
await rooms.result.update.forEach( async (roomData: room) => { await rooms.result.update.forEach( async (roomData: room) => {
@@ -172,7 +172,7 @@ export class WsChatMethodsService {
async getAllRooms () { async getAllRooms () {
this.loadingWholeList = true this.loadingWholeList = true
const rooms = await this.WsChatService.getRooms(); const rooms = await this.WsChatService.getRooms();
console.log('get all rooms', this.loggedUser)
await this.storage.remove('Rooms'); await this.storage.remove('Rooms');
await rooms.result.update.forEach( async (roomData: room, index) => { await rooms.result.update.forEach( async (roomData: room, index) => {
@@ -210,7 +210,7 @@ export class WsChatMethodsService {
}); });
console.log('save rooms', rooms)
await this.storage.set('Rooms', rooms); await this.storage.set('Rooms', rooms);
@@ -249,7 +249,7 @@ export class WsChatMethodsService {
} }
this.WsChatService.streamNotifyLogged().then((subscription=>{ this.WsChatService.streamNotifyLogged().then((subscription=>{
console.log('streamRoomMessages', subscription)
})) }))
} }
@@ -275,14 +275,14 @@ export class WsChatMethodsService {
*/ */
private defaultSubtribe(id: any) { private defaultSubtribe(id: any) {
this.WsChatService.streamRoomMessages(id).then((subscription)=>{ this.WsChatService.streamRoomMessages(id).then((subscription)=>{
//console.log('streamRoomMessages', subscription) //
}) })
this.WsChatService.subStreamNotifyRoom(id, 'typing', false) this.WsChatService.subStreamNotifyRoom(id, 'typing', false)
this.WsChatService.subStreamNotifyRoom(id, 'readMessage', false) this.WsChatService.subStreamNotifyRoom(id, 'readMessage', false)
this.WsChatService.streamNotifyRoomDeleteMessage(id).then((subscription)=>{ this.WsChatService.streamNotifyRoomDeleteMessage(id).then((subscription)=>{
//console.log('streamNotifyRoomDeleteMessage', subscription); //
}) })
} }
+22 -22
View File
@@ -54,7 +54,7 @@ export class WsChatService {
} }
const requestId = uuidv4() const requestId = uuidv4()
// console.log('Login true', SessionStore.user) //
const message = { const message = {
msg: "method", msg: "method",
method: "login", method: "login",
@@ -70,12 +70,12 @@ export class WsChatService {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
// console.log('MESSAGE:ID', requestId) //
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{ this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
// console.log('MESSAGE:ID', message) //
if(message.id == requestId ) { // same request send if(message.id == requestId ) { // same request send
// console.log('MESSAGE:ID', message.id, requestId) //
// console.log('LOGIN WS',message) //
if(message.result) { if(message.result) {
if(message.result.token) { if(message.result.token) {
@@ -87,11 +87,11 @@ export class WsChatService {
}, 10) }, 10)
resolve(message) resolve(message)
// console.log('LOGIN WS',message) //
} }
} else { } else {
this.isLogin = false this.isLogin = false
// console.log('Register FAIl', message) //
reject(message) reject(message)
} }
@@ -121,7 +121,7 @@ export class WsChatService {
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{ this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
if(message.id == requestId) { // same request send if(message.id == requestId) { // same request send
resolve(message) resolve(message)
// console.log('getRooms', message) //
return true return true
} }
}}) }})
@@ -206,7 +206,7 @@ export class WsChatService {
}] }]
} }
// console.log('send message to rocketchat ', message) //
this.ws.send({message, requestId}); this.ws.send({message, requestId});
@@ -312,7 +312,7 @@ export class WsChatService {
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{ this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
if(message.id == requestId ) { // same request send if(message.id == requestId ) { // same request send
resolve(message) resolve(message)
// console.log(message); //
return true return true
} }
@@ -478,7 +478,7 @@ export class WsChatService {
return new Promise<chatHistory>((resolve, reject) => { return new Promise<chatHistory>((resolve, reject) => {
this.ws.registerCallback({type:'Onmessage', funx:(message)=>{ this.ws.registerCallback({type:'Onmessage', funx:(message)=>{
// console.log(message) //
if(message.id == requestId ) { // same request send if(message.id == requestId ) { // same request send
resolve(message) resolve(message)
return true return true
@@ -536,7 +536,7 @@ export class WsChatService {
this.ws.registerCallback({ this.ws.registerCallback({
type:'Onmessage', type:'Onmessage',
funx:(message)=>{ funx:(message)=>{
//console.log(message); //
if(message.msg =='changed' && message.collection == collection) { if(message.msg =='changed' && message.collection == collection) {
if(message.fields.args[0].rid == roomId) { if(message.fields.args[0].rid == roomId) {
@@ -674,7 +674,7 @@ export class WsChatService {
registerCallback:(params: wsCallbacksParams) => { registerCallback:(params: wsCallbacksParams) => {
let id = params.requestId || params.key || uuidv4() let id = params.requestId || params.key || uuidv4()
// console.log('register id', params) //
this.wsCallbacks[id] = params this.wsCallbacks[id] = params
this.n++ this.n++
return id return id
@@ -690,7 +690,7 @@ export class WsChatService {
onopen: async ()=> { onopen: async ()=> {
this.ws.connected = true this.ws.connected = true
console.log('================== welcome to socket server =====================')
setTimeout(()=>{ setTimeout(()=>{
@@ -719,11 +719,11 @@ export class WsChatService {
for (const [key, item] of Object.entries(this.wsMsgQueue)) { for (const [key, item] of Object.entries(this.wsMsgQueue)) {
if(item.loginRequired == true && this.isLogin == true) { if(item.loginRequired == true && this.isLogin == true) {
//console.log('run msgQueue ', key) //
this.ws.send(item); this.ws.send(item);
delete this.wsMsgQueue[key] delete this.wsMsgQueue[key]
} else if(item.loginRequired == false) { } else if(item.loginRequired == false) {
//console.log('run msgQueue ', key) //
this.ws.send(item); this.ws.send(item);
delete this.wsMsgQueue[key] delete this.wsMsgQueue[key]
} }
@@ -732,13 +732,13 @@ export class WsChatService {
send: ({message, requestId = uuidv4(), loginRequired = true}:send) => { send: ({message, requestId = uuidv4(), loginRequired = true}:send) => {
if (this.ws.connected == false || loginRequired == true && this.isLogin == false) { // save data to send when back online if (this.ws.connected == false || loginRequired == true && this.isLogin == false) { // save data to send when back online
// console.log('save msgQueue this.ws.connected == false || loginRequired == true && this.isLogin == false',this.ws.connected, loginRequired, this.isLogin) //
//console.log('save msgQueue', requestId, message) //
this.wsMsgQueue[requestId] = {message, requestId, loginRequired} this.wsMsgQueue[requestId] = {message, requestId, loginRequired}
} else { } else {
let messageStr = JSON.stringify(message) let messageStr = JSON.stringify(message)
// console.log('messageStr', messageStr) //
this.socket.send(messageStr) this.socket.send(messageStr)
} }
@@ -748,7 +748,7 @@ export class WsChatService {
onmessage: async (event: any)=> { onmessage: async (event: any)=> {
const data = JSON.parse(event.data) const data = JSON.parse(event.data)
// console.log('onmessage', data) //
for (const [key, value] of Object.entries(this.wsCallbacks)) { for (const [key, value] of Object.entries(this.wsCallbacks)) {
if(value.type== 'Onmessage') { if(value.type== 'Onmessage') {
@@ -772,11 +772,11 @@ export class WsChatService {
this.connect() this.connect()
this.login() this.login()
console.log(`[close] Connection closed cleanly, code=${event.code} reason=${event.reason}`);
}, },
onerror: (event: any) => { onerror: (event: any) => {
console.log(`[error] ${event.message}`);
} }
}} }}
+56 -13
View File
@@ -47,6 +47,15 @@ export class EventsService {
hasOwnOficial: boolean = false; hasOwnOficial: boolean = false;
hasOwnPessoal: boolean = false; hasOwnPessoal: boolean = false;
userCalendarNameSharedOficial = '';
userCalendarNameSharedPessoal = '';
userCalendarNameOwnOficial = '';
userCalendarNameOwnPessoal = '';
constructor( constructor(
private http: HttpClient, private http: HttpClient,
public user: AuthService, public user: AuthService,
@@ -57,6 +66,7 @@ export class EventsService {
this.loggeduser = this.user.ValidatedUser; this.loggeduser = this.user.ValidatedUser;
this.headers = new HttpHeaders();
this.headersMdOficial = new HttpHeaders(); this.headersMdOficial = new HttpHeaders();
this.headersMdPessoal = new HttpHeaders(); this.headersMdPessoal = new HttpHeaders();
@@ -82,7 +92,7 @@ export class EventsService {
} }
setHeader() { async setHeader () {
this.hasSharedCalendar = false this.hasSharedCalendar = false
this.hasSharedOficial = false this.hasSharedOficial = false
@@ -92,13 +102,22 @@ export class EventsService {
this.hasOwnOficial = false this.hasOwnOficial = false
this.hasOwnPessoal = false this.hasOwnPessoal = false
this.headers = new HttpHeaders();
this.headerOwnOficial= new HttpHeaders(); this.headerOwnOficial= new HttpHeaders();
this.headerOwnPessoal= new HttpHeaders(); this.headerOwnPessoal= new HttpHeaders();
this.headerSharedOficial= new HttpHeaders(); this.headerSharedOficial= new HttpHeaders();
this.headerSharedPessoal= new HttpHeaders(); this.headerSharedPessoal= new HttpHeaders();
this.calendarIds = [] this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
this.userCalendarNameSharedOficial = '';
this.userCalendarNameSharedPessoal = '';
this.userCalendarNameOwnOficial = '';
this.userCalendarNameOwnPessoal = '';
this.calendarIds = [];
if (this.loggeduser) { if (this.loggeduser) {
if (this.loggeduser.Profile == 'MDGPR') { if (this.loggeduser.Profile == 'MDGPR') {
@@ -226,10 +245,15 @@ export class EventsService {
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId); this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarName', sharedCalendar.CalendarName); this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarName', sharedCalendar.CalendarName);
} }
this.GetCalendarName(sharedCalendar.OwnerUserId).subscribe((e)=> {
console.log(e)
})
} }
this.headers = new HttpHeaders();
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
} }
} }
@@ -328,6 +352,23 @@ export class EventsService {
return this.http.get<any>(`${geturl}`, options) return this.http.get<any>(`${geturl}`, options)
} }
GetCalendarName(userid:string) {
let geturl = environment.apiURL + 'userauthentication/single';
let params = new HttpParams();
params = params.set("id", userid);
let options = {
headers: this.headers,
params: params
}
return this.http.get<any>(`${geturl}`, options)
}
async getAllMdEvents(startdate: string, enddate: string) { async getAllMdEvents(startdate: string, enddate: string) {
let prO = [], prP = []; let prO = [], prP = [];
@@ -341,6 +382,8 @@ export class EventsService {
} }
async getAllOwnEvents(startdate: string, enddate: string) { async getAllOwnEvents(startdate: string, enddate: string) {
let ownO = [], ownP = []; let ownO = [], ownP = [];
@@ -469,7 +512,7 @@ export class EventsService {
headers: this.headersSharedOficial, headers: this.headersSharedOficial,
params: params params: params
}; };
console.log(options);
return this.http.get<Event[]>(`${geturl}`, options); return this.http.get<Event[]>(`${geturl}`, options);
} }
@@ -642,7 +685,7 @@ export class EventsService {
return this.http.put<Event>(`${puturl}`, event, options).pipe( return this.http.put<Event>(`${puturl}`, event, options).pipe(
catchError(err => { catchError(err => {
console.log('Event edit saved offline')
this.offlinemanager.storeRequestData('eventEdit', arrayReq); this.offlinemanager.storeRequestData('eventEdit', arrayReq);
throw new Error(err); throw new Error(err);
}) })
@@ -667,7 +710,7 @@ export class EventsService {
let options: any; let options: any;
switch (calendarName) { switch (calendarName) {
case 'Oficial': case 'Oficial':
console.log(calendarName);
options = { options = {
headers: this.headersMdOficial, headers: this.headersMdOficial,
params: params params: params
@@ -675,14 +718,14 @@ export class EventsService {
break; break;
case 'Pessoal': case 'Pessoal':
console.log(calendarName);
options = { options = {
headers: this.headersMdPessoal, headers: this.headersMdPessoal,
params: params params: params
}; };
break; break;
} }
console.log(options);
return this.http.post<string>(`${puturl}`, event, options) return this.http.post<string>(`${puturl}`, event, options)
} }
@@ -695,7 +738,7 @@ export class EventsService {
let options: any; let options: any;
switch (calendarName) { switch (calendarName) {
case 'Oficial': case 'Oficial':
console.log(calendarName);
options = { options = {
headers: this.headersPrOficial, headers: this.headersPrOficial,
params: params params: params
@@ -703,7 +746,7 @@ export class EventsService {
break; break;
case 'Pessoal': case 'Pessoal':
console.log(calendarName);
options = { options = {
headers: this.headersPrPessoal, headers: this.headersPrPessoal,
params: params params: params
@@ -816,7 +859,7 @@ export class EventsService {
return this.http.delete(`${puturl}`, options).pipe( return this.http.delete(`${puturl}`, options).pipe(
catchError(err => { catchError(err => {
console.log('Event edit saved offline')
this.offlinemanager.storeRequestData('eventDelete', arrayReq); this.offlinemanager.storeRequestData('eventDelete', arrayReq);
throw new Error(err); throw new Error(err);
}) })
@@ -891,7 +934,7 @@ export class EventsService {
return this.http.delete(`${puturl}`, options).pipe( return this.http.delete(`${puturl}`, options).pipe(
catchError(err => { catchError(err => {
console.log('Event edit saved offline')
this.offlinemanager.storeRequestData('eventDelete', arrayReq); this.offlinemanager.storeRequestData('eventDelete', arrayReq);
throw new Error(err); throw new Error(err);
}) })
@@ -70,7 +70,7 @@ export class EditEventPage implements OnInit {
else{ else{
this.pageId = paramMap.get('eventId'); this.pageId = paramMap.get('eventId');
eventid = paramMap.get('eventId'); eventid = paramMap.get('eventId');
console.log(eventid);
} }
if (paramMap.has("caller")){ if (paramMap.has("caller")){
@@ -162,7 +162,7 @@ export class EditEventPage implements OnInit {
this.activatedRoute.paramMap.subscribe(paramMap =>{ this.activatedRoute.paramMap.subscribe(paramMap =>{
if (paramMap.has("profile")){ if (paramMap.has("profile")){
console.log(paramMap.get('profile'));
} }
}); });
@@ -184,11 +184,10 @@ export class EditEventPage implements OnInit {
loadAttachments() loadAttachments()
{ {
/* console.log(this.pageId); */
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => { this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
this.loadedEventAttachments = res; this.loadedEventAttachments = res;
console.log(res);
}); });
} }
@@ -72,7 +72,7 @@ export class EventDetailModalPage implements OnInit {
else{ else{
this.pageId = paramMap.get('eventId'); this.pageId = paramMap.get('eventId');
eventid = paramMap.get('eventId'); eventid = paramMap.get('eventId');
console.log(eventid);
} }
if (paramMap.has("caller")){ if (paramMap.has("caller")){
@@ -184,10 +184,10 @@ export class EventDetailModalPage implements OnInit {
this.loadedEventAttachments = attachments; this.loadedEventAttachments = attachments;
}); */ }); */
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => { this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
console.log(res);
},(error) => { },(error) => {
console.log(error);
}); });
} }
@@ -70,7 +70,7 @@ export class EventDetailPage implements OnInit {
else{ else{
this.pageId = paramMap.get('eventId'); this.pageId = paramMap.get('eventId');
eventid = paramMap.get('eventId'); eventid = paramMap.get('eventId');
console.log(eventid);
} }
if (paramMap.has("caller")){ if (paramMap.has("caller")){
@@ -160,7 +160,7 @@ export class EventDetailPage implements OnInit {
this.activatedRoute.paramMap.subscribe(paramMap =>{ this.activatedRoute.paramMap.subscribe(paramMap =>{
if (paramMap.has("profile")){ if (paramMap.has("profile")){
console.log(paramMap.get('profile'));
} }
}); });
@@ -182,11 +182,10 @@ export class EventDetailPage implements OnInit {
loadAttachments() loadAttachments()
{ {
/* console.log(this.pageId); */
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => { this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
this.loadedEventAttachments = res; this.loadedEventAttachments = res;
console.log(res);
}); });
} }
+11 -11
View File
@@ -85,15 +85,15 @@ export class EventsPage implements OnInit {
public platform: Platform, public platform: Platform,
) { ) {
this.existingScreenOrientation = this.screenOrientation.type; this.existingScreenOrientation = this.screenOrientation.type;
console.log(this.existingScreenOrientation);
this.loggeduser = authService.ValidatedUser; this.loggeduser = authService.ValidatedUser;
this.prEventList = null; this.prEventList = null;
this.platform.resize.subscribe(async () => { this.platform.resize.subscribe(async () => {
//console.log('Resize event detected'); //
// console.log('Resize event detected'); //
}); });
@@ -136,7 +136,7 @@ export class EventsPage implements OnInit {
// Lock to portrait // Lock to portrait
lockToPortrait(){ lockToPortrait(){
this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT); this.screenOrientation.lock(this.screenOrientation.ORIENTATIONS.PORTRAIT);
console.log('set');
} }
// Lock to landscape // Lock to landscape
@@ -152,7 +152,7 @@ export class EventsPage implements OnInit {
checkScreenOrientation(){ checkScreenOrientation(){
if( window.innerWidth < 701) { if( window.innerWidth < 701) {
this.lockToPortrait(); this.lockToPortrait();
console.log('was here');
} }
else{ else{
@@ -232,8 +232,8 @@ export class EventsPage implements OnInit {
let prOficialEvents= await this.eventService.getAllPrOficialEvents(start, end).toPromise(); let prOficialEvents= await this.eventService.getAllPrOficialEvents(start, end).toPromise();
let prPessoalEvents= await this.eventService.getAllPrPessoalEvents(start, end).toPromise(); let prPessoalEvents= await this.eventService.getAllPrPessoalEvents(start, end).toPromise();
this.eventsList = prOficialEvents.concat(prPessoalEvents); this.eventsList = prOficialEvents.concat(prPessoalEvents);
console.log(this.eventsList);
console.log(this.eventsList);
if(this.eventsList.length > 0){ if(this.eventsList.length > 0){
this.currentEvent = this.eventsList[0].Subject; this.currentEvent = this.eventsList[0].Subject;
@@ -296,12 +296,12 @@ export class EventsPage implements OnInit {
changeProfile(){ changeProfile(){
if(this.profile == "mdgpr"){ if(this.profile == "mdgpr"){
console.log('pr');
this.profile ="pr"; this.profile ="pr";
this.RefreshEvents(); this.RefreshEvents();
} }
else{ else{
console.log('mdgpr');
this.profile ="mdgpr"; this.profile ="mdgpr";
this.RefreshEvents(); this.RefreshEvents();
} }
@@ -314,7 +314,7 @@ export class EventsPage implements OnInit {
} }
async openEventDetail1(id:any){ async openEventDetail1(id:any){
console.log(id);
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: EventDetailPage, component: EventDetailPage,
@@ -331,7 +331,7 @@ export class EventsPage implements OnInit {
LoadList() { LoadList() {
this.processes.GetTaskListExpediente(false).subscribe(result => { this.processes.GetTaskListExpediente(false).subscribe(result => {
console.log("Expediente", result);
const ExpedienteTask = result.map( e=> this.expedienteTaskPipe.transform(e)) const ExpedienteTask = result.map( e=> this.expedienteTaskPipe.transform(e))
+4 -4
View File
@@ -34,25 +34,25 @@ export class FcmService {
PushNotifications.addListener( PushNotifications.addListener(
'registration', 'registration',
(token: PushNotificationToken) => { (token: PushNotificationToken) => {
console.log('My token: ' + JSON.stringify(token));
} }
); );
PushNotifications.addListener('registrationError', (error: any) => { PushNotifications.addListener('registrationError', (error: any) => {
console.log('Error: ' + JSON.stringify(error));
}); });
PushNotifications.addListener( PushNotifications.addListener(
'pushNotificationReceived', 'pushNotificationReceived',
async (notification: PushNotification) => { async (notification: PushNotification) => {
console.log('Push received: ' + JSON.stringify(notification));
} }
); );
PushNotifications.addListener( PushNotifications.addListener(
'pushNotificationActionPerformed', 'pushNotificationActionPerformed',
async (notification: PushNotificationActionPerformed) => { async (notification: PushNotificationActionPerformed) => {
const data = notification.notification.data; const data = notification.notification.data;
console.log('Action performed: ' + JSON.stringify(notification.notification));
if (data.detailsId) { if (data.detailsId) {
this.router.navigateByUrl(`/home/notifications/notification-detail${data.detaisId}`); this.router.navigateByUrl(`/home/notifications/notification-detail${data.detaisId}`);
} }
@@ -22,7 +22,7 @@ export class CustomImageCachePage implements OnInit {
@Input() @Input()
set src(imageUrl: string){ set src(imageUrl: string){
console.log('SET SOURCE', imageUrl)
const imageName = imageUrl.split('/').pop() const imageName = imageUrl.split('/').pop()
const fileType = imageName.split('.').pop() const fileType = imageName.split('.').pop()
@@ -30,7 +30,7 @@ export class CustomImageCachePage implements OnInit {
Filesystem.readFile({ Filesystem.readFile({
directory: Directory.Cache, directory: Directory.Cache,
path: `${CACHE_FOLDER}/${imageName}`}).then(readFile =>{ path: `${CACHE_FOLDER}/${imageName}`}).then(readFile =>{
console.log('LOCAL FILE: ', readFile)
// set to SRC // set to SRC
this._src = `data:image/${fileType};base64ToFile, ${readFile.data}` this._src = `data:image/${fileType};base64ToFile, ${readFile.data}`
}).catch(async e =>{ }).catch(async e =>{
+1 -1
View File
@@ -25,7 +25,7 @@ export class FileLoaderService {
// input.onchange = () => { // input.onchange = () => {
// // you can use this method to get file and perform respective operations // // you can use this method to get file and perform respective operations
// let files = Array.from(input.files); // let files = Array.from(input.files);
// console.log(files); //
// }; // };
+4 -4
View File
@@ -78,12 +78,12 @@ export class FileService {
path: IMAGE_DIR, path: IMAGE_DIR,
directory: Directory.Data, directory: Directory.Data,
}).then(result => { }).then(result => {
console.log('ALL RESULTS', result.files[0])
let lastphoto = result.files[result.files.length - 1] let lastphoto = result.files[result.files.length - 1]
resolve(lastphoto) resolve(lastphoto)
}, },
async (err) => { async (err) => {
console.log('ERROR FILE DOSENT EXIST', err)
reject('ERROR FILE DOSENT EXIST') reject('ERROR FILE DOSENT EXIST')
// Folder does not yet exists! // Folder does not yet exists!
await Filesystem.mkdir({ await Filesystem.mkdir({
@@ -127,7 +127,7 @@ export class FileService {
//new method 4 //new method 4
async loadFileData(fileName: string) { async loadFileData(fileName: string) {
console.log('ALL PHOTOT FILE', fileName)
// for (let f of fileNames) { // for (let f of fileNames) {
const filePath = `${IMAGE_DIR}/${fileName}`; const filePath = `${IMAGE_DIR}/${fileName}`;
@@ -139,7 +139,7 @@ export class FileService {
data: `data:image/jpeg;base64,${readFile.data}`, data: `data:image/jpeg;base64,${readFile.data}`,
}; };
console.log('ALL IMAGE', image)
const capturedImage = image.data const capturedImage = image.data
+1 -5
View File
@@ -17,7 +17,7 @@ export class SortService {
} }
sortArrayByDate(myArray: any) { sortArrayByDate(myArray: any) {
console.log(myArray[0].taskStartDate);
if(myArray.length > 0){ if(myArray.length > 0){
return myArray.sort(function (a, b) { return myArray.sort(function (a, b) {
return (new Date(a.workflowInstanceDataFields.StartDate) < new Date(b.workflowInstanceDataFields.StartDate)) ? -1 : ((new Date(a.workflowInstanceDataFields.StartDate) > new Date(b.workflowInstanceDataFields.StartDate)) ? 1 : 0); return (new Date(a.workflowInstanceDataFields.StartDate) < new Date(b.workflowInstanceDataFields.StartDate)) ? -1 : ((new Date(a.workflowInstanceDataFields.StartDate) > new Date(b.workflowInstanceDataFields.StartDate)) ? 1 : 0);
@@ -29,10 +29,6 @@ export class SortService {
return array.sort( (a,b)=> { return array.sort( (a,b)=> {
/* console.log("AAA"+new Date(this.ObjectService.deepFind(a, path)));
console.log("BB"+new Date(this.ObjectService.deepFind(b, path))); */
return (new Date(this.ObjectService.deepFind(a, path)) < new Date(this.ObjectService.deepFind(b, path))) ? -1 : ((new Date(this.ObjectService.deepFind(a, path)) > new Date(this.ObjectService.deepFind(b, path))) ? 1 : 0); return (new Date(this.ObjectService.deepFind(a, path)) < new Date(this.ObjectService.deepFind(b, path))) ? -1 : ((new Date(this.ObjectService.deepFind(a, path)) > new Date(this.ObjectService.deepFind(b, path))) ? 1 : 0);
//return new Date(this.ObjectService.deepFind(b, path)).getTime() - new Date(this.ObjectService.deepFind(a, path)).getTime(); //return new Date(this.ObjectService.deepFind(b, path)).getTime() - new Date(this.ObjectService.deepFind(a, path)).getTime();
+4 -4
View File
@@ -60,12 +60,12 @@ export class TimeService {
if(this.room.t === 'p'){ if(this.room.t === 'p'){
this.chatService.deleteGroup(body).subscribe(res=>{ this.chatService.deleteGroup(body).subscribe(res=>{
console.log(res);
}); });
} }
else{ else{
this.chatService.deleteChannel(body).subscribe(res=>{ this.chatService.deleteChannel(body).subscribe(res=>{
console.log(res);
}); });
} }
}); });
@@ -93,12 +93,12 @@ export class TimeService {
if(this.room.t === 'p'){ if(this.room.t === 'p'){
this.chatService.deleteGroup(body).subscribe(res=>{ this.chatService.deleteGroup(body).subscribe(res=>{
console.log(res);
}); });
} }
else{ else{
this.chatService.deleteChannel(body).subscribe(res=>{ this.chatService.deleteChannel(body).subscribe(res=>{
console.log(res);
}); });
} }
}); });
+12 -12
View File
@@ -22,12 +22,12 @@ export class JsonStore {
.then(function () { .then(function () {
WL.Logger.debug('Init done'); WL.Logger.debug('Init done');
console.log('Init done');
return WL.JSONStore.get(collectionName).add(data, addOptions); return WL.JSONStore.get(collectionName).add(data, addOptions);
}).fail(function (err) { }).fail(function (err) {
WL.Logger.error(err); WL.Logger.error(err);
console.log(err)
}); });
} */ } */
@@ -51,16 +51,16 @@ export class JsonStore {
/* WL.JSONStore.init(JSONStoreCollections) /* WL.JSONStore.init(JSONStoreCollections)
.then(function () { .then(function () {
WL.Logger.debug('Find all colletion data'); WL.Logger.debug('Find all colletion data');
console.log('Find all colletion data');
}).fail(function (err) { }).fail(function (err) {
WL.Logger.error(err); WL.Logger.error(err);
console.log("JsonStore getColletion error ",err)
}); });
const data = WL.JSONStore.get(collectionName).findAll(allOptions).then((value) => { const data = WL.JSONStore.get(collectionName).findAll(allOptions).then((value) => {
console.log('Find all colletion data', value);
return JSON.parse(value); return JSON.parse(value);
}); });
@@ -91,14 +91,14 @@ export class JsonStore {
/* WL.JSONStore.init(JSONStoreCollections) /* WL.JSONStore.init(JSONStoreCollections)
.then(function () { .then(function () {
WL.Logger.debug('Find colletion data by id'); WL.Logger.debug('Find colletion data by id');
console.log('Find colletion data by id');
return WL.JSONStore.get(collectionName).find(query, allOptions).then((value) => { return WL.JSONStore.get(collectionName).find(query, allOptions).then((value) => {
console.log('Find colletion data by id', value);
}); });
}).fail(function (err) { }).fail(function (err) {
WL.Logger.error(err); WL.Logger.error(err);
console.log(err)
}); */ }); */
} }
@@ -110,9 +110,9 @@ export class JsonStore {
var options = {}; var options = {};
/* WL.JSONStore.get(collectionName).replace(document, options).then(function (numberOfDocsReplaced) { /* WL.JSONStore.get(collectionName).replace(document, options).then(function (numberOfDocsReplaced) {
console.log("JsonStore replace document sucess: ", numberOfDocsReplaced)
}).fail(function (error) { }).fail(function (error) {
console.log("JsonStore replace document error: ", error)
}); */ }); */
} }
@@ -120,9 +120,9 @@ export class JsonStore {
/* var query = { _id: 1 }; Exemple of query /* var query = { _id: 1 }; Exemple of query
var options = { exact: true }; var options = { exact: true };
/* WL.JSONStore.get(collectionName).remove(query, options).then(function (numberOfDocsRemoved) { /* WL.JSONStore.get(collectionName).remove(query, options).then(function (numberOfDocsRemoved) {
console.log("JsonStore remove document sucess: ", numberOfDocsRemoved)
}).fail(function (error) { }).fail(function (error) {
console.log("JsonStore remove document erro: ", error)
}); */ }); */
} }
} }
@@ -18,9 +18,9 @@ export class NativeNotificationService {
LocalNotifications.requestPermissions() LocalNotifications.requestPermissions()
LocalNotifications.checkPermissions().then((data)=>{ LocalNotifications.checkPermissions().then((data)=>{
// console.log('success', data) //
}).catch((data)=>{ }).catch((data)=>{
// console.log('error', data) //
}) })
} }
@@ -12,7 +12,7 @@ export class NetworkConnectionService {
constructor(){ constructor(){
Network.addListener('networkStatusChange', status => { Network.addListener('networkStatusChange', status => {
console.log('Network status changed', status);
}); });
} }
@@ -23,7 +23,7 @@ export class WebNotificationPopupService {
// Let's check if the browser supports notifications // Let's check if the browser supports notifications
if (!('Notification' in window)) { if (!('Notification' in window)) {
console.log("This browser does not support notifications.");
} else { } else {
if(this.checkNotificationPromise()) { if(this.checkNotificationPromise()) {
Notification.requestPermission() Notification.requestPermission()
@@ -67,7 +67,7 @@ export class WebNotificationPopupService {
// {action: 'reply', title: 'Reply', icon: 'https://example/reply.png'} // {action: 'reply', title: 'Reply', icon: 'https://example/reply.png'}
// ] // ]
}).then(e =>{ }).then(e =>{
console.log(e)
}) })
}); });
+13 -13
View File
@@ -98,17 +98,17 @@ export class NotificationsService {
getAndpostToken(username) { getAndpostToken(username) {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
console.log('Notifications not supported')
} else { } else {
const geturl = environment.apiURL + 'notifications/token'; const geturl = environment.apiURL + 'notifications/token';
PushNotifications.addListener('registration', PushNotifications.addListener('registration',
(token: Token) => { (token: Token) => {
console.log('token: ', token.value)
this.storageService.store(username, token.value); this.storageService.store(username, token.value);
this.storageService.get(username).then(value => { this.storageService.get(username).then(value => {
console.log('STORAGE TOKEN', value)
this.storageService.get(AuthConnstants.USER).then(res => { this.storageService.get(AuthConnstants.USER).then(res => {
console.log('USERID', res);
const headers = { 'Authorization': SessionStore.user.BasicAuthKey }; const headers = { 'Authorization': SessionStore.user.BasicAuthKey };
const body = { const body = {
UserId: res.UserId, UserId: res.UserId,
@@ -118,9 +118,9 @@ export class NotificationsService {
}; };
this.http.post<Tokenn>(`${geturl}`, body, { headers }).subscribe(data => { this.http.post<Tokenn>(`${geturl}`, body, { headers }).subscribe(data => {
console.log('TOKEN USER MIDLE', data);
}, (error) => { }, (error) => {
console.log('Post token to backend', error)
}) })
}); });
@@ -134,7 +134,7 @@ export class NotificationsService {
registrationError() { registrationError() {
PushNotifications.addListener('registrationError', PushNotifications.addListener('registrationError',
(error: any) => { (error: any) => {
console.log('Error on registration: ' + JSON.stringify(error));
} }
); );
} }
@@ -142,9 +142,9 @@ export class NotificationsService {
onReciveForeground() { onReciveForeground() {
PushNotifications.addListener('pushNotificationReceived', PushNotifications.addListener('pushNotificationReceived',
(notification: PushNotificationSchema) => { (notification: PushNotificationSchema) => {
console.log('Push received: ' + JSON.stringify(notification));
this.DataArray.push(notification) this.DataArray.push(notification)
console.log("On ReceiveNotification", this.DataArray)
this.storageService.store("Notifications", this.DataArray) this.storageService.store("Notifications", this.DataArray)
this.eventtrigger.publishSomeData({ this.eventtrigger.publishSomeData({
notification: "recive" notification: "recive"
@@ -156,9 +156,9 @@ export class NotificationsService {
onReciveBackground() { onReciveBackground() {
PushNotifications.addListener('pushNotificationActionPerformed', PushNotifications.addListener('pushNotificationActionPerformed',
(notification: ActionPerformed) => { (notification: ActionPerformed) => {
console.log('Push action performed: ' + JSON.stringify(notification));
/* this.DataArray.push(notification.notification) /* this.DataArray.push(notification.notification)
console.log("On ReceiveNotification", this.DataArray)
this.storageService.store("Notifications", this.DataArray) this.storageService.store("Notifications", this.DataArray)
this.eventtrigger.publishSomeData({ this.eventtrigger.publishSomeData({
notification: "recive" notification: "recive"
@@ -175,10 +175,10 @@ export class NotificationsService {
notificatinsRoutes = (notification) => { notificatinsRoutes = (notification) => {
console.log('Push action performed 2222: ' + JSON.stringify(notification.data));
if (notification.notification.data.Service === "agenda" && notification.notification.data.IdObject.length > 10) { if (notification.notification.data.Service === "agenda" && notification.notification.data.IdObject.length > 10) {
console.log("Id Lenght", notification.notification.data.IdObject.length)
this.zone.run(() => this.router.navigate(['/home/agenda', notification.notification.data.IdObject, 'agenda'])); this.zone.run(() => this.router.navigate(['/home/agenda', notification.notification.data.IdObject, 'agenda']));
} }
else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expediente") { else if (notification.notification.data.Service === "gabinete-digital" && notification.notification.data.Object === "expediente") {
+1 -1
View File
@@ -54,7 +54,7 @@ export class ObjectQueryService {
} }
print() { print() {
console.log(this.data)
} }
} }
+1 -1
View File
@@ -25,7 +25,7 @@ export class OfflineManagerService {
JSON.parse(req).forEach(element => { JSON.parse(req).forEach(element => {
this.eventservice.editEvent(element, 2, 3).subscribe((res) => { this.eventservice.editEvent(element, 2, 3).subscribe((res) => {
this.storage.remove('eventEdit') this.storage.remove('eventEdit')
console.log('eventEdit synchnize', res)
}) })
}); });
}) })

Some files were not shown because too many files have changed in this diff Show More