mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
save
This commit is contained in:
@@ -3,7 +3,7 @@ apply plugin: 'com.android.application'
|
|||||||
android {
|
android {
|
||||||
compileSdkVersion rootProject.ext.compileSdkVersion
|
compileSdkVersion rootProject.ext.compileSdkVersion
|
||||||
defaultConfig {
|
defaultConfig {
|
||||||
applicationId "com.capacitorjs.app.testapp"
|
applicationId "com.gpr.gabinetedigital"
|
||||||
minSdkVersion rootProject.ext.minSdkVersion
|
minSdkVersion rootProject.ext.minSdkVersion
|
||||||
targetSdkVersion rootProject.ext.targetSdkVersion
|
targetSdkVersion rootProject.ext.targetSdkVersion
|
||||||
versionCode 1
|
versionCode 1
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.capacitorjs.app.testapp">
|
package="com.gpr.gabinetedigital">
|
||||||
|
|
||||||
<application
|
<application
|
||||||
android:allowBackup="true"
|
android:allowBackup="true"
|
||||||
@@ -12,7 +12,7 @@
|
|||||||
|
|
||||||
<activity
|
<activity
|
||||||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
|
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|smallestScreenSize|screenLayout|uiMode"
|
||||||
android:name="com.capacitorjs.app.testapp.MainActivity"
|
android:name="com.gpr.gabinetedigital.MainActivity"
|
||||||
android:label="@string/title_activity_main"
|
android:label="@string/title_activity_main"
|
||||||
android:theme="@style/AppTheme.NoActionBarLaunch"
|
android:theme="@style/AppTheme.NoActionBarLaunch"
|
||||||
android:launchMode="singleTask">
|
android:launchMode="singleTask">
|
||||||
|
|||||||
@@ -9,51 +9,51 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pkg": "@capacitor/app",
|
"pkg": "@capacitor/app",
|
||||||
"classpath": "com.capacitorjs.plugins.app.AppPlugin"
|
"classpath": "com.gpr.plugins.app.AppPlugin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pkg": "@capacitor/browser",
|
"pkg": "@capacitor/browser",
|
||||||
"classpath": "com.capacitorjs.plugins.browser.BrowserPlugin"
|
"classpath": "com.gpr.plugins.browser.BrowserPlugin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pkg": "@capacitor/camera",
|
"pkg": "@capacitor/camera",
|
||||||
"classpath": "com.capacitorjs.plugins.camera.CameraPlugin"
|
"classpath": "com.gpr.plugins.camera.CameraPlugin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pkg": "@capacitor/device",
|
"pkg": "@capacitor/device",
|
||||||
"classpath": "com.capacitorjs.plugins.device.DevicePlugin"
|
"classpath": "com.gpr.plugins.device.DevicePlugin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pkg": "@capacitor/filesystem",
|
"pkg": "@capacitor/filesystem",
|
||||||
"classpath": "com.capacitorjs.plugins.filesystem.FilesystemPlugin"
|
"classpath": "com.gpr.plugins.filesystem.FilesystemPlugin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pkg": "@capacitor/haptics",
|
"pkg": "@capacitor/haptics",
|
||||||
"classpath": "com.capacitorjs.plugins.haptics.HapticsPlugin"
|
"classpath": "com.gpr.plugins.haptics.HapticsPlugin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pkg": "@capacitor/keyboard",
|
"pkg": "@capacitor/keyboard",
|
||||||
"classpath": "com.capacitorjs.plugins.keyboard.KeyboardPlugin"
|
"classpath": "com.gpr.plugins.keyboard.KeyboardPlugin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pkg": "@capacitor/local-notifications",
|
"pkg": "@capacitor/local-notifications",
|
||||||
"classpath": "com.capacitorjs.plugins.localnotifications.LocalNotificationsPlugin"
|
"classpath": "com.gpr.plugins.localnotifications.LocalNotificationsPlugin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pkg": "@capacitor/network",
|
"pkg": "@capacitor/network",
|
||||||
"classpath": "com.capacitorjs.plugins.network.NetworkPlugin"
|
"classpath": "com.gpr.plugins.network.NetworkPlugin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pkg": "@capacitor/push-notifications",
|
"pkg": "@capacitor/push-notifications",
|
||||||
"classpath": "com.capacitorjs.plugins.pushnotifications.PushNotificationsPlugin"
|
"classpath": "com.gpr.plugins.pushnotifications.PushNotificationsPlugin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pkg": "@capacitor/share",
|
"pkg": "@capacitor/share",
|
||||||
"classpath": "com.capacitorjs.plugins.share.SharePlugin"
|
"classpath": "com.gpr.plugins.share.SharePlugin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pkg": "@capacitor/storage",
|
"pkg": "@capacitor/storage",
|
||||||
"classpath": "com.capacitorjs.plugins.storage.StoragePlugin"
|
"classpath": "com.gpr.plugins.storage.StoragePlugin"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"pkg": "@sentry/capacitor",
|
"pkg": "@sentry/capacitor",
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
package com.capacitorjs.app.testapp;
|
|
||||||
|
|
||||||
import com.getcapacitor.BridgeActivity;
|
|
||||||
|
|
||||||
public class MainActivity extends BridgeActivity {}
|
|
||||||
@@ -497,7 +497,9 @@ export class EditEventPage implements OnInit {
|
|||||||
this.attachmentsService.getAttachmentsById(eventId).subscribe(res=>{
|
this.attachmentsService.getAttachmentsById(eventId).subscribe(res=>{
|
||||||
this.loadedEventAttachments = res;
|
this.loadedEventAttachments = res;
|
||||||
|
|
||||||
});
|
},((erro) => {
|
||||||
|
console.error('editgetAttchament', erro)
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteAttachment(attachmentID: string, index) {
|
deleteAttachment(attachmentID: string, index) {
|
||||||
|
|||||||
@@ -29,7 +29,9 @@ export class AttachmentsPage implements OnInit {
|
|||||||
this.attachamentsService.getAttachmentsById(eventid).subscribe(attachments => {
|
this.attachamentsService.getAttachmentsById(eventid).subscribe(attachments => {
|
||||||
this.loadedEventAttachments = attachments;
|
this.loadedEventAttachments = attachments;
|
||||||
this.pageId = eventid;
|
this.pageId = eventid;
|
||||||
});
|
},((erro) => {
|
||||||
|
console.error('loadtAttchament', erro)
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
async viewDocument(documenturl:string)
|
async viewDocument(documenturl:string)
|
||||||
|
|||||||
@@ -194,7 +194,9 @@ export class EditEventPage implements OnInit {
|
|||||||
this.loadedEventAttachments = res;
|
this.loadedEventAttachments = res;
|
||||||
|
|
||||||
|
|
||||||
});
|
},((erro) => {
|
||||||
|
console.error('loadAttchament', erro)
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
async viewDocument(documenturl:string)
|
async viewDocument(documenturl:string)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -192,10 +192,9 @@ export class EventDetailModalPage implements OnInit {
|
|||||||
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
|
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
|
||||||
|
|
||||||
|
|
||||||
},(error) => {
|
},((erro) => {
|
||||||
|
console.error('loadAttchament', erro)
|
||||||
|
}));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
async viewDocument(documenturl:string)
|
async viewDocument(documenturl:string)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -190,7 +190,9 @@ export class EventDetailPage implements OnInit {
|
|||||||
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
|
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
|
||||||
this.loadedEventAttachments = res;
|
this.loadedEventAttachments = res;
|
||||||
|
|
||||||
});
|
},((erro) => {
|
||||||
|
console.error('loadAttchament', erro)
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
async viewDocument(documenturl:string)
|
async viewDocument(documenturl:string)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -1,3 +1,145 @@
|
|||||||
<ion-header class="ion-no-border">
|
<ion-header class="ion-no-border">
|
||||||
<app-header></app-header>
|
<app-header></app-header>
|
||||||
</ion-header>
|
</ion-header>
|
||||||
|
|
||||||
|
<!-- <ion-header class="ion-no-border init-event-header"> -->
|
||||||
|
<ion-header class="ion-no-border">
|
||||||
|
<ion-label>
|
||||||
|
<p class="time ion-text-center">{{customDate}}</p>
|
||||||
|
</ion-label>
|
||||||
|
<ion-label>
|
||||||
|
<p *ngIf="totalEvent==1" class="event-number p-small ion-text-center"> <strong>{{totalEvent}}</strong> evento agendado para hoje</p>
|
||||||
|
<p *ngIf="totalEvent!=1"class="event-number p-small ion-text-center"> <strong>{{totalEvent}}</strong> eventos agendados para hoje</p>
|
||||||
|
</ion-label>
|
||||||
|
<div class="next-meeting">
|
||||||
|
<div class="meeting-time" *ngIf="currentHoursMinutes">{{currentHoursMinutes | date: 'HH:mm'}}</div>
|
||||||
|
<div class="meeting-description" *ngIf="currentEvent"> "{{currentEvent}}"</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</ion-header>
|
||||||
|
|
||||||
|
<!-- <ion-content class="main " ng-controller="AppController"> -->
|
||||||
|
<ion-content ng-controller="AppController">
|
||||||
|
<ion-refresher slot="fixed" (ionRefresh)="doRefresh()">
|
||||||
|
<ion-refresher-content>
|
||||||
|
</ion-refresher-content>
|
||||||
|
</ion-refresher>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="conteiner-box px-20 height-100" ng-swipe-up="swipe($event)">
|
||||||
|
<div *ngIf="p.userPermission([p.permissionList.Agenda.access])" class="schedule height-100">
|
||||||
|
<ion-progress-bar type="indeterminate" *ngIf="showAgendaLoader"></ion-progress-bar>
|
||||||
|
<div class="schedule-header">
|
||||||
|
<div class="title">
|
||||||
|
<ion-icon class="icon" slot="end" src="assets/images/icons-default-agenda.svg" ></ion-icon>
|
||||||
|
<div class="text">A sua Agenda</div>
|
||||||
|
</div>
|
||||||
|
<button title="Ir para a sua Agenda" class="btn-no-color" [routerLink]="['/home/agenda']">
|
||||||
|
<ion-icon
|
||||||
|
*ngIf="ThemeService.currentTheme == 'default' "
|
||||||
|
class="icon-next"
|
||||||
|
slot="end"
|
||||||
|
src="assets/images/icons-arrow-circle-arrow-right.svg"
|
||||||
|
></ion-icon>
|
||||||
|
|
||||||
|
<ion-icon
|
||||||
|
*ngIf="ThemeService.currentTheme == 'gov' "
|
||||||
|
class="icon-next"
|
||||||
|
slot="end"
|
||||||
|
src="assets/images/theme/gov/icons-arrow-circle-arrow-right.svg"
|
||||||
|
></ion-icon>
|
||||||
|
|
||||||
|
<ion-icon
|
||||||
|
*ngIf="ThemeService.currentTheme == 'doneIt' "
|
||||||
|
class="icon-next"
|
||||||
|
slot="end"
|
||||||
|
src="assets/images/theme/doneIt/icons-arrow-circle-arrow-right.svg"
|
||||||
|
></ion-icon>
|
||||||
|
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="content overflow-y-auto flex-grow-1 height-100">
|
||||||
|
|
||||||
|
<ion-list>
|
||||||
|
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor="let event of listToPresent"
|
||||||
|
(click)="goToEvent(event)"
|
||||||
|
>
|
||||||
|
<div class="d-flex content-{{sessoStore.user.Profile}}-{{event.CalendarName}}">
|
||||||
|
|
||||||
|
<div class="schedule-time">
|
||||||
|
<div *ngIf="!event.IsAllDayEvent" class="time-start">{{event.StartDate | date: 'HH:mm'}}</div>
|
||||||
|
<div *ngIf="!event.IsAllDayEvent" class="time-end">{{event.EndDate | date: 'HH:mm'}}</div>
|
||||||
|
|
||||||
|
<div *ngIf="event.IsAllDayEvent" class="time-start"> Todo </div>
|
||||||
|
<div *ngIf="event.IsAllDayEvent" class="time-end text-center"> o dia </div>
|
||||||
|
<div></div>
|
||||||
|
</div>
|
||||||
|
<div class="schedule-details">
|
||||||
|
<div class="location">{{event.Location}}</div>
|
||||||
|
<div class="description">
|
||||||
|
<p>{{event.Subject}}</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
</ion-list>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="p.userPermission([p.permissionList.Gabinete.access])" class="schedule height-100">
|
||||||
|
<ion-progress-bar type="indeterminate" *ngIf="showCorrespondenciasLoader"></ion-progress-bar>
|
||||||
|
<div class="schedule-header">
|
||||||
|
<div class="title">
|
||||||
|
<ion-icon class="icon" slot="end" src="assets/images/icons-correspondencias.svg"></ion-icon>
|
||||||
|
<div class="text">Correspondência por ler</div>
|
||||||
|
</div>
|
||||||
|
<button title="Ir para o Gabinete Digital" (click)="viewExpedientListPage()" class="btn-no-color cursor-pointer">
|
||||||
|
<ion-icon
|
||||||
|
*ngIf="ThemeService.currentTheme == 'default' "
|
||||||
|
class="icon-next"
|
||||||
|
slot="end"
|
||||||
|
src="assets/images/icons-arrow-circle-arrow-right.svg"
|
||||||
|
></ion-icon>
|
||||||
|
|
||||||
|
<ion-icon
|
||||||
|
*ngIf="ThemeService.currentTheme == 'gov' "
|
||||||
|
class="icon-next"
|
||||||
|
slot="end"
|
||||||
|
src="assets/images/theme/gov/icons-arrow-circle-arrow-right.svg"
|
||||||
|
></ion-icon>
|
||||||
|
|
||||||
|
<ion-icon
|
||||||
|
*ngIf="ThemeService.currentTheme == 'doneIt' "
|
||||||
|
class="icon-next"
|
||||||
|
slot="end"
|
||||||
|
src="assets/images/theme/doneIt/icons-arrow-circle-arrow-right.svg"
|
||||||
|
></ion-icon>
|
||||||
|
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div class="content overflow-y-auto flex-grow-1 height-100">
|
||||||
|
<ion-list>
|
||||||
|
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor = "let task of listToPresentexpediente"
|
||||||
|
(click)="goToExpediente(task.SerialNumber)">
|
||||||
|
<div class="item-exp d-flex">
|
||||||
|
<div class="schedule-date">
|
||||||
|
<div class="time-end">{{task.taskStartDate | date: 'dd-MM-yyyy'}}</div>
|
||||||
|
<div class="time-start">{{task.taskStartDate | date: 'HH:mm'}}</div>
|
||||||
|
</div>
|
||||||
|
<div class="schedule-details pointer">
|
||||||
|
<div class="description">{{ task.Subject }}</div>
|
||||||
|
<div class="location">{{ task.Senders }}</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</ion-item>
|
||||||
|
|
||||||
|
</ion-list>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- <iframe id="home-iframe" style="width: 100%;" src="/assets/www/pdfjs/web/viewer.html?file=/assets/www/pdfjs/web/compressed.tracemonkey-pldi-09.pdf.pdf"></iframe> -->
|
||||||
|
</ion-content>
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,447 @@
|
|||||||
import { Component, OnInit, EventEmitter, Output } from '@angular/core';
|
import { Component, OnInit, EventEmitter, Output } from '@angular/core';
|
||||||
|
import { EventsService } from 'src/app/services/events.service';
|
||||||
|
import { NavigationExtras, Router } from '@angular/router';
|
||||||
|
import { ActivatedRoute, NavigationEnd } from '@angular/router';
|
||||||
|
import { ModalController, Platform } from '@ionic/angular';
|
||||||
|
import { EventDetailPage } from './event-detail/event-detail.page';
|
||||||
|
import { ProcessesService } from '../../services/processes.service';
|
||||||
|
import { ToDayEventStorage } from 'src/app/store/to-day-event-storage.service';
|
||||||
|
import { ExpedienteTaskPipe } from 'src/app/pipes/expediente-task.pipe';
|
||||||
|
import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
|
||||||
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
|
import { BackgroundService } from 'src/app/services/background.service';
|
||||||
|
import { momentG } from 'src/plugin/momentG';
|
||||||
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
|
import { Storage } from '@ionic/storage';
|
||||||
|
import { PermissionService } from 'src/app/services/permission.service';
|
||||||
|
import { ViewEventPage } from 'src/app/modals/view-event/view-event.page';
|
||||||
|
import { ChangeProfileService } from 'src/app/services/change-profile.service';
|
||||||
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-events',
|
selector: 'app-events',
|
||||||
templateUrl: './events.page.html',
|
templateUrl: './events.page.html',
|
||||||
styleUrls: ['./events.page.scss'],
|
styleUrls: ['./events.page.scss'],
|
||||||
})
|
})
|
||||||
export class EventsPage implements OnInit {
|
export class EventsPage implements OnInit {
|
||||||
constructor() {}
|
today = new Date();
|
||||||
|
|
||||||
|
months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||||
|
days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
||||||
|
|
||||||
|
customDate = this.days[this.today.getDay()] + ", " + this.today.getDate() + " de " + (this.months[this.today.getMonth()]);
|
||||||
|
|
||||||
|
grettings = ["Bom dia", "Boa tarde", "Boa noite"];
|
||||||
|
greetting = '';
|
||||||
|
|
||||||
|
timeDate = this.today.getHours() + ":" + this.today.getMinutes();
|
||||||
|
|
||||||
|
segment: string;
|
||||||
|
public profile: string;
|
||||||
|
currentEvent: any;
|
||||||
|
|
||||||
|
maxSubjectLength = 30;
|
||||||
|
|
||||||
|
customText = false;
|
||||||
|
totalEvent = 0;
|
||||||
|
currentHoursMinutes: Date | string;
|
||||||
|
|
||||||
|
showLoader: boolean;
|
||||||
|
|
||||||
|
expedientList: any;
|
||||||
|
hideSearchBtn: boolean = false;
|
||||||
|
|
||||||
|
// shared data
|
||||||
|
toDayEventStorage = ToDayEventStorage
|
||||||
|
expedienteGdStore = ExpedienteGdStore
|
||||||
|
|
||||||
|
listToPresent = [];
|
||||||
|
listToPresentexpediente = []
|
||||||
|
|
||||||
|
expedienteTaskPipe = new ExpedienteTaskPipe()
|
||||||
|
|
||||||
|
@Output() openExpedientListPage: EventEmitter<any> = new EventEmitter<any>();
|
||||||
|
|
||||||
|
sessoStore = SessionStore;
|
||||||
|
|
||||||
|
showAgendaLoader = false
|
||||||
|
showCorrespondenciasLoader = false
|
||||||
|
|
||||||
|
constructor(
|
||||||
|
private eventService: EventsService,
|
||||||
|
private router: Router,
|
||||||
|
public activatedRoute: ActivatedRoute,
|
||||||
|
private processes: ProcessesService,
|
||||||
|
private modalController: ModalController,
|
||||||
|
public platform: Platform,
|
||||||
|
private sqliteservice: SqliteService,
|
||||||
|
private backgroundservice: BackgroundService,
|
||||||
|
public ThemeService: ThemeService,
|
||||||
|
private storage: Storage,
|
||||||
|
public p: PermissionService,
|
||||||
|
private changeProfileService: ChangeProfileService,
|
||||||
|
) {
|
||||||
|
|
||||||
|
|
||||||
|
window['zipPhoneCallback'] = function (zipphone) {
|
||||||
|
var frame = document.getElementById('home-iframe');
|
||||||
|
if(frame) {
|
||||||
|
frame['contentWindow']['postMessage']({call:'cookies', value: { cookies: {} }});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.changeProfileService.registerCallback(() => {
|
||||||
|
|
||||||
|
this.listToPresent = [];
|
||||||
|
this.listToPresentexpediente = []
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
|
||||||
|
this.showGreeting();
|
||||||
|
|
||||||
|
this.router.events.forEach((event) => {
|
||||||
|
if (event instanceof NavigationEnd && event.url == '/home/events') {
|
||||||
|
this.RefreshEvents();
|
||||||
|
setTimeout(() => {
|
||||||
|
this.LoadList();
|
||||||
|
}, 1500)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.hideSearch();
|
||||||
|
|
||||||
|
this.backgroundservice.registerBackService('Online', () => {
|
||||||
|
this.showGreeting();
|
||||||
|
this.RefreshEvents();
|
||||||
|
this.LoadList();
|
||||||
|
this.hideSearch();
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
hideSearch() {
|
||||||
|
if (this.router.url == '/home/events') {
|
||||||
|
this.hideSearchBtn = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
doRefresh() {
|
||||||
|
this.RefreshEvents();
|
||||||
|
this.LoadList();
|
||||||
|
}
|
||||||
|
|
||||||
|
onSegmentChange() {
|
||||||
|
this.doRefresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async RefreshEvents() {
|
||||||
|
|
||||||
|
this.currentEvent = "";
|
||||||
|
this.showLoader = true;
|
||||||
|
this.showAgendaLoader = true;
|
||||||
|
|
||||||
|
let date = new Date();
|
||||||
|
let month = date.getMonth() + 1;
|
||||||
|
let start = date.getFullYear() + "-" + month + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||||
|
let end = date.getFullYear() + "-" + month + "-" + date.getDate() + " 23:59:59";
|
||||||
|
if(SessionStore.user) {
|
||||||
|
let onwEvent:any = await this.eventService.getAllOwnEvents(start, end).catch((error) => {
|
||||||
|
this.showAgendaLoader = false;
|
||||||
|
console.error(error)
|
||||||
|
})
|
||||||
|
this.listToPresent = onwEvent;
|
||||||
|
this.totalEvent = onwEvent.length;
|
||||||
|
this.showLoader = false;
|
||||||
|
this.showAgendaLoader = false;
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
addEventToDb(list) {
|
||||||
|
|
||||||
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
|
this.storage.set('events', list).then(() => {
|
||||||
|
//
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
if (list.length > 0) {
|
||||||
|
list.forEach(element => {
|
||||||
|
this.sqliteservice.addEvent(element)
|
||||||
|
|
||||||
|
this.sqliteservice.getAllEvents().then((event: any[] = []) => {
|
||||||
|
let todayEvents = new Array()
|
||||||
|
event.forEach((element) => {
|
||||||
|
let eventObject = {
|
||||||
|
AppointmentState: element.AppointmentState,
|
||||||
|
Attachments: element.Attachments,
|
||||||
|
Attendees: element.Attendees,
|
||||||
|
CalendarId: element.CalendarId,
|
||||||
|
CalendarName: element.CalendarName,
|
||||||
|
Category: element.Category,
|
||||||
|
EndDate: element.EndDate,
|
||||||
|
EventId: element.EventId,
|
||||||
|
EventRecurrence: element.EventRecurrence,
|
||||||
|
EventType: element.EventType,
|
||||||
|
HasAttachments: element.HasAttachments,
|
||||||
|
HumanDate: element.HumanDate,
|
||||||
|
IsAllDayEvent: element.IsAllDayEvent,
|
||||||
|
IsMeeting: element.IsMeeting,
|
||||||
|
IsRecurring: element.IsRecurring,
|
||||||
|
Location: element.Location,
|
||||||
|
Organizer: element.Organizer,
|
||||||
|
Profile: element.Profile,
|
||||||
|
StartDate: element.StartDate,
|
||||||
|
Subject: element.Subject
|
||||||
|
}
|
||||||
|
todayEvents.push(eventObject);
|
||||||
|
})
|
||||||
|
|
||||||
|
})
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
addProcessToDb(list) {
|
||||||
|
|
||||||
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
|
this.storage.set('process', list).then(() => {
|
||||||
|
//
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
if (list.length > 0) {
|
||||||
|
list.forEach(element => {
|
||||||
|
this.sqliteservice.addProcess(element)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getEventsFromLocalDb() {
|
||||||
|
|
||||||
|
let date = new Date();
|
||||||
|
let month = date.getMonth() + 1;
|
||||||
|
//date.setMonth(date.getMonth() + 1);
|
||||||
|
let dateToday = date.getFullYear() + "-" + month + "-" + date.getDate();
|
||||||
|
// ('dateeeeee', dateToday)
|
||||||
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
|
this.storage.get('events').then((events: any[] = []) => {
|
||||||
|
//
|
||||||
|
let todayEvents = new Array()
|
||||||
|
this.listToPresent = events
|
||||||
|
this.totalEvent = this.listToPresent.length
|
||||||
|
this.currentEvent = this.listToPresent[0].Subject
|
||||||
|
this.currentHoursMinutes = this.listToPresent[0].StartDate
|
||||||
|
//
|
||||||
|
})
|
||||||
|
|
||||||
|
this.storage.get('process').then((process: any[] = []) => {
|
||||||
|
//
|
||||||
|
const ExpedienteTask = process.map(e => this.expedienteTaskPipe.transform(e))
|
||||||
|
this.listToPresentexpediente = ExpedienteTask;
|
||||||
|
})
|
||||||
|
|
||||||
|
this.showLoader = false;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
this.sqliteservice.getAllEvents().then((event: any[] = []) => {
|
||||||
|
let todayEvents = new Array()
|
||||||
|
event.forEach((element) => {
|
||||||
|
let eventObject = {
|
||||||
|
AppointmentState: element.AppointmentState,
|
||||||
|
Attachments: element.Attachments,
|
||||||
|
Attendees: element.Attendees,
|
||||||
|
CalendarId: element.CalendarId,
|
||||||
|
CalendarName: element.CalendarName,
|
||||||
|
Category: element.Category,
|
||||||
|
EndDate: element.EndDate,
|
||||||
|
EventId: element.EventId,
|
||||||
|
EventRecurrence: element.EventRecurrence,
|
||||||
|
EventType: element.EventType,
|
||||||
|
HasAttachments: element.HasAttachments,
|
||||||
|
HumanDate: element.HumanDate,
|
||||||
|
IsAllDayEvent: element.IsAllDayEvent,
|
||||||
|
IsMeeting: element.IsMeeting,
|
||||||
|
IsRecurring: element.IsRecurring,
|
||||||
|
Location: element.Location,
|
||||||
|
Organizer: element.Organizer,
|
||||||
|
Profile: element.Profile,
|
||||||
|
StartDate: element.StartDate,
|
||||||
|
Subject: element.Subject
|
||||||
|
}
|
||||||
|
let starteDate = momentG(new Date(element.StartDate), 'yyyy-MM-dd');
|
||||||
|
//
|
||||||
|
if (dateToday == starteDate) {
|
||||||
|
todayEvents.push(eventObject);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
this.listToPresent = todayEvents
|
||||||
|
this.totalEvent = this.listToPresent.length
|
||||||
|
this.currentEvent = this.listToPresent[0].Subject
|
||||||
|
this.currentHoursMinutes = this.listToPresent[0].StartDate
|
||||||
|
//
|
||||||
|
})
|
||||||
|
|
||||||
|
this.sqliteservice.getprocessByworkflow("Expediente").then((process: any[] = []) => {
|
||||||
|
|
||||||
|
//
|
||||||
|
|
||||||
|
if (process.length > 0 || process != undefined) {
|
||||||
|
|
||||||
|
var expedientlist: any = new Array();
|
||||||
|
process.forEach((element) => {
|
||||||
|
if(JSON.parse(element.workflowInstanceDataFields).TaskMessage || JSON.parse(element.workflowInstanceDataFields).Note) {
|
||||||
|
|
||||||
|
let task = {
|
||||||
|
activityInstanceName: element.activityInstanceName,
|
||||||
|
deadline: null,
|
||||||
|
serialNumber: element.serialNumber,
|
||||||
|
taskStartDate: element.taskStartDate,
|
||||||
|
totalDocuments: element.totalDocuments,
|
||||||
|
workflowDisplayName: element.workflowDisplayName,
|
||||||
|
workflowInstanceDataFields: JSON.parse(element.workflowInstanceDataFields)
|
||||||
|
}
|
||||||
|
expedientlist.push(task);
|
||||||
|
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
//
|
||||||
|
const ExpedienteTask = expedientlist.map(e => this.expedienteTaskPipe.transform(e))
|
||||||
|
this.listToPresentexpediente = ExpedienteTask;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
this.showLoader = false;
|
||||||
|
})
|
||||||
|
}
|
||||||
|
// });
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
showGreeting() {
|
||||||
|
if (this.today.getHours() >= 6 && this.today.getHours() < 12) {
|
||||||
|
this.greetting = this.grettings[0];
|
||||||
|
}
|
||||||
|
else if (this.today.getHours() >= 12 && this.today.getHours() < 18) {
|
||||||
|
this.greetting = this.grettings[1];
|
||||||
|
}
|
||||||
|
else /* if(this.today.getHours() < 6 && this.today.getHours() >= 18) */ {
|
||||||
|
this.greetting = this.grettings[2];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
gotTo() {
|
||||||
|
this.router.navigate(['/home/events']);
|
||||||
|
}
|
||||||
|
|
||||||
|
changeProfile() {
|
||||||
|
if (this.profile == "mdgpr") {
|
||||||
|
//
|
||||||
|
this.profile = "pr";
|
||||||
|
this.RefreshEvents();
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
//
|
||||||
|
this.profile = "mdgpr";
|
||||||
|
this.RefreshEvents();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
async openEventDetail1(id: any) {
|
||||||
|
//
|
||||||
|
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: EventDetailPage,
|
||||||
|
componentProps: {
|
||||||
|
eventId: id,
|
||||||
|
},
|
||||||
|
cssClass: 'event-detail',
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
await modal.present();
|
||||||
|
modal.onDidDismiss();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
async openEventDetail(id: any) {
|
||||||
|
//
|
||||||
|
|
||||||
|
const modal = await this.modalController.create({
|
||||||
|
component: ViewEventPage,
|
||||||
|
componentProps: {
|
||||||
|
eventId: id,
|
||||||
|
},
|
||||||
|
cssClass: 'view-event',
|
||||||
|
backdropDismiss: false
|
||||||
|
});
|
||||||
|
await modal.present();
|
||||||
|
modal.onDidDismiss();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
LoadList() {
|
||||||
|
this.showCorrespondenciasLoader = true
|
||||||
|
this.processes.GetTaskListExpediente(false).subscribe(result => {
|
||||||
|
this.addProcessToDb(result);
|
||||||
|
|
||||||
|
let ExpedienteTask = result.map(e => this.expedienteTaskPipe.transform(e))
|
||||||
|
|
||||||
|
this.listToPresentexpediente = ExpedienteTask;
|
||||||
|
|
||||||
|
this.showCorrespondenciasLoader = false
|
||||||
|
}, ((error) => {
|
||||||
|
|
||||||
|
this.showCorrespondenciasLoader = false
|
||||||
|
//
|
||||||
|
this.getEventsFromLocalDb();
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
|
sortArrayISODate(myArray: any) {
|
||||||
|
return myArray.sort(function (a, b) {
|
||||||
|
return (a.CreateDate < b.CreateDate) ? -1 : ((a.CreateDate > b.CreateDate) ? 1 : 0);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
goToEvent(event: any) {
|
||||||
|
let navigationExtras: NavigationExtras = { queryParams: { CalendarId: event.CalendarId } }
|
||||||
|
|
||||||
|
|
||||||
|
this.router.navigate(['/home/events', event.EventId, 'agenda'], navigationExtras);
|
||||||
|
}
|
||||||
|
|
||||||
|
goToExpediente(SerialNumber: any) {
|
||||||
|
this.router.navigate(['/home/events/expediente', SerialNumber, 'events']);
|
||||||
|
}
|
||||||
|
|
||||||
|
viewExpedientListPage() {
|
||||||
|
|
||||||
|
if (this.sessoStore.user.Profile == 'PR') {
|
||||||
|
if (window.innerWidth < 701) {
|
||||||
|
this.router.navigate(['/home/gabinete-digital/expedientes-pr']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
let navigationExtras: NavigationExtras = { queryParams: { "expedientes-pr": true, } };
|
||||||
|
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if (window.innerWidth < 701) {
|
||||||
|
this.router.navigate(['/home/gabinete-digital/expediente']);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
let navigationExtras: NavigationExtras = { queryParams: { "expedientes": true, } };
|
||||||
|
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
ngOnInit() {}
|
|
||||||
}
|
}
|
||||||
+5
-2
@@ -144,8 +144,11 @@ export class ApproveEventModalPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getAttachments() {
|
async getAttachments() {
|
||||||
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
|
try {
|
||||||
|
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise;
|
||||||
|
} catch (error) {
|
||||||
|
console.error('getAttachments', error)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,9 @@ export class AttachmentsPage implements OnInit {
|
|||||||
this.attachamentsService.getAttachmentsById(eventid).subscribe(attachments => {
|
this.attachamentsService.getAttachmentsById(eventid).subscribe(attachments => {
|
||||||
this.loadedEventAttachments = attachments;
|
this.loadedEventAttachments = attachments;
|
||||||
this.pageId = eventid;
|
this.pageId = eventid;
|
||||||
});
|
},((erro) => {
|
||||||
|
console.error('loadAttchament', erro)
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
async viewDocument(documenturl:string)
|
async viewDocument(documenturl:string)
|
||||||
|
|||||||
@@ -189,7 +189,9 @@ export class EditEventPage implements OnInit {
|
|||||||
this.loadedEventAttachments = res;
|
this.loadedEventAttachments = res;
|
||||||
|
|
||||||
|
|
||||||
});
|
},((erro) => {
|
||||||
|
console.error('loadAttchament', erro)
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
async viewDocument(documenturl:string)
|
async viewDocument(documenturl:string)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -186,10 +186,9 @@ export class EventDetailModalPage implements OnInit {
|
|||||||
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
|
this.attachamentsService.getAttachmentsById(this.pageId).subscribe(res => {
|
||||||
|
|
||||||
|
|
||||||
},(error) => {
|
},((erro) => {
|
||||||
|
console.error('loadAttchament', erro)
|
||||||
|
}));
|
||||||
});
|
|
||||||
}
|
}
|
||||||
async viewDocument(documenturl:string)
|
async viewDocument(documenturl:string)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -187,7 +187,9 @@ export class EventDetailPage implements OnInit {
|
|||||||
this.loadedEventAttachments = res;
|
this.loadedEventAttachments = res;
|
||||||
|
|
||||||
|
|
||||||
});
|
},((erro) => {
|
||||||
|
console.error('loadAttchament', erro)
|
||||||
|
}));
|
||||||
}
|
}
|
||||||
async viewDocument(documenturl:string)
|
async viewDocument(documenturl:string)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -117,7 +117,12 @@ export class ApproveEventPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getAttachments() {
|
async getAttachments() {
|
||||||
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
|
try {
|
||||||
|
this.loadedAttachments = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
|
||||||
|
} catch (error) {
|
||||||
|
console.error('getAttchaments',error)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -481,9 +481,13 @@ export class EditEventToApprovePage implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
async getAttachments() {
|
async getAttachments() {
|
||||||
|
let result: any;
|
||||||
let result: any = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
|
try {
|
||||||
|
result = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
|
||||||
|
} catch (error) {
|
||||||
|
console.error('getAttachment',error)
|
||||||
|
}
|
||||||
|
|
||||||
result.forEach((e)=>{
|
result.forEach((e)=>{
|
||||||
e.action = false
|
e.action = false
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -456,7 +456,12 @@ export class EditEventPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async getAttachments(eventId: string){
|
async getAttachments(eventId: string){
|
||||||
const rest: any = this.attachmentsService.getAttachmentsById(eventId).toPromise()
|
let rest: any;
|
||||||
|
try {
|
||||||
|
rest = this.attachmentsService.getAttachmentsById(eventId).toPromise()
|
||||||
|
} catch (error) {
|
||||||
|
console.error('getAttchment', error)
|
||||||
|
}
|
||||||
this.loadedEventAttachments = rest;
|
this.loadedEventAttachments = rest;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -404,8 +404,12 @@ export class EditEventToApproveComponent implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
async getAttachments() {
|
async getAttachments() {
|
||||||
|
let result: any;
|
||||||
let result: any = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
|
try {
|
||||||
|
result = await this.attachmentsService.getAttachmentsById(this.InstanceId).toPromise();
|
||||||
|
} catch (error) {
|
||||||
|
console.error('getAttachments', error)
|
||||||
|
}
|
||||||
|
|
||||||
result.forEach((e)=>{
|
result.forEach((e)=>{
|
||||||
e.action = false
|
e.action = false
|
||||||
|
|||||||
Reference in New Issue
Block a user