mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 13:55:51 +00:00
save
This commit is contained in:
@@ -299,6 +299,9 @@ export class AgendaPage implements OnInit {
|
|||||||
const modal = await this.modalCtrl.create({
|
const modal = await this.modalCtrl.create({
|
||||||
component: NewEventPage,
|
component: NewEventPage,
|
||||||
componentProps:{
|
componentProps:{
|
||||||
|
segment: this.segment,
|
||||||
|
profile: this.profile,
|
||||||
|
eventSelectedDate: this.eventSelectedDate,
|
||||||
},
|
},
|
||||||
cssClass: 'modal',
|
cssClass: 'modal',
|
||||||
backdropDismiss: false
|
backdropDismiss: false
|
||||||
@@ -308,9 +311,14 @@ export class AgendaPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async viewEventDetail() {
|
async viewEventDetail() {
|
||||||
|
console.log(this.profile);
|
||||||
|
|
||||||
const modal = await this.modalCtrl.create({
|
const modal = await this.modalCtrl.create({
|
||||||
component: ViewEventPage,
|
component: ViewEventPage,
|
||||||
componentProps:{
|
componentProps:{
|
||||||
|
segment: this.segment,
|
||||||
|
profile: this.profile,
|
||||||
|
/* eventSelectedDate: this.eventSelectedDate, */
|
||||||
},
|
},
|
||||||
cssClass: 'modal',
|
cssClass: 'modal',
|
||||||
backdropDismiss: false
|
backdropDismiss: false
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
<ion-content>
|
<ion-content>
|
||||||
<div class="main-content">
|
<div class="main-content">
|
||||||
<div class="ion-item-container">
|
<div class="ion-item-container">
|
||||||
<ion-input placeholder="Assunto"></ion-input>
|
<ion-input placeholder="Assunto" [(ngModel)]="postEvent.Subject"></ion-input>
|
||||||
</div>
|
</div>
|
||||||
<div class="container-div">
|
<div class="container-div">
|
||||||
<div class="ion-item-class-2">
|
<div class="ion-item-class-2">
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="ion-input-class">
|
<div class="ion-input-class">
|
||||||
<ion-input placeholder="Localização"></ion-input>
|
<ion-input placeholder="Localização" [(ngModel)]="postEvent.Location"></ion-input>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!-- Error messages -->
|
<!-- Error messages -->
|
||||||
@@ -37,7 +37,11 @@
|
|||||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="ion-input-class">
|
<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="Oficial">Oficial</ion-select-option>
|
||||||
<ion-select-option value="Pessoal">Pessoal</ion-select-option>
|
<ion-select-option value="Pessoal">Pessoal</ion-select-option>
|
||||||
</ion-select>
|
</ion-select>
|
||||||
@@ -51,9 +55,11 @@
|
|||||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="ion-input-class">
|
<div class="ion-input-class">
|
||||||
<ion-select placeholder="Selecione tipo" interface="action-sheet" Cancel-text="Cancelar" required>
|
<ion-select placeholder="Selecione tipo" [(ngModel)]="postEvent.EventType" interface="action-sheet" Cancel-text="Cancelar" required>
|
||||||
<ion-select-option value="Oficial">Reunião</ion-select-option>
|
<ion-select-option value="Reunião">Reunião</ion-select-option>
|
||||||
<ion-select-option value="Pessoal">Viagem</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-select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -67,7 +73,7 @@
|
|||||||
<div class="ion-input-class">
|
<div class="ion-input-class">
|
||||||
<ion-datetime
|
<ion-datetime
|
||||||
placeholder="Início"
|
placeholder="Início"
|
||||||
|
[(ngModel)]="postEvent.StartDate"
|
||||||
displayFormat="D MMM YYYY H:mm"
|
displayFormat="D MMM YYYY H:mm"
|
||||||
minuteValues="0,15,30,45"
|
minuteValues="0,15,30,45"
|
||||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||||
@@ -88,7 +94,7 @@
|
|||||||
<div class="ion-input-class">
|
<div class="ion-input-class">
|
||||||
<ion-datetime
|
<ion-datetime
|
||||||
placeholder="Fim"
|
placeholder="Fim"
|
||||||
|
[(ngModel)]="postEvent.EndDate"
|
||||||
displayFormat="D MMM YYYY H:mm"
|
displayFormat="D MMM YYYY H:mm"
|
||||||
minuteValues="0,15,30,45"
|
minuteValues="0,15,30,45"
|
||||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||||
@@ -120,11 +126,11 @@
|
|||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
|
<ion-icon slot="start" src="assets/images/icons-person.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="ion-input-class-no-height">
|
<div (click)="openAttendees()" class="ion-input-class-no-height">
|
||||||
<div class="list-people">
|
<div class="list-people">
|
||||||
<ion-item lines="none">
|
<ion-item lines="none">
|
||||||
<ion-list>
|
<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-label hidden >Text</ion-label>
|
||||||
</ion-list>
|
</ion-list>
|
||||||
</ion-item>
|
</ion-item>
|
||||||
@@ -136,7 +142,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container-div">
|
<div hidden class="container-div">
|
||||||
<div class="ion-item-class-2">
|
<div class="ion-item-class-2">
|
||||||
<div class="ion-icon-class">
|
<div class="ion-icon-class">
|
||||||
<ion-icon slot="start" src="assets/images/icons-people-cc.svg"></ion-icon>
|
<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>
|
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div class="ion-input-class">
|
<div class="ion-input-class">
|
||||||
<ion-input placeholder="Detalhes"></ion-input>
|
<ion-input placeholder="Detalhes" [(ngModel)]="postEvent.Body.Text"></ion-input>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -1,5 +1,10 @@
|
|||||||
import { Component, OnInit } from '@angular/core';
|
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({
|
@Component({
|
||||||
selector: 'app-new-event',
|
selector: 'app-new-event',
|
||||||
@@ -7,18 +12,121 @@ import { ModalController } from '@ionic/angular';
|
|||||||
styleUrls: ['./new-event.page.scss'],
|
styleUrls: ['./new-event.page.scss'],
|
||||||
})
|
})
|
||||||
export class NewEventPage implements OnInit {
|
export class NewEventPage implements OnInit {
|
||||||
|
postEvent: Event;
|
||||||
|
eventBody: EventBody;
|
||||||
|
segment:string = "true";
|
||||||
|
profile:string;
|
||||||
|
eventAttendees: EventPerson[];
|
||||||
|
selectedSegment: string;
|
||||||
|
selectedDate: Date;
|
||||||
|
minDate: string;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modalController: ModalController,
|
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() {
|
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(){
|
close(){
|
||||||
this.modalController.dismiss();
|
this.modalController.dismiss();
|
||||||
}
|
}
|
||||||
save(){
|
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> -->
|
</span> -->
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-label position="floating">Data Início <span class="span-color">*</span></ion-label>
|
<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"
|
displayFormat="D MMM YYYY H:mm" minuteValues="0,15,30,45"
|
||||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||||
required>
|
required>
|
||||||
@@ -83,7 +84,8 @@
|
|||||||
</span> -->
|
</span> -->
|
||||||
<ion-item>
|
<ion-item>
|
||||||
<ion-label position="floating">Data Fim <span class="span-color">*</span></ion-label>
|
<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"
|
displayFormat="D MMM YYYY H:mm" minuteValues="0,15,30,45"
|
||||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"
|
||||||
required></ion-datetime>
|
required></ion-datetime>
|
||||||
|
|||||||
@@ -46,14 +46,19 @@ export class CalModalPage implements OnInit {
|
|||||||
|
|
||||||
profile:string;
|
profile:string;
|
||||||
|
|
||||||
constructor(public formBuilder: FormBuilder, private modalCtrl: ModalController, private eventService: EventsService, private alertController:AlertService,
|
constructor(
|
||||||
private navParams: NavParams) {
|
public formBuilder: FormBuilder,
|
||||||
|
private modalCtrl: ModalController,
|
||||||
|
private eventService: EventsService,
|
||||||
|
private alertController:AlertService,
|
||||||
|
private navParams: NavParams
|
||||||
|
)
|
||||||
|
{
|
||||||
this.postEvent = new Event();
|
this.postEvent = new Event();
|
||||||
this.eventBody = { BodyType : "1", Text : ""};
|
this.eventBody = { BodyType : "1", Text : ""};
|
||||||
this.postEvent.Body = this.eventBody;
|
this.postEvent.Body = this.eventBody;
|
||||||
this.profile = this.navParams.get('profile');
|
this.profile = this.navParams.get('profile');
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
|
|||||||
@@ -91,7 +91,8 @@ export class SearchPage implements OnInit {
|
|||||||
basicSearch(){
|
basicSearch(){
|
||||||
|
|
||||||
this.search.basicSearch(this.searchSubject, this.searchDocumentDate, this.searchSender
|
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 => {
|
res.Categories.forEach( e => {
|
||||||
e['Active'] = false;
|
e['Active'] = false;
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export class SearchService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
basicSearch(subject:string, date:string, sender:string, organicEntity:string, docTypeId:string): Observable<EventSearch>{
|
basicSearch(subject:string, date:string, sender:string, organicEntity:string, docTypeId:string, applicationType:string): Observable<EventSearch>{
|
||||||
// Endpoint
|
// Endpoint
|
||||||
const geturl = environment.apiURL + 'search';
|
const geturl = environment.apiURL + 'search';
|
||||||
// store params
|
// store params
|
||||||
@@ -41,6 +41,7 @@ export class SearchService {
|
|||||||
params = params.set("remetente", sender);
|
params = params.set("remetente", sender);
|
||||||
params = params.set("entidadeOrganica", organicEntity);
|
params = params.set("entidadeOrganica", organicEntity);
|
||||||
params = params.set("docTypeId", docTypeId);
|
params = params.set("docTypeId", docTypeId);
|
||||||
|
params = params.set("applicationType", applicationType);
|
||||||
|
|
||||||
|
|
||||||
const options = {
|
const options = {
|
||||||
|
|||||||
Reference in New Issue
Block a user