mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 21:06:06 +00:00
save
This commit is contained in:
@@ -299,6 +299,9 @@ export class AgendaPage implements OnInit {
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: NewEventPage,
|
||||
componentProps:{
|
||||
segment: this.segment,
|
||||
profile: this.profile,
|
||||
eventSelectedDate: this.eventSelectedDate,
|
||||
},
|
||||
cssClass: 'modal',
|
||||
backdropDismiss: false
|
||||
@@ -308,9 +311,14 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
|
||||
async viewEventDetail() {
|
||||
console.log(this.profile);
|
||||
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: ViewEventPage,
|
||||
componentProps:{
|
||||
segment: this.segment,
|
||||
profile: this.profile,
|
||||
/* eventSelectedDate: this.eventSelectedDate, */
|
||||
},
|
||||
cssClass: 'modal',
|
||||
backdropDismiss: false
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<ion-content>
|
||||
<div class="main-content">
|
||||
<div class="ion-item-container">
|
||||
<ion-input placeholder="Assunto"></ion-input>
|
||||
<ion-input placeholder="Assunto" [(ngModel)]="postEvent.Subject"></ion-input>
|
||||
</div>
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
@@ -21,7 +21,7 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-input placeholder="Localização"></ion-input>
|
||||
<ion-input placeholder="Localização" [(ngModel)]="postEvent.Location"></ion-input>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Error messages -->
|
||||
@@ -37,7 +37,11 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-select placeholder="Selecione agenda" interface="action-sheet" Cancel-text="Cancelar" required>
|
||||
<ion-select placeholder="Selecione agenda"
|
||||
selectedText="{{postEvent.CalendarName}}"
|
||||
[(ngModel)]="postEvent.CalendarName"
|
||||
interface="action-sheet" Cancel-text="Cancelar"
|
||||
required>
|
||||
<ion-select-option value="Oficial">Oficial</ion-select-option>
|
||||
<ion-select-option value="Pessoal">Pessoal</ion-select-option>
|
||||
</ion-select>
|
||||
@@ -51,9 +55,11 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-select placeholder="Selecione tipo" interface="action-sheet" Cancel-text="Cancelar" required>
|
||||
<ion-select-option value="Oficial">Reunião</ion-select-option>
|
||||
<ion-select-option value="Pessoal">Viagem</ion-select-option>
|
||||
<ion-select placeholder="Selecione tipo" [(ngModel)]="postEvent.EventType" interface="action-sheet" Cancel-text="Cancelar" required>
|
||||
<ion-select-option value="Reunião">Reunião</ion-select-option>
|
||||
<ion-select-option value="Viagem">Viagem</ion-select-option>
|
||||
<ion-select-option value="Conferência">Conferência</ion-select-option>
|
||||
<ion-select-option value="Encontro">Encontro</ion-select-option>
|
||||
</ion-select>
|
||||
</div>
|
||||
</div>
|
||||
@@ -67,7 +73,7 @@
|
||||
<div class="ion-input-class">
|
||||
<ion-datetime
|
||||
placeholder="Início"
|
||||
|
||||
[(ngModel)]="postEvent.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"
|
||||
@@ -88,7 +94,7 @@
|
||||
<div class="ion-input-class">
|
||||
<ion-datetime
|
||||
placeholder="Fim"
|
||||
|
||||
[(ngModel)]="postEvent.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"
|
||||
@@ -120,11 +126,11 @@
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height">
|
||||
<div (click)="openAttendees()" class="ion-input-class-no-height">
|
||||
<div class="list-people">
|
||||
<ion-item lines="none">
|
||||
<ion-list>
|
||||
<ion-label class="list-people-title">Adicionar intervenientes</ion-label>
|
||||
<ion-label class="list-people-title">Adicionar participantes</ion-label>
|
||||
<ion-label hidden >Text</ion-label>
|
||||
</ion-list>
|
||||
</ion-item>
|
||||
@@ -136,7 +142,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div hidden class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
|
||||
@@ -163,7 +169,7 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class">
|
||||
<ion-input placeholder="Detalhes"></ion-input>
|
||||
<ion-input placeholder="Detalhes" [(ngModel)]="postEvent.Body.Text"></ion-input>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,10 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { Event } from '../../../models/event.model';
|
||||
import { AttendeesPage } from '../../events/attendees/attendees.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-new-event',
|
||||
@@ -7,18 +12,121 @@ import { ModalController } from '@ionic/angular';
|
||||
styleUrls: ['./new-event.page.scss'],
|
||||
})
|
||||
export class NewEventPage implements OnInit {
|
||||
postEvent: Event;
|
||||
eventBody: EventBody;
|
||||
segment:string = "true";
|
||||
profile:string;
|
||||
eventAttendees: EventPerson[];
|
||||
selectedSegment: string;
|
||||
selectedDate: Date;
|
||||
minDate: string;
|
||||
|
||||
constructor(
|
||||
private modalController: ModalController,
|
||||
) { }
|
||||
private navParams: NavParams,
|
||||
private eventService: EventsService,
|
||||
) {
|
||||
this.postEvent = new Event();
|
||||
this.eventBody = { BodyType : "1", Text : ""};
|
||||
this.postEvent.Body = this.eventBody;
|
||||
this.profile = this.navParams.get('profile');
|
||||
|
||||
this.selectedSegment = this.navParams.get('segment');
|
||||
this.selectedDate = this.navParams.get('eventSelectedDate');
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
console.log(this.profile);
|
||||
|
||||
|
||||
let selectedStartdDate = this.selectedDate;
|
||||
let selectedEndDate = new Date(this.selectedDate);
|
||||
/* Set + 30minutes to seleted datetime */
|
||||
/* selectedEndDate.setMinutes(this.selectedDate.getMinutes() + 30) */
|
||||
|
||||
/* this.minDate = this.selectedDate.toString(); */
|
||||
|
||||
if(this.selectedSegment != "Combinada"){
|
||||
this.postEvent ={
|
||||
EventId: '',
|
||||
Subject: '',
|
||||
Body: this.eventBody,
|
||||
Location: '',
|
||||
CalendarId: '',
|
||||
CalendarName: this.selectedSegment,
|
||||
StartDate: selectedStartdDate,
|
||||
EndDate: new Date(selectedEndDate),
|
||||
EventType: 'Reunião',
|
||||
Attendees: null,
|
||||
IsMeeting: false,
|
||||
IsRecurring: false,
|
||||
AppointmentState: 0,
|
||||
TimeZone: '',
|
||||
Organizer: '',
|
||||
Categories: null,
|
||||
HasAttachments: false,
|
||||
};
|
||||
}
|
||||
else{
|
||||
this.postEvent ={
|
||||
EventId: '',
|
||||
Subject: '',
|
||||
Body: this.eventBody,
|
||||
Location: '',
|
||||
CalendarId: '',
|
||||
CalendarName: 'Oficial',
|
||||
StartDate: selectedStartdDate,
|
||||
EndDate: new Date(selectedEndDate),
|
||||
EventType: 'Reunião',
|
||||
Attendees: null,
|
||||
IsMeeting: false,
|
||||
IsRecurring: false,
|
||||
AppointmentState: 0,
|
||||
TimeZone: '',
|
||||
Organizer: '',
|
||||
Categories: null,
|
||||
HasAttachments: false,
|
||||
};
|
||||
}
|
||||
}
|
||||
close(){
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
save(){
|
||||
|
||||
console.log(this.postEvent);
|
||||
console.log(this.profile);
|
||||
|
||||
|
||||
if(this.profile=='mdgpr'){
|
||||
this.eventService.postEventMd(this.postEvent, this.postEvent.CalendarName).subscribe();
|
||||
}
|
||||
else if(this.profile=='pr'){
|
||||
this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).subscribe();
|
||||
}
|
||||
this.modalController.dismiss(this.postEvent);
|
||||
}
|
||||
|
||||
async openAttendees()
|
||||
{
|
||||
const modal = await this.modalController.create({
|
||||
component: AttendeesPage,
|
||||
componentProps: {
|
||||
eventAttendees: this.postEvent.Attendees
|
||||
},
|
||||
cssClass: 'attendee',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data['data'] != null)
|
||||
{
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
this.postEvent.Attendees = newattendees;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -71,7 +71,8 @@
|
||||
</span> -->
|
||||
<ion-item>
|
||||
<ion-label position="floating">Data Início <span class="span-color">*</span></ion-label>
|
||||
<ion-datetime placeholder="{{postEvent.StartDate | date: 'dd MMM yyyy H:mm'}}" formControlName="startdate" [(ngModel)]="postEvent.StartDate" min="2020" max="2100"
|
||||
<ion-datetime placeholder="{{postEvent.StartDate | date: 'dd MMM yyyy H:mm'}}"
|
||||
formControlName="startdate" [(ngModel)]="postEvent.StartDate" min="2020" max="2100"
|
||||
displayFormat="D MMM YYYY H:mm" minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
required>
|
||||
@@ -83,7 +84,8 @@
|
||||
</span> -->
|
||||
<ion-item>
|
||||
<ion-label position="floating">Data Fim <span class="span-color">*</span></ion-label>
|
||||
<ion-datetime placeholder="{{postEvent.EndDate | date: 'dd MMM yyyy H:mm'}}" formControlName="enddate" [(ngModel)]="postEvent.EndDate" min="2020" max="2100"
|
||||
<ion-datetime placeholder="{{postEvent.EndDate | date: 'dd MMM yyyy H:mm'}}"
|
||||
formControlName="enddate" [(ngModel)]="postEvent.EndDate" min="2020" max="2100"
|
||||
displayFormat="D MMM YYYY H:mm" minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||
required></ion-datetime>
|
||||
|
||||
@@ -46,14 +46,19 @@ export class CalModalPage implements OnInit {
|
||||
|
||||
profile:string;
|
||||
|
||||
constructor(public formBuilder: FormBuilder, private modalCtrl: ModalController, private eventService: EventsService, private alertController:AlertService,
|
||||
private navParams: NavParams) {
|
||||
constructor(
|
||||
public formBuilder: FormBuilder,
|
||||
private modalCtrl: ModalController,
|
||||
private eventService: EventsService,
|
||||
private alertController:AlertService,
|
||||
private navParams: NavParams
|
||||
)
|
||||
{
|
||||
this.postEvent = new Event();
|
||||
this.eventBody = { BodyType : "1", Text : ""};
|
||||
this.postEvent.Body = this.eventBody;
|
||||
this.profile = this.navParams.get('profile');
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
|
||||
@@ -91,7 +91,8 @@ export class SearchPage implements OnInit {
|
||||
basicSearch(){
|
||||
|
||||
this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender
|
||||
,this.searchOrganicEntiry, this.searchDocTypeId).subscribe(res=>{
|
||||
,this.searchOrganicEntiry, this.searchDocTypeId, '386').subscribe(res=>{
|
||||
console.log(res);
|
||||
|
||||
res.Categories.forEach( e => {
|
||||
e['Active'] = false;
|
||||
|
||||
Reference in New Issue
Block a user