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:
+1
-1
@@ -135,7 +135,7 @@
|
||||
</mfp:windows10>
|
||||
<mfp:appChecksum>0</mfp:appChecksum>
|
||||
</mfp:windows>
|
||||
<mfp:platformVersion>8.0.0.00-20210308-063916</mfp:platformVersion>
|
||||
<mfp:platformVersion>8.0.0.00-20210214-154410</mfp:platformVersion>
|
||||
<mfp:clientCustomInit enabled="false" />
|
||||
<mfp:server runtime="mfp" url="http://gpr-dev-10.gabinetedigital.local:9080" />
|
||||
<mfp:serverUri url="" />
|
||||
|
||||
+14
-11
@@ -75,10 +75,11 @@ export class HomePage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.count();
|
||||
|
||||
//Add a test
|
||||
//this.pushCordova();
|
||||
//Initialize profile as mdgpr
|
||||
}
|
||||
|
||||
async count(){
|
||||
|
||||
let date = new Date();
|
||||
date.setMonth(date.getMonth() + 1);
|
||||
@@ -87,16 +88,18 @@ export class HomePage implements OnInit {
|
||||
|
||||
this.profile = "mdgpr";
|
||||
if (this.profile == "mdgpr") {
|
||||
this.eventService.getAllMdEvents(start, end).subscribe(res => {
|
||||
this.eventsList = res;
|
||||
this.totalEvent = this.eventsList.length;
|
||||
});
|
||||
|
||||
let mdOficialEvents = await this.eventService.getAllPrOficialEvents(start, end).toPromise();
|
||||
let mdPessoalEvents = await this.eventService.getAllPrPessoalEvents(start, end).toPromise();
|
||||
this.eventsList = mdOficialEvents.concat(mdPessoalEvents)
|
||||
this.totalEvent = this.eventsList.length;
|
||||
|
||||
}
|
||||
else {
|
||||
this.eventService.getAllPrEvents(start, end).subscribe(res => {
|
||||
this.eventsList = res;
|
||||
this.totalEvent = this.eventsList.length;
|
||||
});
|
||||
let prOficialEvents = await this.eventService.getAllPrOficialEvents(start, end).toPromise();
|
||||
let prPessoalEvents = await this.eventService.getAllPrPessoalEvents(start, end).toPromise();
|
||||
this.eventsList = prOficialEvents.concat(prPessoalEvents)
|
||||
this.totalEvent = this.eventsList.length;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -14,15 +14,19 @@ export class User {
|
||||
FullName: string
|
||||
OwnerCalendars: {
|
||||
CalendarId: string
|
||||
CalendarName: "Oficial" | "Pessoal"
|
||||
Id: 1
|
||||
CalendarName: "Oficial" | "Pessoal";
|
||||
CalendarRoleId: string;
|
||||
Id: number;
|
||||
}[]
|
||||
RoleDescription: string
|
||||
RoleID: number
|
||||
SharedCalendars: {
|
||||
CalendarId: string
|
||||
CalendarName: "Oficial" | "Pessoal"
|
||||
Id: 1
|
||||
CalendarName: "Oficial" | "Pessoal";
|
||||
CalendarRoleId: string;
|
||||
Id: number;
|
||||
OwnerUserId: string;
|
||||
TypeShare: number;
|
||||
}[]
|
||||
UserName: string
|
||||
Profile: any;
|
||||
|
||||
@@ -515,7 +515,7 @@ export class AgendaPage implements OnInit {
|
||||
return ((new Date(this.timelineDate)).getDate()).toString().padStart(2,'0')
|
||||
}
|
||||
|
||||
loadRangeEvents(startTime: Date, endTime: Date){
|
||||
async loadRangeEvents(startTime: Date, endTime: Date){
|
||||
|
||||
this.eventSelectedDate = new Date(startTime);
|
||||
|
||||
@@ -531,13 +531,14 @@ export class AgendaPage implements OnInit {
|
||||
//this.eventSource=[];
|
||||
|
||||
if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR' ) {
|
||||
this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).subscribe(
|
||||
response => {
|
||||
|
||||
let mdOficialEvents = await this.eventService.getAllPrOficialEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).toPromise();
|
||||
let mdPessoalEvents = await this.eventService.getAllPrPessoalEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).toPromise();
|
||||
|
||||
// calendar
|
||||
this.eventSource=[];
|
||||
|
||||
this.eventsList = response;
|
||||
this.eventsList = mdOficialEvents.concat(mdPessoalEvents);
|
||||
// loop
|
||||
this.eventsList.forEach((element, eventIndex) => {
|
||||
|
||||
@@ -572,17 +573,17 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.timelineBoxCorrectHeight(500);
|
||||
this.centralizeTimeline(500);
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
else {
|
||||
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(
|
||||
response => {
|
||||
let prOficialEvents= await this.eventService.getAllPrOficialEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).toPromise();
|
||||
let prPessoalEvents= await this.eventService.getAllPrPessoalEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).toPromise();
|
||||
|
||||
// calendar
|
||||
this.eventSource=[];
|
||||
|
||||
this.eventsList = response;
|
||||
this.eventsList = prOficialEvents.concat(prPessoalEvents);
|
||||
|
||||
// calendar
|
||||
this.eventsList.forEach((element, eventIndex) => {
|
||||
@@ -616,8 +617,6 @@ export class AgendaPage implements OnInit {
|
||||
this.timelineBoxCorrectHeight(500);
|
||||
this.centralizeTimeline(500);
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -625,7 +624,7 @@ export class AgendaPage implements OnInit {
|
||||
//Inicializa o array eventSource
|
||||
|
||||
if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') {
|
||||
this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(response => {
|
||||
this.eventService.getAllMdPessoalEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(response => {
|
||||
|
||||
this.eventSource=[];
|
||||
this.eventsListPessoal= [];
|
||||
@@ -666,10 +665,11 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
}
|
||||
else{
|
||||
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(response => {
|
||||
let prPessoalEvents= await this.eventService.getAllPrPessoalEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).toPromise();
|
||||
|
||||
this.eventSource=[];
|
||||
|
||||
this.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal");
|
||||
this.eventsListPessoal = prPessoalEvents.filter(data => data.CalendarName == "Pessoal");
|
||||
this.eventsListPessoal.forEach(element => {
|
||||
this.eventSource.push({
|
||||
title: element.Subject,
|
||||
@@ -699,7 +699,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.timelineBoxCorrectHeight(500);
|
||||
this.centralizeTimeline(500);
|
||||
});
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -709,7 +709,7 @@ export class AgendaPage implements OnInit {
|
||||
this.eventsListOficial = [];
|
||||
|
||||
if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') {
|
||||
this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(res => {
|
||||
this.eventService.getAllMdOficialEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(res => {
|
||||
this.eventSource=[];
|
||||
this.eventsListOficial = res.filter(data => data.CalendarName == "Oficial");
|
||||
|
||||
@@ -743,9 +743,9 @@ export class AgendaPage implements OnInit {
|
||||
this.centralizeTimeline(500);
|
||||
});
|
||||
} else {
|
||||
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(res => {
|
||||
let prOficialEvents= await this.eventService.getAllPrOficialEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).toPromise();
|
||||
this.eventSource=[];
|
||||
this.eventsListOficial = res.filter(data => data.CalendarName == "Oficial");
|
||||
this.eventsListOficial = prOficialEvents.filter(data => data.CalendarName == "Oficial");
|
||||
this.eventsListOficial.forEach(element => {
|
||||
this.eventSource.push({
|
||||
title: element.Subject,
|
||||
@@ -775,7 +775,6 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.timelineBoxCorrectHeight(500);
|
||||
this.centralizeTimeline(500);
|
||||
});
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -789,15 +788,16 @@ export class AgendaPage implements OnInit {
|
||||
let counter = 0;
|
||||
|
||||
if(this.loggeduser.Profile == 'MDGPR') {
|
||||
this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).subscribe(
|
||||
response => {
|
||||
|
||||
let mdOficialEvents = await this.eventService.getAllPrOficialEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).toPromise();
|
||||
let mdPessoalEvents = await this.eventService.getAllPrPessoalEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).toPromise();
|
||||
|
||||
if(this.segment == 'Oficial') {
|
||||
this.eventsList = response.filter(data => data.CalendarName == "Oficial");
|
||||
this.eventsList = mdOficialEvents;
|
||||
} else if (this.segment == 'Pessoal') {
|
||||
this.eventsList = response.filter(data => data.CalendarName == "Pessoal");
|
||||
this.eventsList = mdPessoalEvents;
|
||||
} else {
|
||||
this.eventsList = response;
|
||||
this.eventsList = mdOficialEvents.concat(mdPessoalEvents);
|
||||
}
|
||||
|
||||
this.eventSource= this.eventSource.filter(e => e.profile != 'md');
|
||||
@@ -840,18 +840,18 @@ export class AgendaPage implements OnInit {
|
||||
this.centralizeTimeline(500);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).subscribe(
|
||||
response => {
|
||||
let prOficialEvents= await this.eventService.getAllPrOficialEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).toPromise();
|
||||
let prPessoalEvents= await this.eventService.getAllPrPessoalEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).toPromise();
|
||||
|
||||
if(this.segment == 'Oficial') {
|
||||
this.eventsList = response.filter(data => data.CalendarName == "Oficial");
|
||||
this.eventsList = prOficialEvents;
|
||||
} else if (this.segment == 'Pessoal') {
|
||||
this.eventsList = response.filter(data => data.CalendarName == "Pessoal");
|
||||
this.eventsList = prPessoalEvents;
|
||||
} else {
|
||||
this.eventsList = response;
|
||||
this.eventsList = prOficialEvents.concat(prPessoalEvents);
|
||||
}
|
||||
|
||||
this.eventSource = this.eventSource.filter(e => e.profile != 'pr');
|
||||
@@ -890,8 +890,6 @@ export class AgendaPage implements OnInit {
|
||||
this.timelineBoxCorrectHeight(500);
|
||||
this.centralizeTimeline(500);
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ export class EventsPage implements OnInit {
|
||||
this.RefreshEvents();
|
||||
}
|
||||
|
||||
RefreshEvents(){
|
||||
async RefreshEvents(){
|
||||
this.currentEvent = "";
|
||||
this.showLoader = true;
|
||||
|
||||
@@ -127,43 +127,49 @@ export class EventsPage implements OnInit {
|
||||
{
|
||||
case "Combinada":
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
this.eventService.getAllMdEvents(start, end).subscribe(res => {
|
||||
this.eventsList = res;
|
||||
|
||||
let mdOficialEvents = await this.eventService.getAllPrOficialEvents(start, end).toPromise();
|
||||
let mdPessoalEvents = await this.eventService.getAllPrPessoalEvents(start, end).toPromise();
|
||||
|
||||
this.eventsList = mdOficialEvents.concat(mdPessoalEvents);
|
||||
|
||||
if(res.length > 0){
|
||||
this.currentEvent = res[0].Subject;
|
||||
this.currentHoursMinutes = res[0].StartDate;
|
||||
if(this.eventsList.length > 0){
|
||||
this.currentEvent = this.eventsList[0].Subject;
|
||||
this.currentHoursMinutes = this.eventsList[0].StartDate;
|
||||
}
|
||||
|
||||
this.totalEvent = this.eventsList.length;
|
||||
this.showLoader = false;
|
||||
});
|
||||
}else{
|
||||
this.eventService.getAllPrEvents(start, end).subscribe(res => {
|
||||
this.eventsList = res;
|
||||
console.log(this.eventsList);
|
||||
console.log(res);
|
||||
console.log(res[0]);
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
if(res.length > 0){
|
||||
this.currentEvent = res[0].Subject;
|
||||
this.currentHoursMinutes = res[0].StartDate;
|
||||
}
|
||||
let prOficialEvents= await this.eventService.getAllPrOficialEvents(start, end).toPromise();
|
||||
let prPessoalEvents= await this.eventService.getAllPrPessoalEvents(start, end).toPromise();
|
||||
this.eventsList = prOficialEvents.concat(prPessoalEvents);
|
||||
console.log(this.eventsList);
|
||||
console.log(this.eventsList);
|
||||
|
||||
this.totalEvent = this.eventsList.length;
|
||||
this.showLoader = false;
|
||||
});
|
||||
if(this.eventsList.length > 0){
|
||||
this.currentEvent = this.eventsList[0].Subject;
|
||||
this.currentHoursMinutes = this.eventsList[0].StartDate;
|
||||
}
|
||||
|
||||
this.totalEvent = this.eventsList.length;
|
||||
this.showLoader = false;
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
case "Pessoal":
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
this.eventService.getAllMdEvents(start, end).subscribe(res => {
|
||||
this.eventService.getAllMdPessoalEvents(start, end).subscribe(res => {
|
||||
this.personaleventsList = res.filter(data => data.CalendarName == "Pessoal");
|
||||
this.showLoader = false;
|
||||
});
|
||||
}else{
|
||||
this.eventService.getAllPrEvents(start, end).subscribe(res => {
|
||||
}
|
||||
else{
|
||||
this.eventService.getAllPrPessoalEvents(start, end).subscribe(res => {
|
||||
this.personaleventsList = res.filter(data => data.CalendarName == "Pessoal");
|
||||
this.showLoader = false;
|
||||
});
|
||||
@@ -172,12 +178,13 @@ export class EventsPage implements OnInit {
|
||||
break;
|
||||
case "Oficial":
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
this.eventService.getAllMdEvents(start, end).subscribe(res => {
|
||||
this.eventService.getAllMdOficialEvents(start, end).subscribe(res => {
|
||||
this.officialeventsList = res.filter(data => data.CalendarName == "Oficial");;
|
||||
this.showLoader = false;
|
||||
});
|
||||
}else{
|
||||
this.eventService.getAllPrEvents(start, end).subscribe(res => {
|
||||
}
|
||||
else{
|
||||
this.eventService.getAllPrOficialEvents(start, end).subscribe(res => {
|
||||
this.officialeventsList = res.filter(data => data.CalendarName == "Oficial");;
|
||||
this.showLoader = false;
|
||||
});
|
||||
|
||||
+12
-78
@@ -218,14 +218,8 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
console.log(this.postData);
|
||||
|
||||
this.taskResult = await this.processes.postDespatcho(this.postData).toPromise();
|
||||
await this.toastService.successMessage('Processo efetuado', () =>{
|
||||
console.log('Hoje Teste T');
|
||||
this.modalController.dismiss(action_despacho);
|
||||
});
|
||||
/* setInterval(()=>{
|
||||
console.log('Hoje Teste T');
|
||||
this.modalController.dismiss(action_despacho);
|
||||
}, 7000); */
|
||||
await this.toastService.successMessage('Processo efetuado');
|
||||
this.modalController.dismiss();
|
||||
|
||||
} catch (error) {
|
||||
await this.toastService.badRequest('Processo não efetuado')
|
||||
@@ -253,11 +247,9 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
"Note": "",
|
||||
}
|
||||
}
|
||||
//this.taskResult = await this.processes.postParecer(this.postData).toPromise();
|
||||
this.taskResult = await this.processes.postParecer(this.postData).toPromise();
|
||||
await this.toastService.successMessage('Processo efetuado');
|
||||
setInterval(()=>{
|
||||
this.modalController.dismiss(action_parecer);
|
||||
}, 7000);
|
||||
this.modalController.dismiss(action_parecer);
|
||||
|
||||
} catch (error) {
|
||||
await this.toastService.badRequest('Processo não efetuado')
|
||||
@@ -284,9 +276,8 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
}
|
||||
}
|
||||
this.taskResult = await this.processes.postDeferimento(this.postData).toPromise();
|
||||
await this.toastService.successMessage('Processo efetuado', () =>{
|
||||
this.modalController.dismiss(action_deferimento);
|
||||
});
|
||||
await this.toastService.successMessage('Processo efetuado');
|
||||
this.modalController.dismiss(action_deferimento);
|
||||
} catch (error) {
|
||||
await this.toastService.badRequest('Processo não efetuado')
|
||||
}
|
||||
@@ -309,7 +300,6 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
UsersSelected: attendees,
|
||||
DispatchFolder: this.dispatchFolder,
|
||||
AttachmentList: docs,
|
||||
//SubjectTypes: [],
|
||||
}
|
||||
console.log(this.postData);
|
||||
try {
|
||||
@@ -323,9 +313,9 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
}
|
||||
this.taskResult = await this.processes.postDespatchoPr(this.postData).toPromise();
|
||||
|
||||
await this.toastService.successMessage('Processo efetuado', () =>{
|
||||
this.modalController.dismiss(action_despacho_pr);
|
||||
});
|
||||
await this.toastService.successMessage('Processo efetuado');
|
||||
this.modalController.dismiss(action_despacho_pr);
|
||||
|
||||
} catch (error) {
|
||||
await this.toastService.badRequest('Processo não efetuado')
|
||||
}
|
||||
@@ -354,9 +344,9 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
}
|
||||
this.taskResult = await this.processes.postParecerPr(this.postData).toPromise();
|
||||
|
||||
await this.toastService.badRequest('Processo efetuado', () =>{
|
||||
this.modalController.dismiss(action_parecer_pr);
|
||||
})
|
||||
await this.toastService.badRequest('Processo efetuado');
|
||||
this.modalController.dismiss(action_parecer_pr);
|
||||
|
||||
} catch (error) {
|
||||
await this.toastService.badRequest('Processo não efetuado')
|
||||
}
|
||||
@@ -406,17 +396,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
this.showAttendees = true
|
||||
}
|
||||
}
|
||||
|
||||
/* setIntervenient(data){
|
||||
this.taskParticipants = data;
|
||||
//this.postData.UsersSelected = data;
|
||||
}
|
||||
|
||||
setIntervenientCC(data){
|
||||
this.taskParticipantsCc = data;
|
||||
} */
|
||||
|
||||
|
||||
async setIntervenient(data) {
|
||||
this.taskParticipants = data;
|
||||
}
|
||||
@@ -530,50 +510,4 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
|
||||
async successMessage(message?: any, callback?) {
|
||||
|
||||
var notification = document.createElement('div')
|
||||
notification.id = 'notification'
|
||||
notification.innerHTML = `
|
||||
|
||||
<div class="main-content width-100 pa-20">
|
||||
<p class="message d-flex align-center">
|
||||
<ion-icon slot="end" class="title-icon pr-10" src="/assets/images/nofitication-success.svg"></ion-icon>
|
||||
<p class="text">{{ message }}</p>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
`
|
||||
|
||||
document.body.append(notification)
|
||||
notification.querySelector('.text').innerHTML = message
|
||||
setTimeout(()=>{
|
||||
notification.remove()
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
|
||||
var notification = document.createElement('div')
|
||||
notification.id = 'notification'
|
||||
notification.innerHTML = `
|
||||
<div class="main-content width-100 pa-20">
|
||||
<p class="message d-flex align-center">
|
||||
<ion-icon slot="end" class="title-icon pr-10" src="/assets/images/notification-error.svg"></ion-icon>
|
||||
<p class="text">{{ message }}</p>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
`
|
||||
|
||||
document.body.append(notification)
|
||||
notification.querySelector('.text').innerHTML = message
|
||||
setTimeout(()=>{
|
||||
notification.remove()
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+1
-1
@@ -147,7 +147,7 @@ export class ExpedienteDetailPage implements OnInit {
|
||||
"Note": res.workflowInstanceDataFields.Note,
|
||||
"FolderId": res.workflowInstanceDataFields.FolderID,
|
||||
"FsId": res.workflowInstanceDataFields.FsId,
|
||||
"DocId": res.workflowInstanceDataFields.DocId,
|
||||
"DocId": res.workflowInstanceDataFields.DocID,
|
||||
"WorkflowName": res.workflowDisplayName,
|
||||
}
|
||||
|
||||
|
||||
@@ -15,12 +15,59 @@ export class EventsService {
|
||||
authheader = {};
|
||||
loggeduser: User;
|
||||
headers: HttpHeaders;
|
||||
|
||||
headersOwnerOficial: HttpHeaders;
|
||||
headersOwnerPessoal: HttpHeaders;
|
||||
|
||||
headersSharedOficial: HttpHeaders;
|
||||
headersSharedPessoal: HttpHeaders;
|
||||
//lastloadedevent: Event;
|
||||
|
||||
constructor(private http: HttpClient, user: AuthService) {
|
||||
this.loggeduser = user.ValidatedUser;
|
||||
|
||||
this.headersOwnerOficial = new HttpHeaders();
|
||||
this.headersOwnerPessoal = new HttpHeaders();
|
||||
this.headersSharedOficial = new HttpHeaders();
|
||||
this.headersSharedPessoal = new HttpHeaders();
|
||||
|
||||
|
||||
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
this.headersOwnerOficial = this.headersOwnerOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersOwnerOficial = this.headersOwnerOficial.set('CalendarId', this.loggeduser.OwnerCalendars[0].CalendarId);
|
||||
this.headersOwnerOficial = this.headersOwnerOficial.set('CalendarRoleId', this.loggeduser.OwnerCalendars[0].CalendarRoleId);
|
||||
|
||||
this.headersOwnerPessoal = this.headersOwnerPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersOwnerPessoal = this.headersOwnerPessoal.set('CalendarId', this.loggeduser.OwnerCalendars[1].CalendarId);
|
||||
this.headersOwnerPessoal = this.headersOwnerPessoal.set('CalendarRoleId', this.loggeduser.OwnerCalendars[1].CalendarRoleId);
|
||||
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('CalendarId', this.loggeduser.SharedCalendars[0].CalendarId);
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('CalendarRoleId', this.loggeduser.SharedCalendars[0].CalendarRoleId);
|
||||
|
||||
this.headersSharedPessoal = this.headersSharedPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarId', this.loggeduser.SharedCalendars[1].CalendarId);
|
||||
this.headersSharedPessoal = this.headersSharedPessoal.set('CalendarRoleId', this.loggeduser.SharedCalendars[1].CalendarRoleId);
|
||||
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR'){
|
||||
this.headersOwnerOficial = this.headersOwnerOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersOwnerOficial = this.headersOwnerOficial.set('CalendarId', this.loggeduser.OwnerCalendars[0].CalendarId);
|
||||
this.headersOwnerOficial = this.headersOwnerOficial.set('CalendarRoleId', this.loggeduser.OwnerCalendars[0].CalendarRoleId);
|
||||
|
||||
this.headersOwnerPessoal = this.headersOwnerPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersOwnerPessoal = this.headersOwnerPessoal.set('CalendarId', this.loggeduser.OwnerCalendars[1].CalendarId);
|
||||
this.headersOwnerPessoal = this.headersOwnerPessoal.set('CalendarRoleId', this.loggeduser.OwnerCalendars[1].CalendarRoleId);
|
||||
}
|
||||
this.headers = new HttpHeaders();
|
||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
/* this.headers = this.headers.set('CalendarId', this.loggeduser.OwnerCalendars[0].CalendarId);
|
||||
this.headers = this.headers.set('CalendarRoleId', this.loggeduser.OwnerCalendars[0].CalendarRoleId); */
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
getAllEvents(startdate:string, enddate:string): Observable<Event[]>{
|
||||
@@ -36,7 +83,9 @@ export class EventsService {
|
||||
};
|
||||
return this.http.get<Event[]>(`${geturl}`, options);
|
||||
}
|
||||
getAllPrEvents(startdate:string, enddate:string): Observable<Event[]>{
|
||||
|
||||
|
||||
getAllPrOficialEvents(startdate:string, enddate:string): Observable<Event[]>{
|
||||
const geturl = environment.apiURL + 'calendar/pr';
|
||||
let params = new HttpParams();
|
||||
|
||||
@@ -44,12 +93,27 @@ export class EventsService {
|
||||
params = params.set("End", enddate);
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
headers: this.headersOwnerOficial,
|
||||
params: params
|
||||
};
|
||||
return this.http.get<Event[]>(`${geturl}`, options);
|
||||
}
|
||||
getAllMdEvents(startdate:string, enddate:string): Observable<Event[]>{
|
||||
|
||||
getAllPrPessoalEvents(startdate:string, enddate:string): Observable<Event[]>{
|
||||
const geturl = environment.apiURL + 'calendar/pr';
|
||||
let params = new HttpParams();
|
||||
|
||||
params = params.set("Start", startdate);
|
||||
params = params.set("End", enddate);
|
||||
|
||||
let options = {
|
||||
headers: this.headersOwnerPessoal,
|
||||
params: params
|
||||
};
|
||||
return this.http.get<Event[]>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
getAllMdOficialEvents(startdate:string, enddate:string): Observable<Event[]>{
|
||||
const geturl = environment.apiURL + 'calendar/md';
|
||||
let params = new HttpParams();
|
||||
|
||||
@@ -57,7 +121,51 @@ export class EventsService {
|
||||
params = params.set("End", enddate);
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
headers: this.headersOwnerOficial,
|
||||
params: params
|
||||
};
|
||||
return this.http.get<Event[]>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
getAllMdPessoalEvents(startdate:string, enddate:string): Observable<Event[]>{
|
||||
const geturl = environment.apiURL + 'calendar/md';
|
||||
let params = new HttpParams();
|
||||
|
||||
params = params.set("Start", startdate);
|
||||
params = params.set("End", enddate);
|
||||
|
||||
let options = {
|
||||
headers: this.headersOwnerPessoal,
|
||||
params: params
|
||||
};
|
||||
return this.http.get<Event[]>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
|
||||
|
||||
getAllSharedOficialEvents(startdate:string, enddate:string): Observable<Event[]>{
|
||||
const geturl = environment.apiURL + 'calendar/pr';
|
||||
let params = new HttpParams();
|
||||
|
||||
params = params.set("Start", startdate);
|
||||
params = params.set("End", enddate);
|
||||
|
||||
let options = {
|
||||
headers: this.headersSharedOficial,
|
||||
params: params
|
||||
};
|
||||
return this.http.get<Event[]>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
getAllSharedPessoalEvents(startdate:string, enddate:string): Observable<Event[]>{
|
||||
const geturl = environment.apiURL + 'calendar/pr';
|
||||
let params = new HttpParams();
|
||||
|
||||
params = params.set("Start", startdate);
|
||||
params = params.set("End", enddate);
|
||||
|
||||
let options = {
|
||||
headers: this.headersSharedPessoal,
|
||||
params: params
|
||||
};
|
||||
return this.http.get<Event[]>(`${geturl}`, options);
|
||||
|
||||
@@ -24,94 +24,47 @@ export class ToastService {
|
||||
|
||||
async successMessage(message?: any, callback?) {
|
||||
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
var notification = document.createElement('div')
|
||||
notification.id = 'notification'
|
||||
notification.innerHTML = `
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
<div class="main-content width-100 pa-20">
|
||||
<p class="message d-flex align-center">
|
||||
<ion-icon slot="end" class="title-icon pr-10" src="/assets/images/nofitication-success.svg"></ion-icon>
|
||||
<p class="text">{{ message }}</p>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
`
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: SuccessMessagePage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
document.body.append(notification)
|
||||
notification.querySelector('.text').innerHTML = message
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
notification.remove()
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
async badRequest(message?: string, callback?) {
|
||||
const enterAnimation = (baseEl: any) => {
|
||||
const backdropAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('ion-backdrop')!)
|
||||
.fromTo('opacity', '0.01', 'var(--backdrop-opacity)');
|
||||
|
||||
const wrapperAnimation = this.animationController.create()
|
||||
.addElement(baseEl.querySelector('.modal-wrapper')!)
|
||||
.keyframes([
|
||||
{ offset: 0, opacity: '1', right: '-100%' },
|
||||
{ offset: 1, opacity: '1', right: '0px' }
|
||||
]);
|
||||
var notification = document.createElement('div')
|
||||
notification.id = 'notification'
|
||||
notification.innerHTML = `
|
||||
<div class="main-content width-100 pa-20">
|
||||
<p class="message d-flex align-center">
|
||||
<ion-icon slot="end" class="title-icon pr-10" src="/assets/images/notification-error.svg"></ion-icon>
|
||||
<p class="text">{{ message }}</p>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
`
|
||||
|
||||
return this.animationController.create()
|
||||
.addElement(baseEl)
|
||||
.easing('ease-out')
|
||||
.duration(500)
|
||||
.addAnimation([backdropAnimation, wrapperAnimation]);
|
||||
}
|
||||
|
||||
const leaveAnimation = (baseEl: any) => {
|
||||
return enterAnimation(baseEl).direction('reverse');
|
||||
}
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
enterAnimation,
|
||||
leaveAnimation,
|
||||
component: BadRequestPage,
|
||||
componentProps: {
|
||||
message: message || 'Processo efetuado' ,
|
||||
},
|
||||
cssClass: 'notification-modal'
|
||||
});
|
||||
|
||||
modal.present()
|
||||
|
||||
document.body.append(notification)
|
||||
notification.querySelector('.text').innerHTML = message
|
||||
setTimeout(()=>{
|
||||
if (callback) {
|
||||
callback()
|
||||
}
|
||||
modal.dismiss()
|
||||
notification.remove()
|
||||
},7000)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user