diff --git a/src/app/pages/agenda/agenda.page.ts b/src/app/pages/agenda/agenda.page.ts index df841023f..a768b9296 100644 --- a/src/app/pages/agenda/agenda.page.ts +++ b/src/app/pages/agenda/agenda.page.ts @@ -138,6 +138,17 @@ export class AgendaPage implements OnInit { },5000) // console.log(setHours(setMinutes(new Date(), 0), 12)) + + function setCookie(cname, cvalue, exdays) { + var d = new Date(); + d.setTime(d.getTime() + (exdays*24*60*60*1000)); + var expires = "expires="+ d.toUTCString(); + document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; + } + + // AccoesPresidenciais = Correspondencia = 0 + setCookie('searchModalAPPType','0', 99999999); + } ngOnInit() { diff --git a/src/app/pages/gabinete-digital/gabinete-digital.page.ts b/src/app/pages/gabinete-digital/gabinete-digital.page.ts index 1356aa8c8..c2d17e3e9 100644 --- a/src/app/pages/gabinete-digital/gabinete-digital.page.ts +++ b/src/app/pages/gabinete-digital/gabinete-digital.page.ts @@ -19,7 +19,17 @@ export class GabineteDigitalPage implements OnInit { private processesbackend:ProcessesService, private modalController: ModalController, private eventService: EventsService, - private alertService: AlertService) { } + private alertService: AlertService) { + function setCookie(cname, cvalue, exdays) { + var d = new Date(); + d.setTime(d.getTime() + (exdays*24*60*60*1000)); + var expires = "expires="+ d.toUTCString(); + document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; + } + + // AccoesPresidenciais = Correspondencia = 8 + setCookie('searchModalAPPType','8,361', 99999999); + } count_exp_dailywork=0; count_exp_pp : string; diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index dbde526c8..827961e65 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -39,9 +39,19 @@ export class PublicationsPage implements OnInit { private animationController: AnimationController, private loading: LoadingService, private publications: PublicationsService, - ) { + ) { this.months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"]; this.days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"]; + + function setCookie(cname, cvalue, exdays) { + var d = new Date(); + d.setTime(d.getTime() + (exdays*24*60*60*1000)); + var expires = "expires="+ d.toUTCString(); + document.cookie = cname + "=" + cvalue + ";" + expires + ";path=/"; + } + + // AccoesPresidenciais = AccoesPresidenciais = 386,, + setCookie('searchModalAPPType','386', 99999999); } ngOnInit() { diff --git a/src/app/pages/search/search.page.ts b/src/app/pages/search/search.page.ts index c5deed915..23cf8da80 100644 --- a/src/app/pages/search/search.page.ts +++ b/src/app/pages/search/search.page.ts @@ -88,6 +88,106 @@ export class SearchPage implements OnInit { */ basicSearch(){ + function getCookie(cname) { + var name = cname + "="; + var decodedCookie = decodeURIComponent(document.cookie); + var ca = decodedCookie.split(';'); + for(var i = 0; i { + console.log(res); + + res.Categories.forEach( e => { + e['Active'] = false; + }); + + // bind respose + this.searchCategories = res.Categories; + + this.searchDocuments = this.sortArrayISODate(res.Documents); + + this.reorderList(this.ordinance); + + // hide show document + if(this.searchDocuments.length >= 1){ + this.showDocuments = true; + } else { + this.showDocuments = false + } + + }); + } else if (APPType == '8,361'){ + + console.log('aplication type 8,361'); + + this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender + ,this.searchOrganicEntiry, this.searchDocTypeId, '8').subscribe(res=>{ + console.log(res); + + res.Categories.forEach( e => { + e['Active'] = false; + }); + + // bind respose + this.searchCategories = res.Categories; + + this.searchDocuments = this.sortArrayISODate(res.Documents); + + this.reorderList(this.ordinance); + + // hide show document + if(this.searchDocuments.length >= 1){ + this.showDocuments = true; + } else { + this.showDocuments = false + } + + }); + + this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender + ,this.searchOrganicEntiry, this.searchDocTypeId, '361').subscribe(res=>{ + console.log(res); + + res.Categories.forEach( e => { + e['Active'] = false; + }); + + // bind respose + this.searchCategories = res.Categories; + + this.searchDocuments = this.sortArrayISODate(res.Documents); + + this.reorderList(this.ordinance); + + // hide show document + if(this.searchDocuments.length >= 1){ + this.showDocuments = true; + } else { + this.showDocuments = false + } + + }); + } else if (APPType == '386'){ + + console.log('aplication type 386'); + this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender ,this.searchOrganicEntiry, this.searchDocTypeId, '386').subscribe(res=>{ console.log(res); @@ -111,6 +211,9 @@ export class SearchPage implements OnInit { } }); + } + + } /**