diff --git a/src/app/app.component.ts b/src/app/app.component.ts index fadb07747..14ab0d183 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -12,7 +12,8 @@ import { SqliteService } from 'src/app/services/sqlite.service'; import { BackgroundService } from 'src/app/services/background.service'; import { ScreenOrientation } from '@ionic-native/screen-orientation/ngx'; import { StorageService } from 'src/app/services/storage.service'; -import { MessageModel } from './models/beast-orm' +import { MessageModel } from './models/beast-orm'; +import { InativityService } from "src/app/services/inativity.service"; const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { parse: { @@ -43,7 +44,8 @@ export class AppComponent { private screenOrientation: ScreenOrientation, private sqliteservice: SqliteService, private backgroundservice: BackgroundService, - private storageservice: StorageService + private storageservice: StorageService, + private InativityService: InativityService ) { // this.createCacheFolder() this.initializeApp(); diff --git a/src/app/home/home.page.ts b/src/app/home/home.page.ts index 732fc50af..6e0f74a4d 100644 --- a/src/app/home/home.page.ts +++ b/src/app/home/home.page.ts @@ -118,7 +118,12 @@ export class HomePage implements OnInit { const pathname = window.location.pathname SessionStore.setUrlBeforeInactivity(pathname) - this.router.navigate(['/inactivity']); + + if (this.platform.is('mobileweb')) { + this.router.navigate(['/inactivity']); + }else{ + this.router.navigate(['/']); + } } } diff --git a/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html b/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html index b9d79ab33..6d53d4669 100644 --- a/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html +++ b/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.html @@ -50,6 +50,28 @@ --> +
+
+
+ +
+
+ + + + + +
Calendário de {{calendars}}
+
{{calendars}}
+
+ +
+
+ +
+
+
+
@@ -61,7 +83,9 @@ [(ngModel)]="postData.CalendarName" placeholder="Selecione repetição" interface="action-sheet" - Cancel-text="Cancelar" required> + Cancel-text="Cancelar" required + (selectionChange)="changeAgenda()" + > Oficial Pessoal diff --git a/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts b/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts index 6a0d130a9..56a0bb27f 100644 --- a/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts +++ b/src/app/modals/document-set-up-meeting/document-set-up-meeting.page.ts @@ -90,6 +90,9 @@ export class DocumentSetUpMeetingPage implements OnInit { docs:any[] = []; eventPipe = new EventPipe() + CalendarName; + CalendarNameShow = true + CalendarNamesOptions constructor( private modalController: ModalController, @@ -99,7 +102,8 @@ export class DocumentSetUpMeetingPage implements OnInit { private toastService: ToastService, private calendarService: EventsService, private eventService: EventService, - public ThemeService: ThemeService + public ThemeService: ThemeService, + public _eventService: EventsService, ) { this.loggeduser = authService.ValidatedUser; this.document = this.navParams.get('document') @@ -165,6 +169,33 @@ export class DocumentSetUpMeetingPage implements OnInit { }) } + changeAgenda() { + + this.CalendarNameShow = false + + setTimeout(() => { + + this.CalendarNameShow = true + + if(this._eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this._eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) { + + this.CalendarNamesOptions = ['Oficial', 'Pessoal'] + + } else if (this._eventService.calendarNamesType[this.CalendarName]?.['Oficial']) { + this.CalendarNamesOptions = ['Oficial'] + this.postData.CalendarName = 'Oficial' + + } else if (this._eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) { + this.CalendarNamesOptions = ['Pessoal'] + this.postData.CalendarName = 'Pessoal' + + } else { + this.CalendarNamesOptions = ['Oficial', 'Pessoal'] + } + }, 50) + + } + async saveTask() { if(this.loggeduser.Profile == 'MDGPR') { @@ -175,7 +206,7 @@ export class DocumentSetUpMeetingPage implements OnInit { let Attendees = this.taskParticipants.concat(this.taskParticipantsCc); - if(this.document.Documents){ + if(this.document.Documents) { this.document.Documents.forEach((e)=> { this.docs.push({ ApplicationId: e.ApplicationId || e.ApplicationType, diff --git a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts index 99941db31..a5a3cec8b 100644 --- a/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts +++ b/src/app/pages/gabinete-digital/despachos-pr/despacho-pr/despacho-pr.page.ts @@ -276,7 +276,6 @@ export class DespachoPrPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() - this.close(); this.toastService._successMessage() } catch (error) { this.toastService._badRequest() @@ -303,7 +302,6 @@ export class DespachoPrPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() this.toastService._successMessage('Processo arquivado') - this.close(); } catch (error) { this.toastService._badRequest('Processo não arquivado') } @@ -326,7 +324,6 @@ export class DespachoPrPage implements OnInit { }).toPromise() this.toastService._successMessage('Processo criado') - this.close(); } catch (error) { this.toastService._badRequest('Processo não criado') } @@ -352,7 +349,6 @@ export class DespachoPrPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() this.toastService._successMessage('') - this.close(); } catch (error) { this.toastService._badRequest() } @@ -379,7 +375,6 @@ export class DespachoPrPage implements OnInit { try { await this.processes.CompleteTask(body).toPromise() this.toastService._successMessage() - this.close(); } catch (error) { this.toastService._badRequest() } @@ -394,12 +389,14 @@ export class DespachoPrPage implements OnInit { } sendExpedienteToPending() { + const loader = this.toastService.loading() this.processes.SetTaskToPending(this.serialNumber).subscribe(res => { this.popoverController.dismiss('close') this.toastService._successMessage('Processo enviado para pendentes') this.goBack() + loader.remove() }, () => { - + loader.remove() this.toastService._badRequest('Processo não encontrado') }); } diff --git a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts index 2a05fb7e1..4d0a0c165 100644 --- a/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts +++ b/src/app/pages/gabinete-digital/despachos/despacho/despacho.page.ts @@ -387,15 +387,17 @@ export class DespachoPage implements OnInit { } async sendExpedienteToPending() { - + const loader = this.toastService.loading() this.despachoService.sendExpedienteToPending(this.serialnumber).subscribe(res => { this.goBack(); + loader.remove() this.toastService.successMessage() }, error => { + loader.remove() this.toastService.badRequest("Processo não enviado para despacho") }); - + // loader.remove() } async openAddNoteModal(actionName: string) { diff --git a/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts b/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts index 6c06b62b5..64b9e95bc 100644 --- a/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts +++ b/src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts @@ -193,9 +193,9 @@ export class ApproveEventModalPage implements OnInit { try { await this.processes.PostTaskAction(body).toPromise() this.router.navigate(['/home/gabinete-digital/event-list']); - this.toastService.successMessage() + this.toastService._successMessage() } catch (error) { - this.toastService.badRequest() + this.toastService._badRequest() this.router.navigate(['/home/gabinete-digital/event-list']); } finally { diff --git a/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts index b4061d4ec..e6852b302 100644 --- a/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts +++ b/src/app/pages/gabinete-digital/event-list/approve-event/approve-event.page.ts @@ -2,12 +2,9 @@ import { Component, OnInit, Input, EventEmitter, Output } from '@angular/core'; import { ActivatedRoute, NavigationExtras, Router } from '@angular/router'; import { AnimationController, MenuController, ModalController, PopoverController } from '@ionic/angular'; import { Event } from 'src/app/models/event.model'; -import { AlertService } from 'src/app/services/alert.service'; -import { AttachmentsService } from 'src/app/services/attachments.service'; import { ProcessesService } from 'src/app/services/processes.service'; import { EmendMessageModalPage } from 'src/app/pages/agenda/emend-message-modal/emend-message-modal.page'; import { EventActionsPopoverPage } from 'src/app/pages/agenda/event-actions-popover/event-actions-popover.page'; -import { InAppBrowser } from '@ionic-native/in-app-browser/ngx'; import { EditEventToApproveComponent } from 'src/app/shared/gabinete-digital/edit-event-to-approve/edit-event.page'; import { ToastService } from 'src/app/services/toast.service'; import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page'; diff --git a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts index e19baa83a..1c5683c65 100644 --- a/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts +++ b/src/app/pages/gabinete-digital/pedidos/pedido/pedido.page.ts @@ -426,10 +426,12 @@ export class PedidoPage implements OnInit { } sendExpedienteToPending() { + const loader = this.toastService.loading() this.processes.SetTaskToPending(this.serialnumber).subscribe(res => { this.goBack(); + loader.remove() }, () => { - + loader.remove() this.toastService._badRequest('Processo não encontrado') }); } diff --git a/src/app/pages/publications/edit-action/edit-action.page.ts b/src/app/pages/publications/edit-action/edit-action.page.ts index 7e582fff8..59517d6af 100644 --- a/src/app/pages/publications/edit-action/edit-action.page.ts +++ b/src/app/pages/publications/edit-action/edit-action.page.ts @@ -22,13 +22,14 @@ export class EditActionPage implements OnInit { public showSeconds = false; public touchUi = false; public enableMeridian = false; - public minDate = new Date().toISOString().slice(0,10) + public minDate = new Date().toISOString() public maxDate: any; public stepHour = 1; public stepMinute = 5; public stepSecond = 5; public dateControlStart = new FormControl(moment("DD MM YYYY hh")); public dateControlEnd = new FormControl(moment("DD MM YYYY hh")); + currentDate = new Date(); folder: PublicationFolder; folderId: string; @@ -64,8 +65,15 @@ export class EditActionPage implements OnInit { } get dateValid() { + var validado: boolean; + if (window.innerWidth <= 800) { - return this.folder.DateBegin < this.folder.DateEnd? ['ok']: [] + if ((this.folder.DateBegin < this.folder.DateEnd) && (new Date(this.folder.DateBegin).getTime() > this.currentDate.getTime())) { + validado = true; + }else{ + validado = false; + } + return validado == true ? ['ok']: []; } else { return ['ok'] } @@ -89,6 +97,11 @@ export class EditActionPage implements OnInit { } async save() { + this.injectValidation() + this.runValidation() + + if(this.Form.invalid) return false + let body = { ProcessId: this.folderId, Description: this.folder.Description, diff --git a/src/app/pages/publications/new-action/new-action.page.ts b/src/app/pages/publications/new-action/new-action.page.ts index 6e086e615..34c7f3dd9 100644 --- a/src/app/pages/publications/new-action/new-action.page.ts +++ b/src/app/pages/publications/new-action/new-action.page.ts @@ -43,13 +43,14 @@ export class NewActionPage implements OnInit { public showSeconds = false; public touchUi = false; public enableMeridian = false; - public minDate = new Date().toISOString().slice(0,10) + public minDate = new Date().toISOString() public endMinDate = new Date(new Date().getTime() + 15 * 60000); public stepHour = 1; public stepMinute = 5; public stepSecond = 5; public dateControlStart = new FormControl(moment("DD MM YYYY hh")); public dateControlEnd = new FormControl(moment("DD MM YYYY hh")); + currentDate = new Date(); showLoader = false @@ -94,8 +95,15 @@ export class NewActionPage implements OnInit { } get dateValid() { + var validado: boolean; + if (window.innerWidth <= 800) { - return this.folder.DateBegin < this.folder.DateEnd? ['ok']: [] + if ((this.folder.DateBegin < this.folder.DateEnd) && (new Date(this.folder.DateBegin).getTime() > this.currentDate.getTime())) { + validado = true; + }else{ + validado = false; + } + return validado == true ? ['ok']: []; } else { return ['ok'] } diff --git a/src/app/pages/publications/publications.page.html b/src/app/pages/publications/publications.page.html index f42b34e44..36689ddd7 100644 --- a/src/app/pages/publications/publications.page.html +++ b/src/app/pages/publications/publications.page.html @@ -30,7 +30,7 @@ -
diff --git a/src/app/pages/publications/publications.page.ts b/src/app/pages/publications/publications.page.ts index 10ef64bf8..345388407 100644 --- a/src/app/pages/publications/publications.page.ts +++ b/src/app/pages/publications/publications.page.ts @@ -401,6 +401,7 @@ export class PublicationsPage implements OnInit { goBackToViewPublications() { this.closeDesktopComponent(); + this.idSelected = this.folderId; this.desktopComponent.showViewPublication = true; } @@ -408,6 +409,7 @@ export class PublicationsPage implements OnInit { // Emitters goBackToPubications() { this.closeDesktopComponent(); + this.idSelected = this.folderId; this.desktopComponent.showViewPublication = true; } @@ -429,6 +431,7 @@ export class PublicationsPage implements OnInit { // edit publication will send null if (folderId != undefined) { this.folderId = folderId; + this.idSelected = this.folderId; } this.publication = publication; @@ -437,6 +440,7 @@ export class PublicationsPage implements OnInit { async editPublication(foolderId: string) { this.closeDesktopComponent(); + this.idSelected = this.folderId; this.desktopComponent.showEditActions = true; } @@ -445,6 +449,7 @@ export class PublicationsPage implements OnInit { this.publicationId = publicationId; this.closeDesktopComponent(); + this.idSelected = this.folderId; this.desktopComponent.showPublicationDetail = true; } diff --git a/src/app/services/chat/room.service.ts b/src/app/services/chat/room.service.ts index 7b319d875..f5cb26c86 100644 --- a/src/app/services/chat/room.service.ts +++ b/src/app/services/chat/room.service.ts @@ -202,12 +202,14 @@ export class RoomService { if(this.t === 'p') { this.chatService.deleteGroup(body).subscribe(res=>{ - this.wsChatMethodsService.deleteRoom(this.id) + this.wsChatMethodsService.deleteRoom(this.id); + this.wsChatMethodsService.getAllRooms(); }); } else { this.chatService.deleteChannel(body).subscribe(res=>{ - this.wsChatMethodsService.deleteRoom(this.id) + this.wsChatMethodsService.deleteRoom(this.id); + this.wsChatMethodsService.getAllRooms(); }); } }); diff --git a/src/app/services/chat/ws-chat-methods.service.ts b/src/app/services/chat/ws-chat-methods.service.ts index 3afc12ba9..06c30dc08 100644 --- a/src/app/services/chat/ws-chat-methods.service.ts +++ b/src/app/services/chat/ws-chat-methods.service.ts @@ -14,7 +14,6 @@ import { SortService } from '../functions/sort.service'; import { chatUser } from 'src/app/models/chatMethod'; import { NfService } from 'src/app/services/chat/nf.service' import { ChangeProfileService } from '../change-profile.service'; -import { UserSession } from 'src/app/models/user.model'; import { AuthService } from '../auth.service'; import { ChatStorageService } from './chat-storage.service'; import { ChatMethodsService } from './chat-methods.service'; diff --git a/src/app/services/inativity.service.ts b/src/app/services/inativity.service.ts index 1ea52ceca..a4892dd1d 100644 --- a/src/app/services/inativity.service.ts +++ b/src/app/services/inativity.service.ts @@ -11,7 +11,7 @@ export class InativityService { private router: Router, ) { - var t; + var time; window.onload = resetTimer; window.onmousemove = resetTimer; window.onmousedown = resetTimer; // catches touchscreen presses as well @@ -28,8 +28,8 @@ export class InativityService { } function resetTimer() { - clearTimeout(t); - t = setTimeout(userIsNotActive, 60000 * 5); // time is in milliseconds + clearTimeout(time); + time = setTimeout(userIsNotActive, 60000 * 5); // time is in milliseconds } } } diff --git a/src/app/shared/agenda/approve-event/approve-event.page.html b/src/app/shared/agenda/approve-event/approve-event.page.html index e3f5efea6..3ebb71116 100644 --- a/src/app/shared/agenda/approve-event/approve-event.page.html +++ b/src/app/shared/agenda/approve-event/approve-event.page.html @@ -66,9 +66,14 @@

{{customDate}}

das {{loadedEvent.workflowInstanceDataFields.StartDate | date: 'HH:mm'}} às {{loadedEvent.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}

-

{{loadedEvent.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ loadedEvent.workflowInstanceDataFields.StartDate | date: 'dd/M/yy'}}

-

(Não se repete)

-

Repete

+

{{loadedEvent.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ loadedEvent.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}}

+

+ Diário + Semanal + Mensal + Anual + (Não se repete) +

diff --git a/src/app/shared/agenda/approve-event/approve-event.page.ts b/src/app/shared/agenda/approve-event/approve-event.page.ts index 84340d863..443d71d60 100644 --- a/src/app/shared/agenda/approve-event/approve-event.page.ts +++ b/src/app/shared/agenda/approve-event/approve-event.page.ts @@ -71,6 +71,7 @@ export class ApproveEventPage implements OnInit { this.processes.GetTask(this.serialNumber).subscribe(res => { this.loadedEvent = res; + console.log(this.loadedEvent); this.today = new Date(res.workflowInstanceDataFields.StartDate); // this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); @@ -86,9 +87,9 @@ export class ApproveEventPage implements OnInit { try { await this.processes.PostTaskAction(body).toPromise() this.modalController.dismiss(serialNumber); - this.toastService.successMessage() + this.toastService._successMessage() } catch (error) { - this.toastService.badRequest() + this.toastService._badRequest() } finally { this.close() loader.remove() @@ -105,9 +106,9 @@ export class ApproveEventPage implements OnInit { try { await this.processes.PostTaskAction(body).toPromise() - this.toastService.successMessage('Evento rejeitado') + this.toastService._successMessage('Evento rejeitado') } catch (error) { - this.toastService.badRequest('Processo não efectuado') + this.toastService._badRequest('Processo não efectuado') } finally { loader.remove() this.close() @@ -184,17 +185,17 @@ export class ApproveEventPage implements OnInit { try { await this.processes.PostTaskAction(body).toPromise(); - this.toastService.successMessage('Pedido enviado'); + this.toastService._successMessage('Pedido enviado'); this.close(); } catch (error) { - this.toastService.badRequest(); + this.toastService._badRequest(); } finally { loader.remove() } } else{ - - } + this.toastService._badRequest('É necessário adicionar uma nota'); + } }); } diff --git a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.html b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.html index 9aba6682d..01dfd4946 100644 --- a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.html +++ b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.html @@ -159,7 +159,7 @@ @@ -197,8 +197,8 @@ diff --git a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts index 7fa166360..248230c96 100644 --- a/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts +++ b/src/app/shared/agenda/edit-event-to-approve/edit-event-to-approve.page.ts @@ -41,7 +41,7 @@ export class EditEventToApprovePage implements OnInit { public showSeconds = false; public touchUi = false; public enableMeridian = false; - public minDate = new Date().toISOString().slice(0,10) + public minDate = new Date() public endMinDate = new Date(new Date().getTime() + 15 * 60000); public maxDate: any; public stepHour = 1; @@ -179,6 +179,9 @@ export class EditEventToApprovePage implements OnInit { } onSelectedRecurringChanged(ev:any) { + + this.calculetedLastOccurrence(ev); + if(ev.length > 1) { this.eventProcess.workflowInstanceDataFields.OccurrenceType = ev.filter(data => data != '-1'); @@ -188,6 +191,44 @@ export class EditEventToApprovePage implements OnInit { } } + calculetedLastOccurrence(type:number){ + var valor; + var opcao: boolean; + if (type == 0) { + valor = 7; + opcao = true; + } else if(type == 1){ + valor = 30; + opcao = true; + } else if(type == 2){ + valor = 1; + opcao = false; + }else if(type == 3){ + valor = 5; + opcao = false; + } + this.defineLastOccurrence(valor, opcao); + } + + + defineLastOccurrence(valor:number, opcao:boolean){ + var time = new Date(this.eventProcess.workflowInstanceDataFields.EndDate); + if (opcao == true) { + time.setDate(time.getDate() + valor); + this.eventProcess.workflowInstanceDataFields.LastOccurrence = time; + } else { + time = new Date( + time.getFullYear() + valor, + time.getMonth(), + time.getDate(), + time.getHours(), + time.getMinutes() + ); + this.eventProcess.workflowInstanceDataFields.LastOccurrence = time; + } + + } + setOtherData() { if(this.eventProcess.workflowInstanceDataFields.ParticipantsList) { this.eventProcess.workflowInstanceDataFields.ParticipantsList.forEach(e => { @@ -276,7 +317,10 @@ export class EditEventToApprovePage implements OnInit { if(this.Form.invalid) return false // set dates to eventProcess object - this.getDatepickerData() + this.dateControlStart = new FormControl(moment(new Date(this.eventProcess.workflowInstanceDataFields.StartDate)).add(1, 'hours')); + this.dateControlEnd = new FormControl(moment(new Date(this.eventProcess.workflowInstanceDataFields.EndDate)).add(1, 'hours')); + // this.restoreDatepickerData() + // this.getDatepickerData() this.taskParticipantsCc.forEach( e => { e.IsRequired = false @@ -291,13 +335,14 @@ export class EditEventToApprovePage implements OnInit { } }) + const event: EventToApproveEdit = { SerialNumber: this.eventProcess.serialNumber, Body: this.eventProcess.workflowInstanceDataFields.Body, Location: this.eventProcess.workflowInstanceDataFields.Location, Subject: this.eventProcess.workflowInstanceDataFields.Subject, - StartDate: this.eventProcess.workflowInstanceDataFields.StartDate, - EndDate: this.eventProcess.workflowInstanceDataFields.EndDate, + StartDate: this.dateControlStart.value, + EndDate: this.dateControlEnd.value, ReviewUserComment: '', Agenda: this.eventProcess.workflowInstanceDataFields.Agenda, MDName: this.eventProcess.workflowInstanceDataFields.MDName, @@ -472,7 +517,6 @@ export class EditEventToApprovePage implements OnInit { } getDatepickerData() { - this.eventProcess.workflowInstanceDataFields.StartDate = this.dateStart this.eventProcess.workflowInstanceDataFields.EndDate = this.dateEnd diff --git a/src/app/shared/agenda/edit-event/edit-event.page.html b/src/app/shared/agenda/edit-event/edit-event.page.html index 00c2e0949..f533c3b11 100644 --- a/src/app/shared/agenda/edit-event/edit-event.page.html +++ b/src/app/shared/agenda/edit-event/edit-event.page.html @@ -118,6 +118,7 @@ [(ngModel)]="postEvent.StartDate" [max]="maxDate" [disabled]="disabled" + [min]="currentDate" > { this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString(); @@ -225,6 +220,8 @@ export class EditEventPage implements OnInit { } onSelectedRecurringChanged(ev:any){ + + this.calculetedLastOccurrence(ev); if(ev.length > 1){ @@ -235,6 +232,45 @@ export class EditEventPage implements OnInit { } } + calculetedLastOccurrence(type:number){ + console.log(type); + var valor; + var opcao: boolean; + if (type == 0) { + valor = 7; + opcao = true; + } else if(type == 1){ + valor = 30; + opcao = true; + } else if(type == 2){ + valor = 1; + opcao = false; + }else if(type == 3){ + valor = 5; + opcao = false; + } + this.defineLastOccurrence(valor, opcao); + } + + + defineLastOccurrence(valor:number, opcao:boolean){ + var time = new Date(this.postEvent.EndDate); + if (opcao == true) { + time.setDate(time.getDate() + valor); + this.postEvent.EventRecurrence.LastOccurrence = time; + } else { + time = new Date( + time.getFullYear() + valor, + time.getMonth(), + time.getDate(), + time.getHours(), + time.getMinutes() + ); + this.postEvent.EventRecurrence.LastOccurrence = time; + } + + } + async save() { diff --git a/src/app/shared/agenda/event-list/event-list.page.scss b/src/app/shared/agenda/event-list/event-list.page.scss index 72b9e85f6..a9ce19c12 100644 --- a/src/app/shared/agenda/event-list/event-list.page.scss +++ b/src/app/shared/agenda/event-list/event-list.page.scss @@ -98,6 +98,7 @@ font-style: normal; line-height: normal; letter-spacing: normal; + text-transform: none ; color: var(--title-text-color); margin: 0; padding: 0; diff --git a/src/app/shared/agenda/new-event/new-event.page.html b/src/app/shared/agenda/new-event/new-event.page.html index c51ac294f..f70060fab 100644 --- a/src/app/shared/agenda/new-event/new-event.page.html +++ b/src/app/shared/agenda/new-event/new-event.page.html @@ -128,6 +128,7 @@ placeholder="Choose a date" [(ngModel)]="postEvent.StartDate" [disabled]="disabled" + [min]="currentDate" > 1){ this.postEvent.EventRecurrence.Type = ev.filter(data => data != '-1'); @@ -373,8 +376,45 @@ export class NewEventPage implements OnInit { } } + calculetedLastOccurrence(type:number){ + console.log(type); + var valor; + var opcao: boolean; + if (type == 0) { + valor = 7; + opcao = true; + } else if(type == 1){ + valor = 30; + opcao = true; + } else if(type == 2){ + valor = 1; + opcao = false; + }else if(type == 3){ + valor = 5; + opcao = false; + } + this.defineLastOccurrence(valor, opcao); + } + defineLastOccurrence(valor:number, opcao:boolean){ + var time = new Date(this.postEvent.EndDate); + if (opcao == true) { + time.setDate(time.getDate() + valor); + this.postEvent.EventRecurrence.LastOccurrence = time; + } else { + time = new Date( + time.getFullYear() + valor, + time.getMonth(), + time.getDate(), + time.getHours(), + time.getMinutes() + ); + this.postEvent.EventRecurrence.LastOccurrence = time; + } + + } + async save() { this.injectValidation() diff --git a/src/app/shared/agenda/view-event/view-event.page.html b/src/app/shared/agenda/view-event/view-event.page.html index 834cf7de3..185e14d62 100644 --- a/src/app/shared/agenda/view-event/view-event.page.html +++ b/src/app/shared/agenda/view-event/view-event.page.html @@ -53,13 +53,12 @@

{{customDate}}

das {{loadedEvent.StartDate | date: 'HH:mm'}} às {{loadedEvent.EndDate | date: 'HH:mm'}}

{{loadedEvent.StartDate | date: 'd/M/yy' }} - {{ loadedEvent.StartDate | date: 'dd/M/yy'}}

-

(Não se repete)

-

+

Diário Semanal Mensal Anual - Nunca + (Não se repete)

diff --git a/src/app/shared/agenda/view-event/view-event.page.ts b/src/app/shared/agenda/view-event/view-event.page.ts index 8cf67a75b..8855a1897 100644 --- a/src/app/shared/agenda/view-event/view-event.page.ts +++ b/src/app/shared/agenda/view-event/view-event.page.ts @@ -105,6 +105,7 @@ export class ViewEventPage implements OnInit { this.eventsService.getEvent(this.eventId).subscribe(res => { this.loadedEvent = res; + console.log(this.loadedEvent); this.today = new Date(res.StartDate); this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); }, (error)=> { diff --git a/src/app/shared/publication/edit-action/edit-action.page.html b/src/app/shared/publication/edit-action/edit-action.page.html index 173d6e34f..1c10a1a44 100644 --- a/src/app/shared/publication/edit-action/edit-action.page.html +++ b/src/app/shared/publication/edit-action/edit-action.page.html @@ -36,7 +36,7 @@ diff --git a/src/app/shared/publication/edit-action/edit-action.page.ts b/src/app/shared/publication/edit-action/edit-action.page.ts index 42312aa68..7569c9a76 100644 --- a/src/app/shared/publication/edit-action/edit-action.page.ts +++ b/src/app/shared/publication/edit-action/edit-action.page.ts @@ -29,6 +29,7 @@ export class EditActionPage implements OnInit { public stepSecond = 5; public dateControlStart = new FormControl(moment("DD MM YYYY hh")); public dateControlEnd = new FormControl(moment("DD MM YYYY hh")); + public currentDate = new Date(); folder: PublicationFolder; @Input() folderId: string; diff --git a/src/app/shared/publication/new-action/new-action.page.html b/src/app/shared/publication/new-action/new-action.page.html index b46192da2..1304afdd1 100644 --- a/src/app/shared/publication/new-action/new-action.page.html +++ b/src/app/shared/publication/new-action/new-action.page.html @@ -46,6 +46,7 @@ placeholder="Choose a date*" [(ngModel)]="folder.DateBegin" [disabled]="disabled" + [min]="currentDate" >