+
-
-
+
-
-
Lista vazia
-
+
diff --git a/src/app/pages/inactivity/inactivity.page.ts b/src/app/pages/inactivity/inactivity.page.ts
index 9d3c2387d..a6d0d98ef 100644
--- a/src/app/pages/inactivity/inactivity.page.ts
+++ b/src/app/pages/inactivity/inactivity.page.ts
@@ -205,9 +205,16 @@ export class InactivityPage implements OnInit {
setTimeout(()=>{
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
- this.router.navigate(['/home/events'], {replaceUrl: true});
+ //When user has got access to Agenda but does not have their own calendar, goes to Agenda
+ if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0){
+ this.router.navigate(['/home/agenda']);
+ }
+ else{
+ this.router.navigate(['/home/events']);
+ }
}
- else if(this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)){
+ //If user has access permission to both Chat and Action, goes to Chat by default.
+ else if((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.access)){
this.router.navigate(['/home/chat']);
}
else if(this.p.userPermission(this.p.permissionList.Actions.access)){
@@ -228,9 +235,16 @@ export class InactivityPage implements OnInit {
SessionStore.setPin(code);
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
- this.router.navigate(['/home/events']);
+ //When user has got access to Agenda but does not have their own calendar, goes to Agenda
+ if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0){
+ this.router.navigate(['/home/agenda']);
+ }
+ else{
+ this.router.navigate(['/home/events']);
+ }
}
- else if(this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)){
+ //If user has access permission to both Chat and Action, goes to Chat by default.
+ else if((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.access)){
this.router.navigate(['/home/chat']);
}
else if(this.p.userPermission(this.p.permissionList.Actions.access)){
diff --git a/src/app/pages/login/login.page.ts b/src/app/pages/login/login.page.ts
index 655e60d2b..751c3cb26 100644
--- a/src/app/pages/login/login.page.ts
+++ b/src/app/pages/login/login.page.ts
@@ -163,9 +163,16 @@ export class LoginPage implements OnInit {
this.router.navigate([pathName]);
} else {
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
- this.router.navigate(['/home/events']);
+ //When user has got access to Agenda but does not have their own calendar, goes to Agenda
+ if(this.p.userPermission(this.p.permissionList.Agenda.access) && SessionStore.user.OwnerCalendars.length == 0){
+ this.router.navigate(['/home/agenda']);
+ }
+ else{
+ this.router.navigate(['/home/events']);
+ }
}
- else if(this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)){
+ //If user has access permission to both Chat and Action, goes to Chat by default.
+ else if((this.p.userPermission(this.p.permissionList.Chat.access) && this.p.userPermission(this.p.permissionList.Actions.access)) || this.p.userPermission(this.p.permissionList.Chat.access)){
this.router.navigate(['/home/chat']);
}
else if(this.p.userPermission(this.p.permissionList.Actions.access)){
diff --git a/src/app/services/chat/ws-chat-methods.service.ts b/src/app/services/chat/ws-chat-methods.service.ts
index 8780bb626..6d8ae3d30 100644
--- a/src/app/services/chat/ws-chat-methods.service.ts
+++ b/src/app/services/chat/ws-chat-methods.service.ts
@@ -33,7 +33,7 @@ export class WsChatMethodsService {
_dm: RoomService[] = []
_group: RoomService[] = []
- loadingWholeList = false
+ loadingWholeList = false;
dmCount = 0;
groupCount = 0;
@@ -121,7 +121,7 @@ export class WsChatMethodsService {
this._dm = []
this._group = []
- this.loadingWholeList = false
+ this.loadingWholeList = false;
this.dmCount = 0;
this.groupCount = 0;
@@ -177,13 +177,13 @@ export class WsChatMethodsService {
const roomId = this.getRoomId(roomData);
if(roomData.t == 'd') {
-
+
const res = await this.chatService.getMembers(roomId).toPromise();
-
+
const members = res['members'];
const users = members.filter(data => data.username != this.loggedUser.me.username);
rooms.result.update[index]['members'] = users
-
+
await this.prepareRoom(roomData);
} else {
if (roomData.t === 'p') {
@@ -209,7 +209,7 @@ export class WsChatMethodsService {
console.log('save rooms', rooms)
await this.storage.set('Rooms', rooms);
-
+
setTimeout(()=>{
this.sortRoomList()
}, 1000)
@@ -218,7 +218,7 @@ export class WsChatMethodsService {
setTimeout(()=>{
this.sortRoomList()
}, 10000)
-
+
this.loadingWholeList = false
}
diff --git a/src/app/services/route.service.ts b/src/app/services/route.service.ts
index 2f0c59440..ac5b250b4 100644
--- a/src/app/services/route.service.ts
+++ b/src/app/services/route.service.ts
@@ -88,4 +88,13 @@ export class RouteService {
}
+
+ getLastRoute() {
+ return this.history[this.history.length - 1]
+ }
+
+ getLastRouteA() {
+ return this.history[this.history.length - 2]
+ }
+
}
diff --git a/src/app/services/worker/document-counter.service.spec.ts b/src/app/services/worker/document-counter.service.spec.ts
deleted file mode 100644
index bc3c0f89e..000000000
--- a/src/app/services/worker/document-counter.service.spec.ts
+++ /dev/null
@@ -1,16 +0,0 @@
-import { TestBed } from '@angular/core/testing';
-
-import { DocumentCounterService } from './document-counter.service';
-
-describe('DocumentCounterService', () => {
- let service: DocumentCounterService;
-
- beforeEach(() => {
- TestBed.configureTestingModule({});
- service = TestBed.inject(DocumentCounterService);
- });
-
- it('should be created', () => {
- expect(service).toBeTruthy();
- });
-});
diff --git a/src/app/services/worker/document-counter.service.ts b/src/app/services/worker/document-counter.service.ts
deleted file mode 100644
index eafc6e6db..000000000
--- a/src/app/services/worker/document-counter.service.ts
+++ /dev/null
@@ -1,39 +0,0 @@
-import { Injectable } from '@angular/core';
-import { DespachoStore } from 'src/app/store/despacho-store.service';
-import { EventoAprovacaoStore } from 'src/app/store/eventoaprovacao-store.service';
-import { ExpedienteGdStore } from 'src/app/store/expedientegd-store.service';
-import { PendentesStore } from 'src/app/store/pendestes-store.service';
-import { PedidosStore } from 'src/app/store/pedidos-store.service';
-import { DespachosprStore } from 'src/app/store/despachospr-store.service';
-import { DeplomasStore } from 'src/app/store/deplomas.service';
-
-
-@Injectable({
- providedIn: 'root'
-})
-export class DocumentCounterService {
-
- expedienteGbStore = ExpedienteGdStore;
- pendentesStore = PendentesStore;
- despachoStore = DespachoStore;
- eventoAprovacaoStore = EventoAprovacaoStore;
- pedidosStore = PedidosStore;
- // expedientePrStore = ExpedienteprStore;
- despachoPrStore = DespachosprStore;
- deplomasStore = DeplomasStore
-
- constructor() { }
-
- // falta a contagem dos deplomas
- get mdTotalDocument(): number {
- return this.despachoStore.count + /** this.expedientePrStore.count + */ this.pedidosStore.countdeferimento
- + this.pedidosStore.countparecer + this.expedienteGbStore.count + this.despachoPrStore.count + this.pendentesStore.count
- + this.eventoAprovacaoStore.count + this.deplomasStore.diplomasListCount + this.deplomasStore.countDiplomasAssinadoListCount + this.deplomasStore.deplomasReviewCount
- }
-
- get prTotalDocument(): number {
- return this.despachoStore.count + /** this.expedientePrStore.count + */ this.pedidosStore.countdeferimento
- + this.pedidosStore.countparecer + this.expedienteGbStore.count + this.despachoPrStore.count + this.pendentesStore.count
- + this.eventoAprovacaoStore.count + this.deplomasStore.diplomasListCount + this.deplomasStore.countDiplomasAssinadoListCount + this.deplomasStore.deplomasReviewCount
- }
-}
diff --git a/src/app/shared/gabinete-digital/diplomas/diplomas.page.html b/src/app/shared/gabinete-digital/diplomas/diplomas.page.html
index 7b85534a7..c9702e023 100644
--- a/src/app/shared/gabinete-digital/diplomas/diplomas.page.html
+++ b/src/app/shared/gabinete-digital/diplomas/diplomas.page.html
@@ -10,7 +10,7 @@
-
+
Diplomas por validar
@@ -23,7 +23,7 @@
-
= 1">
+
= 1 && p.userPermission([p.permissionList.Gabinete.md_tasks])">
- = 2">
+
= 2 || (p.userPermission([permissionList.Agenda.access]) && loggeduser.OwnerCalendars.length != 0) || p.userPermission([permissionList.Gabinete.access])">
@@ -169,6 +169,7 @@
+
diff --git a/src/app/shared/header/header.page.ts b/src/app/shared/header/header.page.ts
index b91aa2d7a..e61de5c6c 100644
--- a/src/app/shared/header/header.page.ts
+++ b/src/app/shared/header/header.page.ts
@@ -39,7 +39,7 @@ export class HeaderPage implements OnInit {
private modalController: ModalController,
private animationController: AnimationController,
private storageservice: StorageService,
- private platform: Platform,
+ public platform: Platform,
//private notificationsService: NotificationsService,
private eventrigger: EventTrigger,
public ThemeService: ThemeService,