mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Merge branch 'consoleCle' of bitbucket.org:equilibriumito/gabinete-digital-fo into develop_bitOut-fix
This commit is contained in:
@@ -16,7 +16,8 @@ export class AgendaPermission{
|
||||
}
|
||||
}
|
||||
get access () {
|
||||
|
||||
return 530
|
||||
|
||||
if(this.hasOwnCalendar || this.hasSharedCalendar) {
|
||||
return 530
|
||||
} else {
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
<ion-item class="item-hover cursor-pointer" lines="none" *ngFor="let event of listToPresent"
|
||||
(click)="goToEvent(event)"
|
||||
>
|
||||
<div class="d-flex content-{{loggeduser.Profile}}-{{event.CalendarName}}">
|
||||
<div class="d-flex content-{{sessoStore.user.Profile}}-{{event.CalendarName}}">
|
||||
|
||||
<div class="schedule-time">
|
||||
<div *ngIf="!event.IsAllDayEvent" class="time-start">{{event.StartDate | date: 'HH:mm'}}</div>
|
||||
|
||||
@@ -63,6 +63,7 @@ export class EventsPage implements OnInit {
|
||||
@Output() openExpedientListPage: EventEmitter<any> = new EventEmitter<any>();
|
||||
|
||||
loggeduser: LoginUserRespose;
|
||||
sessoStore = SessionStore;
|
||||
|
||||
constructor(
|
||||
private eventService: EventsService,
|
||||
@@ -148,6 +149,7 @@ export class EventsPage implements OnInit {
|
||||
|
||||
|
||||
async RefreshEvents() {
|
||||
|
||||
this.currentEvent = "";
|
||||
this.showLoader = true;
|
||||
|
||||
@@ -155,60 +157,16 @@ export class EventsPage implements OnInit {
|
||||
let month = date.getMonth() + 1;
|
||||
let start = date.getFullYear() + "-" + month + "-" + date.getDate() + " " + date.getHours() + ":" + date.getMinutes() + ":" + date.getSeconds();
|
||||
let end = date.getFullYear() + "-" + month + "-" + date.getDate() + " 23:59:59";
|
||||
|
||||
if (this.loggeduser.Profile == 'MDGPR') {
|
||||
|
||||
let mdOficialEvents = await this.eventService.getAllMdOficialEvents(start, end).toPromise();
|
||||
let mdPessoalEvents = await this.eventService.getAllMdPessoalEvents(start, end).toPromise();
|
||||
|
||||
const list = mdOficialEvents.concat(mdPessoalEvents);
|
||||
|
||||
|
||||
|
||||
this.addEventToDb(list);
|
||||
this.listToPresent = list
|
||||
|
||||
if (list.length > 0) {
|
||||
this.currentEvent = list[0].Subject;
|
||||
this.currentHoursMinutes = list[0].StartDate;
|
||||
}
|
||||
|
||||
this.totalEvent = list.length;
|
||||
if(SessionStore.user) {
|
||||
console.log('im here')
|
||||
let onwEvent:any = await this.eventService.getAllOwnEvents(start, end).catch((error) => {
|
||||
console.error(error)
|
||||
})
|
||||
this.listToPresent = onwEvent;
|
||||
this.totalEvent = onwEvent.length;
|
||||
this.showLoader = false;
|
||||
|
||||
}
|
||||
else if (this.loggeduser.Profile == 'PR') {
|
||||
|
||||
let prOficialEvents = await this.eventService.getAllPrOficialEvents(start, end).toPromise();
|
||||
let prPessoalEvents = await this.eventService.getAllPrPessoalEvents(start, end).toPromise();
|
||||
|
||||
|
||||
const list = prOficialEvents.concat(prPessoalEvents);
|
||||
|
||||
this.addEventToDb(list);
|
||||
if (list.length > 0) {
|
||||
this.currentEvent = list[0].Subject;
|
||||
this.currentHoursMinutes = list[0].StartDate;
|
||||
}
|
||||
|
||||
this.listToPresent = list;
|
||||
this.totalEvent = list.length;
|
||||
this.showLoader = false;
|
||||
|
||||
} else {
|
||||
|
||||
if(this.loggeduser.OwnerCalendars.length >= 1) {
|
||||
|
||||
let onwEvent:any = await this.eventService.getAllOwnEvents(start, end).catch((error) => {
|
||||
console.error(error)
|
||||
})
|
||||
this.listToPresent = onwEvent;
|
||||
this.totalEvent = onwEvent.length;
|
||||
this.showLoader = false;
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ export class LoginPage implements OnInit {
|
||||
|
||||
} else {
|
||||
|
||||
this.sqliteservice.deleteAllTables();
|
||||
|
||||
this.RochetChatConnectorService.logout();
|
||||
this.clearStoreService.clear();
|
||||
this.ChatSystemService.clearChat();
|
||||
|
||||
@@ -118,8 +118,8 @@ export class AttendeePage implements OnInit {
|
||||
filterSearchList(itm: EventPerson): boolean {
|
||||
|
||||
const result = this.LtaskParticipants.concat(this.LtaskParticipantsCc).find((contact, index)=>{
|
||||
|
||||
if(contact.Name.toLowerCase() == itm.Name.toLowerCase() && contact.EmailAddress.toLowerCase() == itm.EmailAddress.toLowerCase()){
|
||||
|
||||
if(this.checkStringNull(contact.Name) == this.checkStringNull(itm.Name) && this.checkStringNull(contact.EmailAddress) == this.checkStringNull(itm.EmailAddress)){
|
||||
index = index;
|
||||
return contact;
|
||||
}
|
||||
@@ -133,7 +133,7 @@ export class AttendeePage implements OnInit {
|
||||
|
||||
const result2 = this.LtaskParticipantsCc.find((contact, index)=>{
|
||||
|
||||
if(contact.Name.toLowerCase() == itm.Name && contact.EmailAddress.toLowerCase() == itm.EmailAddress.toLowerCase()){
|
||||
if(this.checkStringNull(contact.Name) == itm.Name && this.checkStringNull(contact.EmailAddress) == this.checkStringNull(itm.EmailAddress)){
|
||||
index = index;
|
||||
return contact;
|
||||
}
|
||||
@@ -199,7 +199,7 @@ export class AttendeePage implements OnInit {
|
||||
{
|
||||
this.eventPersons.forEach(attendee => {
|
||||
const index: number = result.findIndex((cont) => {
|
||||
return cont.EmailAddress.toLowerCase() == attendee.EmailAddress.toLowerCase()
|
||||
return this.checkStringNull(cont.EmailAddress) == this.checkStringNull(attendee.EmailAddress)
|
||||
});
|
||||
|
||||
result.splice(index, 1);
|
||||
@@ -212,4 +212,12 @@ export class AttendeePage implements OnInit {
|
||||
);
|
||||
}
|
||||
|
||||
checkStringNull(value: string) {
|
||||
if(value) {
|
||||
return value.toLowerCase();
|
||||
} else {
|
||||
return value
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user