mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
added MD as default interveninete when PR are creating events ou mettings
This commit is contained in:
@@ -34,6 +34,7 @@ import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { Subject } from 'rxjs';
|
||||
|
||||
import { TaskService } from 'src/app/services/task.service'
|
||||
import { ContactsService } from 'src/app/services/contacts.service';
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
parse: {
|
||||
dateInput: "YYYY-MMMM-DD HH:mm"
|
||||
@@ -131,6 +132,8 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
CalendarNamesOptions = ['Oficial', 'Pessoal']
|
||||
environment = environment
|
||||
eventPersons: EventPerson[];
|
||||
contacts: EventPerson[] = [];
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
@@ -142,7 +145,8 @@ export class NewEventPage implements OnInit {
|
||||
private chatMethodService: ChatMethodsService,
|
||||
private hhtpErrorHandle: HttpErrorHandle,
|
||||
private processeService: ProcessesService,
|
||||
public TaskService: TaskService
|
||||
public TaskService: TaskService,
|
||||
private contactsService: ContactsService,
|
||||
) {
|
||||
this.dateAdapter.setLocale('pt');
|
||||
this.loggeduser = SessionStore.user;
|
||||
@@ -220,6 +224,7 @@ export class NewEventPage implements OnInit {
|
||||
}
|
||||
})
|
||||
}
|
||||
console.log('Attendes',this.taskParticipants)
|
||||
this.taskParticipants = removeDuplicate(this.taskParticipants);
|
||||
this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
|
||||
|
||||
@@ -234,6 +239,7 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
this.injectValidation();
|
||||
this.changeAgenda()
|
||||
this.fetchContacts("")
|
||||
|
||||
}
|
||||
|
||||
@@ -987,5 +993,34 @@ export class NewEventPage implements OnInit {
|
||||
return toAproveObject;
|
||||
}
|
||||
|
||||
async fetchContacts(filter: string) {
|
||||
|
||||
if (this.loggeduser.Profile == 'PR') {
|
||||
this.contactsService.getContacts(filter).subscribe(result => {
|
||||
if (this.eventPersons != null) {
|
||||
this.eventPersons.forEach(attendee => {
|
||||
const index: number = result.findIndex((cont) => {
|
||||
return cont.EmailAddress.toLocaleLowerCase() == attendee.EmailAddress.toLocaleLowerCase()
|
||||
});
|
||||
|
||||
result.splice(index, 1);
|
||||
|
||||
});
|
||||
}
|
||||
this.contacts = result;
|
||||
console.log('Attendes Email', this.loggeduser.Email)
|
||||
let filterLoggedUserEmail = this.contacts.filter(item => item.RoleDescription == "Ministro e Director do Gabinete do PR")
|
||||
console.log('Attendes Email', filterLoggedUserEmail)
|
||||
|
||||
this.contacts = filterLoggedUserEmail;
|
||||
|
||||
this.taskParticipants.push(this.contacts[0]);
|
||||
this.setIntervenient.emit(this.taskParticipants);
|
||||
console.log('Attendes Email', this.taskParticipants)
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user