mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
Many changes
Edit event
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
/* This file stores all the keys */
|
||||
export class AuthConnstants{
|
||||
/* My reference key */
|
||||
public static readonly AUTH = 'userDataKey'
|
||||
public static readonly AUTH = 'userDataKey';
|
||||
public static readonly PROFILE = 'profile';
|
||||
}
|
||||
@@ -96,7 +96,7 @@ const routes: Routes = [
|
||||
path:'event-list',
|
||||
children: [
|
||||
{
|
||||
path:'',
|
||||
path:':profile',
|
||||
loadChildren: ()=> import('../pages/gabinete-digital/event-list/event-list.module').then(m => m.EventListPageModule)
|
||||
},
|
||||
]
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
<ion-icon name="search"></ion-icon>
|
||||
<ion-label>Pesquisa</ion-label>
|
||||
</ion-tab-button> -->
|
||||
<ion-tab-button tab="chat">
|
||||
<!-- <ion-tab-button tab="chat">
|
||||
<ion-icon name="chatbubbles"></ion-icon>
|
||||
<ion-label>Chat</ion-label>
|
||||
</ion-tab-button>
|
||||
</ion-tab-button> -->
|
||||
</ion-tab-bar>
|
||||
|
||||
</ion-tabs>
|
||||
|
||||
@@ -119,6 +119,7 @@ export class AgendaPage implements OnInit {
|
||||
component: CalModalPage,
|
||||
componentProps:{
|
||||
segment: this.segment,
|
||||
profile: this.profile,
|
||||
eventSelectedDate: this.eventSelectedDate,
|
||||
},
|
||||
cssClass: 'cal-modal',
|
||||
@@ -147,7 +148,6 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
async loadRangeEvents(startTime: Date, endTime: Date){
|
||||
this.showLoader = true;
|
||||
|
||||
switch (this.segment)
|
||||
{
|
||||
case "Combinada":
|
||||
@@ -210,7 +210,8 @@ export class AgendaPage implements OnInit {
|
||||
this.myCal.loadEvents();
|
||||
this.showLoader = false;
|
||||
});
|
||||
}else{
|
||||
}
|
||||
else{
|
||||
this.eventService.getAllPrEvents(formatDate(startTime, 'yyyy-MM-dd HH:mm:ss', 'pt'), formatDate(endTime, 'yyyy-MM-dd HH:mm:ss', 'pt')).subscribe(response => {
|
||||
this.eventsListPessoal = response.filter(data => data.CalendarName == "Pessoal");;
|
||||
this.eventsListPessoal.forEach(element => {
|
||||
@@ -227,9 +228,8 @@ export class AgendaPage implements OnInit {
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case "Oficial":
|
||||
//Inicializa o array eventSource
|
||||
this.eventSource=[];
|
||||
@@ -266,14 +266,12 @@ export class AgendaPage implements OnInit {
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
doRefresh(ev: any){
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
|
||||
setTimeout(() => {
|
||||
ev.target.complete();
|
||||
}, 250);
|
||||
|
||||
@@ -10,6 +10,7 @@ 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',
|
||||
@@ -43,15 +44,20 @@ export class CalModalPage implements OnInit {
|
||||
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');
|
||||
|
||||
@@ -127,9 +133,14 @@ export class CalModalPage implements OnInit {
|
||||
}
|
||||
|
||||
save(){
|
||||
if (this.ionicForm.valid)
|
||||
{
|
||||
this.eventService.postEvent(this.postEvent, this.postEvent.CalendarName, "md").subscribe();
|
||||
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{
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { EventDetailModalPage } from './event-detail-modal.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: EventDetailModalPage
|
||||
}
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class EventDetailModalPageRoutingModule {}
|
||||
@@ -0,0 +1,20 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { EventDetailModalPageRoutingModule } from './event-detail-modal-routing.module';
|
||||
|
||||
import { EventDetailModalPage } from './event-detail-modal.page';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
EventDetailModalPageRoutingModule
|
||||
],
|
||||
declarations: [EventDetailModalPage]
|
||||
})
|
||||
export class EventDetailModalPageModule {}
|
||||
@@ -0,0 +1,215 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button defaultHref="{{ backURL }}"></ion-back-button>
|
||||
</ion-buttons>
|
||||
<ion-title>Visualizar Evento</ion-title>
|
||||
<ion-buttons slot="end">
|
||||
<button (click)="deleteConfirm()" class="ion-icon-delete">
|
||||
<ion-icon name="trash"></ion-icon>
|
||||
</button>
|
||||
</ion-buttons>
|
||||
</ion-toolbar>
|
||||
</ion-header>
|
||||
|
||||
<ion-content padding>
|
||||
<div *ngIf="loadedEvent">
|
||||
<ion-item-group>
|
||||
<ion-item-sliding>
|
||||
<form [formGroup]="ionicForm" novalidate>
|
||||
<ion-item>
|
||||
<ion-label class="capitalizeText" position="stacked">Assunto</ion-label>
|
||||
<ion-input class="capitalizeText" [(ngModel)]="loadedEvent.Subject" formControlName="subject" type="text" required></ion-input>
|
||||
</ion-item>
|
||||
<!-- Error messages -->
|
||||
<span class="error ion-padding" *ngIf="errorControl.subject.errors?.required">
|
||||
Campo obrigatório
|
||||
</span>
|
||||
</form>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Descrição</ion-label>
|
||||
<ion-input class="capitalizeText" [(ngModel)]='loadedEvent.Body.Text'></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Localização</ion-label>
|
||||
<ion-input class="capitalizeText" [(ngModel)]='loadedEvent.Location'></ion-input>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Calendário</ion-label>
|
||||
<ion-select class="capitalizeText" placeholder="{{loadedEvent.CalendarName}}" [(ngModel)]="loadedEvent.CalendarName" interface="action-sheet" class="custom-options" Cancel-text="Cancelar">
|
||||
<ion-select-option Pessoal="Reunião">Pessoal</ion-select-option>
|
||||
<ion-select-option Oficial="Viagem">Oficial</ion-select-option>
|
||||
</ion-select>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Tipo do evento</ion-label>
|
||||
<ion-select placeholder="{{loadedEvent.EventType}}" [(ngModel)]="loadedEvent.EventType" interface="action-sheet" class="custom-options" Cancel-text="Cancelar">
|
||||
<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>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Data Início</ion-label>
|
||||
<ion-datetime value="{{loadedEvent.StartDate}}" [(ngModel)]="loadedEvent.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"></ion-datetime>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Data Fim</ion-label>
|
||||
<ion-datetime value="{{loadedEvent.EndDate}}" [(ngModel)]="loadedEvent.EndDate" min="2020" max="2100"
|
||||
displayFormat="D MMM YYYY HH:mm" minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"></ion-datetime>
|
||||
</ion-item>
|
||||
|
||||
<div class="div-attach" >
|
||||
<ion-item>
|
||||
<ion-buttons slot="end" (click)="openAttendees()">
|
||||
<ion-label color="secondary">Editar</ion-label>
|
||||
</ion-buttons>
|
||||
<ion-label class="attach-label">Participantes</ion-label>
|
||||
</ion-item>
|
||||
<div *ngIf="loadedEvent.Attendees">
|
||||
<div *ngFor="let attendee of loadedEvent.Attendees; let i=index">
|
||||
<div *ngIf="i<1">
|
||||
<ion-list >
|
||||
<ion-item class="attendees" lines="none" >
|
||||
<ion-icon class="attendees-icon" name="person" slot="start"></ion-icon>
|
||||
<ion-label class="capitalizeText" class="attendees-list">{{attendee.Name}}</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div *ngIf="loadedEvent.Attendees.length > 1">
|
||||
<ion-button class="see-more-button" fill="none" shape="round" (click)="openAttendees()">
|
||||
<ion-label color="secondary">Ver mais...</ion-label>
|
||||
</ion-button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="div-attach">
|
||||
<ion-item>
|
||||
<ion-buttons slot="end" (click)="showAlert()">
|
||||
<ion-label color="secondary">Editar</ion-label>
|
||||
</ion-buttons>
|
||||
<ion-label class="attach-label">Anexos</ion-label>
|
||||
</ion-item>
|
||||
<div *ngIf="loadedEventAttachments">
|
||||
<div *ngFor="let att of loadedEventAttachments; let j=index">
|
||||
<div *ngIf="j<2">
|
||||
<ion-list *ngIf="loadedEvent.HasAttachments">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<ion-item lines="none" (click)="viewDocument(att.Link)">
|
||||
<ion-icon name="attach" slot="start"></ion-icon>
|
||||
<ion-label>
|
||||
<p>{{ att.Description }}</p>
|
||||
<p>{{ att.CreateDate }}</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="loadedEventAttachments.length > 1">
|
||||
<ion-button class="see-more-button" fill="none" shape="round" (click)="openAttachments()"><!-- [routerLink]="['/home/attachments', loadedEvent.EventId]" -->
|
||||
<ion-label color="secondary">Ver mais...</ion-label>
|
||||
</ion-button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Skeleton Attachment -->
|
||||
<ion-list *ngIf="!loadedEventAttachments">
|
||||
<ion-item lines="none" >
|
||||
<ion-icon name="attach" slot="start"></ion-icon>
|
||||
<ion-label>
|
||||
<p> <ion-skeleton-text animated></ion-skeleton-text></p>
|
||||
<p> <ion-skeleton-text animated></ion-skeleton-text></p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
<!-- No attachment message -->
|
||||
<ion-list *ngIf="!loadedEvent.HasAttachments">
|
||||
<ion-item lines="none" >
|
||||
<ion-label>
|
||||
Sem anexos
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
</ion-item-sliding>
|
||||
</ion-item-group>
|
||||
</div>
|
||||
<!-- Skeleton screen -->
|
||||
<div *ngIf="!loadedEvent">
|
||||
<div class="ion-padding custom-skeleton">
|
||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
||||
<ion-skeleton-text animated></ion-skeleton-text>
|
||||
<ion-skeleton-text animated style="width: 88%"></ion-skeleton-text>
|
||||
<ion-skeleton-text animated style="width: 70%"></ion-skeleton-text>
|
||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
||||
</div>
|
||||
|
||||
<ion-list>
|
||||
<ion-list-header>
|
||||
<ion-label>
|
||||
<ion-skeleton-text animated style="width: 20%"></ion-skeleton-text>
|
||||
</ion-label>
|
||||
</ion-list-header>
|
||||
<ion-item>
|
||||
<ion-avatar slot="start">
|
||||
<ion-skeleton-text animated></ion-skeleton-text>
|
||||
</ion-avatar>
|
||||
<ion-label>
|
||||
<h3>
|
||||
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
|
||||
</h3>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
|
||||
</p>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
||||
</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-thumbnail slot="start">
|
||||
<ion-skeleton-text animated></ion-skeleton-text>
|
||||
</ion-thumbnail>
|
||||
<ion-label>
|
||||
<h3>
|
||||
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
|
||||
</h3>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
|
||||
</p>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
||||
</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
<ion-item>
|
||||
<ion-skeleton-text animated style="width: 27px; height: 27px" slot="start"></ion-skeleton-text>
|
||||
<ion-label>
|
||||
<h3>
|
||||
<ion-skeleton-text animated style="width: 50%"></ion-skeleton-text>
|
||||
</h3>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 80%"></ion-skeleton-text>
|
||||
</p>
|
||||
<p>
|
||||
<ion-skeleton-text animated style="width: 60%"></ion-skeleton-text>
|
||||
</p>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
</ion-content>
|
||||
<ion-footer>
|
||||
<ion-toolbar>
|
||||
<div class="event-detail-buttons">
|
||||
<ion-button shape="round" (click)="Save()">Gravar</ion-button>
|
||||
</div>
|
||||
</ion-toolbar>
|
||||
</ion-footer>
|
||||
|
||||
@@ -0,0 +1,95 @@
|
||||
ion-item-group{
|
||||
margin: 15px;
|
||||
}
|
||||
.div-item{
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
border-bottom: 1px solid #ccc;
|
||||
margin: 10px 0 5px 0;
|
||||
}
|
||||
.div-up{
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
.div-up h3{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 17px;
|
||||
width: 100%;
|
||||
}
|
||||
.div-icon{
|
||||
width: 10%;
|
||||
font-size: 22px;
|
||||
float: left;
|
||||
color: #808080;
|
||||
}
|
||||
.div-icon ion-icon{
|
||||
display: block;
|
||||
margin: 0 auto;
|
||||
|
||||
}
|
||||
.div-content-attachment{
|
||||
width: 85%;
|
||||
float: left;
|
||||
padding: 0 0 0 12px;
|
||||
}
|
||||
.ion-icon-attach{
|
||||
color: #666666;
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.btn-attach{
|
||||
margin: 15px 0 0 0;
|
||||
--color: #333;
|
||||
--border-color:#333;
|
||||
}
|
||||
.div-card-button{
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
padding: 0 !important;
|
||||
}
|
||||
ion-card{
|
||||
margin: 2.5% !important;
|
||||
width: 45%;
|
||||
float: left;
|
||||
}
|
||||
.center{
|
||||
text-align: center;
|
||||
float: center;
|
||||
}
|
||||
|
||||
/* FFOTER */
|
||||
.event-detail-buttons{
|
||||
width: 90%;
|
||||
margin: 10px auto;
|
||||
}
|
||||
.event-detail-buttons ion-button{
|
||||
width: 90%;
|
||||
margin: 0 auto;
|
||||
display: block;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
.ion-icon-delete{
|
||||
font-size: 22px;
|
||||
color: red;
|
||||
background-color: white;
|
||||
padding-right: 5px;
|
||||
}
|
||||
.error{
|
||||
color:red;
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
/* .event-detail-buttons{
|
||||
margin-bottom: 80px;
|
||||
margin-top: 10px;
|
||||
} */
|
||||
.attendees-icon{
|
||||
font-size: 14px;
|
||||
}
|
||||
.see-more-button{
|
||||
text-transform: initial;
|
||||
font-size: 16px;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
import { IonicModule } from '@ionic/angular';
|
||||
|
||||
import { EventDetailModalPage } from './event-detail-modal.page';
|
||||
|
||||
describe('EventDetailModalPage', () => {
|
||||
let component: EventDetailModalPage;
|
||||
let fixture: ComponentFixture<EventDetailModalPage>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ EventDetailModalPage ],
|
||||
imports: [IonicModule.forRoot()]
|
||||
}).compileComponents();
|
||||
|
||||
fixture = TestBed.createComponent(EventDetailModalPage);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
}));
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,227 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { AlertController, ModalController, NavParams } from '@ionic/angular';
|
||||
import { Attachment } from 'src/app/models/attachment.model';
|
||||
import { Event } from 'src/app/models/event.model';
|
||||
import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AttachmentsService } from 'src/app/services/attachments.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { AttachmentsPage } from '../attachments/attachments.page';
|
||||
import { AttendeesPage } from '../attendees/attendees.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-event-detail-modal',
|
||||
templateUrl: './event-detail-modal.page.html',
|
||||
styleUrls: ['./event-detail-modal.page.scss'],
|
||||
})
|
||||
export class EventDetailModalPage implements OnInit {
|
||||
|
||||
loadedEvent: Event;
|
||||
loadedEventAttachments: Attachment[];
|
||||
pageId: string;
|
||||
showLoader: boolean;
|
||||
backURL: string;
|
||||
ionicForm: FormGroup;
|
||||
isSubmitted = false;
|
||||
|
||||
minDate: Date;
|
||||
|
||||
profile:string;
|
||||
|
||||
constructor(
|
||||
public formBuilder: FormBuilder,
|
||||
public alertController: AlertController,
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
private eventsService: EventsService,
|
||||
private modalCtrl: ModalController,
|
||||
private alertService: AlertService,
|
||||
private attachamentsService: AttachmentsService,
|
||||
private route: Router,
|
||||
private iab: InAppBrowser) {
|
||||
this.loadedEvent = new Event();
|
||||
this.loadedEvent.Body = new EventBody();
|
||||
}
|
||||
ngOnInit() {
|
||||
this.loadEvent();
|
||||
this.loadAttachments();
|
||||
this.ionicForm = this.formBuilder.group({
|
||||
subject: ['', [Validators.required]]
|
||||
})
|
||||
}
|
||||
|
||||
get errorControl() {
|
||||
return this.ionicForm.controls;
|
||||
}
|
||||
|
||||
loadEvent(){
|
||||
let eventid: string;
|
||||
this.activatedRoute.paramMap.subscribe(paramMap =>
|
||||
{
|
||||
if (!paramMap.has("eventId")){
|
||||
return;
|
||||
}
|
||||
else{
|
||||
this.pageId = paramMap.get('eventId');
|
||||
eventid = paramMap.get('eventId');
|
||||
console.log(eventid);
|
||||
|
||||
}
|
||||
if (paramMap.has("caller")){
|
||||
this.backURL = "/home/" + paramMap.get('caller');
|
||||
}
|
||||
}
|
||||
);
|
||||
this.eventsService.getEvent(eventid).subscribe(response => {
|
||||
this.loadedEvent = response;
|
||||
});
|
||||
}
|
||||
|
||||
async openAttendees(){
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: AttendeesPage,
|
||||
componentProps: {
|
||||
eventAttendees: this.loadedEvent.Attendees
|
||||
},
|
||||
cssClass: 'attendee',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data['data'] != null)
|
||||
{
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
this.loadedEvent.Attendees = newattendees;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
getEventAttendees(): EventPerson[]
|
||||
{
|
||||
return this.loadedEvent.Attendees;
|
||||
}
|
||||
|
||||
setEventAttendees(newattendes: EventPerson[])
|
||||
{
|
||||
this.loadedEvent.Attendees = newattendes;
|
||||
}
|
||||
|
||||
async deleteConfirm()
|
||||
{
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Apagar evento!',
|
||||
message: 'Deseja <strong>apagar</strong> o evento da agenda ' + this.loadedEvent.CalendarName + '?',
|
||||
buttons: [
|
||||
{
|
||||
text: 'Não',
|
||||
role: 'cancel',
|
||||
cssClass: 'secondary',
|
||||
handler: () => { }
|
||||
}, {
|
||||
text: 'Sim',
|
||||
handler: () => {
|
||||
this.Delete();
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
await alert.present();
|
||||
}
|
||||
|
||||
Delete()
|
||||
{
|
||||
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0).subscribe(async () =>
|
||||
{
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Evento removido',
|
||||
buttons: ['OK']
|
||||
});
|
||||
|
||||
await alert.present();
|
||||
|
||||
this.router.navigate(['/home/events']);
|
||||
});
|
||||
}
|
||||
|
||||
Save()
|
||||
{
|
||||
if (this.ionicForm.valid)
|
||||
{
|
||||
|
||||
this.eventsService.putEvent(this.loadedEvent, 2, 3, "md").subscribe(async () =>
|
||||
{
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
header: 'Evento actualizado',
|
||||
buttons: ['OK']
|
||||
});
|
||||
|
||||
await alert.present();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
showAlert(){
|
||||
this.alertService.presentAlert("Funcionalidade em desenvolvimento");
|
||||
}
|
||||
|
||||
loadAttachments()
|
||||
{
|
||||
/* this.attachamentsService.getEventAttachments(this.pageId).subscribe(attachments => {
|
||||
this.loadedEventAttachments = attachments;
|
||||
}); */
|
||||
}
|
||||
async viewDocument(documenturl:string)
|
||||
{
|
||||
const url: string = documenturl.replace("webTRIX.Viewer","webTRIX.Viewer.Branch1");
|
||||
/* const browser = this.iab.create(url,"_blank");
|
||||
browser.show(); */
|
||||
}
|
||||
|
||||
back()
|
||||
{
|
||||
//this.back();
|
||||
}
|
||||
doRefresh(event){
|
||||
/* this.RefreshEvents(); */
|
||||
event.target.complete();
|
||||
setTimeout(() => {
|
||||
event.target.complete();
|
||||
}, 2000);
|
||||
|
||||
}
|
||||
navigateTo(ev){
|
||||
this.route.navigate(['/home/events',ev]);
|
||||
}
|
||||
async openAttachments(){
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: AttachmentsPage,
|
||||
componentProps: {
|
||||
eventId: this.pageId,
|
||||
attachments: this.loadedEventAttachments
|
||||
},
|
||||
cssClass: 'attachments',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if (data['data'] != null)
|
||||
{
|
||||
let newattendees: EventPerson[] = data['data'];
|
||||
this.loadedEvent.Attendees = newattendees;
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -19,7 +19,7 @@
|
||||
<form [formGroup]="ionicForm" novalidate>
|
||||
<ion-item>
|
||||
<ion-label class="capitalizeText" position="stacked">Assunto</ion-label>
|
||||
<ion-input class="capitalizeText" [(ngModel)]="loadedEvent.Subject" formControlName="subject" type="text" required></ion-input>
|
||||
<ion-input class="capitalizeText" [(ngModel)]="loadedEvent.Subject" formControlName="subject" type="text" required></ion-input>
|
||||
</ion-item>
|
||||
<!-- Error messages -->
|
||||
<span class="error ion-padding" *ngIf="errorControl.subject.errors?.required">
|
||||
|
||||
@@ -32,8 +32,11 @@ export class EventDetailPage implements OnInit {
|
||||
|
||||
minDate: Date;
|
||||
|
||||
profile:string;
|
||||
|
||||
constructor(public formBuilder: FormBuilder,
|
||||
|
||||
constructor(
|
||||
public formBuilder: FormBuilder,
|
||||
public alertController: AlertController,
|
||||
private router: Router,
|
||||
private activatedRoute: ActivatedRoute,
|
||||
@@ -155,9 +158,16 @@ export class EventDetailPage implements OnInit {
|
||||
|
||||
Save()
|
||||
{
|
||||
if (this.ionicForm.valid)
|
||||
{
|
||||
this.eventsService.putEvent(this.loadedEvent, 2, 3, "md").subscribe(async () =>
|
||||
if (this.ionicForm.valid){
|
||||
|
||||
this.activatedRoute.paramMap.subscribe(paramMap =>{
|
||||
if (paramMap.has("profile")){
|
||||
console.log(paramMap.get('profile'));
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
this.eventsService.editEvent(this.loadedEvent, 2, 3).subscribe(async () =>
|
||||
{
|
||||
const alert = await this.alertController.create({
|
||||
cssClass: 'my-custom-class',
|
||||
@@ -176,9 +186,11 @@ export class EventDetailPage implements OnInit {
|
||||
|
||||
loadAttachments()
|
||||
{
|
||||
/* this.attachamentsService.getEventAttachments(this.pageId).subscribe(attachments => {
|
||||
console.log(this.pageId);
|
||||
|
||||
this.attachamentsService.getEventAttachments(this.pageId).subscribe(attachments => {
|
||||
this.loadedEventAttachments = attachments;
|
||||
}); */
|
||||
});
|
||||
}
|
||||
async viewDocument(documenturl:string)
|
||||
{
|
||||
|
||||
@@ -1,33 +1,37 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { EventsPage } from './events.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: EventsPage
|
||||
},
|
||||
{
|
||||
path: 'event-detail',
|
||||
loadChildren: () => import('./event-detail/event-detail.module').then( m => m.EventDetailPageModule)
|
||||
},
|
||||
{
|
||||
path: 'attachments',
|
||||
loadChildren: () => import('./attachments/attachments.module').then( m => m.AttachmentsPageModule)
|
||||
},
|
||||
{
|
||||
path: 'attendees',
|
||||
loadChildren: () => import('./attendees/attendees.module').then( m => m.AttendeesPageModule)
|
||||
},
|
||||
{
|
||||
path: 'attendee-modal',
|
||||
loadChildren: () => import('./attendee-modal/attendee-modal.module').then( m => m.AttendeeModalPageModule)
|
||||
import { NgModule } from '@angular/core';
|
||||
import { Routes, RouterModule } from '@angular/router';
|
||||
|
||||
import { EventsPage } from './events.page';
|
||||
|
||||
const routes: Routes = [
|
||||
{
|
||||
path: '',
|
||||
component: EventsPage
|
||||
},
|
||||
{
|
||||
path: 'event-detail',
|
||||
loadChildren: () => import('./event-detail/event-detail.module').then( m => m.EventDetailPageModule)
|
||||
},
|
||||
{
|
||||
path: 'attachments',
|
||||
loadChildren: () => import('./attachments/attachments.module').then( m => m.AttachmentsPageModule)
|
||||
},
|
||||
{
|
||||
path: 'attendees',
|
||||
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',
|
||||
loadChildren: () => import('./event-detail-modal/event-detail-modal.module').then( m => m.EventDetailModalPageModule)
|
||||
];
|
||||
}
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
export class EventsPageRoutingModule {}
|
||||
|
||||
];
|
||||
|
||||
@NgModule({
|
||||
imports: [RouterModule.forChild(routes)],
|
||||
exports: [RouterModule],
|
||||
})
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
<ion-list *ngSwitchCase="'Oficial'">
|
||||
<ion-item-group>
|
||||
<ion-item-sliding>
|
||||
<ion-item lines="none"
|
||||
<ion-item lines="none"
|
||||
*ngFor="let event of officialeventsList"
|
||||
[routerLink]="['/home/events', event.EventId, 'events']">
|
||||
<div class="div-item-{{event.CalendarName}}">
|
||||
|
||||
@@ -7,6 +7,11 @@ import { ActivatedRoute, NavigationEnd } from '@angular/router';
|
||||
import { formatDate } from '@angular/common';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { AuthService } from 'src/app/services/auth.service';
|
||||
import { StorageService } from 'src/app/services/storage.service';
|
||||
import { AuthConnstants } from 'src/app/config/auth-constants';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { EventDetailPage } from './event-detail/event-detail.page';
|
||||
import { EventDetailModalPage } from './event-detail-modal/event-detail-modal.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-events',
|
||||
@@ -46,8 +51,10 @@ export class EventsPage implements OnInit {
|
||||
|
||||
constructor(private eventService: EventsService,
|
||||
private router: Router,
|
||||
private storageService:StorageService,
|
||||
public activatedRoute: ActivatedRoute,
|
||||
private alertController: AlertService,
|
||||
private modalController: ModalController,
|
||||
private authService: AuthService) {
|
||||
this.prEventList = null;
|
||||
}
|
||||
@@ -57,6 +64,8 @@ export class EventsPage implements OnInit {
|
||||
this.segment = "Combinada";
|
||||
//Initialize profile as mdgpr
|
||||
this.profile = "mdgpr";
|
||||
console.log(this.profile);
|
||||
|
||||
|
||||
this.showGreeting();
|
||||
|
||||
@@ -65,6 +74,10 @@ export class EventsPage implements OnInit {
|
||||
this.RefreshEvents();
|
||||
}
|
||||
});
|
||||
/* this.storageService.get(AuthConnstants.PROFILE).then(res=>{
|
||||
this.profile = res;
|
||||
}); */
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -93,7 +106,6 @@ export class EventsPage implements OnInit {
|
||||
this.eventsList = res;
|
||||
console.log(this.eventsList);
|
||||
this.showLoader = false;
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
@@ -163,5 +175,31 @@ export class EventsPage implements OnInit {
|
||||
this.router.navigate(['/home/login']);
|
||||
}
|
||||
|
||||
async openEventDetail1(id:any){
|
||||
console.log(id);
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: EventDetailPage,
|
||||
componentProps: {
|
||||
eventId: id,
|
||||
},
|
||||
cssClass: 'event-detail',
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
|
||||
}
|
||||
async openEventDetail(id:any) {
|
||||
const modal = await this.modalController.create({
|
||||
component: EventDetailModalPage,
|
||||
componentProps: {
|
||||
eventId: id,
|
||||
},
|
||||
cssClass: 'my-custom-class'
|
||||
});
|
||||
return await modal.present();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -20,10 +20,15 @@ export class DiscartExpedientModalPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
console.log(this.serialNumber);
|
||||
|
||||
}
|
||||
close(){
|
||||
this.modalController.dismiss();
|
||||
}
|
||||
/* notDelete(){
|
||||
|
||||
} */
|
||||
save(){
|
||||
let body = { "serialNumber": this.serialNumber, "action": "Task Completed" }
|
||||
console.log(body);
|
||||
|
||||
@@ -1,10 +1,19 @@
|
||||
<ion-header>
|
||||
<ion-toolbar>
|
||||
<ion-header class="ion-no-border">
|
||||
<div class="header-content">
|
||||
<div class="header-icon-left">
|
||||
<ion-icon (click)="close()" src="assets/images/icons-arrow-arrow-left.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="header-title">
|
||||
<label>Eventos para Aprovação</label>
|
||||
</div>
|
||||
|
||||
<!-- <ion-toolbar>
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button defaultHref="/gabinete-digital"></ion-back-button>
|
||||
<ion-back-button (click) ="close()"></ion-back-button>
|
||||
</ion-buttons>
|
||||
<ion-icon (click)="close()" src="assets/images/icons-arrow-arrow-left.svg"></ion-icon>
|
||||
<ion-title>Eventos para Aprovação</ion-title>
|
||||
</ion-toolbar>
|
||||
</ion-toolbar> -->
|
||||
<ion-toolbar>
|
||||
<ion-segment [(ngModel)]="segment">
|
||||
<ion-segment-button value="MDGPR">
|
||||
@@ -15,6 +24,7 @@
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
</ion-toolbar>
|
||||
</div>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
|
||||
@@ -1,3 +1,24 @@
|
||||
.header-content{
|
||||
width: 360px;
|
||||
overflow: auto;
|
||||
margin: 0 auto;
|
||||
padding-top: 25px;
|
||||
}
|
||||
.header-icon-left{
|
||||
width: 36px;
|
||||
font-size: 33px;
|
||||
color: #42b9fe;
|
||||
float: left;
|
||||
}
|
||||
.header-title{
|
||||
width: 300px;
|
||||
font-family: Roboto;
|
||||
font-size: 25px;
|
||||
margin: 0 5px 0 5px;
|
||||
padding: 0;
|
||||
color:#000;
|
||||
float: left;
|
||||
}
|
||||
ion-item-sliding{
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import { EventBody } from 'src/app/models/eventbody.model';
|
||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||
import { Event } from 'src/app/models/event.model';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { ModalController, NavParams } from '@ionic/angular';
|
||||
import { ApproveEventModalPage } from '../../agenda/approve-event-modal/approve-event-modal.page';
|
||||
import { NavigationEnd, Router } from '@angular/router';
|
||||
|
||||
@@ -27,10 +27,16 @@ export class EventListPage implements OnInit {
|
||||
private processes:ProcessesService,
|
||||
private modalController: ModalController,
|
||||
private router: Router,
|
||||
private navParams: NavParams,
|
||||
) { }
|
||||
|
||||
S
|
||||
ngOnInit() {
|
||||
this.segment = "MDGPR";
|
||||
this.segment = this.navParams.get('segment');
|
||||
/* console.log(this.navParams.get('md')); */
|
||||
console.log(this.segment);
|
||||
this.LoadToApproveEvents();
|
||||
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationEnd && event.url == this.router.url) {
|
||||
this.LoadToApproveEvents();
|
||||
@@ -71,6 +77,9 @@ export class EventListPage implements OnInit {
|
||||
event.target.complete();
|
||||
}, 2000);
|
||||
}
|
||||
close(){
|
||||
this.modalController.dismiss(null);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+22
-12
@@ -11,6 +11,7 @@ import { StorageService } from 'src/app/services/storage.service';
|
||||
import { AddParticipantsCcModalPage } from '../add-participants-cc-modal/add-participants-cc-modal.page';
|
||||
import { AddParticipantsModalPage } from '../add-participants-modal/add-participants-modal.page';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { DiscartExpedientModalPage } from '../../discart-expedient-modal/discart-expedient-modal.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-expedient-task-modal',
|
||||
@@ -66,13 +67,14 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.task = this.navParams.get('task');
|
||||
this.taskDate = new Date(this.task.taskStartDate);
|
||||
/* this.authService.userData$.subscribe((res:any)=>{
|
||||
console.log(res);
|
||||
});
|
||||
console.log(this.user); */
|
||||
console.log(this.task)
|
||||
console.log(this.task.serialNumber);
|
||||
|
||||
}
|
||||
|
||||
close(){
|
||||
@@ -98,6 +100,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
}
|
||||
console.log(this.postData);
|
||||
this.processes.postDespatcho(this.postData);
|
||||
|
||||
break;
|
||||
case '1':
|
||||
this.postData = {
|
||||
@@ -122,8 +125,8 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
this.processes.postDeferimento(this.postData);
|
||||
break;
|
||||
}
|
||||
this.router.navigate(['/home/gabinete-digital/expediente']);
|
||||
this.modalController.dismiss(null);
|
||||
this.distartExpedientModal();
|
||||
this.close();
|
||||
}
|
||||
|
||||
async addParticipants(){
|
||||
@@ -135,14 +138,10 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
cssClass: 'add-participants-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((res) => {
|
||||
this.taskParticipants = res.data;
|
||||
|
||||
let newattendees: EventPerson[] = res['data'];
|
||||
|
||||
if(newattendees!= null){
|
||||
newattendees.forEach(newattendee => {
|
||||
let att = {
|
||||
@@ -159,6 +158,7 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
console.log(this.postData);
|
||||
});
|
||||
}
|
||||
|
||||
async addParticipantsCc(){
|
||||
const modal = await this.modalController.create({
|
||||
component: AddParticipantsCcModalPage,
|
||||
@@ -168,14 +168,10 @@ export class ExpedientTaskModalPage implements OnInit {
|
||||
cssClass: 'add-participants-cc-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
|
||||
await modal.present();
|
||||
|
||||
modal.onDidDismiss().then((res) => {
|
||||
this.taskParticipantsCc = res.data;
|
||||
|
||||
let newattendees: EventPerson[] = res['data'];
|
||||
|
||||
if(newattendees!= null){
|
||||
newattendees.forEach(newattendee => {
|
||||
let att = {
|
||||
@@ -193,4 +189,18 @@ export class ExpedientTaskModalPage 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();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -14,11 +14,11 @@
|
||||
<ion-card-header>
|
||||
<ion-card-title>Eventos para Aprovação</ion-card-title>
|
||||
<ion-card-content>
|
||||
<ion-item [routerLink]="['/home/gabinete-digital/event-list']">
|
||||
<ion-item (click)="openEventsToApproveList('MDGPR')">
|
||||
<ion-label>Minha agenda</ion-label>
|
||||
<ion-button slot="end">{{count_ev_md}}</ion-button>
|
||||
</ion-item>
|
||||
<ion-item [routerLink]="['/home/gabinete-digital/event-list']" class="ion-item-change-color">
|
||||
<ion-item (click)="openEventsToApproveList('PR')" class="ion-item-change-color"><!-- [routerLink]="['/home/gabinete-digital/event-list', 'pr']" -->
|
||||
<ion-label>Agenda do Presidente</ion-label>
|
||||
<ion-button slot="end">{{count_ev_pr}}</ion-button>
|
||||
</ion-item>
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { ProcessesService } from 'src/app/services/processes.service';
|
||||
import { AlertService } from 'src/app/services/alert.service';
|
||||
import { EventsService } from 'src/app/services/events.service';
|
||||
import { ModalController } from '@ionic/angular';
|
||||
import { EventListPage } from './event-list/event-list.page';
|
||||
|
||||
@Component({
|
||||
selector: 'app-gabinete-digital',
|
||||
@@ -12,7 +15,11 @@ export class GabineteDigitalPage implements OnInit {
|
||||
segment:string;
|
||||
showLoader: boolean;
|
||||
|
||||
constructor(private processesbackend:ProcessesService, private alertService: AlertService) { }
|
||||
constructor(
|
||||
private processesbackend:ProcessesService,
|
||||
private modalController: ModalController,
|
||||
private eventService: EventsService,
|
||||
private alertService: AlertService) { }
|
||||
|
||||
count_exp_dailywork : number;
|
||||
count_exp_pp : string;
|
||||
@@ -25,6 +32,12 @@ export class GabineteDigitalPage implements OnInit {
|
||||
|
||||
ngOnInit() {
|
||||
this.LoadCounts();
|
||||
/* this.eventService.getAllMdEvents.subscribe(res=>{
|
||||
console.log(res);
|
||||
|
||||
});
|
||||
console.log(this.eventService.getAllPrEvents.length);
|
||||
*/
|
||||
}
|
||||
|
||||
LoadCounts() {
|
||||
@@ -47,8 +60,6 @@ export class GabineteDigitalPage implements OnInit {
|
||||
this.count_de_pr = "-";
|
||||
this.count_ev_md='-';
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
doRefresh(event) {
|
||||
@@ -63,5 +74,18 @@ export class GabineteDigitalPage implements OnInit {
|
||||
{
|
||||
this.alertService.presentAlert('Funcionalidade em desenvolvimento');
|
||||
}
|
||||
|
||||
async openEventsToApproveList(segment:any){
|
||||
const modal = await this.modalController.create({
|
||||
component: EventListPage,
|
||||
componentProps:{
|
||||
segment: segment,
|
||||
},
|
||||
cssClass: 'expedient-task-modal',
|
||||
backdropDismiss: false
|
||||
});
|
||||
await modal.present();
|
||||
modal.onDidDismiss();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ export class LoginPage implements OnInit {
|
||||
ngOnInit() {
|
||||
|
||||
}
|
||||
/* Function to validade the login inputs */
|
||||
//Function to validade the login inputs
|
||||
validateInput(){
|
||||
return (
|
||||
this.username.trim().length > 0
|
||||
@@ -60,7 +60,7 @@ export class LoginPage implements OnInit {
|
||||
if(res.data){
|
||||
this.storageService.store(AuthConnstants.AUTH, res.data);
|
||||
console.log('Log RockectChat OK');
|
||||
/* console.log(res.data); */
|
||||
//console.log(res.data);
|
||||
|
||||
}
|
||||
else{
|
||||
@@ -79,6 +79,7 @@ export class LoginPage implements OnInit {
|
||||
async Login(){
|
||||
try {
|
||||
//Go to our home in home/feed.
|
||||
//this.router.navigate(['/home/events']);
|
||||
if(this.validateInput()){
|
||||
this.userattempt = {
|
||||
username: this.username,
|
||||
@@ -86,20 +87,19 @@ export class LoginPage implements OnInit {
|
||||
domainName: environment.domain,
|
||||
BasicAuthKey: ""
|
||||
}
|
||||
if (await this.authService.login(this.userattempt))
|
||||
{
|
||||
if (await this.authService.login(this.userattempt)){
|
||||
this.loginAction();
|
||||
console.log('Log Gabinete Digital OK');
|
||||
this.router.navigate(['/home/events']);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* this.toastService.presentToast('Não foi possível fazer login"'); */
|
||||
//this.toastService.presentToast('Não foi possível fazer login"');
|
||||
this.presentAlert('O nome de utilizador e palavra-passe estão incorretas ou verifique a sua conexão com a internet e volte a tentar.');
|
||||
}
|
||||
}
|
||||
else{
|
||||
/* this.toastService.presentToast('Preencha todos campos'); */
|
||||
//this.toastService.presentToast('Preencha todos campos');
|
||||
this.presentAlert('Por favor, insira o seu nome de utilizador e palavra-passe.');
|
||||
}
|
||||
} catch (error) {
|
||||
|
||||
@@ -62,6 +62,12 @@ export class AuthService {
|
||||
})
|
||||
}
|
||||
|
||||
getProfile(){
|
||||
this.storageService.get(AuthConnstants.PROFILE).then(res=>{
|
||||
return res;
|
||||
});
|
||||
}
|
||||
|
||||
logoutChat(){
|
||||
//this.storageService.clear();
|
||||
this.storageService.removeStorageItem(AuthConnstants.AUTH).then(res =>{
|
||||
|
||||
@@ -82,8 +82,10 @@ export class EventsService {
|
||||
}
|
||||
|
||||
getEvent(eventid: string): Observable<Event>{
|
||||
let geturl = environment.apiURL + 'Calendar/GetEvent';
|
||||
let geturl = environment.apiURL + 'calendar/GetEvent';
|
||||
let params = new HttpParams();
|
||||
console.log(eventid);
|
||||
|
||||
|
||||
params = params.set("EventId", eventid);
|
||||
|
||||
@@ -112,6 +114,23 @@ export class EventsService {
|
||||
return this.http.put<Event>(`${puturl}`, event, options)
|
||||
}
|
||||
|
||||
editEvent(event: Event, conflictResolutionMode:number, sendInvitationsOrCancellationsMode:number): Observable<Event>
|
||||
{
|
||||
const puturl = environment.apiURL + 'calendar/PutEvent';
|
||||
|
||||
let params = new HttpParams();
|
||||
|
||||
params = params.set("conflictResolutionMode", conflictResolutionMode.toString());
|
||||
params = params.set("sendInvitationsOrCancellationsMode", sendInvitationsOrCancellationsMode.toString());
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
|
||||
return this.http.put<Event>(`${puturl}`, event, options)
|
||||
}
|
||||
|
||||
postEvent(event:Event, calendarName:string, sharedagenda:string)
|
||||
{
|
||||
const puturl = environment.apiURL + 'calendar/' + ((sharedagenda != '') ? sharedagenda : 'PostEvent');
|
||||
@@ -126,6 +145,36 @@ export class EventsService {
|
||||
|
||||
return this.http.post<Event>(`${puturl}`, event, options)
|
||||
}
|
||||
|
||||
postEventMd(event:Event, calendarName:string)
|
||||
{
|
||||
const puturl = environment.apiURL + 'calendar/md';
|
||||
let params = new HttpParams();
|
||||
|
||||
params = params.set("CalendarName", calendarName);
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
|
||||
return this.http.post<Event>(`${puturl}`, event, options)
|
||||
}
|
||||
|
||||
postEventPr(event:Event, calendarName:string)
|
||||
{
|
||||
const puturl = environment.apiURL + 'calendar/pr';
|
||||
let params = new HttpParams();
|
||||
|
||||
params = params.set("CalendarName", calendarName);
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
|
||||
return this.http.post<Event>(`${puturl}`, event, options)
|
||||
}
|
||||
|
||||
deleteEvent(eventid:string, deletemode:number)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user