mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
Merge branch 'feature/chatStorage' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
Generated
+27
@@ -3079,6 +3079,13 @@
|
|||||||
"integrity": "sha512-Xeabtfjw/OCa8tZUh3yVqomVNMztwmg0hXYrcX18r3+Zq0XYRSgNtsBHrye1rBgNkXYqblWQHZQErwrAC2UNxQ==",
|
"integrity": "sha512-Xeabtfjw/OCa8tZUh3yVqomVNMztwmg0hXYrcX18r3+Zq0XYRSgNtsBHrye1rBgNkXYqblWQHZQErwrAC2UNxQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"@types/cordova": "^0.0.34"
|
"@types/cordova": "^0.0.34"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"@types/cordova": {
|
||||||
|
"version": "0.0.34",
|
||||||
|
"resolved": "https://registry.npmjs.org/@types/cordova/-/cordova-0.0.34.tgz",
|
||||||
|
"integrity": "sha1-6nrd907Ow9dimCegw54smt3HPQQ="
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"@ionic-native/local-notifications": {
|
"@ionic-native/local-notifications": {
|
||||||
@@ -11805,6 +11812,26 @@
|
|||||||
"resolved": "https://registry.npmjs.org/ionic-angular/-/ionic-angular-3.9.10.tgz",
|
"resolved": "https://registry.npmjs.org/ionic-angular/-/ionic-angular-3.9.10.tgz",
|
||||||
"integrity": "sha512-4nmGrdpu4Zy3SZwF0AaS/3gDrbFGU1dV+zn1eqInFgFj9q20N1cIITgvyIcoxUI/IoqYiohsJX1rGY5vB/HrhQ=="
|
"integrity": "sha512-4nmGrdpu4Zy3SZwF0AaS/3gDrbFGU1dV+zn1eqInFgFj9q20N1cIITgvyIcoxUI/IoqYiohsJX1rGY5vB/HrhQ=="
|
||||||
},
|
},
|
||||||
|
"ionic-image-loader": {
|
||||||
|
"version": "6.3.3",
|
||||||
|
"resolved": "https://registry.npmjs.org/ionic-image-loader/-/ionic-image-loader-6.3.3.tgz",
|
||||||
|
"integrity": "sha512-X7AbaY3Yt3q0+kOjodjqYwTkXNhRTs3/P/afffaWLBPk5frsd7JCNaFae9U8iErwfOIbJ7VZmCHYMApBZ3Aqew=="
|
||||||
|
},
|
||||||
|
"ionic-image-loader-v5": {
|
||||||
|
"version": "1.0.2",
|
||||||
|
"resolved": "https://registry.npmjs.org/ionic-image-loader-v5/-/ionic-image-loader-v5-1.0.2.tgz",
|
||||||
|
"integrity": "sha512-SsFRVjA4p6nloF+xljMctj3Uc1a74rG7HA4nDQ3zJNZgLa8S/6GqR9fr8qDb7/L3441i4ICrdQSKyfAkddbELQ==",
|
||||||
|
"requires": {
|
||||||
|
"tslib": "^1.9.0"
|
||||||
|
},
|
||||||
|
"dependencies": {
|
||||||
|
"tslib": {
|
||||||
|
"version": "1.14.1",
|
||||||
|
"resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz",
|
||||||
|
"integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg=="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"ionic-selectable": {
|
"ionic-selectable": {
|
||||||
"version": "4.9.0",
|
"version": "4.9.0",
|
||||||
"resolved": "https://registry.npmjs.org/ionic-selectable/-/ionic-selectable-4.9.0.tgz",
|
"resolved": "https://registry.npmjs.org/ionic-selectable/-/ionic-selectable-4.9.0.tgz",
|
||||||
|
|||||||
+3
-1
@@ -66,7 +66,7 @@
|
|||||||
"@ionic-native/http": "^5.31.1",
|
"@ionic-native/http": "^5.31.1",
|
||||||
"@ionic-native/image-picker": "^5.36.0",
|
"@ionic-native/image-picker": "^5.36.0",
|
||||||
"@ionic-native/in-app-browser": "^5.28.0",
|
"@ionic-native/in-app-browser": "^5.28.0",
|
||||||
"@ionic-native/ionic-webview": "^5.35.0",
|
"@ionic-native/ionic-webview": "^5.36.0",
|
||||||
"@ionic-native/local-notifications": "^4.20.0",
|
"@ionic-native/local-notifications": "^4.20.0",
|
||||||
"@ionic-native/media": "^5.36.0",
|
"@ionic-native/media": "^5.36.0",
|
||||||
"@ionic-native/media-capture": "^5.36.0",
|
"@ionic-native/media-capture": "^5.36.0",
|
||||||
@@ -120,6 +120,8 @@
|
|||||||
"hammerjs": "^2.0.8",
|
"hammerjs": "^2.0.8",
|
||||||
"http-server": "^0.12.3",
|
"http-server": "^0.12.3",
|
||||||
"ionic-angular": "^3.9.10",
|
"ionic-angular": "^3.9.10",
|
||||||
|
"ionic-image-loader": "^6.3.3",
|
||||||
|
"ionic-image-loader-v5": "^1.0.2",
|
||||||
"ionic-selectable": "^4.7.1",
|
"ionic-selectable": "^4.7.1",
|
||||||
"ionic2-alpha-scroll": "^2.0.1",
|
"ionic2-alpha-scroll": "^2.0.1",
|
||||||
"ionic2-calendar": "^0.6.6",
|
"ionic2-calendar": "^0.6.6",
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ import { StreamingMedia } from '@ionic-native/streaming-media/ngx';
|
|||||||
import { PhotoViewer } from '@ionic-native/photo-viewer/ngx';
|
import { PhotoViewer } from '@ionic-native/photo-viewer/ngx';
|
||||||
import {NgxImageCompressService} from 'ngx-image-compress';
|
import {NgxImageCompressService} from 'ngx-image-compress';
|
||||||
import { CustomImageCachePageRoutingModule } from './services/file/custom-image-cache/custom-image-cache-routing.module';
|
import { CustomImageCachePageRoutingModule } from './services/file/custom-image-cache/custom-image-cache-routing.module';
|
||||||
|
import { IonicImageLoaderComponent, IonicImageLoaderModule } from 'ionic-image-loader-v5';
|
||||||
|
|
||||||
/* import { FCM } from '@ionic-native/fcm/ngx';
|
/* import { FCM } from '@ionic-native/fcm/ngx';
|
||||||
import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
||||||
@@ -82,10 +83,13 @@ import { FirebaseX } from '@ionic-native/firebase-x/ngx'; */
|
|||||||
provide: DateAdapter,
|
provide: DateAdapter,
|
||||||
useFactory: adapterFactory
|
useFactory: adapterFactory
|
||||||
}),
|
}),
|
||||||
|
|
||||||
|
IonicImageLoaderModule,
|
||||||
IonicModule.forRoot({animated: false}),
|
IonicModule.forRoot({animated: false}),
|
||||||
IonicStorageModule.forRoot({
|
IonicStorageModule.forRoot({
|
||||||
name: '__mydb',
|
name: '__mydb',
|
||||||
driverOrder: ['indexeddb', 'sqlite', 'websql']
|
driverOrder: ['indexeddb', 'sqlite', 'websql']
|
||||||
|
|
||||||
}),
|
}),
|
||||||
|
|
||||||
AppRoutingModule,
|
AppRoutingModule,
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { momentG } from 'src/plugin/momentG';
|
|||||||
import { DomSanitizer } from "@angular/platform-browser";
|
import { DomSanitizer } from "@angular/platform-browser";
|
||||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||||
import { removeDuplicate } from 'src/plugin/removeDuplicate.js';
|
import { removeDuplicate } from 'src/plugin/removeDuplicate.js';
|
||||||
|
import { Storage } from '@ionic/storage';
|
||||||
|
|
||||||
// showTimeline
|
// showTimeline
|
||||||
import { setHours, setMinutes } from 'date-fns';
|
import { setHours, setMinutes } from 'date-fns';
|
||||||
@@ -179,7 +180,8 @@ export class AgendaPage implements OnInit {
|
|||||||
private sqliteservice: SqliteService,
|
private sqliteservice: SqliteService,
|
||||||
private platform: Platform,
|
private platform: Platform,
|
||||||
private backgroundservice: BackgroundService,
|
private backgroundservice: BackgroundService,
|
||||||
public ThemeService: ThemeService
|
public ThemeService: ThemeService,
|
||||||
|
private storage:Storage
|
||||||
) {
|
) {
|
||||||
|
|
||||||
this.dateAdapter.setLocale('es');
|
this.dateAdapter.setLocale('es');
|
||||||
@@ -770,6 +772,27 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
addEventToDB(response, profile) {
|
addEventToDB(response, profile) {
|
||||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
|
let responseArray = [];
|
||||||
|
response.forEach(element => {
|
||||||
|
let event = {
|
||||||
|
CalendarId: element.CalendarId,
|
||||||
|
CalendarName: element.CalendarName,
|
||||||
|
EndDate: element.EndDate,
|
||||||
|
EventId: element.EventId,
|
||||||
|
HasAttachments: element.HasAttachments,
|
||||||
|
HumanDate: element.HumanDate,
|
||||||
|
IsAllDayEvent: element.IsAllDayEvent,
|
||||||
|
Location: element.Location,
|
||||||
|
StartDate: element.StartDate,
|
||||||
|
Subject: element.Subject,
|
||||||
|
Profile: profile
|
||||||
|
}
|
||||||
|
responseArray.push(event)
|
||||||
|
|
||||||
|
});
|
||||||
|
this.storage.set('agendaResponse',responseArray).then(() => {
|
||||||
|
console.log('Agenda data saved')
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
if (response.length > 0) {
|
if (response.length > 0) {
|
||||||
|
|
||||||
@@ -796,21 +819,35 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
getFromDB() {
|
getFromDB() {
|
||||||
console.log('ALL EVENTS FROM DB AGENDA OFFLINE')
|
console.log('ALL EVENTS FROM DB AGENDA OFFLINE')
|
||||||
this.sqliteservice.getAllEvents().then((events: any[]) => {
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
console.log('ALL EVENTS FROM DB', events)
|
this.storage.get('agendaResponse').then((events) => {
|
||||||
let eventArray = [];
|
this.trasnformDataDB(events)
|
||||||
|
this.updateEventListBox()
|
||||||
this.trasnformDataDB(events)
|
|
||||||
this.updateEventListBox()
|
this.myCal.update();
|
||||||
|
this.myCal.loadEvents();
|
||||||
this.myCal.update();
|
|
||||||
this.myCal.loadEvents();
|
this.showLoader = false;
|
||||||
|
this.showTimeline = true;
|
||||||
this.showLoader = false;
|
})
|
||||||
this.showTimeline = true;
|
} else {
|
||||||
|
this.sqliteservice.getAllEvents().then((events: any[]) => {
|
||||||
|
console.log('ALL EVENTS FROM DB', events)
|
||||||
})
|
let eventArray = [];
|
||||||
|
|
||||||
|
this.trasnformDataDB(events)
|
||||||
|
this.updateEventListBox()
|
||||||
|
|
||||||
|
this.myCal.update();
|
||||||
|
this.myCal.loadEvents();
|
||||||
|
|
||||||
|
this.showLoader = false;
|
||||||
|
this.showTimeline = true;
|
||||||
|
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
updateEventListBox() {
|
updateEventListBox() {
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import { BackgroundService } from 'src/app/services/background.service';
|
|||||||
import { StorageService } from 'src/app/services/storage.service';
|
import { StorageService } from 'src/app/services/storage.service';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { RouteService } from 'src/app/services/route.service';
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
|
import { Storage } from '@ionic/storage';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -74,6 +75,7 @@ export class ViewEventPage implements OnInit {
|
|||||||
private storage: StorageService,
|
private storage: StorageService,
|
||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
private RouteService: RouteService,
|
private RouteService: RouteService,
|
||||||
|
private ionicStorage: Storage
|
||||||
) {
|
) {
|
||||||
this.isEventEdited = false;
|
this.isEventEdited = false;
|
||||||
this.loadedEvent = new Event();
|
this.loadedEvent = new Event();
|
||||||
@@ -394,6 +396,9 @@ 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(() => {
|
||||||
|
console.log('Details event saved')
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
let event = {
|
let event = {
|
||||||
Attendees: JSON.stringify(data.Attendees) || JSON.stringify(''),
|
Attendees: JSON.stringify(data.Attendees) || JSON.stringify(''),
|
||||||
@@ -423,33 +428,40 @@ export class ViewEventPage implements OnInit {
|
|||||||
|
|
||||||
getFromDb() {
|
getFromDb() {
|
||||||
const loader = this.toastService.loading();
|
const loader = this.toastService.loading();
|
||||||
this.sqliteservice.getEventById(this.eventId).then((event) => {
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
let arrayevent = [];
|
this.ionicStorage.get('eventDetails').then((events) =>{
|
||||||
console.log('EVENT ATTENDEES',event[0].Attendees)
|
this.loadedEvent = events;
|
||||||
let elemet = {
|
})
|
||||||
Attendees: (typeof JSON.parse(event[0].Attendees) === 'undefined') ? "" : JSON.parse(event[0].Attendees),
|
} else {
|
||||||
Body: JSON.parse(event[0].Body) || "",
|
this.sqliteservice.getEventById(this.eventId).then((event) => {
|
||||||
CalendarId: event[0].CalendarId,
|
let arrayevent = [];
|
||||||
CalendarName: event[0].CalendarName,
|
console.log('EVENT ATTENDEES',event[0].Attendees)
|
||||||
Category: event[0].Category,
|
let elemet = {
|
||||||
EndDate: event[0].EndDate,
|
Attendees: (typeof JSON.parse(event[0].Attendees) === 'undefined') ? "" : JSON.parse(event[0].Attendees),
|
||||||
EventId: event[0].EventId,
|
Body: JSON.parse(event[0].Body) || "",
|
||||||
EventRecurrence: JSON.parse(event[0].EventRecurrence) || "",
|
CalendarId: event[0].CalendarId,
|
||||||
EventType: event[0].EventType,
|
CalendarName: event[0].CalendarName,
|
||||||
HasAttachments: event[0].HasAttachments,
|
Category: event[0].Category,
|
||||||
IsAllDayEvent: event[0].IsAllDayEvent,
|
EndDate: event[0].EndDate,
|
||||||
IsMeeting: event[0].IsMeeting,
|
EventId: event[0].EventId,
|
||||||
IsRecurring: event[0].IsRecurring,
|
EventRecurrence: JSON.parse(event[0].EventRecurrence) || "",
|
||||||
Location: event[0].Location,
|
EventType: event[0].EventType,
|
||||||
Organizer: JSON.parse(event[0].Organizer) || "",
|
HasAttachments: event[0].HasAttachments,
|
||||||
StartDate: event[0].StartDate,
|
IsAllDayEvent: event[0].IsAllDayEvent,
|
||||||
Subject: event[0].Subject,
|
IsMeeting: event[0].IsMeeting,
|
||||||
TimeZone: event[0].TimeZone
|
IsRecurring: event[0].IsRecurring,
|
||||||
}
|
Location: event[0].Location,
|
||||||
arrayevent.push(elemet);
|
Organizer: JSON.parse(event[0].Organizer) || "",
|
||||||
this.loadedEvent = arrayevent[0];
|
StartDate: event[0].StartDate,
|
||||||
console.log("Event ditails local,", elemet)
|
Subject: event[0].Subject,
|
||||||
})
|
TimeZone: event[0].TimeZone
|
||||||
|
}
|
||||||
|
arrayevent.push(elemet);
|
||||||
|
this.loadedEvent = arrayevent[0];
|
||||||
|
console.log("Event ditails local,", elemet)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
loader.remove()
|
loader.remove()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import { NetworkConnectionService } from 'src/app/services/network-connection.se
|
|||||||
import { BackgroundService } from 'src/app/services/background.service';
|
import { BackgroundService } from 'src/app/services/background.service';
|
||||||
import { momentG } from 'src/plugin/momentG';
|
import { momentG } from 'src/plugin/momentG';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
|
import { Storage } from '@ionic/storage';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-events',
|
selector: 'app-events',
|
||||||
templateUrl: './events.page.html',
|
templateUrl: './events.page.html',
|
||||||
@@ -95,7 +96,8 @@ export class EventsPage implements OnInit {
|
|||||||
private sqliteservice: SqliteService,
|
private sqliteservice: SqliteService,
|
||||||
private networkconnection: NetworkConnectionService,
|
private networkconnection: NetworkConnectionService,
|
||||||
private backgroundservice: BackgroundService,
|
private backgroundservice: BackgroundService,
|
||||||
public ThemeService: ThemeService
|
public ThemeService: ThemeService,
|
||||||
|
private storage: Storage
|
||||||
) {
|
) {
|
||||||
/* this.existingScreenOrientation = this.screenOrientation.type;
|
/* this.existingScreenOrientation = this.screenOrientation.type;
|
||||||
console.log(this.existingScreenOrientation); */
|
console.log(this.existingScreenOrientation); */
|
||||||
@@ -317,6 +319,9 @@ export class EventsPage implements OnInit {
|
|||||||
addEventToDb(list) {
|
addEventToDb(list) {
|
||||||
|
|
||||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
|
this.storage.set('events', list).then(() => {
|
||||||
|
console.log('Init events saved')
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
if (list.length > 0) {
|
if (list.length > 0) {
|
||||||
list.forEach(element => {
|
list.forEach(element => {
|
||||||
@@ -359,6 +364,9 @@ export class EventsPage implements OnInit {
|
|||||||
addProcessToDb(list) {
|
addProcessToDb(list) {
|
||||||
|
|
||||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
|
this.storage.set('process', list).then(() => {
|
||||||
|
console.log('Init process saved')
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
if (list.length > 0) {
|
if (list.length > 0) {
|
||||||
list.forEach(element => {
|
list.forEach(element => {
|
||||||
@@ -376,6 +384,23 @@ export class EventsPage implements OnInit {
|
|||||||
let dateToday = date.getFullYear() + "-" + month + "-" + date.getDate();
|
let dateToday = date.getFullYear() + "-" + month + "-" + date.getDate();
|
||||||
console.log('dateeeeee', dateToday)
|
console.log('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[]) => {
|
||||||
|
console.log('Today events',events)
|
||||||
|
let todayEvents = new Array()
|
||||||
|
this.listToPresent = events
|
||||||
|
this.totalEvent = this.listToPresent.length
|
||||||
|
this.currentEvent = this.listToPresent[0].Subject
|
||||||
|
this.currentHoursMinutes = this.listToPresent[0].StartDate
|
||||||
|
console.log("All events from local,", events)
|
||||||
|
})
|
||||||
|
|
||||||
|
this.storage.get('process').then((process: any[]) => {
|
||||||
|
console.log('OFOFOFOOF22222', process)
|
||||||
|
const ExpedienteTask = process.map(e => this.expedienteTaskPipe.transform(e))
|
||||||
|
this.listToPresentexpediente = ExpedienteTask;
|
||||||
|
})
|
||||||
|
|
||||||
|
this.showLoader = false;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.sqliteservice.getAllEvents().then((event: any[]) => {
|
this.sqliteservice.getAllEvents().then((event: any[]) => {
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ import { Platform } from '@ionic/angular';
|
|||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { OfflineManagerService } from 'src/app/services/offline-manager.service';
|
import { OfflineManagerService } from 'src/app/services/offline-manager.service';
|
||||||
import { RouteService } from 'src/app/services/route.service';
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
|
import { Storage } from '@ionic/storage';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-approve-event',
|
selector: 'app-approve-event',
|
||||||
@@ -63,7 +64,8 @@ export class ApproveEventPage implements OnInit {
|
|||||||
private platform: Platform,
|
private platform: Platform,
|
||||||
private backgroundservice: BackgroundService,
|
private backgroundservice: BackgroundService,
|
||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
private offlineManager: OfflineManagerService
|
private offlineManager: OfflineManagerService,
|
||||||
|
private storage: Storage
|
||||||
) {
|
) {
|
||||||
this.activatedRoute.paramMap.subscribe(params => {
|
this.activatedRoute.paramMap.subscribe(params => {
|
||||||
// console.log(params["params"]);
|
// console.log(params["params"]);
|
||||||
@@ -110,6 +112,9 @@ 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(() => {
|
||||||
|
console.log('APPROVE EVENT DETAILS SAVED')
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
this.sqliteservice.updateProcess(data);
|
this.sqliteservice.updateProcess(data);
|
||||||
}
|
}
|
||||||
@@ -117,69 +122,85 @@ export class ApproveEventPage implements OnInit {
|
|||||||
|
|
||||||
getProcessFromDB() {
|
getProcessFromDB() {
|
||||||
|
|
||||||
this.platform.ready().then(() => {
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
|
this.storage.get('approve_event_detils').then((event) => {
|
||||||
this.sqliteservice.getProcessById(this.serialNumber).then((process) => {
|
this.loadedEvent = event
|
||||||
console.log('event aprove serial', process)
|
console.log('offline event', this.loadedEvent);
|
||||||
|
|
||||||
var doc;
|
this.today = new Date(this.loadedEvent.workflowInstanceDataFields.StartDate);
|
||||||
var action = [];
|
|
||||||
var origi = [];
|
this.customDate = this.days[this.today.getDay()] + ", " + this.today.getDate() + " de " + (this.months[this.today.getMonth()]);
|
||||||
var wordafi = {};
|
|
||||||
if (process[0].Documents === "null" || process[0].Documents === "undefined") {
|
let instanceId = this.loadedEvent.workflowInstanceDataFields.InstanceId;
|
||||||
doc = []
|
this.loadedAttachments = this.loadedEvent.Documents;
|
||||||
} else {
|
console.log('Attatara', this.loadedAttachments)
|
||||||
doc = JSON.parse(process[0].Documents)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (process[0].actions === "null" || process[0].actions === "undefined") {
|
|
||||||
action = []
|
|
||||||
} else {
|
|
||||||
action = JSON.parse(process[0].Documents)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (process[0].originator === "null" || process[0].originator === "undefined") {
|
|
||||||
origi = []
|
|
||||||
} else {
|
|
||||||
origi = JSON.parse(process[0].Documents)
|
|
||||||
}
|
|
||||||
if (process[0].workflowInstanceDataFields === "null" || process[0].workflowInstanceDataFields === "undefined") {
|
|
||||||
wordafi = []
|
|
||||||
} else {
|
|
||||||
wordafi = JSON.parse(process[0].workflowInstanceDataFields)
|
|
||||||
}
|
|
||||||
|
|
||||||
let task = {
|
|
||||||
"Documents": doc,
|
|
||||||
"actions": action,
|
|
||||||
"activityInstanceName": process[0].activityInstanceName,
|
|
||||||
"formURL": process[0].formURL,
|
|
||||||
"originator": origi,
|
|
||||||
"serialNumber": process[0].serialNumber,
|
|
||||||
"taskStartDate": process[0].taskStartDate,
|
|
||||||
"totalDocuments": process[0].totalDocuments,
|
|
||||||
"workflowDisplayName": process[0].workflowDisplayName,
|
|
||||||
"workflowID": process[0].workflowID,
|
|
||||||
"workflowInstanceDataFields": wordafi,
|
|
||||||
"workflowInstanceFolio": process[0].workflowInstanceFolio,
|
|
||||||
"workflowInstanceID": process[0].workflowInstanceID,
|
|
||||||
"workflowName": process[0].workflowInstanceID
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
this.loadedEvent = task
|
|
||||||
console.log('offline event', this.loadedEvent);
|
|
||||||
|
|
||||||
this.today = new Date(this.loadedEvent.workflowInstanceDataFields.StartDate);
|
|
||||||
|
|
||||||
this.customDate = this.days[this.today.getDay()] + ", " + this.today.getDate() + " de " + (this.months[this.today.getMonth()]);
|
|
||||||
|
|
||||||
let instanceId = this.loadedEvent.workflowInstanceDataFields.InstanceId;
|
|
||||||
this.loadedAttachments = this.loadedEvent.Documents;
|
|
||||||
console.log('Attatara', this.loadedAttachments)
|
|
||||||
|
|
||||||
})
|
})
|
||||||
})
|
} else {
|
||||||
|
this.platform.ready().then(() => {
|
||||||
|
|
||||||
|
this.sqliteservice.getProcessById(this.serialNumber).then((process) => {
|
||||||
|
console.log('event aprove serial', process)
|
||||||
|
|
||||||
|
var doc;
|
||||||
|
var action = [];
|
||||||
|
var origi = [];
|
||||||
|
var wordafi = {};
|
||||||
|
if (process[0].Documents === "null" || process[0].Documents === "undefined") {
|
||||||
|
doc = []
|
||||||
|
} else {
|
||||||
|
doc = JSON.parse(process[0].Documents)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process[0].actions === "null" || process[0].actions === "undefined") {
|
||||||
|
action = []
|
||||||
|
} else {
|
||||||
|
action = JSON.parse(process[0].Documents)
|
||||||
|
}
|
||||||
|
|
||||||
|
if (process[0].originator === "null" || process[0].originator === "undefined") {
|
||||||
|
origi = []
|
||||||
|
} else {
|
||||||
|
origi = JSON.parse(process[0].Documents)
|
||||||
|
}
|
||||||
|
if (process[0].workflowInstanceDataFields === "null" || process[0].workflowInstanceDataFields === "undefined") {
|
||||||
|
wordafi = []
|
||||||
|
} else {
|
||||||
|
wordafi = JSON.parse(process[0].workflowInstanceDataFields)
|
||||||
|
}
|
||||||
|
|
||||||
|
let task = {
|
||||||
|
"Documents": doc,
|
||||||
|
"actions": action,
|
||||||
|
"activityInstanceName": process[0].activityInstanceName,
|
||||||
|
"formURL": process[0].formURL,
|
||||||
|
"originator": origi,
|
||||||
|
"serialNumber": process[0].serialNumber,
|
||||||
|
"taskStartDate": process[0].taskStartDate,
|
||||||
|
"totalDocuments": process[0].totalDocuments,
|
||||||
|
"workflowDisplayName": process[0].workflowDisplayName,
|
||||||
|
"workflowID": process[0].workflowID,
|
||||||
|
"workflowInstanceDataFields": wordafi,
|
||||||
|
"workflowInstanceFolio": process[0].workflowInstanceFolio,
|
||||||
|
"workflowInstanceID": process[0].workflowInstanceID,
|
||||||
|
"workflowName": process[0].workflowInstanceID
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
this.loadedEvent = task
|
||||||
|
console.log('offline event', this.loadedEvent);
|
||||||
|
|
||||||
|
this.today = new Date(this.loadedEvent.workflowInstanceDataFields.StartDate);
|
||||||
|
|
||||||
|
this.customDate = this.days[this.today.getDay()] + ", " + this.today.getDate() + " de " + (this.months[this.today.getMonth()]);
|
||||||
|
|
||||||
|
let instanceId = this.loadedEvent.workflowInstanceDataFields.InstanceId;
|
||||||
|
this.loadedAttachments = this.loadedEvent.Documents;
|
||||||
|
console.log('Attatara', this.loadedAttachments)
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
console.log('Offlineee')
|
console.log('Offlineee')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import { Platform } from '@ionic/angular';
|
|||||||
import { SortService } from 'src/app/services/functions/sort.service';
|
import { SortService } from 'src/app/services/functions/sort.service';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { RouteService } from 'src/app/services/route.service';
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
|
import { Storage } from '@ionic/storage';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-event-list',
|
selector: 'app-event-list',
|
||||||
@@ -46,7 +47,8 @@ export class EventListPage implements OnInit {
|
|||||||
private sortService: SortService,
|
private sortService: SortService,
|
||||||
private backgroundservice: BackgroundService,
|
private backgroundservice: BackgroundService,
|
||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
private RouteService: RouteService
|
private RouteService: RouteService,
|
||||||
|
private storage: Storage
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@@ -83,22 +85,37 @@ export class EventListPage implements OnInit {
|
|||||||
|
|
||||||
getEventToAproveFromDB() {
|
getEventToAproveFromDB() {
|
||||||
|
|
||||||
this.platform.ready().then(() => {
|
|
||||||
|
|
||||||
this.sqliteservice.getListOfEventAprove('Agenda Oficial MDGPR', 'Agenda Pessoal MDGPR').then((event: any[]) => {
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
|
this.storage.get('event-to-aproveMD').then((events) => {
|
||||||
this.eventsMDGPRList = this.sortService.sortDate(this.transformaDataDB(event), 'taskStartDate')
|
this.eventsMDGPRList = events
|
||||||
//this.eventsMDGPRList = this.eventsMDGPRList.filter(element => element.interveners != null)
|
})
|
||||||
console.log('MD event to aprove', this.eventsMDGPRList)
|
|
||||||
|
this.storage.get('event-to-aprovePR').then((events) => {
|
||||||
|
this.eventsPRList = events
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.platform.ready().then(() => {
|
||||||
|
|
||||||
|
this.sqliteservice.getListOfEventAprove('Agenda Oficial MDGPR', 'Agenda Pessoal MDGPR').then((event: any[]) => {
|
||||||
|
|
||||||
|
this.eventsMDGPRList = this.sortService.sortDate(this.transformaDataDB(event), 'taskStartDate')
|
||||||
|
//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.eventsPRList = this.sortService.sortDate(this.transformaDataDB(event), 'taskStartDate')
|
||||||
|
console.log('PR event to aprove', this.eventsPRList)
|
||||||
|
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
this.sqliteservice.getListOfEventAprove('Agenda Oficial PR', 'Agenda Pessoal PR').then((event: any[]) => {
|
}
|
||||||
this.eventsPRList = this.sortService.sortDate(this.transformaDataDB(event), 'taskStartDate')
|
|
||||||
console.log('PR event to aprove', this.eventsPRList)
|
|
||||||
|
|
||||||
})
|
|
||||||
})
|
|
||||||
console.log('Offlineee')
|
console.log('Offlineee')
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -143,16 +160,24 @@ export class EventListPage implements OnInit {
|
|||||||
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)
|
||||||
console.log('MD EVENT TO APROVE ONLINE',this.eventsMDGPRList)
|
console.log('MD EVENT TO APROVE ONLINE',this.eventsMDGPRList)
|
||||||
this.eventaprovacaostore.resetmd(this.sortService.sortArrayByDate(this.eventsMDGPRList).reverse());
|
this.storage.set('event-to-aproveMD',this.eventsMDGPRList).then(() => {
|
||||||
|
console.log(' EVENTMD TO APROVE SAVED')
|
||||||
|
})
|
||||||
|
//this.eventaprovacaostore.resetmd(this.sortService.sortArrayByDate(this.eventsMDGPRList).reverse());
|
||||||
}
|
}
|
||||||
else if (this.segment == 'PR') {
|
else if (this.segment == 'PR') {
|
||||||
let prEventsOficial = await this.processes.GetTasksList('Agenda Oficial PR', false).toPromise();
|
let prEventsOficial = await this.processes.GetTasksList('Agenda Oficial PR', false).toPromise();
|
||||||
let prEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal PR', false).toPromise();
|
let prEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal PR', false).toPromise();
|
||||||
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)
|
||||||
console.log('PR EVENT TO APROVE ONLINE',this.eventsPRList)
|
console.log('PR EVENT TO APROVE ONLINE',this.eventsPRList)
|
||||||
this.eventaprovacaostore.resetpr(this.sortService.sortArrayByDate(this.eventsPRList).reverse());
|
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.showLoader = false;
|
this.showLoader = false;
|
||||||
this.skeletonLoader = false
|
this.skeletonLoader = false
|
||||||
@@ -162,6 +187,8 @@ export class EventListPage implements OnInit {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async openApproveModal(eventSerialNumber, event) {
|
async openApproveModal(eventSerialNumber, event) {
|
||||||
const modal = await this.modalController.create({
|
const modal = await this.modalController.create({
|
||||||
component: ApproveEventModalPage,
|
component: ApproveEventModalPage,
|
||||||
|
|||||||
+91
-46
@@ -33,6 +33,7 @@ import { BackgroundService } from 'src/app/services/background.service';
|
|||||||
import { NewGroupPage } from 'src/app/pages/chat/new-group/new-group.page';
|
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';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-expediente-detail',
|
selector: 'app-expediente-detail',
|
||||||
@@ -82,6 +83,7 @@ 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
|
||||||
) {
|
) {
|
||||||
this.activatedRoute.paramMap.subscribe(params => {
|
this.activatedRoute.paramMap.subscribe(params => {
|
||||||
if (params["params"].SerialNumber) {
|
if (params["params"].SerialNumber) {
|
||||||
@@ -112,63 +114,106 @@ 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(() =>{
|
||||||
|
console.log('EXPEDIENTE DETAILS SAVED')
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
this.sqliteservice.updateProcess(res)
|
this.sqliteservice.updateProcess(res)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
getFromDB() {
|
getFromDB() {
|
||||||
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
this.platform.ready().then(() => {
|
this.storage.get('expediente_details').then((process) => {
|
||||||
this.onlinecheck = false;
|
|
||||||
this.sqliteservice.getProcessById(this.serialNumber).then((process) => {
|
|
||||||
console.log("expedient ditail", process)
|
|
||||||
|
|
||||||
var workflow = JSON.parse(process[0].workflowInstanceDataFields);
|
|
||||||
var origina
|
|
||||||
if (process[0].originator === "undefined") {
|
|
||||||
origina = ""
|
|
||||||
} else {
|
|
||||||
origina = JSON.parse(process[0].originator)
|
|
||||||
}
|
|
||||||
|
|
||||||
this.task = {
|
this.task = {
|
||||||
"SerialNumber": process[0].serialNumber,
|
"SerialNumber": process.serialNumber,
|
||||||
"Folio": workflow.Subject,
|
"Folio": process.workflowInstanceDataFields.Subject,
|
||||||
"Senders": origina.email || process[0].originator,
|
"Senders": process.originator || process.originator,
|
||||||
"CreateDate": momentG(new Date(process[0].taskStartDate), 'yyyy-MM-dd HH:mm:ss'),
|
"CreateDate": momentG(new Date(process.taskStartDate), 'yyyy-MM-dd HH:mm:ss'),
|
||||||
"DocumentURL": workflow.ViewerRequest,
|
"DocumentURL": process.workflowInstanceDataFields.ViewerRequest,
|
||||||
"Remetente": workflow.Sender,
|
"Remetente": process.workflowInstanceDataFields.Sender,
|
||||||
"Note": workflow.TaskMessage || workflow.Note,
|
"Note": process.workflowInstanceDataFields.TaskMessage || process.workflowInstanceDataFields.Note,
|
||||||
"FolderId": workflow.FolderID,
|
"FolderId": process.workflowInstanceDataFields.FolderID,
|
||||||
"FsId": workflow.FsId,
|
"FsId": process.workflowInstanceDataFields.FsId,
|
||||||
"DocId": workflow.DocID,
|
"DocId": process.workflowInstanceDataFields.DocID,
|
||||||
"WorkflowName": process[0].workflowDisplayName,
|
"WorkflowName": process.workflowDisplayName,
|
||||||
"Status": workflow.Status,
|
"Status": process.workflowInstanceDataFields.Status,
|
||||||
"DispatchNumber": workflow.DispatchNumber,
|
"DispatchNumber": process.workflowInstanceDataFields.DispatchNumber,
|
||||||
"AttachmentsProcessLastInstanceID": workflow.AttachmentsProcessLastInstanceID,
|
"AttachmentsProcessLastInstanceID": process.workflowInstanceDataFields.AttachmentsProcessLastInstanceID,
|
||||||
"InstanceID": workflow.InstanceID
|
"InstanceID": process.workflowInstanceDataFields.InstanceID
|
||||||
}
|
}
|
||||||
|
|
||||||
this.fulltask = {
|
this.fulltask = {
|
||||||
Documents: JSON.parse(process[0].Documents),
|
Documents: process.Documents,
|
||||||
actions: JSON.parse(process[0].actions),
|
actions: process.actions,
|
||||||
activityInstanceName: process[0].activityInstanceName,
|
activityInstanceName: process.activityInstanceName,
|
||||||
formURL: process[0].formURL,
|
formURL: process.formURL,
|
||||||
interveners: process[0].interveners,
|
interveners: process.interveners,
|
||||||
originator: JSON.parse(process[0].originator),
|
originator: process.originator,
|
||||||
serialNumber: process[0].serialNumber,
|
serialNumber: process.serialNumber,
|
||||||
taskStartDate: process[0].taskStartDate,
|
taskStartDate: process.taskStartDate,
|
||||||
totalDocuments: process[0].totalDocuments,
|
totalDocuments: process.totalDocuments,
|
||||||
workflowDisplayName: process[0].workflowDisplayName,
|
workflowDisplayName: process.workflowDisplayName,
|
||||||
workflowID: process[0].workflowID,
|
workflowID: process.workflowID,
|
||||||
workflowInstanceDataFields: JSON.parse(process[0].workflowInstanceDataFields),
|
workflowInstanceDataFields: process.workflowInstanceDataFields,
|
||||||
workflowInstanceFolio: process[0].workflowInstanceFolio,
|
workflowInstanceFolio: process.workflowInstanceFolio,
|
||||||
workflowInstanceID: process[0].workflowInstanceID,
|
workflowInstanceID: process.workflowInstanceID,
|
||||||
workflowName: process[0].workflowName,
|
workflowName: process.workflowName,
|
||||||
}
|
}
|
||||||
|
|
||||||
})
|
})
|
||||||
})
|
} else {
|
||||||
|
this.platform.ready().then(() => {
|
||||||
|
this.onlinecheck = false;
|
||||||
|
this.sqliteservice.getProcessById(this.serialNumber).then((process) => {
|
||||||
|
console.log("expedient ditail", process)
|
||||||
|
|
||||||
|
var workflow = JSON.parse(process[0].workflowInstanceDataFields);
|
||||||
|
var origina
|
||||||
|
if (process[0].originator === "undefined") {
|
||||||
|
origina = ""
|
||||||
|
} else {
|
||||||
|
origina = JSON.parse(process[0].originator)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.task = {
|
||||||
|
"SerialNumber": process[0].serialNumber,
|
||||||
|
"Folio": workflow.Subject,
|
||||||
|
"Senders": origina.email || process[0].originator,
|
||||||
|
"CreateDate": momentG(new Date(process[0].taskStartDate), 'yyyy-MM-dd HH:mm:ss'),
|
||||||
|
"DocumentURL": workflow.ViewerRequest,
|
||||||
|
"Remetente": workflow.Sender,
|
||||||
|
"Note": workflow.TaskMessage || workflow.Note,
|
||||||
|
"FolderId": workflow.FolderID,
|
||||||
|
"FsId": workflow.FsId,
|
||||||
|
"DocId": workflow.DocID,
|
||||||
|
"WorkflowName": process[0].workflowDisplayName,
|
||||||
|
"Status": workflow.Status,
|
||||||
|
"DispatchNumber": workflow.DispatchNumber,
|
||||||
|
"AttachmentsProcessLastInstanceID": workflow.AttachmentsProcessLastInstanceID,
|
||||||
|
"InstanceID": workflow.InstanceID
|
||||||
|
}
|
||||||
|
|
||||||
|
this.fulltask = {
|
||||||
|
Documents: JSON.parse(process[0].Documents),
|
||||||
|
actions: JSON.parse(process[0].actions),
|
||||||
|
activityInstanceName: process[0].activityInstanceName,
|
||||||
|
formURL: process[0].formURL,
|
||||||
|
interveners: process[0].interveners,
|
||||||
|
originator: JSON.parse(process[0].originator),
|
||||||
|
serialNumber: process[0].serialNumber,
|
||||||
|
taskStartDate: process[0].taskStartDate,
|
||||||
|
totalDocuments: process[0].totalDocuments,
|
||||||
|
workflowDisplayName: process[0].workflowDisplayName,
|
||||||
|
workflowID: process[0].workflowID,
|
||||||
|
workflowInstanceDataFields: JSON.parse(process[0].workflowInstanceDataFields),
|
||||||
|
workflowInstanceFolio: process[0].workflowInstanceFolio,
|
||||||
|
workflowInstanceID: process[0].workflowInstanceID,
|
||||||
|
workflowName: process[0].workflowName,
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { Platform } from '@ionic/angular';
|
|||||||
import { BackgroundService } from '../../../services/background.service';
|
import { BackgroundService } from '../../../services/background.service';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { SortService } from 'src/app/services/functions/sort.service';
|
import { SortService } from 'src/app/services/functions/sort.service';
|
||||||
|
import {Storage } from '@ionic/storage';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-expediente',
|
selector: 'app-expediente',
|
||||||
@@ -40,6 +41,7 @@ export class ExpedientePage implements OnInit {
|
|||||||
private backgroundservice: BackgroundService,
|
private backgroundservice: BackgroundService,
|
||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
private sortService: SortService,
|
private sortService: SortService,
|
||||||
|
private storage: Storage
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@@ -112,63 +114,48 @@ export class ExpedientePage implements OnInit {
|
|||||||
|
|
||||||
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(() => {
|
||||||
|
console.log('GABINETE EXPEDIENTE SAVED')
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
this.sqliteservice.addProcess(task);
|
this.sqliteservice.addProcess(task);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SqliteAddExpediente(list) {
|
|
||||||
list.forEach((expediente) => {
|
|
||||||
let data = {
|
|
||||||
serialNumber: expediente.serialNumber,
|
|
||||||
workflowInstanceFolio: expediente.workflowInstanceFolio,
|
|
||||||
Documents: expediente.Documents,
|
|
||||||
actions: expediente.actions,
|
|
||||||
activityInstanceName: expediente.activityInstanceName,
|
|
||||||
formURL: expediente.formURL,
|
|
||||||
originator: expediente.originator,
|
|
||||||
taskStartDate: expediente.taskStartDate,
|
|
||||||
totalDocuments: expediente.totalDocuments,
|
|
||||||
workflowDisplayName: expediente.workflowDisplayName,
|
|
||||||
workflowID: expediente.workflowID,
|
|
||||||
workflowInstanceDataFields: expediente.workflowInstanceDataFields,
|
|
||||||
workflowInstanceID: expediente.workflowInstanceID,
|
|
||||||
workflowName: expediente.workflowName
|
|
||||||
}
|
|
||||||
|
|
||||||
this.sqliteservice.addExpediente(data);
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
getEventsFromLocalDb() {
|
getEventsFromLocalDb() {
|
||||||
|
|
||||||
this.taskslist = new Array();
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
this.sqliteservice.getprocessByworkflow("Expediente").then((expediente: any[]) => {
|
this.storage.get('gabinete-expediente').then((expediente) => {
|
||||||
console.log("All expedientes from local,", expediente)
|
this.listToPresent = expediente
|
||||||
|
})
|
||||||
expediente.forEach((element) => {
|
} else {
|
||||||
|
this.taskslist = new Array();
|
||||||
var workflow = JSON.parse(element.workflowInstanceDataFields);
|
this.sqliteservice.getprocessByworkflow("Expediente").then((expediente: any[]) => {
|
||||||
|
console.log("All expedientes from local,", expediente)
|
||||||
let exped = {
|
|
||||||
"CreateDate": element.taskStartDate,
|
expediente.forEach((element) => {
|
||||||
"DocumentsQty": element.totalDocuments,
|
|
||||||
"Senders": workflow.Senders,
|
var workflow = JSON.parse(element.workflowInstanceDataFields);
|
||||||
"SerialNumber": element.serialNumber,
|
|
||||||
"Status": workflow.Status,
|
let exped = {
|
||||||
"Subject": workflow.Subject,
|
"CreateDate": element.taskStartDate,
|
||||||
"WorkflowName": element.workflowDisplayName,
|
"DocumentsQty": element.totalDocuments,
|
||||||
"activityInstanceName": element.activityInstanceName
|
"Senders": workflow.Senders,
|
||||||
}
|
"SerialNumber": element.serialNumber,
|
||||||
|
"Status": workflow.Status,
|
||||||
this.taskslist.push(exped)
|
"Subject": workflow.Subject,
|
||||||
|
"WorkflowName": element.workflowDisplayName,
|
||||||
});
|
"activityInstanceName": element.activityInstanceName
|
||||||
|
}
|
||||||
this.listToPresent = this.taskslist
|
|
||||||
|
this.taskslist.push(exped)
|
||||||
})
|
|
||||||
|
});
|
||||||
|
|
||||||
|
this.listToPresent = this.taskslist
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,6 +31,7 @@ import { Platform } from '@ionic/angular';
|
|||||||
import { BackgroundService } from 'src/app/services/background.service';
|
import { BackgroundService } from 'src/app/services/background.service';
|
||||||
import { SortService } from 'src/app/services/functions/sort.service';
|
import { SortService } from 'src/app/services/functions/sort.service';
|
||||||
import { DataService } from 'src/app/services/data.service';
|
import { DataService } from 'src/app/services/data.service';
|
||||||
|
import { Storage } from '@ionic/storage';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-gabinete-digital',
|
selector: 'app-gabinete-digital',
|
||||||
@@ -135,6 +136,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
|||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
private sortService: SortService,
|
private sortService: SortService,
|
||||||
private dataService: DataService,
|
private dataService: DataService,
|
||||||
|
private storage: Storage
|
||||||
) {
|
) {
|
||||||
|
|
||||||
this.loggeduser = authService.ValidatedUser;
|
this.loggeduser = authService.ValidatedUser;
|
||||||
@@ -215,7 +217,9 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
|||||||
addProcessToDB(data) {
|
addProcessToDB(data) {
|
||||||
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(() => {
|
||||||
|
console.log('Gabinete process saved')
|
||||||
|
})
|
||||||
} else {
|
} else {
|
||||||
data.forEach(element => {
|
data.forEach(element => {
|
||||||
|
|
||||||
@@ -245,39 +249,77 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
|||||||
getAllProcessFromDB() {
|
getAllProcessFromDB() {
|
||||||
|
|
||||||
this.hideRefreshButton();
|
this.hideRefreshButton();
|
||||||
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
|
this.storage.get('GabineteProcess').then((allprocess: any[]) => {
|
||||||
|
console.log('ALL PROCESS WEB',allprocess )
|
||||||
|
allprocess.forEach(element => {
|
||||||
|
let date = new Date(element.taskStartDate);
|
||||||
|
date.setMonth(date.getMonth() + 1);
|
||||||
|
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||||
|
|
||||||
|
let task = {
|
||||||
|
"SerialNumber": element.serialNumber,
|
||||||
|
"Folio": element.workflowInstanceDataFields.Subject,
|
||||||
|
"Senders": element.workflowInstanceDataFields.Sender,
|
||||||
|
//"CreateDate": taskDate,
|
||||||
|
"CreateDate": new Date(element.taskStartDate),
|
||||||
|
"DocumentURL": element.workflowInstanceDataFields.ViewerRequest,
|
||||||
|
"Remetente": element.workflowInstanceDataFields.Remetente,
|
||||||
|
"DocumentsQty": element.totalDocuments,
|
||||||
|
"DocId": element.workflowInstanceDataFields.DispatchDocId,
|
||||||
|
"FolderID": element.workflowInstanceDataFields.FolderID,
|
||||||
|
"WorkflowName": element.workflowDisplayName,
|
||||||
|
"activityInstanceName": element.activityInstanceName,
|
||||||
|
"Status": element.workflowInstanceDataFields.Status,
|
||||||
|
"Agenda": element.workflowInstanceDataFields.Agenda,
|
||||||
|
"customDate": this.setFormatDate(new Date(element.workflowInstanceDataFields.StartDate), new Date(element.workflowInstanceDataFields.EndDate), element.workflowInstanceDataFields.IsAllDayEvent),
|
||||||
|
}
|
||||||
|
|
||||||
|
this.allProcessesList.push(task);
|
||||||
|
this.allProcessesList = removeDuplicate(this.allProcessesList);
|
||||||
|
this.allProcessesList = this.sortService.sortDate(this.allProcessesList, 'CreateDate')
|
||||||
|
|
||||||
|
});
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.sqliteservice.getAllProcess().then((allprocess: any[]) => {
|
||||||
|
allprocess.forEach(element => {
|
||||||
|
let date = new Date(element.taskStartDate);
|
||||||
|
date.setMonth(date.getMonth() + 1);
|
||||||
|
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||||
|
|
||||||
|
var workflowInstanceDataFields = JSON.parse(element.workflowInstanceDataFields);
|
||||||
|
|
||||||
|
let task = {
|
||||||
|
"SerialNumber": element.serialNumber,
|
||||||
|
"Folio": workflowInstanceDataFields.Subject,
|
||||||
|
"Senders": workflowInstanceDataFields.Sender,
|
||||||
|
"CreateDate": taskDate,
|
||||||
|
"DocumentURL": workflowInstanceDataFields.ViewerRequest,
|
||||||
|
"Remetente": workflowInstanceDataFields.Remetente,
|
||||||
|
"DocumentsQty": element.totalDocuments,
|
||||||
|
"DocId": workflowInstanceDataFields.DispatchDocId,
|
||||||
|
"FolderID": workflowInstanceDataFields.FolderID,
|
||||||
|
"WorkflowName": element.workflowDisplayName,
|
||||||
|
"activityInstanceName": element.activityInstanceName,
|
||||||
|
"Status": workflowInstanceDataFields.Status,
|
||||||
|
"Agenda": workflowInstanceDataFields.Agenda,
|
||||||
|
"customDate": this.setFormatDate(new Date(workflowInstanceDataFields.StartDate), new Date(workflowInstanceDataFields.EndDate), workflowInstanceDataFields.IsAllDayEvent),
|
||||||
|
}
|
||||||
|
|
||||||
|
this.allProcessesList.push(task);
|
||||||
|
this.allProcessesList = removeDuplicate(this.allProcessesList)
|
||||||
|
this.allProcessesList = this.sortService.sortDate(this.allProcessesList, 'CreateDate')
|
||||||
|
|
||||||
|
});
|
||||||
|
console.log("All process from db ", allprocess)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
this.sqliteservice.getAllProcess().then((allprocess: any[]) => {
|
}
|
||||||
allprocess.forEach(element => {
|
|
||||||
let date = new Date(element.taskStartDate);
|
|
||||||
date.setMonth(date.getMonth() + 1);
|
|
||||||
let taskDate = date.getFullYear() + "-" + date.getMonth() + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
|
||||||
|
|
||||||
var workflowInstanceDataFields = JSON.parse(element.workflowInstanceDataFields);
|
dataTranform(data) {
|
||||||
|
|
||||||
let task = {
|
|
||||||
"SerialNumber": element.serialNumber,
|
|
||||||
"Folio": workflowInstanceDataFields.Subject,
|
|
||||||
"Senders": workflowInstanceDataFields.Sender,
|
|
||||||
"CreateDate": taskDate,
|
|
||||||
"DocumentURL": workflowInstanceDataFields.ViewerRequest,
|
|
||||||
"Remetente": workflowInstanceDataFields.Remetente,
|
|
||||||
"DocumentsQty": element.totalDocuments,
|
|
||||||
"DocId": workflowInstanceDataFields.DispatchDocId,
|
|
||||||
"FolderID": workflowInstanceDataFields.FolderID,
|
|
||||||
"WorkflowName": element.workflowDisplayName,
|
|
||||||
"activityInstanceName": element.activityInstanceName,
|
|
||||||
"Status": workflowInstanceDataFields.Status,
|
|
||||||
"Agenda": workflowInstanceDataFields.Agenda,
|
|
||||||
"customDate": this.setFormatDate(new Date(workflowInstanceDataFields.StartDate), new Date(workflowInstanceDataFields.EndDate), workflowInstanceDataFields.IsAllDayEvent),
|
|
||||||
}
|
|
||||||
|
|
||||||
this.allProcessesList.push(task);
|
|
||||||
this.allProcessesList = removeDuplicate(this.allProcessesList)
|
|
||||||
this.allProcessesList = this.sortService.sortDate(this.allProcessesList, 'CreateDate')
|
|
||||||
|
|
||||||
});
|
|
||||||
console.log("All process from db ", allprocess)
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sortArrayISODate(myArray: any) {
|
sortArrayISODate(myArray: any) {
|
||||||
@@ -495,6 +537,7 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
|||||||
let allProcessesList = allPreocesses_;
|
let allProcessesList = allPreocesses_;
|
||||||
|
|
||||||
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Conhecimento')
|
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Conhecimento')
|
||||||
|
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Revisar Diploma')
|
||||||
|
|
||||||
if (!this.p.userRole(['PR'])) {
|
if (!this.p.userRole(['PR'])) {
|
||||||
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Assinar Diplomas')
|
allProcessesList = allProcessesList.filter(element => element.activityInstanceName != 'Assinar Diplomas')
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import { SqliteService } from 'src/app/services/sqlite.service';
|
|||||||
import { BackgroundService } from 'src/app/services/background.service';
|
import { BackgroundService } from 'src/app/services/background.service';
|
||||||
import { Platform } from '@ionic/angular';
|
import { Platform } from '@ionic/angular';
|
||||||
import { SortService } from 'src/app/services/functions/sort.service';
|
import { SortService } from 'src/app/services/functions/sort.service';
|
||||||
|
import { Storage } from '@ionic/storage';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -47,6 +48,7 @@ export class PendentesPage implements OnInit {
|
|||||||
private platform: Platform,
|
private platform: Platform,
|
||||||
private backgroundservices: BackgroundService,
|
private backgroundservices: BackgroundService,
|
||||||
private sortService: SortService,
|
private sortService: SortService,
|
||||||
|
private storage: Storage
|
||||||
) {
|
) {
|
||||||
this.loggeduser = authService.ValidatedUser;
|
this.loggeduser = authService.ValidatedUser;
|
||||||
this.profile = 'mdgpr';
|
this.profile = 'mdgpr';
|
||||||
@@ -104,6 +106,9 @@ export class PendentesPage implements OnInit {
|
|||||||
pendentesList = removeDuplicate(pendentesList)
|
pendentesList = removeDuplicate(pendentesList)
|
||||||
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(() => {
|
||||||
|
console.log('Pendente list SAVED')
|
||||||
|
})
|
||||||
this.skeletonLoader = false;
|
this.skeletonLoader = false;
|
||||||
|
|
||||||
}, (error) => {
|
}, (error) => {
|
||||||
@@ -116,34 +121,41 @@ export class PendentesPage implements OnInit {
|
|||||||
|
|
||||||
getFromDb() {
|
getFromDb() {
|
||||||
|
|
||||||
this.platform.ready().then(() => {
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
this.sqliteservice.getAllProcess().then((process: any[]) => {
|
this.storage.get('pendente-list').then((pendentes) => {
|
||||||
var pendingList = []
|
this.listToPresent =pendentes
|
||||||
console.log('Pendentes off off',process )
|
|
||||||
process.forEach(element => {
|
|
||||||
var workflow = JSON.parse(element.workflowInstanceDataFields);
|
|
||||||
if (workflow.Status === "Pending") {
|
|
||||||
let task = {
|
|
||||||
"CreateDate": new Date(element.taskStartDate),
|
|
||||||
"DocumentsQty": element.totalDocuments,
|
|
||||||
"FolderID": workflow.FolderID,
|
|
||||||
"Folio": workflow.Subject,
|
|
||||||
"Senders": workflow.Sender,
|
|
||||||
"SerialNumber": element.serialNumber,
|
|
||||||
"Status": workflow.Status,
|
|
||||||
"WorkflowName": element.workflowDisplayName
|
|
||||||
|
|
||||||
}
|
|
||||||
pendingList.push(task)
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
pendingList = this.sortService.sortDate(pendingList, 'CreateDate');
|
|
||||||
this.listToPresent = pendingList;
|
|
||||||
console.log('pendentes', pendingList)
|
|
||||||
|
|
||||||
})
|
})
|
||||||
})
|
} else {
|
||||||
|
|
||||||
|
this.platform.ready().then(() => {
|
||||||
|
this.sqliteservice.getAllProcess().then((process: any[]) => {
|
||||||
|
var pendingList = []
|
||||||
|
console.log('Pendentes off off',process )
|
||||||
|
process.forEach(element => {
|
||||||
|
var workflow = JSON.parse(element.workflowInstanceDataFields);
|
||||||
|
if (workflow.Status === "Pending") {
|
||||||
|
let task = {
|
||||||
|
"CreateDate": new Date(element.taskStartDate),
|
||||||
|
"DocumentsQty": element.totalDocuments,
|
||||||
|
"FolderID": workflow.FolderID,
|
||||||
|
"Folio": workflow.Subject,
|
||||||
|
"Senders": workflow.Sender,
|
||||||
|
"SerialNumber": element.serialNumber,
|
||||||
|
"Status": workflow.Status,
|
||||||
|
"WorkflowName": element.workflowDisplayName
|
||||||
|
|
||||||
|
}
|
||||||
|
pendingList.push(task)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
pendingList = this.sortService.sortDate(pendingList, 'CreateDate');
|
||||||
|
this.listToPresent = pendingList;
|
||||||
|
console.log('pendentes', pendingList)
|
||||||
|
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async refreshing() {
|
async refreshing() {
|
||||||
|
|||||||
@@ -38,11 +38,15 @@
|
|||||||
*ngFor="let publication of getpublication"
|
*ngFor="let publication of getpublication"
|
||||||
(click)="goToPublicationDetail(publication.DocumentId)"
|
(click)="goToPublicationDetail(publication.DocumentId)"
|
||||||
>
|
>
|
||||||
<div *ngIf="publication.FileBase64.length > 30" class="post-img">
|
<div *ngIf="publication.FileBase64 != null">
|
||||||
<ion-img src="{{publication.FileBase64}}" alt="image"></ion-img>
|
<div *ngIf="publication.FileBase64.length < 30; else imageLoaded" class="post-img">
|
||||||
</div>
|
<img src="/assets/icon/icon-no-image.svg">
|
||||||
<div *ngIf="publication.FileBase64.length < 30" class="post-img">
|
</div>
|
||||||
<img src="/assets/icon/icon-no-image.svg" alt="image">
|
<ng-template #imageLoaded>
|
||||||
|
<div *ngIf="publication.FileBase64.length > 30" class="post-img">
|
||||||
|
<img src="{{publication.FileBase64}}">
|
||||||
|
</div>
|
||||||
|
</ng-template>
|
||||||
</div>
|
</div>
|
||||||
<div class="post-content px-20">
|
<div class="post-content px-20">
|
||||||
<div class="post-title-time">
|
<div class="post-title-time">
|
||||||
|
|||||||
@@ -68,15 +68,16 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
if (typeof (this.folderId) == 'object') {
|
if (typeof (this.folderId) == 'object') {
|
||||||
this.folderId = this.folderId['ProcessId']
|
this.folderId = this.folderId['ProcessId']
|
||||||
}
|
}
|
||||||
this.testForkJoin()
|
//this.testForkJoin()
|
||||||
this.getPublicationDetail();
|
this.getPublicationDetail();
|
||||||
setTimeout(() => {
|
this.getPublicationsIds();
|
||||||
|
/* setTimeout(() => {
|
||||||
this.getPublicationsIds();
|
this.getPublicationsIds();
|
||||||
}, 1000);
|
}, 1000); */
|
||||||
|
|
||||||
this.backgroundservice.registerBackService('Online', () => {
|
this.backgroundservice.registerBackService('Online', () => {
|
||||||
this.getPublicationDetail();
|
this.getPublicationDetail();
|
||||||
this.testForkJoin()
|
//this.testForkJoin()
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -91,16 +92,16 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
// if (typeof (this.id == 'object') {
|
// if (typeof (this.id == 'object') {
|
||||||
// this.id = this.id['ProcessId']
|
// this.id = this.id['ProcessId']
|
||||||
// }
|
// }
|
||||||
this.testForkJoin()
|
//this.testForkJoin()
|
||||||
this.getPublicationDetail();
|
//this.getPublicationDetail();
|
||||||
// this.getPublicationsIds();
|
// this.getPublicationsIds();
|
||||||
}
|
}
|
||||||
|
|
||||||
doRefresh = (event) => {
|
doRefresh = (event) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.testForkJoin()
|
//this.testForkJoin()
|
||||||
this.getPublicationDetail();
|
this.getPublicationDetail();
|
||||||
// this.getPublicationsIds();
|
this.getPublicationsIds();
|
||||||
event.target.complete();
|
event.target.complete();
|
||||||
}, 3000);
|
}, 3000);
|
||||||
|
|
||||||
@@ -116,13 +117,14 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getPublicationDetail() {
|
getPublicationDetail() {
|
||||||
this.publications.GetPresidentialAction(this.folderId).subscribe(res=>{
|
this.publications.GetPresidentialAction(this.folderId).subscribe(res => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
this.item = res;
|
this.item = res;
|
||||||
|
this.sqliteservice.updatePublicationsDetails(this.folderId, JSON.stringify(res));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// goes to fork
|
// goes to fork
|
||||||
// getPublicationsIds() {
|
// getPublicationsIds() {
|
||||||
|
|
||||||
// this.showLoader = true;
|
// this.showLoader = true;
|
||||||
@@ -138,22 +140,22 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
|
|
||||||
this.showLoader = true;
|
this.showLoader = true;
|
||||||
const folderId = this.folderId
|
const folderId = this.folderId
|
||||||
|
this.getFromDB()
|
||||||
this.publications.GetPublicationsImages(this.folderId).subscribe(res => {
|
this.publications.GetPublicationsImages(this.folderId).subscribe(res => {
|
||||||
|
|
||||||
console.log('publications ids', res)
|
console.log('publications ids', res)
|
||||||
this.publicationList = new Array();
|
this.publicationList = new Array();
|
||||||
|
|
||||||
/* for(let i of res) {
|
for(let i = 0; i < res.length; i++) {
|
||||||
this.publications.GetPublicationById(i).subscribe(ress => {
|
this.publications.GetPublicationById(res[i]).subscribe(ress => {
|
||||||
console.log('publications by ids', 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)
|
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)
|
console.log('publications elements', element)
|
||||||
this.publications.GetPublicationById(element).subscribe(ress => {
|
this.publications.GetPublicationById(element).subscribe(ress => {
|
||||||
console.log('publications by ids', ress)
|
console.log('publications by ids', ress)
|
||||||
@@ -162,13 +164,13 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
this.publicationList.push(ress);
|
this.publicationList.push(ress);
|
||||||
})
|
})
|
||||||
|
|
||||||
});
|
}); */
|
||||||
|
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.publicationListStorage.add(folderId, this.publicationList)
|
this.publicationListStorage.add(folderId, this.publicationList)
|
||||||
this.getpublication = this.publicationList;
|
this.getpublication = this.publicationList;
|
||||||
|
|
||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
|
|
||||||
/* this.publicationList = new Array();
|
/* this.publicationList = new Array();
|
||||||
@@ -189,7 +191,7 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
|
|
||||||
this.showLoader = true;
|
this.showLoader = true;
|
||||||
const folderId = this.folderId
|
const folderId = this.folderId
|
||||||
|
this.getFromDB();
|
||||||
this.publications.GetPublications(this.folderId).subscribe(res => {
|
this.publications.GetPublications(this.folderId).subscribe(res => {
|
||||||
|
|
||||||
console.log(this.folderId)
|
console.log(this.folderId)
|
||||||
@@ -223,13 +225,13 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
testForkJoin(){
|
testForkJoin() {
|
||||||
forkJoin([
|
forkJoin([
|
||||||
this.getPublicationsIds(),
|
this.getPublicationsIds(),
|
||||||
this.getPublications(),
|
this.getPublications(),
|
||||||
|
|
||||||
|
|
||||||
]).subscribe(allResults =>{
|
]).subscribe(allResults => {
|
||||||
this.publicationList = allResults[2]
|
this.publicationList = allResults[2]
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -238,7 +240,7 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
|
|
||||||
this.sqliteservice.getActionById(this.folderId).then((publications) => {
|
this.sqliteservice.getActionById(this.folderId).then((publications) => {
|
||||||
console.log('publications', 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,
|
||||||
DateEnd: publications[0].DateEnd,
|
DateEnd: publications[0].DateEnd,
|
||||||
@@ -246,7 +248,8 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
Detail: publications[0].Detail,
|
Detail: publications[0].Detail,
|
||||||
ProcessId: publications[0].ProcessId
|
ProcessId: publications[0].ProcessId
|
||||||
}
|
}
|
||||||
this.publicationDitails = item;
|
this.publicationDitails = item; */
|
||||||
|
this.item = JSON.parse(publications[0].publicationsDetails);
|
||||||
|
|
||||||
let publicationArray = [];
|
let publicationArray = [];
|
||||||
JSON.parse(publications[0].publications).forEach(element => {
|
JSON.parse(publications[0].publications).forEach(element => {
|
||||||
@@ -264,7 +267,7 @@ export class ViewPublicationsPage implements OnInit {
|
|||||||
publicationArray.push(publicationlis);
|
publicationArray.push(publicationlis);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.getpublication = publicationArray;
|
this.getpublication = publicationArray;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,13 @@ export class WsChatMethodsService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getRoomFromDb() {
|
||||||
|
this.storage.get('Rooms').then((rooms) => {
|
||||||
|
rooms.result.update.forEach((roomData: room) => {
|
||||||
|
this.prepareRoom(roomData);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
};
|
||||||
openRoom(roomId) {
|
openRoom(roomId) {
|
||||||
|
|
||||||
if(this.currentRoom) {
|
if(this.currentRoom) {
|
||||||
@@ -92,9 +99,12 @@ export class WsChatMethodsService {
|
|||||||
|
|
||||||
async getAllRooms () {
|
async getAllRooms () {
|
||||||
this.loadingWholeList = true
|
this.loadingWholeList = true
|
||||||
|
this.getRoomFromDb();
|
||||||
const rooms = await this.WsChatService.getRooms();
|
const rooms = await this.WsChatService.getRooms();
|
||||||
|
|
||||||
|
this.storage.set('Rooms', rooms);
|
||||||
|
|
||||||
|
// console.log("ROOMS" + JSON.stringify(rooms))
|
||||||
this.WsChatService.registerCallback({
|
this.WsChatService.registerCallback({
|
||||||
type:'Onmessage',
|
type:'Onmessage',
|
||||||
funx:(message)=>{
|
funx:(message)=>{
|
||||||
|
|||||||
@@ -127,7 +127,8 @@ export class SqliteService {
|
|||||||
DateEnd varchar(255),
|
DateEnd varchar(255),
|
||||||
Detail varchar(255),
|
Detail varchar(255),
|
||||||
Description varchar(255),
|
Description varchar(255),
|
||||||
publications Text
|
publications Text,
|
||||||
|
publicationsDetails Text
|
||||||
)`, [])
|
)`, [])
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
console.log("Sucess action Table created: ", res)
|
console.log("Sucess action Table created: ", res)
|
||||||
@@ -195,8 +196,8 @@ export class SqliteService {
|
|||||||
public addactions(data) {
|
public addactions(data) {
|
||||||
console.log('Action insert', data)
|
console.log('Action insert', data)
|
||||||
this.dbInstance.executeSql(`
|
this.dbInstance.executeSql(`
|
||||||
INSERT OR IGNORE INTO ${this.actions} (ActionType,DateBegin,DateEnd,Description,Detail,ProcessId,publications)
|
INSERT OR IGNORE INTO ${this.actions} (ActionType,DateBegin,DateEnd,Description,Detail,ProcessId,publications,publicationsDetails)
|
||||||
VALUES ('${data.ActionType}','${data.DateBegin}', '${data.DateEnd}','${data.Description}','${data.Detail}','${data.ProcessId}','${data.publications}')`, [])
|
VALUES ('${data.ActionType}','${data.DateBegin}', '${data.DateEnd}','${data.Description}','${data.Detail}','${data.ProcessId}','${data.publications}','${data.publicationsDetails}')`, [])
|
||||||
.then(() => {
|
.then(() => {
|
||||||
console.log("action add with Success");
|
console.log("action add with Success");
|
||||||
|
|
||||||
@@ -319,6 +320,22 @@ export class SqliteService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//updatePublicationsDetails
|
||||||
|
public updatePublicationsDetails(id, data) {
|
||||||
|
try {
|
||||||
|
console.log("update action data", data)
|
||||||
|
this.dbInstance.executeSql(`
|
||||||
|
UPDATE ${this.actions} SET publicationsDetails = ? WHERE ProcessId = ${id}`, [data])
|
||||||
|
.then(() => {
|
||||||
|
console.log("action update with Success");
|
||||||
|
|
||||||
|
}, (e) => {
|
||||||
|
console.log(JSON.stringify(e.err));
|
||||||
|
});
|
||||||
|
} catch(error) {}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
//updateChatMsg
|
//updateChatMsg
|
||||||
public updateChatMsg(id, data) {
|
public updateChatMsg(id, data) {
|
||||||
let jsonId = JSON.stringify(id)
|
let jsonId = JSON.stringify(id)
|
||||||
|
|||||||
@@ -28,12 +28,12 @@
|
|||||||
|
|
||||||
<div *ngSwitchCase="'MDGPR'" class="height-100">
|
<div *ngSwitchCase="'MDGPR'" class="height-100">
|
||||||
|
|
||||||
<div *ngIf="eventaprovacaostore.listmd.length != 0">
|
<div *ngIf="eventsMDGPRList.length != 0">
|
||||||
|
|
||||||
<ion-list class="width-100" >
|
<ion-list class="width-100" >
|
||||||
<div
|
<div
|
||||||
class="expediente item-hover ion-no-padding ion-no-margin cursor-pointer"
|
class="expediente item-hover ion-no-padding ion-no-margin cursor-pointer"
|
||||||
*ngFor="let event of eventaprovacaostore.listmd"
|
*ngFor="let event of eventsMDGPRList"
|
||||||
(click)="goToEventDetail(event)"
|
(click)="goToEventDetail(event)"
|
||||||
>
|
>
|
||||||
<!-- (click)="openApproveModal(event)" -->
|
<!-- (click)="openApproveModal(event)" -->
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
</ion-list>
|
</ion-list>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="eventaprovacaostore.listmd.length == 0" class="centered-div">
|
<div *ngIf="eventsMDGPRList.length == 0" class="centered-div">
|
||||||
<div *ngSwitchCase="'MDGPR'" >
|
<div *ngSwitchCase="'MDGPR'" >
|
||||||
<div class="d-flex height-90 align-center justify-content-center"
|
<div class="d-flex height-90 align-center justify-content-center"
|
||||||
>
|
>
|
||||||
@@ -62,12 +62,12 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div *ngSwitchCase="'PR'">
|
<div *ngSwitchCase="'PR'">
|
||||||
<div *ngIf="eventaprovacaostore.listpr.length != 0">
|
<div *ngIf="eventsPRList.length != 0">
|
||||||
<ion-list class="width-100" *ngSwitchCase="'PR'">
|
<ion-list class="width-100" *ngSwitchCase="'PR'">
|
||||||
<div class="width-100" *ngIf="eventaprovacaostore.listpr">
|
<div class="width-100" *ngIf="eventsPRList">
|
||||||
<div
|
<div
|
||||||
class="expediente item-hover ion-no-padding ion-no-margin cursor-pointer"
|
class="expediente item-hover ion-no-padding ion-no-margin cursor-pointer"
|
||||||
*ngFor="let event of eventaprovacaostore.listpr"
|
*ngFor="let event of eventsPRList"
|
||||||
(click)="goToEventDetail(event)"
|
(click)="goToEventDetail(event)"
|
||||||
>
|
>
|
||||||
<div class="item event-pr-{{event.workflowInstanceDataFields.Agenda}} width-100">
|
<div class="item event-pr-{{event.workflowInstanceDataFields.Agenda}} width-100">
|
||||||
@@ -87,10 +87,10 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="eventaprovacaostore.listpr.length == 0" class="centered-div d-flex height-90 align-center justify-content-center">
|
<div *ngIf="eventsPRList.length == 0" class="centered-div d-flex height-90 align-center justify-content-center">
|
||||||
<div *ngSwitchCase="'PR'" >
|
<div *ngSwitchCase="'PR'" >
|
||||||
<div class="d-flex align-center justify-content-center"
|
<div class="d-flex align-center justify-content-center"
|
||||||
*ngIf="eventaprovacaostore.listpr.length < 1">
|
*ngIf="eventsPRList.length < 1">
|
||||||
Lista vazia
|
Lista vazia
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { LoginUserRespose } from 'src/app/models/user.model';
|
|||||||
import { AuthService } from 'src/app/services/auth.service';
|
import { AuthService } from 'src/app/services/auth.service';
|
||||||
import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service';
|
import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service';
|
||||||
import { SortService } from 'src/app/services/functions/sort.service';
|
import { SortService } from 'src/app/services/functions/sort.service';
|
||||||
|
import { Storage } from '@ionic/storage';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-events-to-approve',
|
selector: 'app-events-to-approve',
|
||||||
@@ -33,6 +34,7 @@ export class EventsToApprovePage implements OnInit {
|
|||||||
private router: Router,
|
private router: Router,
|
||||||
private userAuth: AuthService,
|
private userAuth: AuthService,
|
||||||
private sortService: SortService,
|
private sortService: SortService,
|
||||||
|
private storage: Storage
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this.loggeduser = userAuth.ValidatedUser;
|
this.loggeduser = userAuth.ValidatedUser;
|
||||||
@@ -63,25 +65,46 @@ export class EventsToApprovePage implements OnInit {
|
|||||||
async LoadToApproveEvents() {
|
async LoadToApproveEvents() {
|
||||||
this.showLoader = true;
|
this.showLoader = true;
|
||||||
console.log(this.segment);
|
console.log(this.segment);
|
||||||
|
this.getFromDB();
|
||||||
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.sortArrayByDate(this.eventsMDGPRList)
|
||||||
console.log(this.sortService.sortArrayByDate(this.eventsMDGPRList));
|
console.log(this.sortService.sortArrayByDate(this.eventsMDGPRList));
|
||||||
|
|
||||||
this.eventaprovacaostore.resetmd(this.sortService.sortDate(this.eventsMDGPRList, 'CreateDate'));
|
this.storage.set('event-to-aproveMD',this.eventsMDGPRList).then(() => {
|
||||||
|
console.log(' EVENTMD TO APROVE SAVED')
|
||||||
|
})
|
||||||
|
|
||||||
|
//this.eventaprovacaostore.resetmd(this.sortService.sortDate(this.eventsMDGPRList, 'CreateDate'));
|
||||||
}
|
}
|
||||||
else if(this.segment == 'PR'){
|
else if(this.segment == 'PR'){
|
||||||
let prEventsOficial = await this.processes.GetTasksList('Agenda Oficial PR', false).toPromise();
|
let prEventsOficial = await this.processes.GetTasksList('Agenda Oficial PR', false).toPromise();
|
||||||
let prEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal PR', false).toPromise();
|
let prEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal PR', false).toPromise();
|
||||||
this.eventsPRList = prEventsOficial.concat(prEventsPessoal);
|
this.eventsPRList = prEventsOficial.concat(prEventsPessoal);
|
||||||
|
this.eventsPRList = this.sortService.sortArrayByDate(this.eventsPRList)
|
||||||
|
|
||||||
this.eventaprovacaostore.resetpr(this.sortService.sortDate(this.eventsPRList, 'CreateDate'));
|
this.storage.set('event-to-aprovePR',this.eventsPRList).then(() => {
|
||||||
|
console.log(' EVENTPR TO APROVE SAVED')
|
||||||
|
})
|
||||||
|
//this.eventaprovacaostore.resetpr(this.sortService.sortDate(this.eventsPRList, 'CreateDate'));
|
||||||
}
|
}
|
||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getFromDB() {
|
||||||
|
this.storage.get('event-to-aproveMD').then((events) => {
|
||||||
|
this.eventsMDGPRList = events
|
||||||
|
})
|
||||||
|
|
||||||
|
this.storage.get('event-to-aprovePR').then((events) => {
|
||||||
|
this.eventsPRList = events
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
toDateString(e) {
|
toDateString(e) {
|
||||||
return new Date(e).toDateString()
|
return new Date(e).toDateString()
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,10 +22,10 @@
|
|||||||
<div class="content width-100 overflow-y-auto height-100" >
|
<div class="content width-100 overflow-y-auto height-100" >
|
||||||
<div >
|
<div >
|
||||||
|
|
||||||
<ion-list *ngIf="expedientegbstore.list.length >=0">
|
<ion-list *ngIf="taskslist.length >=0">
|
||||||
<div
|
<div
|
||||||
class="expediente item-hover ion-no-padding ion-no-margin cursor-pointer"
|
class="expediente item-hover ion-no-padding ion-no-margin cursor-pointer"
|
||||||
*ngFor = "let task of expedientegbstore.list"
|
*ngFor = "let task of taskslist"
|
||||||
(click)="goToExpediente(task.SerialNumber)"
|
(click)="goToExpediente(task.SerialNumber)"
|
||||||
>
|
>
|
||||||
<div class="item width-100">
|
<div class="item width-100">
|
||||||
@@ -58,13 +58,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
*ngIf="!skeletonLoader && expedientegbstore.list.length == 0 && expedientegbstore.list.length == 0"
|
*ngIf="!skeletonLoader && taskslist.length == 0 && taskslist.length == 0"
|
||||||
class="empty-list d-flex height-100 align-center justify-content-center"
|
class="empty-list d-flex height-100 align-center justify-content-center"
|
||||||
>
|
>
|
||||||
<span>Lista vazia</span>
|
<span>Lista vazia</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div *ngIf="skeletonLoader && expedientegbstore.list.length == 0">
|
<div *ngIf="skeletonLoader && taskslist.length == 0">
|
||||||
|
|
||||||
<ion-list>
|
<ion-list>
|
||||||
<ion-item>
|
<ion-item>
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
|||||||
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
|
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { SortService } from 'src/app/services/functions/sort.service';
|
import { SortService } from 'src/app/services/functions/sort.service';
|
||||||
|
import { Storage } from '@ionic/storage';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-expedients',
|
selector: 'app-expedients',
|
||||||
@@ -13,27 +14,28 @@ import { SortService } from 'src/app/services/functions/sort.service';
|
|||||||
styleUrls: ['./expedients.page.scss'],
|
styleUrls: ['./expedients.page.scss'],
|
||||||
})
|
})
|
||||||
export class ExpedientsPage implements OnInit {
|
export class ExpedientsPage implements OnInit {
|
||||||
segment:string;
|
segment: string;
|
||||||
|
|
||||||
taskslist = [];
|
taskslist = [];
|
||||||
serialNumber:string;
|
serialNumber: string;
|
||||||
|
|
||||||
@Input() profile:string;
|
@Input() profile: string;
|
||||||
skeletonLoader = true
|
skeletonLoader = true
|
||||||
expedientegbstore = ExpedienteGdStore
|
expedientegbstore = ExpedienteGdStore
|
||||||
|
|
||||||
expedienteTaskPipe = new ExpedienteTaskPipe()
|
expedienteTaskPipe = new ExpedienteTaskPipe()
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private processes:ProcessesService,
|
private processes: ProcessesService,
|
||||||
private alertService: AlertService,
|
private alertService: AlertService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
private sortService: SortService,
|
private sortService: SortService,
|
||||||
) {
|
private storage: Storage
|
||||||
this.profile = 'mdgpr';
|
) {
|
||||||
|
this.profile = 'mdgpr';
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
//Inicializar segment
|
//Inicializar segment
|
||||||
@@ -43,11 +45,11 @@ export class ExpedientsPage implements OnInit {
|
|||||||
this.router.events.forEach((event) => {
|
this.router.events.forEach((event) => {
|
||||||
if (event instanceof NavigationStart &&
|
if (event instanceof NavigationStart &&
|
||||||
event.url.startsWith('/home/gabinete-digital?expedientes=true')) {
|
event.url.startsWith('/home/gabinete-digital?expedientes=true')) {
|
||||||
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
if (window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||||
this.doRefresh()
|
this.doRefresh()
|
||||||
} else {
|
} else {
|
||||||
this.LoadList()
|
this.LoadList()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -75,21 +77,35 @@ export class ExpedientsPage implements OnInit {
|
|||||||
this.taskslist.push(task);
|
this.taskslist.push(task);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
this.taskslist = this.sortService.sortDate(this.taskslist, 'CreateDate')
|
this.taskslist = this.sortService.sortDate(this.taskslist, 'CreateDate')
|
||||||
|
this.addProcessTODb(this.taskslist);
|
||||||
this.expedientegbstore.reset(this.taskslist);
|
this.expedientegbstore.reset(this.taskslist);
|
||||||
|
}, (error) => {
|
||||||
|
this.getEventsFromLocalDb();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
doRefresh() {
|
addProcessTODb(task) {
|
||||||
setTimeout(()=>{
|
this.storage.set('gabinete-expediente', task).then(() => {
|
||||||
this.LoadList();
|
console.log('GABINETE EXPEDIENTE SAVED')
|
||||||
}, 1000)
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
goToExpediente(serialNumber:any){
|
getEventsFromLocalDb() {
|
||||||
this.router.navigate(['/home/gabinete-digital/expediente',serialNumber,'gabinete-digital']);
|
this.storage.get('gabinete-expediente').then((expediente) => {
|
||||||
|
this.taskslist = expediente
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
doRefresh() {
|
||||||
|
setTimeout(() => {
|
||||||
|
this.LoadList();
|
||||||
|
}, 1000)
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
goToExpediente(serialNumber: any) {
|
||||||
|
this.router.navigate(['/home/gabinete-digital/expediente', serialNumber, 'gabinete-digital']);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
</ion-refresher>
|
</ion-refresher>
|
||||||
|
|
||||||
<app-task-list
|
<app-task-list
|
||||||
[taskList] = pendentesstore.list
|
[taskList] = listToPresent
|
||||||
[skeletonLoader] = skeletonLoader
|
[skeletonLoader] = skeletonLoader
|
||||||
(viewTaskDetail)="viewTaskDetails($event)"
|
(viewTaskDetail)="viewTaskDetails($event)"
|
||||||
> </app-task-list>
|
> </app-task-list>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import { PendentesStore } from 'src/app/store/pendestes-store.service';
|
|||||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||||
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
|
import { CustomTaskPipe } from 'src/app/pipes/custom-task.pipe';
|
||||||
import { SortService } from 'src/app/services/functions/sort.service';
|
import { SortService } from 'src/app/services/functions/sort.service';
|
||||||
|
import { Storage } from '@ionic/storage';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-pendentes',
|
selector: 'app-pendentes',
|
||||||
@@ -20,6 +21,7 @@ export class PendentesPage implements OnInit {
|
|||||||
pendentesstore = PendentesStore;
|
pendentesstore = PendentesStore;
|
||||||
customTaskPipe = new CustomTaskPipe()
|
customTaskPipe = new CustomTaskPipe()
|
||||||
loggeduser: LoginUserRespose;
|
loggeduser: LoginUserRespose;
|
||||||
|
listToPresent = [];
|
||||||
|
|
||||||
@Input() profile:string;
|
@Input() profile:string;
|
||||||
segment:string;
|
segment:string;
|
||||||
@@ -30,6 +32,7 @@ export class PendentesPage implements OnInit {
|
|||||||
private authService: AuthService,
|
private authService: AuthService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private sortService: SortService,
|
private sortService: SortService,
|
||||||
|
private storage: Storage
|
||||||
) {
|
) {
|
||||||
this.loggeduser = authService.ValidatedUser;
|
this.loggeduser = authService.ValidatedUser;
|
||||||
}
|
}
|
||||||
@@ -52,7 +55,7 @@ export class PendentesPage implements OnInit {
|
|||||||
|
|
||||||
async LoadList(){
|
async LoadList(){
|
||||||
this.skeletonLoader = true;
|
this.skeletonLoader = true;
|
||||||
|
this.processes.GetPendingTasks(false).subscribe(async res => {
|
||||||
let pendentes = await this.processes.GetPendingTasks(false).toPromise();
|
let pendentes = await this.processes.GetPendingTasks(false).toPromise();
|
||||||
let pendentesList = [];
|
let pendentesList = [];
|
||||||
|
|
||||||
@@ -64,9 +67,24 @@ export class PendentesPage implements OnInit {
|
|||||||
pendentesList = removeDuplicate( pendentesList)
|
pendentesList = removeDuplicate( pendentesList)
|
||||||
pendentesList = this.sortService.sortDate(pendentesList, 'CreateDate')
|
pendentesList = this.sortService.sortDate(pendentesList, 'CreateDate')
|
||||||
|
|
||||||
|
this.listToPresent = pendentesList
|
||||||
this.pendentesstore.reset(pendentesList);
|
this.pendentesstore.reset(pendentesList);
|
||||||
|
this.storage.set('pendente-list',pendentesList).then(() => {
|
||||||
|
console.log('Pendente list SAVED')
|
||||||
|
})
|
||||||
this.skeletonLoader = false;
|
this.skeletonLoader = false;
|
||||||
}
|
}, (error) => {
|
||||||
|
if(error.status == 0){
|
||||||
|
this.getFromDb();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
getFromDb() {
|
||||||
|
this.storage.get('pendente-list').then((pendentes) => {
|
||||||
|
this.listToPresent =pendentes
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
doRefresh() {
|
doRefresh() {
|
||||||
setTimeout(()=>{
|
setTimeout(()=>{
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ import { NgModule } from '@angular/core';
|
|||||||
import { CommonModule } from '@angular/common';
|
import { CommonModule } from '@angular/common';
|
||||||
import { FormsModule } from '@angular/forms';
|
import { FormsModule } from '@angular/forms';
|
||||||
import { IonicModule } from '@ionic/angular';
|
import { IonicModule } from '@ionic/angular';
|
||||||
|
import { IonicImageLoaderModule } from 'ionic-image-loader-v5';
|
||||||
// import { HeaderPage } from './header/header.page';
|
// import { HeaderPage } from './header/header.page';
|
||||||
// import { HeaderPrPage } from './header-pr/header-pr.page';
|
// import { HeaderPrPage } from './header-pr/header-pr.page';
|
||||||
// import { BtnSeguintePage } from './btn-seguinte/btn-seguinte.page';
|
// import { BtnSeguintePage } from './btn-seguinte/btn-seguinte.page';
|
||||||
@@ -17,7 +18,8 @@ import { IonicModule } from '@ionic/angular';
|
|||||||
imports: [
|
imports: [
|
||||||
CommonModule,
|
CommonModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
IonicModule
|
IonicModule,
|
||||||
|
IonicImageLoaderModule
|
||||||
],
|
],
|
||||||
exports: [
|
exports: [
|
||||||
// HeaderPage,
|
// HeaderPage,
|
||||||
|
|||||||
Reference in New Issue
Block a user