+
{{document.SourceName}}
-
+
- {{document.Stakeholders}}
+
Correspondência
Acções Presidenciais
Arquivo Despacho Electrónico
- {{document.CreateDate | date: 'dd-MM-yy'}}
+
+
diff --git a/src/app/pages/agenda/edit-event/edit-event.page.ts b/src/app/pages/agenda/edit-event/edit-event.page.ts
index 88a575bd2..51d6b5de5 100644
--- a/src/app/pages/agenda/edit-event/edit-event.page.ts
+++ b/src/app/pages/agenda/edit-event/edit-event.page.ts
@@ -40,7 +40,7 @@ export class EditEventPage implements OnInit {
selectedRecurringType: any;
- loadedEventAttachments: Attachment[];
+ loadedEventAttachments: Attachment[] = [];
taskParticipants: any = [];
taskParticipantsCc: any = [];
adding: "intervenient" | "CC" = "intervenient";
@@ -212,6 +212,40 @@ export class EditEventPage implements OnInit {
this.toastService.badRequest()
}
+ this.saveDocument()
+ }
+
+
+ saveDocument() {
+
+ this.loadedEventAttachments.forEach((e)=>{
+
+ const id: any = e.Id
+ const remove = e['remove']
+
+ if ( id == 'add') {
+ //data.selected
+ const DocumentToSave = {
+ SourceTitle: e.SourceName,
+ ParentId: this.postEvent.EventId,
+ Source: '1',
+ SourceId: e.SourceId,
+ ApplicationId: e.ApplicationId.toString(),
+ Id: '0',
+ Link: '',
+ SerialNumber: '',
+ };
+
+ this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe(()=>{
+ this.getAttachments(this.postEvent.EventId);
+ });
+
+ } else if(remove) {
+ this.attachmentsService.deleteEventAttachmentById(e.Id).subscribe( res=> {})
+ }
+
+ })
+
}
async openAttendees() {
@@ -281,12 +315,17 @@ export class EditEventPage implements OnInit {
});
}
- deleteAttachment(attachmentID: string) {
+ deleteAttachment(attachmentID: string, index) {
- this.attachmentsService.deleteEventAttachmentById(attachmentID).subscribe(
- res=>{
- this.loadedEventAttachments = this.loadedEventAttachments.filter(e=> e.Id.toString() != attachmentID);
- })
+ const id: any = this.loadedEventAttachments[index].Id
+
+ if(id == 'add') {
+ this.loadedEventAttachments = this.loadedEventAttachments.filter((e,i)=> i!=index)
+ } else {
+ this.loadedEventAttachments[index]['remove'] = true
+ }
+
+
}
async getDoc() {
@@ -300,27 +339,30 @@ export class EditEventPage implements OnInit {
}
});
await modal.present();
- modal.onDidDismiss().then( async (res)=>{
- if(res){
+ modal.onDidDismiss().then( async (res)=> {
+ if(res) {
const data = res.data;
- //data.selected
- const DocumentToSave = {
- SourceTitle: data.selected.Assunto,
+
+ const ApplicationIdDocumentToSave: any = {
+ SourceName: data.selected.Assunto,
ParentId: this.postEvent.EventId,
- Source: '1',
SourceId: data.selected.Id,
+ Stakeholders: false,
ApplicationId: data.selected.ApplicationType.toString(),
- Id: '0',
+ CreateDate: false,
+ // needed to attach this document
+ Id: 'add',
+ SourceTitle: data.selected.Assunto,
+ Source: '1',
Link: '',
SerialNumber: '',
- };
+ }
- await this.attachmentsService.setEventAttachmentById(DocumentToSave).subscribe(()=>{
- this.getAttachments(this.postEvent.EventId);
- });
+ console.log( this.loadedEventAttachments)
+ this.loadedEventAttachments.push(ApplicationIdDocumentToSave)
}
- });
+ })
}
}
\ No newline at end of file
diff --git a/src/app/pages/events/edit-event/edit-event.page.ts b/src/app/pages/events/edit-event/edit-event.page.ts
index 22b43307b..b6c51d26a 100644
--- a/src/app/pages/events/edit-event/edit-event.page.ts
+++ b/src/app/pages/events/edit-event/edit-event.page.ts
@@ -14,14 +14,13 @@ import { FormGroup, FormBuilder, Validators } from "@angular/forms";
import { InAppBrowser } from '@ionic-native/in-app-browser/ngx';
import { AttachmentsPage } from '../attachments/attachments.page';
-
@Component({
selector: 'app-edit-event',
templateUrl: './edit-event.page.html',
styleUrls: ['./edit-event.page.scss'],
})
-export class EditEventPage implements OnInit {
+export class EditEventPage implements OnInit {
loadedEvent: Event;
loadedEventAttachments: Attachment[];
diff --git a/src/app/pages/events/events.page.ts b/src/app/pages/events/events.page.ts
index 2f9eca264..cb673824c 100644
--- a/src/app/pages/events/events.page.ts
+++ b/src/app/pages/events/events.page.ts
@@ -97,8 +97,10 @@ export class EventsPage implements OnInit {
this.showGreeting();
+ const pathname = window.location.pathname
+
this.router.events.forEach((event) => {
- if(event instanceof NavigationEnd && event.url == this.router.url) {
+ if(event instanceof NavigationEnd && event.url == pathname) {
this.RefreshEvents();
this.LoadList();
}
diff --git a/src/app/pages/gabinete-digital/despachos-pr/despachos-pr.page.ts b/src/app/pages/gabinete-digital/despachos-pr/despachos-pr.page.ts
index d74ecaaa5..9ab6445c5 100644
--- a/src/app/pages/gabinete-digital/despachos-pr/despachos-pr.page.ts
+++ b/src/app/pages/gabinete-digital/despachos-pr/despachos-pr.page.ts
@@ -64,8 +64,11 @@ export class DespachosPrPage implements OnInit {
ngOnInit() {
//Inicializar segment
this.segment = "despachos";
+
+ const pathname = window.location.pathname
+
this.router.events.forEach((event) => {
- if(event instanceof NavigationEnd && event.url == this.router.url) {
+ if(event instanceof NavigationEnd && event.url == pathname) {
this.LoadList();
}
});
diff --git a/src/app/pages/gabinete-digital/diplomas/diplomas.page.ts b/src/app/pages/gabinete-digital/diplomas/diplomas.page.ts
index 9d3208a45..d81479cbd 100644
--- a/src/app/pages/gabinete-digital/diplomas/diplomas.page.ts
+++ b/src/app/pages/gabinete-digital/diplomas/diplomas.page.ts
@@ -39,8 +39,11 @@ constructor(
}
ngOnInit() {
+
+ const pathname = window.location.pathname
+
this.router.events.forEach((event) => {
- if(event instanceof NavigationEnd && event.url == this.router.url) {
+ if(event instanceof NavigationEnd && event.url == pathname) {
this.refreshing();
}
});
diff --git a/src/app/pages/gabinete-digital/event-list/event-list.page.ts b/src/app/pages/gabinete-digital/event-list/event-list.page.ts
index 900815593..3a2bef146 100644
--- a/src/app/pages/gabinete-digital/event-list/event-list.page.ts
+++ b/src/app/pages/gabinete-digital/event-list/event-list.page.ts
@@ -36,8 +36,10 @@ export class EventListPage implements OnInit {
this.LoadToApproveEvents();
+ const pathname = window.location.pathname
+
this.router.events.forEach((event) => {
- if(event instanceof NavigationEnd && event.url == this.router.url) {
+ if(event instanceof NavigationEnd && event.url == pathname) {
this.LoadToApproveEvents();
}
});
diff --git a/src/app/pages/gabinete-digital/expediente/expediente.page.ts b/src/app/pages/gabinete-digital/expediente/expediente.page.ts
index 8379d6e98..7913c0bea 100644
--- a/src/app/pages/gabinete-digital/expediente/expediente.page.ts
+++ b/src/app/pages/gabinete-digital/expediente/expediente.page.ts
@@ -40,8 +40,11 @@ export class ExpedientePage implements OnInit {
ngOnInit() {
this.LoadList();
+
+ const pathname = window.location.pathname
+
this.router.events.forEach((event) => {
- if(event instanceof NavigationEnd && event.url == this.router.url) {
+ if(event instanceof NavigationEnd && event.url == pathname) {
this.LoadList();
}
});
diff --git a/src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts b/src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts
index 07975558d..d8995453f 100644
--- a/src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts
+++ b/src/app/pages/gabinete-digital/expedientes-pr/expedientes-pr.page.ts
@@ -40,8 +40,11 @@ export class ExpedientesPrPage implements OnInit {
}
ngOnInit() {
+
+ const pathname = window.location.pathname
+
this.router.events.forEach((event) => {
- if(event instanceof NavigationEnd && event.url == this.router.url) {
+ if(event instanceof NavigationEnd && event.url == pathname) {
this.refreshing();
}
});
diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.ts b/src/app/pages/gabinete-digital/gabinete-digital.page.ts
index 7a10e3e65..f9fe3ce78 100644
--- a/src/app/pages/gabinete-digital/gabinete-digital.page.ts
+++ b/src/app/pages/gabinete-digital/gabinete-digital.page.ts
@@ -98,7 +98,6 @@ export class GabineteDigitalPage implements OnInit {
}
};
this.checkRoutes();
- this.checkUser();
}
@@ -112,9 +111,15 @@ export class GabineteDigitalPage implements OnInit {
ngOnInit() {
- this.router.events.forEach((event) => {
- if(event instanceof NavigationEnd && event.url == this.router.url) {
+ const pathname = window.location.pathname
+
+ this.router.events.forEach((event) => {
+ if(event instanceof NavigationEnd && event.url == pathname) {
+ this.checkRoutes();
this.LoadCounts();
+ console.log('yes', pathname)
+ } else {
+ console.log('not')
}
});
@@ -189,7 +194,7 @@ export class GabineteDigitalPage implements OnInit {
this.selectedElement='DiplomasAssinar';
}
else{
- this.checkRoutes();
+ this.checkUser();
}
}
diff --git a/src/app/pages/gabinete-digital/pendentes/pendentes.page.ts b/src/app/pages/gabinete-digital/pendentes/pendentes.page.ts
index 3d9309608..363602e0e 100644
--- a/src/app/pages/gabinete-digital/pendentes/pendentes.page.ts
+++ b/src/app/pages/gabinete-digital/pendentes/pendentes.page.ts
@@ -38,8 +38,10 @@ export class PendentesPage implements OnInit {
ngOnInit() {
//Inicializar segment
this.segment = "despachos";
+
+ const pathname = window.location.pathname
this.router.events.forEach((event) => {
- if(event instanceof NavigationEnd && event.url == this.router.url) {
+ if(event instanceof NavigationEnd && event.url == pathname) {
this.refreshing();
}
});
diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts
index f73261083..b060456b9 100644
--- a/src/app/pages/publications/publications.page.ts
+++ b/src/app/pages/publications/publications.page.ts
@@ -67,8 +67,11 @@ export class PublicationsPage implements OnInit {
}
ngOnInit() {
+
+ const pathname = window.location.pathname
+
this.router.events.forEach((event) => {
- if(event instanceof NavigationEnd && event.url == this.router.url) {
+ if(event instanceof NavigationEnd && event.url == pathname) {
this.getActions();
}
});
diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts
index a3cda93c2..7e0e52038 100644
--- a/src/app/pages/search/search.page.ts
+++ b/src/app/pages/search/search.page.ts
@@ -463,15 +463,15 @@ export class SearchPage implements OnInit {
}
}
- clearInputRemetente() {
+ clearInputRemetente(){
this.searchSender = "";
}
- clearInputDocumentDate() {
+ clearInputDocumentDate(){
this.searchDocumentDate = "";
}
- clearInputOrganicEntity() {
+ clearInputOrganicEntity(){
this.searchOrganicEntiry = "";
}
@@ -531,10 +531,10 @@ export class SearchPage implements OnInit {
}
- async filterDocList(categoryName:string) {
+ async filterDocList(categoryName:string){
// show all category
- if(this. showCategory == categoryName ) {
+ if(this. showCategory == categoryName ){
this.showSearchDocuments = this.searchDocuments;
@@ -562,12 +562,12 @@ export class SearchPage implements OnInit {
const ApplicationType = searchDocument.ApplicationType.toString()
const Id = searchDocument.Id
- if(this.select == false) {
+ if(this.select == false){
if(this.type == "Agenda") {
const modal = await this.modalCtrl.create({
component: ViewEventPage,
- componentProps: {
+ componentProps:{
eventId: Id
},
cssClass: 'modal modal-desktop',
@@ -575,7 +575,7 @@ export class SearchPage implements OnInit {
await modal.present();
modal.onDidDismiss().then((res)=>{});
- } else if(this.type == "AccoesPresidenciais") {
+ } else if(this.type == "AccoesPresidenciais"){
this.viewPublicationDetail(Id);
}
@@ -585,8 +585,6 @@ export class SearchPage implements OnInit {
}
- } else {
- console.log('!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!', this.select)
}
}
diff --git a/src/app/shared/agenda/edit-event/edit-event.page.html b/src/app/shared/agenda/edit-event/edit-event.page.html
index 797c03bea..f60650c94 100644
--- a/src/app/shared/agenda/edit-event/edit-event.page.html
+++ b/src/app/shared/agenda/edit-event/edit-event.page.html
@@ -261,8 +261,8 @@
-