mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
Merge branch 'developer' of https://bitbucket.org/equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -8,7 +8,6 @@ import { AgendaPageRoutingModule } from './agenda-routing.module';
|
|||||||
|
|
||||||
import { AgendaPage } from './agenda.page';
|
import { AgendaPage } from './agenda.page';
|
||||||
import { NgCalendarModule } from 'ionic2-calendar';
|
import { NgCalendarModule } from 'ionic2-calendar';
|
||||||
import { CalModalPageModule } from '../cal-modal/cal-modal.module';
|
|
||||||
|
|
||||||
import { registerLocaleData } from '@angular/common';
|
import { registerLocaleData } from '@angular/common';
|
||||||
import localeDe from '@angular/common/locales/pt';
|
import localeDe from '@angular/common/locales/pt';
|
||||||
@@ -45,8 +44,6 @@ import { EditEventPageModule } from 'src/app/shared/agenda/edit-event/edit-event
|
|||||||
ComponentsModule,
|
ComponentsModule,
|
||||||
AgendaPageRoutingModule,
|
AgendaPageRoutingModule,
|
||||||
NgCalendarModule,
|
NgCalendarModule,
|
||||||
CalModalPageModule,
|
|
||||||
|
|
||||||
// entryComponents
|
// entryComponents
|
||||||
HeaderPageModule,
|
HeaderPageModule,
|
||||||
ViewEventPageModule,
|
ViewEventPageModule,
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ import { Component, OnInit, ViewChild, Inject, LOCALE_ID, Input } from '@angular
|
|||||||
import { CalendarComponent } from 'ionic2-calendar';
|
import { CalendarComponent } from 'ionic2-calendar';
|
||||||
import { AlertController, ModalController } from '@ionic/angular';
|
import { AlertController, ModalController } from '@ionic/angular';
|
||||||
import { formatDate } from '@angular/common';
|
import { formatDate } from '@angular/common';
|
||||||
import { CalModalPage } from '../cal-modal/cal-modal.page';
|
|
||||||
import { EventsService } from 'src/app/services/events.service';
|
import { EventsService } from 'src/app/services/events.service';
|
||||||
import { Event } from '../../models/event.model';
|
import { Event } from '../../models/event.model';
|
||||||
import { Router, NavigationEnd } from '@angular/router';
|
import { Router, NavigationEnd } from '@angular/router';
|
||||||
@@ -289,39 +288,6 @@ export class AgendaPage implements OnInit {
|
|||||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||||
}
|
}
|
||||||
|
|
||||||
async openCalModal() {
|
|
||||||
const modal = await this.modalCtrl.create({
|
|
||||||
component: CalModalPage,
|
|
||||||
componentProps:{
|
|
||||||
segment: this.segment,
|
|
||||||
profile: this.profile,
|
|
||||||
eventSelectedDate: this.eventSelectedDate,
|
|
||||||
},
|
|
||||||
cssClass: 'cal-modal modal-desktop',
|
|
||||||
backdropDismiss: false
|
|
||||||
});
|
|
||||||
|
|
||||||
await modal.present();
|
|
||||||
|
|
||||||
modal.onDidDismiss().then((data) => {
|
|
||||||
let postEvent: Event = data['data'];
|
|
||||||
if (postEvent.Subject != null)
|
|
||||||
{
|
|
||||||
this.eventSource.push({
|
|
||||||
title: postEvent.Subject,
|
|
||||||
startTime: new Date(postEvent.StartDate),
|
|
||||||
endTime: new Date(postEvent.EndDate),
|
|
||||||
allDay: false,
|
|
||||||
event: postEvent
|
|
||||||
});
|
|
||||||
|
|
||||||
this.myCal.update();
|
|
||||||
this.myCal.loadEvents();
|
|
||||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// for calendar
|
// for calendar
|
||||||
currentDayEventDisplayBorder(day: any, id: any){
|
currentDayEventDisplayBorder(day: any, id: any){
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +0,0 @@
|
|||||||
import { NgModule } from '@angular/core';
|
|
||||||
import { Routes, RouterModule } from '@angular/router';
|
|
||||||
|
|
||||||
import { CalModalPage } from './cal-modal.page';
|
|
||||||
|
|
||||||
const routes: Routes = [
|
|
||||||
{
|
|
||||||
path: '',
|
|
||||||
component: CalModalPage
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [RouterModule.forChild(routes)],
|
|
||||||
exports: [RouterModule],
|
|
||||||
})
|
|
||||||
export class CalModalPageRoutingModule {}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
import { NgModule } from '@angular/core';
|
|
||||||
import { CommonModule } from '@angular/common';
|
|
||||||
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
|
|
||||||
|
|
||||||
import { IonicModule } from '@ionic/angular';
|
|
||||||
|
|
||||||
import { CalModalPageRoutingModule } from './cal-modal-routing.module';
|
|
||||||
|
|
||||||
import { CalModalPage } from './cal-modal.page';
|
|
||||||
import { NgCalendarModule } from 'ionic2-calendar';
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [
|
|
||||||
CommonModule,
|
|
||||||
FormsModule,
|
|
||||||
IonicModule,
|
|
||||||
CalModalPageRoutingModule,
|
|
||||||
ReactiveFormsModule,
|
|
||||||
NgCalendarModule
|
|
||||||
],
|
|
||||||
declarations: [CalModalPage]
|
|
||||||
})
|
|
||||||
export class CalModalPageModule {}
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
<ion-header>
|
|
||||||
<ion-toolbar>
|
|
||||||
<ion-buttons slot="start">
|
|
||||||
<ion-button (click)="close()">
|
|
||||||
<ion-icon name="chevron-back" slot="start"></ion-icon>
|
|
||||||
</ion-button>
|
|
||||||
</ion-buttons>
|
|
||||||
<ion-title>Novo Evento</ion-title>
|
|
||||||
</ion-toolbar>
|
|
||||||
</ion-header>
|
|
||||||
|
|
||||||
<ion-content>
|
|
||||||
<div class="div-ion-content">
|
|
||||||
<form [formGroup]="ionicForm" novalidate>
|
|
||||||
<ion-item>
|
|
||||||
<ion-label position="floating">Assunto <span class="span-color">*</span></ion-label>
|
|
||||||
<ion-input formControlName="subject" type="text" [(ngModel)]="postEvent.Subject" required></ion-input>
|
|
||||||
</ion-item>
|
|
||||||
<!-- Error messages -->
|
|
||||||
<span class="error ion-padding" *ngIf="formSubjectSatus">
|
|
||||||
Campo obrigatório
|
|
||||||
</span>
|
|
||||||
<ion-item>
|
|
||||||
<ion-label position="floating">Descrição <span class="span-color">*</span></ion-label>
|
|
||||||
<ion-input formControlName="description" type="text" [(ngModel)]="postEvent.Body.Text" required></ion-input>
|
|
||||||
</ion-item>
|
|
||||||
<!-- Error messages -->
|
|
||||||
<span class="error ion-padding" *ngIf="formDescriptionSatus">
|
|
||||||
Campo obrigatório
|
|
||||||
</span>
|
|
||||||
<ion-item>
|
|
||||||
<ion-label position="floating">Localização <span class="span-color">*</span></ion-label>
|
|
||||||
<ion-input formControlName="location" type="text" [(ngModel)]="postEvent.Location" required></ion-input>
|
|
||||||
</ion-item>
|
|
||||||
<!-- Error messages -->
|
|
||||||
<span class="error ion-padding" *ngIf="formLocationSatus">
|
|
||||||
Campo obrigatório
|
|
||||||
</span>
|
|
||||||
<!-- <span class="error ion-padding" *ngIf="errorControl.location.errors?.required">
|
|
||||||
Campo obrigatório
|
|
||||||
</span> -->
|
|
||||||
<ion-item>
|
|
||||||
<ion-label position="floating">Selecione a Agenda <span class="span-color">*</span></ion-label>
|
|
||||||
<ion-select selectedText="{{postEvent.CalendarName}}" formControlName="agenda" [(ngModel)]="postEvent.CalendarName" interface="action-sheet" class="custom-options" Cancel-text="Cancelar" required>
|
|
||||||
<ion-select-option Pessoal="Reunião">Pessoal</ion-select-option>
|
|
||||||
<ion-select-option Oficial="Viagem">Oficial</ion-select-option>
|
|
||||||
</ion-select>
|
|
||||||
</ion-item>
|
|
||||||
<!-- Error messages -->
|
|
||||||
<span class="error ion-padding" *ngIf="formEventTypeSatus">
|
|
||||||
Campo obrigatório
|
|
||||||
</span>
|
|
||||||
<!-- <span class="error ion-padding" *ngIf="errorControl.agenda.errors?.required">
|
|
||||||
Campo obrigatório
|
|
||||||
</span> -->
|
|
||||||
<ion-item>
|
|
||||||
<ion-label position="floating">Tipo de evento <span class="span-color">*</span></ion-label>
|
|
||||||
<ion-select formControlName="eventtype" [(ngModel)]="postEvent.EventType" interface="action-sheet" class="custom-options" 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>
|
|
||||||
</ion-item>
|
|
||||||
<!-- Error messages -->
|
|
||||||
<span class="error ion-padding" *ngIf="formEventTypeSatus">
|
|
||||||
Campo obrigatório
|
|
||||||
</span>
|
|
||||||
<!-- <span class="error ion-padding" *ngIf="errorControl.eventtype.errors?.required">
|
|
||||||
Campo obrigatório
|
|
||||||
</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"
|
|
||||||
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>
|
|
||||||
</ion-item>
|
|
||||||
<!-- Error messages -->
|
|
||||||
<!-- <span class="error ion-padding" *ngIf="errorControl.startdate.errors?.required">
|
|
||||||
Campo obrigatório
|
|
||||||
</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"
|
|
||||||
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>
|
|
||||||
</ion-item>
|
|
||||||
<!-- Error messages -->
|
|
||||||
<!-- <span class="error ion-padding" *ngIf="errorControl.enddate.errors?.required">
|
|
||||||
Campo obrigatório
|
|
||||||
</span> -->
|
|
||||||
</form>
|
|
||||||
<div class="div-attach">
|
|
||||||
<ion-item lines="none">
|
|
||||||
<ion-icon name="add" slot="end" (click)="openAttendees()"></ion-icon>
|
|
||||||
<ion-label class="attach-label">Participantes</ion-label>
|
|
||||||
</ion-item>
|
|
||||||
<div id="AttachFiles"></div>
|
|
||||||
</div>
|
|
||||||
<div class="div-attach">
|
|
||||||
<ion-item lines="none">
|
|
||||||
<ion-icon name="add" slot="end" (click)="showAlert()"></ion-icon>
|
|
||||||
<ion-label class="attach-label">Anexos</ion-label>
|
|
||||||
</ion-item>
|
|
||||||
<div id="AttachFiles"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</ion-content>
|
|
||||||
<ion-footer class="ion-no-border">
|
|
||||||
<ion-toolbar class="btn-div">
|
|
||||||
<ion-buttons slot="start">
|
|
||||||
<ion-button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
|
|
||||||
<ion-label>Cancelar</ion-label>
|
|
||||||
<ion-icon name="close" slot="start"></ion-icon>
|
|
||||||
</ion-button>
|
|
||||||
</ion-buttons>
|
|
||||||
<ion-title>{{ viewTitle }}</ion-title>
|
|
||||||
<ion-buttons slot="end">
|
|
||||||
<ion-button class="btn-ok" fill="clear" color="#fff" (click)="save()">
|
|
||||||
<ion-label>Enviar</ion-label>
|
|
||||||
<ion-icon name="checkmark" slot="start"></ion-icon>
|
|
||||||
</ion-button>
|
|
||||||
</ion-buttons>
|
|
||||||
</ion-toolbar>
|
|
||||||
</ion-footer>
|
|
||||||
@@ -1,34 +0,0 @@
|
|||||||
.div-ion-content{
|
|
||||||
margin: 15px;
|
|
||||||
}
|
|
||||||
:host ::ng-deep{
|
|
||||||
.monthview-container {
|
|
||||||
height: auto !important;
|
|
||||||
}
|
|
||||||
.event-detail-container{
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.div-attach{
|
|
||||||
border: 1px solid #ccc;
|
|
||||||
margin: 15px 0 0 0;
|
|
||||||
padding: 15px;
|
|
||||||
}
|
|
||||||
.error{
|
|
||||||
color:red;
|
|
||||||
font-size: 12px;
|
|
||||||
font-weight: bold;
|
|
||||||
padding-bottom: 20px;
|
|
||||||
}
|
|
||||||
/* ion-item{
|
|
||||||
display: block;
|
|
||||||
border: 1px solid red;
|
|
||||||
width: 100%;
|
|
||||||
float: left;
|
|
||||||
} */
|
|
||||||
.span-color{
|
|
||||||
color:red;
|
|
||||||
}
|
|
||||||
/* .ion-badge{
|
|
||||||
|
|
||||||
} */
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
||||||
import { IonicModule } from '@ionic/angular';
|
|
||||||
|
|
||||||
import { CalModalPage } from './cal-modal.page';
|
|
||||||
|
|
||||||
describe('CalModalPage', () => {
|
|
||||||
let component: CalModalPage;
|
|
||||||
let fixture: ComponentFixture<CalModalPage>;
|
|
||||||
|
|
||||||
beforeEach(async(() => {
|
|
||||||
TestBed.configureTestingModule({
|
|
||||||
declarations: [ CalModalPage ],
|
|
||||||
imports: [IonicModule.forRoot()]
|
|
||||||
}).compileComponents();
|
|
||||||
|
|
||||||
fixture = TestBed.createComponent(CalModalPage);
|
|
||||||
component = fixture.componentInstance;
|
|
||||||
fixture.detectChanges();
|
|
||||||
}));
|
|
||||||
|
|
||||||
it('should create', () => {
|
|
||||||
expect(component).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,260 +0,0 @@
|
|||||||
import { Component, OnInit, AfterViewInit, Input } from '@angular/core';
|
|
||||||
import { ModalController, NavParams } from '@ionic/angular';
|
|
||||||
|
|
||||||
import { Event } from '../../models/event.model';
|
|
||||||
import { EventsService } from 'src/app/services/events.service';
|
|
||||||
import { EventBody } from 'src/app/models/eventbody.model';
|
|
||||||
import { AttendeesPage } from 'src/app/pages/events/attendees/attendees.page';
|
|
||||||
|
|
||||||
import { AttendeeModalPage } from '../events/attendee-modal/attendee-modal.page';
|
|
||||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
|
||||||
import { AlertService } from 'src/app/services/alert.service';
|
|
||||||
import { FormGroup, FormBuilder, Validators } from "@angular/forms";
|
|
||||||
import { identifierModuleUrl } from '@angular/compiler';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'app-cal-modal',
|
|
||||||
templateUrl: './cal-modal.page.html',
|
|
||||||
styleUrls: ['./cal-modal.page.scss'],
|
|
||||||
})
|
|
||||||
export class CalModalPage implements OnInit {
|
|
||||||
|
|
||||||
calendar = {
|
|
||||||
mode: 'month',
|
|
||||||
currentDate: new Date()
|
|
||||||
};
|
|
||||||
|
|
||||||
eventAttendees: EventPerson[];
|
|
||||||
segment:string = "true";
|
|
||||||
selectedSegment: string;
|
|
||||||
selectedDate: Date;
|
|
||||||
|
|
||||||
viewTitle: string;
|
|
||||||
postEvent: Event;
|
|
||||||
eventBody: EventBody;
|
|
||||||
modalReady = false;
|
|
||||||
|
|
||||||
minDate: string;
|
|
||||||
|
|
||||||
ionicForm: FormGroup;
|
|
||||||
isSubmitted = false;
|
|
||||||
|
|
||||||
formSubjectSatus: boolean = false;
|
|
||||||
formDescriptionSatus: boolean = false;
|
|
||||||
formLocationSatus: boolean = false;
|
|
||||||
formEventTypeSatus: boolean = false;
|
|
||||||
|
|
||||||
profile:string;
|
|
||||||
|
|
||||||
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() {
|
|
||||||
|
|
||||||
|
|
||||||
this.selectedSegment = this.navParams.get('segment');
|
|
||||||
this.selectedDate = this.navParams.get('eventSelectedDate');
|
|
||||||
|
|
||||||
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,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
this.ionicForm = this.formBuilder.group({
|
|
||||||
subject: ['', [Validators.required]],
|
|
||||||
agenda: ['', [Validators.required]],
|
|
||||||
startdate: ['', [Validators.required]],
|
|
||||||
enddate: ['', [Validators.required]],
|
|
||||||
description: ['', [Validators.required]],
|
|
||||||
location: ['', [Validators.required]],
|
|
||||||
eventtype: ['', [Validators.required]]
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
get errorControl() {
|
|
||||||
return this.ionicForm.controls;
|
|
||||||
}
|
|
||||||
|
|
||||||
ngAfterViewInit(): void {
|
|
||||||
setTimeout(()=>{
|
|
||||||
this.modalReady = true;
|
|
||||||
}, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
save(){
|
|
||||||
if (this.ionicForm.valid) {
|
|
||||||
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.modalCtrl.dismiss(this.postEvent);
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
this.validateFormInputs();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
validateFormInputs(){
|
|
||||||
let formSubject = this.postEvent.Subject.trim();
|
|
||||||
let formDescription = this.postEvent.Body.Text.trim();
|
|
||||||
let formLocation = this.postEvent.Location.trim();
|
|
||||||
|
|
||||||
if (!this.postEvent.Subject && formSubject.length <= 0){
|
|
||||||
this.formSubjectSatus=true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
this.formSubjectSatus=false;
|
|
||||||
if(!this.postEvent.Body.Text && formDescription.length <= 0){
|
|
||||||
this.formDescriptionSatus=true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
this.formDescriptionSatus=false;
|
|
||||||
if (!this.postEvent.Location && formLocation.length <= 0){
|
|
||||||
this.formLocationSatus=true;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
this.formLocationSatus=false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/* return (this.postEvent.Subject && formSubject.length > 0); */
|
|
||||||
}
|
|
||||||
|
|
||||||
onViewTitleChanged(title){
|
|
||||||
this.viewTitle = title;
|
|
||||||
}
|
|
||||||
|
|
||||||
onTimeSelected(ev){
|
|
||||||
/* this.postEvent.startTime = new Date(ev.selectedTime); */
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
close(){
|
|
||||||
this.modalCtrl.dismiss();
|
|
||||||
/* this.modalCtrl.dismiss(this.postEvent); */
|
|
||||||
}
|
|
||||||
|
|
||||||
async addAttendees()
|
|
||||||
{
|
|
||||||
const modal = await this.modalCtrl.create({
|
|
||||||
component: AttendeeModalPage,
|
|
||||||
componentProps: {
|
|
||||||
eventPersons: this.postEvent.Attendees
|
|
||||||
},
|
|
||||||
cssClass: 'attendee-modal',
|
|
||||||
backdropDismiss: false
|
|
||||||
});
|
|
||||||
|
|
||||||
await modal.present();
|
|
||||||
|
|
||||||
modal.onDidDismiss().then((data) => {
|
|
||||||
let newattendees: EventPerson[] = data['data'];
|
|
||||||
|
|
||||||
|
|
||||||
if (newattendees != null)
|
|
||||||
{
|
|
||||||
newattendees.forEach(newattendee => {
|
|
||||||
let att = {
|
|
||||||
"EmailAddress": newattendee.EmailAddress,
|
|
||||||
"Name": newattendee.Name,
|
|
||||||
"IsRequired": (this.segment == "true")
|
|
||||||
};
|
|
||||||
if (this.eventAttendees == null)
|
|
||||||
{
|
|
||||||
this.eventAttendees = new Array();
|
|
||||||
}
|
|
||||||
this.eventAttendees.push(att);
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.postEvent.Attendees = this.eventAttendees;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
showAlert(){
|
|
||||||
this.alertController.presentAlert("Funcionalidade em desenvolvimento");
|
|
||||||
}
|
|
||||||
|
|
||||||
async openAttendees()
|
|
||||||
{
|
|
||||||
const modal = await this.modalCtrl.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;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
import { NgModule } from '@angular/core';
|
|
||||||
import { Routes, RouterModule } from '@angular/router';
|
|
||||||
|
|
||||||
import { AttendeeModalPage } from './attendee-modal.page';
|
|
||||||
|
|
||||||
const routes: Routes = [
|
|
||||||
{
|
|
||||||
path: '',
|
|
||||||
component: AttendeeModalPage
|
|
||||||
}
|
|
||||||
];
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [RouterModule.forChild(routes)],
|
|
||||||
exports: [RouterModule],
|
|
||||||
})
|
|
||||||
export class AttendeeModalPageRoutingModule {}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
import { NgModule } from '@angular/core';
|
|
||||||
import { CommonModule } from '@angular/common';
|
|
||||||
import { FormsModule } from '@angular/forms';
|
|
||||||
|
|
||||||
import { IonicModule } from '@ionic/angular';
|
|
||||||
|
|
||||||
import { AttendeeModalPageRoutingModule } from './attendee-modal-routing.module';
|
|
||||||
|
|
||||||
import { AttendeeModalPage } from './attendee-modal.page';
|
|
||||||
|
|
||||||
@NgModule({
|
|
||||||
imports: [
|
|
||||||
CommonModule,
|
|
||||||
FormsModule,
|
|
||||||
IonicModule,
|
|
||||||
AttendeeModalPageRoutingModule
|
|
||||||
],
|
|
||||||
declarations: [AttendeeModalPage],
|
|
||||||
exports: [AttendeeModalPage]
|
|
||||||
|
|
||||||
})
|
|
||||||
export class AttendeeModalPageModule {}
|
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
<ion-header class="ion-no-border">
|
|
||||||
<ion-toolbar>
|
|
||||||
<ion-title>Adicionar intervenientes</ion-title>
|
|
||||||
</ion-toolbar>
|
|
||||||
<ion-searchbar (ionChange)="onChange($event)" placeholder="Pesquisar"></ion-searchbar><!-- [(ngModel)]="searchCountryString" -->
|
|
||||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
|
||||||
</ion-header>
|
|
||||||
|
|
||||||
<ion-content>
|
|
||||||
<ion-item-group>
|
|
||||||
<ion-list>
|
|
||||||
<ion-item-sliding>
|
|
||||||
<ion-item lines="none" *ngFor="let attendee of contacts">
|
|
||||||
<ion-checkbox slot="end" (ionChange)="selectContact(attendee)"></ion-checkbox><!-- [disabled]="isCheckboxDisabled" -->
|
|
||||||
<ion-label>
|
|
||||||
<h3>{{ attendee.Name }}</h3>
|
|
||||||
<p>{{ attendee.EmailAddress }}</p>
|
|
||||||
</ion-label>
|
|
||||||
</ion-item>
|
|
||||||
</ion-item-sliding>
|
|
||||||
</ion-list>
|
|
||||||
</ion-item-group>
|
|
||||||
</ion-content>
|
|
||||||
<ion-footer class="ion-no-border">
|
|
||||||
<ion-toolbar class="btn-div">
|
|
||||||
<ion-buttons slot="start">
|
|
||||||
<ion-button class="btn-cancel" fill="clear" color="#061b52" (click)="close()">
|
|
||||||
<ion-label>Cancelar</ion-label>
|
|
||||||
<ion-icon name="close" slot="start"></ion-icon>
|
|
||||||
</ion-button>
|
|
||||||
</ion-buttons>
|
|
||||||
<ion-buttons slot="end">
|
|
||||||
<ion-button class="btn-ok" fill="clear" color="#fff" (click)="save()">
|
|
||||||
<ion-label>Adicionar</ion-label>
|
|
||||||
<ion-icon name="checkmark" slot="start"></ion-icon>
|
|
||||||
</ion-button>
|
|
||||||
</ion-buttons>
|
|
||||||
</ion-toolbar>
|
|
||||||
</ion-footer>
|
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
ion-item-group{
|
|
||||||
margin: 15px;
|
|
||||||
}
|
|
||||||
ion-searchbar{
|
|
||||||
--border-radius: 20px;
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
|
||||||
import { IonicModule } from '@ionic/angular';
|
|
||||||
|
|
||||||
import { AttendeeModalPage } from './attendee-modal.page';
|
|
||||||
|
|
||||||
describe('AttendeeModalPage', () => {
|
|
||||||
let component: AttendeeModalPage;
|
|
||||||
let fixture: ComponentFixture<AttendeeModalPage>;
|
|
||||||
|
|
||||||
beforeEach(async(() => {
|
|
||||||
TestBed.configureTestingModule({
|
|
||||||
declarations: [ AttendeeModalPage ],
|
|
||||||
imports: [IonicModule.forRoot()]
|
|
||||||
}).compileComponents();
|
|
||||||
|
|
||||||
fixture = TestBed.createComponent(AttendeeModalPage);
|
|
||||||
component = fixture.componentInstance;
|
|
||||||
fixture.detectChanges();
|
|
||||||
}));
|
|
||||||
|
|
||||||
it('should create', () => {
|
|
||||||
expect(component).toBeTruthy();
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,66 +0,0 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
|
||||||
import { ModalController } from '@ionic/angular';
|
|
||||||
import { ContactsService } from 'src/app/services/contacts.service';
|
|
||||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
|
||||||
import { ThrowStmt, removeSummaryDuplicates } from '@angular/compiler';
|
|
||||||
|
|
||||||
@Component({
|
|
||||||
selector: 'app-attendee-modal',
|
|
||||||
templateUrl: './attendee-modal.page.html',
|
|
||||||
styleUrls: ['./attendee-modal.page.scss'],
|
|
||||||
})
|
|
||||||
export class AttendeeModalPage implements OnInit {
|
|
||||||
|
|
||||||
contacts: EventPerson[];
|
|
||||||
showLoader: boolean = false;
|
|
||||||
eventPersons: EventPerson[];
|
|
||||||
|
|
||||||
constructor(private modalCtrl: ModalController, private contactsService: ContactsService) { }
|
|
||||||
|
|
||||||
ngOnInit() {
|
|
||||||
this.fetchContacts("");
|
|
||||||
}
|
|
||||||
|
|
||||||
save() {
|
|
||||||
this.modalCtrl.dismiss(
|
|
||||||
this.contacts.filter(function(contact) {
|
|
||||||
return contact.IsRequired == true;
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
close() {
|
|
||||||
this.modalCtrl.dismiss(null);
|
|
||||||
}
|
|
||||||
|
|
||||||
onChange(evt: any) {
|
|
||||||
this.fetchContacts(evt.detail.value);
|
|
||||||
}
|
|
||||||
|
|
||||||
selectContact(itm: EventPerson){
|
|
||||||
itm.IsRequired = !itm.IsRequired;
|
|
||||||
}
|
|
||||||
|
|
||||||
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;
|
|
||||||
this.showLoader = false;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -26,9 +26,11 @@ export class AttendeesPage implements OnInit {
|
|||||||
private contactsService: ContactsService,
|
private contactsService: ContactsService,
|
||||||
private navParams: NavParams,
|
private navParams: NavParams,
|
||||||
private modalController: ModalController) {
|
private modalController: ModalController) {
|
||||||
|
|
||||||
this.adding = this.navParams.get('adding');
|
this.adding = this.navParams.get('adding');
|
||||||
this.taskParticipants = this.navParams.get('taskParticipants');
|
this.taskParticipants = this.navParams.get('taskParticipants');
|
||||||
this.taskParticipantsCc = this.navParams.get('taskParticipantsCc');
|
this.taskParticipantsCc = this.navParams.get('taskParticipantsCc');
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@@ -44,7 +46,7 @@ export class AttendeesPage implements OnInit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges(event){}
|
ngOnChanges(event) {}
|
||||||
|
|
||||||
save(){
|
save(){
|
||||||
|
|
||||||
@@ -54,7 +56,7 @@ export class AttendeesPage implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
close(){
|
close() {
|
||||||
this.modalController.dismiss(false);
|
this.modalController.dismiss(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -20,14 +20,11 @@ const routes: Routes = [
|
|||||||
path: 'attendees',
|
path: 'attendees',
|
||||||
loadChildren: () => import('./attendees/attendees.module').then( m => m.AttendeesPageModule)
|
loadChildren: () => import('./attendees/attendees.module').then( m => m.AttendeesPageModule)
|
||||||
},
|
},
|
||||||
{
|
|
||||||
path: 'attendee-modal',
|
|
||||||
loadChildren: () => import('./attendee-modal/attendee-modal.module').then( m => m.AttendeeModalPageModule)
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
path: 'event-detail-modal',
|
path: 'event-detail-modal',
|
||||||
loadChildren: () => import('./event-detail-modal/event-detail-modal.module').then( m => m.EventDetailModalPageModule)
|
loadChildren: () => import('./event-detail-modal/event-detail-modal.module').then( m => m.EventDetailModalPageModule)
|
||||||
},
|
},
|
||||||
|
{
|
||||||
path: 'edit-event',
|
path: 'edit-event',
|
||||||
loadChildren: () => import('./edit-event/edit-event.module').then( m => m.EditEventPageModule)
|
loadChildren: () => import('./edit-event/edit-event.module').then( m => m.EditEventPageModule)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ export class DespachoPage implements OnInit {
|
|||||||
task: any;
|
task: any;
|
||||||
attachments:any;
|
attachments:any;
|
||||||
fulltask: any;
|
fulltask: any;
|
||||||
eventsList: Event[];
|
eventsList: Event[] = [];
|
||||||
serialnumber: string;
|
serialnumber: string;
|
||||||
profile: string;
|
profile: string;
|
||||||
intervenientes: any;
|
intervenientes: any;
|
||||||
|
|||||||
+39
-41
@@ -16,6 +16,7 @@ import { BadRequestPage } from 'src/app/shared/popover/bad-request/bad-request.p
|
|||||||
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
import { SuccessMessagePage } from 'src/app/shared/popover/success-message/success-message.page';
|
||||||
import { User } from 'src/app/models/user.model';
|
import { User } from 'src/app/models/user.model';
|
||||||
import { AuthService } from 'src/app/services/auth.service';
|
import { AuthService } from 'src/app/services/auth.service';
|
||||||
|
import { AttendeesPage } from 'src/app/pages/events/attendees/attendees.page';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-book-meeting-modal',
|
selector: 'app-book-meeting-modal',
|
||||||
@@ -175,34 +176,31 @@ export class BookMeetingModalPage implements OnInit {
|
|||||||
|
|
||||||
if(window.innerWidth <= 800){
|
if(window.innerWidth <= 800){
|
||||||
const modal = await this.modalController.create({
|
const modal = await this.modalController.create({
|
||||||
component: AddParticipantsModalPage,
|
component: AttendeesPage,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
eventPersons: this.eventAttendees
|
adding: this.adding,
|
||||||
|
taskParticipants: this.taskParticipants,
|
||||||
|
taskParticipantsCc: this.taskParticipantsCc
|
||||||
},
|
},
|
||||||
cssClass: 'book-meeting-modal',
|
cssClass: 'attendee',
|
||||||
backdropDismiss: false
|
backdropDismiss: false
|
||||||
});
|
});
|
||||||
|
|
||||||
await modal.present();
|
await modal.present();
|
||||||
|
|
||||||
modal.onDidDismiss().then((res) => {
|
modal.onDidDismiss().then((data) => {
|
||||||
this.taskParticipants = res.data;
|
|
||||||
let newattendees: EventPerson[] = res['data'];
|
if(data){
|
||||||
if(newattendees != null){
|
data = data['data'];
|
||||||
newattendees.forEach(newattendee => {
|
|
||||||
let att = {
|
const newAttendees: EventPerson[] = data['taskParticipants'];
|
||||||
"EmailAddress": newattendee.EmailAddress,
|
const newAttendeesCC: EventPerson[] = data['taskParticipantsCc'];
|
||||||
"Name": newattendee.Name,
|
|
||||||
"IsRequired": true
|
this.setIntervenient(newAttendees);
|
||||||
};
|
this.setIntervenientCC(newAttendeesCC);
|
||||||
if(this.eventAttendees == null){
|
|
||||||
this.eventAttendees = new Array();
|
|
||||||
}
|
}
|
||||||
this.eventAttendees.push(att);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.postData.Attendees = this.eventAttendees;
|
|
||||||
});
|
});
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.showAttendees = true;
|
this.showAttendees = true;
|
||||||
}
|
}
|
||||||
@@ -214,38 +212,29 @@ export class BookMeetingModalPage implements OnInit {
|
|||||||
|
|
||||||
if(window.innerWidth <= 800) {
|
if(window.innerWidth <= 800) {
|
||||||
const modal = await this.modalController.create({
|
const modal = await this.modalController.create({
|
||||||
component: AddParticipantsCcModalPage,
|
component: AttendeesPage,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
eventPersons: this.eventAttendees
|
adding: this.adding,
|
||||||
|
taskParticipants: this.taskParticipants,
|
||||||
|
taskParticipantsCc: this.taskParticipantsCc
|
||||||
},
|
},
|
||||||
cssClass: 'add-participants-cc-modal',
|
cssClass: 'attendee',
|
||||||
backdropDismiss: false
|
backdropDismiss: false
|
||||||
});
|
});
|
||||||
|
|
||||||
await modal.present();
|
await modal.present();
|
||||||
|
|
||||||
modal.onDidDismiss().then((res) => {
|
modal.onDidDismiss().then((data) => {
|
||||||
this.taskParticipantsCc = res.data;
|
|
||||||
let newattendees: EventPerson[] = res['data'];
|
|
||||||
|
|
||||||
|
if(data){
|
||||||
|
data = data['data'];
|
||||||
|
|
||||||
if (newattendees != null)
|
const newAttendees: EventPerson[] = data['taskParticipants'];
|
||||||
{
|
const newAttendeesCC: EventPerson[] = data['taskParticipantsCc'];
|
||||||
newattendees.forEach(newattendee => {
|
|
||||||
let att = {
|
this.setIntervenient(newAttendees);
|
||||||
"EmailAddress": newattendee.EmailAddress,
|
this.setIntervenientCC(newAttendeesCC);
|
||||||
"Name": newattendee.Name,
|
|
||||||
"IsRequired": false
|
|
||||||
};
|
|
||||||
if (this.eventAttendees == null)
|
|
||||||
{
|
|
||||||
this.eventAttendees = new Array();
|
|
||||||
}
|
}
|
||||||
this.eventAttendees.push(att);
|
|
||||||
|
|
||||||
});
|
|
||||||
}
|
|
||||||
this.postData.Attendees = this.eventAttendees;
|
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
this.showAttendees = true;
|
this.showAttendees = true;
|
||||||
@@ -403,4 +392,13 @@ export class BookMeetingModalPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
setIntervenient(data){
|
||||||
|
this.taskParticipants = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
setIntervenientCC(data){
|
||||||
|
this.taskParticipantsCc = data;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user