mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 05:16:07 +00:00
- Integrate combined profile events at home
-Added another button to change profile
This commit is contained in:
+29
-25
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { ContactsService } from 'src/app/services/contacts.service';
|
||||
|
||||
@@ -13,35 +13,18 @@ export class AddParticipantsCcModalPage implements OnInit {
|
||||
contacts: EventPerson[];
|
||||
showLoader: boolean = false;
|
||||
eventPersons: EventPerson[];
|
||||
participantsAdded: any;
|
||||
|
||||
constructor(private modalController: ModalController, private contactsService: ContactsService) { }
|
||||
constructor(private modalController: ModalController,
|
||||
private contactsService: ContactsService,
|
||||
private navParams: NavParams,
|
||||
) {
|
||||
this.participantsAdded = this.navParams.get('eventPersons');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.fetchContacts("");
|
||||
}
|
||||
async fetchContacts(filter: string) {
|
||||
this.showLoader = true;
|
||||
|
||||
this.contactsService.getContacts(filter).subscribe(result =>
|
||||
{
|
||||
if (this.eventPersons != null)
|
||||
{
|
||||
this.eventPersons.forEach(attendee => {
|
||||
const index: number = result.findIndex((cont) => {
|
||||
return cont.EmailAddress == attendee.EmailAddress
|
||||
});
|
||||
|
||||
result.splice(index, 1);
|
||||
});
|
||||
}
|
||||
|
||||
this.contacts = result;
|
||||
/* console.log(result); */
|
||||
|
||||
this.showLoader = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
onChange(evt: any) {
|
||||
this.fetchContacts(evt.detail.value);
|
||||
@@ -50,6 +33,27 @@ export class AddParticipantsCcModalPage implements OnInit {
|
||||
selectContact(itm: EventPerson){
|
||||
itm.IsRequired = !itm.IsRequired;
|
||||
}
|
||||
|
||||
async fetchContacts(filter: string) {
|
||||
this.showLoader = true;
|
||||
|
||||
this.contactsService.getContacts(filter).subscribe(result =>
|
||||
{
|
||||
if (this.participantsAdded != null)
|
||||
{
|
||||
this.participantsAdded.forEach(attendee => {
|
||||
const index: number = result.findIndex((cont) => {
|
||||
return cont.EmailAddress == attendee.UserId
|
||||
});
|
||||
|
||||
result.splice(index, 1);
|
||||
});
|
||||
}
|
||||
this.contacts = result;
|
||||
this.showLoader = false;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
cancelTask(){
|
||||
this.modalController.dismiss(null);
|
||||
|
||||
+6
-4
@@ -10,10 +10,12 @@
|
||||
<ion-item-sliding>
|
||||
<ion-item *ngFor="let attendee of contacts">
|
||||
<ion-checkbox slot="end" [disabled]="isCheckboxDisabled" (ionChange)="selectContact(attendee)"></ion-checkbox>
|
||||
<ion-label>
|
||||
<h3>{{ attendee.Name }}</h3>
|
||||
<p>{{ attendee.EmailAddress }}</p>
|
||||
</ion-label>
|
||||
<!-- <div *ngFor="let part of participantsAdded"> -->
|
||||
<ion-label>
|
||||
<h3>{{ attendee.Name }}</h3>
|
||||
<p>{{ attendee.EmailAddress }}</p>
|
||||
</ion-label>
|
||||
<!-- </div> -->
|
||||
</ion-item>
|
||||
</ion-item-sliding>
|
||||
</ion-list>
|
||||
|
||||
+9
-8
@@ -1,5 +1,5 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { ContactsService } from 'src/app/services/contacts.service';
|
||||
|
||||
@@ -13,31 +13,32 @@ export class AddParticipantsModalPage implements OnInit {
|
||||
contacts: EventPerson[];
|
||||
showLoader: boolean = false;
|
||||
eventPersons: EventPerson[];
|
||||
participantsAdded: any;
|
||||
|
||||
constructor(private modalController: ModalController, private contactsService: ContactsService) { }
|
||||
constructor(private modalController: ModalController,
|
||||
private contactsService: ContactsService,
|
||||
private navParams: NavParams,) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.fetchContacts("");
|
||||
this.participantsAdded = this.navParams.get('eventPersons');
|
||||
}
|
||||
async fetchContacts(filter: string) {
|
||||
this.showLoader = true;
|
||||
|
||||
this.contactsService.getContacts(filter).subscribe(result =>
|
||||
{
|
||||
if (this.eventPersons != null)
|
||||
if (this.participantsAdded != null)
|
||||
{
|
||||
this.eventPersons.forEach(attendee => {
|
||||
this.participantsAdded.forEach(attendee => {
|
||||
const index: number = result.findIndex((cont) => {
|
||||
return cont.EmailAddress == attendee.EmailAddress
|
||||
return cont.EmailAddress == attendee.UserId
|
||||
});
|
||||
|
||||
result.splice(index, 1);
|
||||
});
|
||||
}
|
||||
|
||||
this.contacts = result;
|
||||
/* console.log(result); */
|
||||
|
||||
this.showLoader = false;
|
||||
}
|
||||
);
|
||||
|
||||
+22
-2
@@ -42,7 +42,17 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-input placeholder="Data início" [(ngModel)]="postData.StartDate"></ion-input>
|
||||
<ion-datetime
|
||||
placeholder="{{postData.StartDate | date: 'dd MMM yyyy H:mm'}}"
|
||||
[(ngModel)]="postData.StartDate"
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2018"
|
||||
max="2022"
|
||||
value="2020-11-19T11:06Z">
|
||||
</ion-datetime>
|
||||
<!-- <ion-input placeholder="Data início" [(ngModel)]="postData.StartDate"></ion-input> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -53,7 +63,17 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-input placeholder="Data fim" [(ngModel)]="postData.EndDate"></ion-input>
|
||||
<ion-datetime
|
||||
placeholder="{{postData.EndDate | date: 'dd MMM yyyy H:mm'}}"
|
||||
[(ngModel)]="postData.EndDate"
|
||||
displayFormat="D MMM YYYY H:mm"
|
||||
minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
min="2018"
|
||||
max="2022"
|
||||
value="2020-11-19T11:06Z">
|
||||
</ion-datetime>
|
||||
<!-- <ion-input placeholder="Data fim" [(ngModel)]="postData.EndDate"></ion-input> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+28
-12
@@ -8,6 +8,7 @@ import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-book-meeting-modal',
|
||||
@@ -39,14 +40,16 @@ export class BookMeetingModalPage implements OnInit {
|
||||
/* Initialize 'Subject' with the title of the expedient */
|
||||
this.postData.Subject = this.task.Folio;
|
||||
this.postData.CalendarName = "Oficial";
|
||||
this.postData.StartDate = new Date();
|
||||
/* Set + 30minutes to seleted datetime */
|
||||
let selectedEndDate = new Date();
|
||||
this.postData.EndDate = new Date(selectedEndDate.setMinutes(new Date().getMinutes() + 30));
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.task)
|
||||
console.log(this.task.SerialNumber);
|
||||
|
||||
|
||||
}
|
||||
|
||||
close(){
|
||||
@@ -68,8 +71,8 @@ export class BookMeetingModalPage implements OnInit {
|
||||
Location: this.postData.Location,
|
||||
CalendarId: '',
|
||||
CalendarName: this.postData.CalendarName,
|
||||
StartDate: new Date(),
|
||||
EndDate: new Date(),
|
||||
StartDate: this.postData.StartDate,
|
||||
EndDate: this.postData.EndDate,
|
||||
EventType: 'Reunião',
|
||||
Attendees: this.eventAttendees,
|
||||
IsMeeting: false,
|
||||
@@ -82,15 +85,13 @@ export class BookMeetingModalPage implements OnInit {
|
||||
}
|
||||
console.log(this.postData);
|
||||
|
||||
this.processes.GetTask(this.task.SerialNumber).subscribe(res =>{
|
||||
this.taskDocId = res.workflowInstanceDataFields.DocId;
|
||||
this.calendarService.postExpedientEvent(this.taskDocId, this.postData);
|
||||
this.processes.FindTaskDocId(this.task.SerialNumber).subscribe(res =>{
|
||||
if(res){
|
||||
/* this.calendarService.postExpedientEvent(res, this.postData); */
|
||||
}
|
||||
});
|
||||
|
||||
this.distartExpedientModal();
|
||||
this.close();
|
||||
|
||||
/* this.processes.postExpedientEvent(this.postData); */
|
||||
|
||||
}
|
||||
|
||||
async addParticipants(){
|
||||
@@ -122,12 +123,12 @@ export class BookMeetingModalPage implements OnInit {
|
||||
this.eventAttendees = new Array();
|
||||
}
|
||||
this.eventAttendees.push(att);
|
||||
|
||||
});
|
||||
}
|
||||
this.postData.Attendees = this.eventAttendees;
|
||||
});
|
||||
}
|
||||
|
||||
async addParticipantsCc(){
|
||||
const modal = await this.modalController.create({
|
||||
component: AddParticipantsCcModalPage,
|
||||
@@ -164,4 +165,19 @@ export class BookMeetingModalPage implements OnInit {
|
||||
});
|
||||
}
|
||||
|
||||
async distartExpedientModal(){
|
||||
const modal = await this.modalController.create({
|
||||
component: DiscartExpedientModalPage,
|
||||
componentProps: {
|
||||
serialNumber: this.task.SerialNumber,
|
||||
},
|
||||
cssClass: 'discart-expedient-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+2
-2
@@ -23,7 +23,7 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-select placeholder="Prazo" [(ngModel)]="postData.TypeDeadline" interface="action-sheet" Cancel-text="Cancelar" required>
|
||||
<ion-select placeholder="Prazo" [(ngModel)]="postData.Priority" interface="action-sheet" Cancel-text="Cancelar" required>
|
||||
<ion-select-option value="99999861">Normal</ion-select-option>
|
||||
<ion-select-option value="99999862">Urgente</ion-select-option>
|
||||
<ion-select-option value="99999863">Muito Urgente</ion-select-option>
|
||||
@@ -93,7 +93,7 @@
|
||||
<ion-list>
|
||||
<ion-item>
|
||||
<ion-label>
|
||||
<h4 class="attach-title-item">{{taskSubject}}</h4>
|
||||
<h4 class="attach-title-item">{{task.workflowInstanceFolio}}</h4>
|
||||
<p><span class="span-left">OAPR - GTI</span><span class="span-right"> {{ taskDate | date: 'dd/MM/yyyy' }}</span></p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
|
||||
+9
-7
@@ -60,7 +60,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
this.postData.DispatchFolder = this.dispatchFolder;
|
||||
this.postData.UsersSelected = this.participants;
|
||||
/* By Default TypeDeadline should be 'Normal' */
|
||||
this.postData.TypeDeadline = '99999861';
|
||||
this.postData.Priority = '99999861';
|
||||
/* Initialize 'Subject' with the title of the expedient */
|
||||
this.postData.DispatchFolder.Subject = this.task.workflowInstanceFolio;
|
||||
}
|
||||
@@ -91,35 +91,35 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
this.postData = {
|
||||
DistributionType: "Paralelo",
|
||||
CountryCode: 'AO',
|
||||
TypeDeadline: this.postData.TypeDeadline,
|
||||
Priority: this.postData.Priority,
|
||||
UserEmail: this.user,
|
||||
UsersSelected: this.participants,
|
||||
DispatchFolder: this.dispatchFolder,
|
||||
}
|
||||
console.log(this.postData);
|
||||
/* this.processes.postDespatcho(this.postData); */
|
||||
this.processes.postDespatcho(this.postData);
|
||||
break;
|
||||
case '1':
|
||||
this.postData = {
|
||||
DistributionType: "Paralelo",
|
||||
CountryCode: 'AO',
|
||||
TypeDeadline: this.postData.TypeDeadline,
|
||||
Priority: this.postData.Priority,
|
||||
UserEmail: this.user,
|
||||
UsersSelected: this.participants,
|
||||
DispatchFolder: this.dispatchFolder,
|
||||
}
|
||||
/* this.processes.postParecer(this.postData); */
|
||||
this.processes.postParecer(this.postData);
|
||||
break;
|
||||
case '2':
|
||||
this.postData = {
|
||||
DistributionType: "Paralelo",
|
||||
CountryCode: 'AO',
|
||||
TypeDeadline: this.postData.TypeDeadline,
|
||||
Priority: this.postData.Priority,
|
||||
UserEmail: this.user,
|
||||
UsersSelected: this.participants,
|
||||
DispatchFolder: this.dispatchFolder,
|
||||
}
|
||||
/* this.processes.postDeferimento(this.postData); */
|
||||
this.processes.postDeferimento(this.postData);
|
||||
break;
|
||||
}
|
||||
this.router.navigate(['/home/gabinete-digital/expediente']);
|
||||
@@ -130,6 +130,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
const modal = await this.modalController.create({
|
||||
component: AddParticipantsModalPage,
|
||||
componentProps: {
|
||||
eventPersons: this.participants
|
||||
},
|
||||
cssClass: 'add-participants-modal',
|
||||
backdropDismiss: false
|
||||
@@ -162,6 +163,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
const modal = await this.modalController.create({
|
||||
component: AddParticipantsCcModalPage,
|
||||
componentProps: {
|
||||
eventPersons: this.participants
|
||||
},
|
||||
cssClass: 'add-participants-cc-modal',
|
||||
backdropDismiss: false
|
||||
|
||||
Reference in New Issue
Block a user