This commit is contained in:
Eudes Inácio
2022-06-02 09:10:07 +01:00
18 changed files with 50 additions and 99 deletions
+4 -20
View File
@@ -24,22 +24,14 @@ export class InactivityGuard implements CanActivate {
if (this.platform.is('desktop') || this.platform.is('mobileweb')) { if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){ if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
//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']); 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']); this.router.navigate(['/home/chat']);
} }
else if(this.p.userPermission(this.p.permissionList.Actions.access)) { else if(this.p.userPermission(this.p.permissionList.Actions.access)) {
this.router.navigate(['/home/publications']); this.router.navigate(['/home/publications']);
} } else {
else {
this.alertController.create({ this.alertController.create({
cssClass: 'my-custom-class', cssClass: 'my-custom-class',
@@ -65,22 +57,14 @@ export class InactivityGuard implements CanActivate {
else { else {
if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){ if(this.p.userPermission(this.p.permissionList.Agenda.access) || this.p.userPermission(this.p.permissionList.Gabinete.access)){
//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']); 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']); this.router.navigate(['/home/chat']);
} }
else if(this.p.userPermission(this.p.permissionList.Actions.access)){ else if(this.p.userPermission(this.p.permissionList.Actions.access)){
this.router.navigate(['/home/publications']); this.router.navigate(['/home/publications']);
} } else {
else {
this.alertController.create({ this.alertController.create({
cssClass: 'my-custom-class', cssClass: 'my-custom-class',
header: 'Utilizador sem acesso a aplicação', header: 'Utilizador sem acesso a aplicação',
@@ -176,7 +176,6 @@ export class NewEventPage implements OnInit {
} }
window.onresize = (event) => { window.onresize = (event) => {
// if not mobile remove all component
if( window.innerWidth >= 1024){ if( window.innerWidth >= 1024){
this.modalController.dismiss(); this.modalController.dismiss();
} }
@@ -569,9 +569,6 @@ export class DespachoPrPage implements OnInit {
modal.onDidDismiss().then(res => { modal.onDidDismiss().then(res => {
if (res['data'] == 'close') { if (res['data'] == 'close') {
this.close(); this.close();
/*
this.close();
this.openMenu(); */
} }
}); });
} }
@@ -62,7 +62,7 @@
<h5>Documentos Anexados</h5> <h5>Documentos Anexados</h5>
<ion-item class="ion-no-margin ion-no-padding cursor-pointer" *ngFor="let Document of fulltask.Documents"> <ion-item class="ion-no-margin ion-no-padding cursor-pointer" *ngFor="let Document of fulltask.Documents">
<ion-label class="d-block" (click)="viewDocument(Document.DocId, Document)"> <ion-label class="d-block" (click)="viewDocument(Document.DocId, Document)">
<p class="attach-title-item">{{ Document.Assunto }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p> <p class="attach-title-item">{{ Document.Assunto || "Sem assunto" }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
<p><span class="span-left">{{ Document.Sender}}</span><span class="span-right">{{ Document.DocDate | date: 'dd/MM/yyyy HH:mm' }}</span></p> <p><span class="span-left">{{ Document.Sender}}</span><span class="span-right">{{ Document.DocDate | date: 'dd/MM/yyyy HH:mm' }}</span></p>
</ion-label> </ion-label>
</ion-item> </ion-item>
@@ -305,10 +305,10 @@ export class DespachoPage implements OnInit {
try { try {
await this.despachoService.executado(note, documents, this.serialnumber).toPromise(); await this.despachoService.executado(note, documents, this.serialnumber).toPromise();
this.toastService.successMessage('Processo criado') this.toastService._successMessage('Processo criado')
this.close(); this.close();
} catch (error) { } catch (error) {
this.toastService.badRequest("Processo não criado") this.toastService._badRequest("Processo não criado")
} }
finally { finally {
loader.remove() loader.remove()
@@ -347,11 +347,11 @@ export class DespachoPage implements OnInit {
try { try {
await this.processes.CompleteTask(body).toPromise() await this.processes.CompleteTask(body).toPromise()
this.toastService.successMessage() this.toastService._successMessage()
this.close(); this.close();
} catch (error) { } catch (error) {
this.toastService.badRequest() this.toastService._badRequest()
} }
finally { finally {
loader.remove() loader.remove()
@@ -59,7 +59,7 @@
<h5>Documentos Anexados</h5> <h5>Documentos Anexados</h5>
<ion-item class="ion-no-margin ion-no-padding cursor-pointer" *ngFor="let Document of fulltask.Documents"> <ion-item class="ion-no-margin ion-no-padding cursor-pointer" *ngFor="let Document of fulltask.Documents">
<ion-label class="d-block" (click)="viewDocument(Document.DocId, Document)"> <ion-label class="d-block" (click)="viewDocument(Document.DocId, Document)">
<p class="attach-title-item">{{ Document.Assunto }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p> <p class="attach-title-item">{{ Document.Assunto || "Sem assunto" }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
<p><span class="span-left">{{ Document.Sender}}</span><span class="span-right">{{ Document.DocDate | date: 'dd/MM/yyyy HH:mm' }}</span></p> <p><span class="span-left">{{ Document.Sender}}</span><span class="span-right">{{ Document.DocDate | date: 'dd/MM/yyyy HH:mm' }}</span></p>
</ion-label> </ion-label>
</ion-item> </ion-item>
@@ -166,6 +166,8 @@
</ion-item> </ion-item>
</div> </div>
<div>
</div>
</ion-content> </ion-content>
@@ -320,42 +320,7 @@ export class ExpedienteDetailPage implements OnInit {
goBack() { goBack() {
this.RouteService.goBack(); this.RouteService.goBack();
/* if(this.task.Status == "Pending" && this.caller != 'events'){
if (window.innerWidth <= 800) {
this.router.navigate(['/home/gabinete-digital/pendentes']);
}
else {
let navigationExtras: NavigationExtras = {
queryParams: {
"pendentes": true,
}
}
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
}
else{
this.activatedRoute.paramMap.subscribe(params => {
switch (params["params"].caller) {
case 'events':
this.router.navigate(['/home',params["params"].caller]);
break;
case 'gabinete-digital':
let navigationExtras: NavigationExtras = {
queryParams: {
"expedientes": true,
}
}
if( window.innerWidth < 801) {
this.router.navigate(['/home/gabinete-digital/expediente']);
} else {
this.router.navigate(['/home/gabinete-digital'], navigationExtras);
}
break;
}
});
} */
} }
sendExpedienteToPending() { sendExpedienteToPending() {
@@ -383,7 +348,7 @@ export class ExpedienteDetailPage implements OnInit {
"Remetente": res.workflowInstanceDataFields.Sender, "Remetente": res.workflowInstanceDataFields.Sender,
"Note": res.workflowInstanceDataFields.TaskMessage || res.workflowInstanceDataFields.Note, "Note": res.workflowInstanceDataFields.TaskMessage || res.workflowInstanceDataFields.Note,
"FolderId": res.workflowInstanceDataFields.FolderID, "FolderId": res.workflowInstanceDataFields.FolderID,
"FsId": res.workflowInstanceDataFields.FsId, "FsId": res.workflowInstanceDataFields.FsId || res.workflowInstanceDataFields.ApplicationID,
"DocId": res.workflowInstanceDataFields.DocID, "DocId": res.workflowInstanceDataFields.DocID,
"WorkflowName": res.workflowDisplayName, "WorkflowName": res.workflowDisplayName,
"Status": res.workflowInstanceDataFields.Status, "Status": res.workflowInstanceDataFields.Status,
@@ -68,7 +68,7 @@
<h5>Documentos Anexados</h5> <h5>Documentos Anexados</h5>
<ion-item class="ion-no-margin ion-no-padding cursor-pointer" *ngFor="let Document of fulltask.Documents"> <ion-item class="ion-no-margin ion-no-padding cursor-pointer" *ngFor="let Document of fulltask.Documents">
<ion-label class="d-block" (click)="viewDocument(Document.DocId, Document)"> <ion-label class="d-block" (click)="viewDocument(Document.DocId, Document)">
<p class="attach-title-item">{{ Document.Assunto }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p> <p class="attach-title-item">{{ Document.Assunto || "Sem assunto" }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
<p><span class="span-left">{{ Document.Sender}}</span><span class="span-right">{{ Document.DocDate | date: 'dd/MM/yyyy HH:mm' }}</span></p> <p><span class="span-left">{{ Document.Sender}}</span><span class="span-right">{{ Document.DocDate | date: 'dd/MM/yyyy HH:mm' }}</span></p>
</ion-label> </ion-label>
</ion-item> </ion-item>
@@ -36,7 +36,7 @@
<!-- This is the list view --> <!-- This is the list view -->
<div *ngSwitchCase="'listview'"> <div *ngSwitchCase="'listview'">
<ion-item-sliding *ngIf="AllProcess"> <ion-item-sliding *ngIf="loadCount">
<div class="listview" > <div class="listview" >
<ion-list *ngIf="AllProcess"> <ion-list *ngIf="AllProcess">
@@ -97,7 +97,7 @@
</ion-item-sliding> </ion-item-sliding>
<ion-item-sliding *ngIf="!AllProcess" class="width-100"> <ion-item-sliding *ngIf="!loadCount" class="width-100">
<ion-item lines="none" <ion-item lines="none"
class="item-skeleton width-100 d-flex ion-no-border ion-no-margin ion-no-padding"> class="item-skeleton width-100 d-flex ion-no-border ion-no-margin ion-no-padding">
@@ -383,8 +383,6 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
goToProcess(serialNumber: string, workflowName: string, activityName: string) { goToProcess(serialNumber: string, workflowName: string, activityName: string) {
alert('nice!!!')
if (workflowName == 'Despacho') { if (workflowName == 'Despacho') {
if (activityName == 'Tarefa de Despacho' || activityName == 'Concluir Despacho') { if (activityName == 'Tarefa de Despacho' || activityName == 'Concluir Despacho') {
this.router.navigate(['/home/gabinete-digital/despachos', serialNumber, 'gabinete-digital']); this.router.navigate(['/home/gabinete-digital/despachos', serialNumber, 'gabinete-digital']);
+1 -1
View File
@@ -717,7 +717,7 @@ export class SearchPage implements OnInit {
if(ApplicationType == '8' || ApplicationType == '361') { if(ApplicationType == '8' || ApplicationType == '361') {
alert('view!!') // alert('view!!')
this.viewDocumentDetail(Id, ApplicationType); this.viewDocumentDetail(Id, ApplicationType);
} }
} }
@@ -152,7 +152,11 @@ export class NewEventPage implements OnInit {
ngOnInit() { ngOnInit() {
if(!this.CalendarName) {
this.CalendarName = this.loggeduser.Profile; this.CalendarName = this.loggeduser.Profile;
}
this.getRecurrenceTypes(); this.getRecurrenceTypes();
if(!this.restoreTemporaryData()){ if(!this.restoreTemporaryData()){
@@ -475,7 +479,7 @@ export class NewEventPage implements OnInit {
if(DocumentToSave.length == 0){ if(DocumentToSave.length == 0){
this.afterSave(); this.afterSave();
} }
this.toastService.successMessage('Evento criado') this.toastService._successMessage('Evento criado')
}); });
} else { } else {
@@ -513,7 +517,7 @@ export class NewEventPage implements OnInit {
if(DocumentToSave.length == 0){ if(DocumentToSave.length == 0){
this.afterSave(); this.afterSave();
} }
this.toastService.successMessage('Evento criado') this.toastService._successMessage('Evento criado')
}); });
} }
@@ -574,7 +578,8 @@ export class NewEventPage implements OnInit {
window['temp.path:/home/agenda/new-event.component.ts'] = { window['temp.path:/home/agenda/new-event.component.ts'] = {
postEvent: this.postEvent, postEvent: this.postEvent,
eventBody: this.eventBody, eventBody: this.eventBody,
segment: this.segment segment: this.segment,
CalendarName: this.CalendarName
} }
} }
@@ -591,6 +596,7 @@ export class NewEventPage implements OnInit {
this.postEvent = restoredData.postEvent this.postEvent = restoredData.postEvent
this.eventBody = restoredData.eventBody this.eventBody = restoredData.eventBody
this.segment = restoredData.segment this.segment = restoredData.segment
this.CalendarName = restoredData.CalendarName
// restore dater for date and hours picker // restore dater for date and hours picker
@@ -58,7 +58,7 @@
<h5>Documentos Anexados</h5> <h5>Documentos Anexados</h5>
<ion-item class="ion-no-margin ion-no-padding cursor-pointer" *ngFor="let Document of fulltask.Documents"> <ion-item class="ion-no-margin ion-no-padding cursor-pointer" *ngFor="let Document of fulltask.Documents">
<ion-label class="d-block" (click)="viewDocument.emit(Document.DocId)"> <ion-label class="d-block" (click)="viewDocument.emit(Document.DocId)">
<p class="attach-title-item">{{ Document.Assunto }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p> <p class="attach-title-item">{{ Document.Assunto || "Sem assunto" }}<span class="span-right color-red btn-size"><ion-icon hidden name="close"></ion-icon></span></p>
<p><span class="span-left">{{ Document.Sender}}</span><span class="span-right">{{ Document.DocDate | date: 'dd/MM/yyyy HH:mm' }}</span></p> <p><span class="span-left">{{ Document.Sender}}</span><span class="span-right">{{ Document.DocDate | date: 'dd/MM/yyyy HH:mm' }}</span></p>
</ion-label> </ion-label>
</ion-item> </ion-item>