mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 20:47:54 +00:00
merge
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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(['/']);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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')
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -7,19 +7,7 @@ import { IonicModule } from '@ionic/angular';
|
||||
import { GabineteDigitalPageRoutingModule } from './gabinete-digital-routing.module';
|
||||
|
||||
import { GabineteDigitalPage } from './gabinete-digital.page';
|
||||
import { SharedModule } from 'src/app/shared/shared.module';
|
||||
|
||||
import { EventListPage } from 'src/app/shared/agenda/event-list/event-list.page';
|
||||
import { EmptyContainerPage } from 'src/app/shared/empty-container/empty-container.page';
|
||||
import { EventsToApprovePage } from 'src/app/shared/gabinete-digital/events-to-approve/events-to-approve.page';
|
||||
import { ExpedientsPage } from 'src/app/shared/gabinete-digital/expedients/expedients.page';
|
||||
import { PendentesPage } from 'src/app/shared/gabinete-digital/pendentes/pendentes.page';
|
||||
import { PedidosPage } from 'src/app/shared/gabinete-digital/pedidos/pedidos.page';
|
||||
import { DespachosPage } from 'src/app/shared/gabinete-digital/despachos/despachos.page';
|
||||
import { DespachosPrPage } from 'src/app/shared/gabinete-digital/despachos-pr/despachos-pr.page';
|
||||
import { DiplomasPage } from 'src/app/shared/gabinete-digital/diplomas/diplomas.page';
|
||||
import { ExpedientesPrPage } from 'src/app/shared/gabinete-digital/expedientes-pr/expedientes-pr.page';
|
||||
import { DiplomasAssinarPage } from 'src/app/shared/gabinete-digital/diplomas-assinar/diplomas-assinar.page';
|
||||
|
||||
import { EmptyContainerPageModule } from 'src/app/shared/empty-container/empty-container.module';
|
||||
import { EventsToApprovePageModule } from 'src/app/shared/gabinete-digital/events-to-approve/events-to-approve.module';
|
||||
|
||||
@@ -43,7 +43,7 @@ import { SessionStore } from 'src/app/store/session.service';
|
||||
styleUrls: ['./gabinete-digital.page.scss'],
|
||||
})
|
||||
|
||||
export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
export class GabineteDigitalPage implements OnInit {
|
||||
|
||||
segment: string;
|
||||
segmentVista: string;
|
||||
@@ -165,11 +165,6 @@ export class GabineteDigitalPage implements OnInit, DoCheck {
|
||||
this.checkRoutes();
|
||||
|
||||
}
|
||||
|
||||
ngDoCheck(): void {
|
||||
|
||||
}
|
||||
|
||||
closeAllDesktopComponent() {
|
||||
this.desktopComponent = {
|
||||
showEventList: false,
|
||||
|
||||
@@ -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')
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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']
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -66,9 +66,14 @@
|
||||
<ion-label>
|
||||
<p>{{customDate}}</p>
|
||||
<p *ngIf="toDateString(loadedEvent.workflowInstanceDataFields.StartDate) == toDateString(loadedEvent.workflowInstanceDataFields.EndDate)">das {{loadedEvent.workflowInstanceDataFields.StartDate | date: 'HH:mm'}} às {{loadedEvent.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}</p>
|
||||
<p *ngIf="toDateString(loadedEvent.workflowInstanceDataFields.StartDate) != toDateString(loadedEvent.workflowInstanceDataFields.EndDate)">{{loadedEvent.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ loadedEvent.workflowInstanceDataFields.StartDate | date: 'dd/M/yy'}} </p>
|
||||
<p *ngIf="!loadedEvent.workflowInstanceDataFields.IsRecurring">(Não se repete)</p>
|
||||
<p *ngIf="loadedEvent.workflowInstanceDataFields.IsRecurring">Repete</p>
|
||||
<p *ngIf="toDateString(loadedEvent.workflowInstanceDataFields.StartDate) != toDateString(loadedEvent.workflowInstanceDataFields.EndDate)">{{loadedEvent.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ loadedEvent.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} </p>
|
||||
<p>
|
||||
<span *ngIf="loadedEvent.workflowInstanceDataFields.OccurrenceType == 0">Diário</span>
|
||||
<span *ngIf="loadedEvent.workflowInstanceDataFields.OccurrenceType == 1">Semanal</span>
|
||||
<span *ngIf="loadedEvent.workflowInstanceDataFields.OccurrenceType == 2">Mensal</span>
|
||||
<span *ngIf="loadedEvent.workflowInstanceDataFields.OccurrenceType == 3">Anual</span>
|
||||
<span *ngIf="loadedEvent.workflowInstanceDataFields.OccurrenceType == -1">(Não se repete)</span>
|
||||
</p>
|
||||
|
||||
</ion-label>
|
||||
</div>
|
||||
|
||||
@@ -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()]);
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
<mat-form-field appearance="none" class="width-100 date-hour-picker d-none d-md-block">
|
||||
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||
placeholder="Choose a date"
|
||||
[formControl]="dateControlStart"
|
||||
[(ngModel)]="eventProcess.workflowInstanceDataFields.StartDate"
|
||||
[min]="minDate" [max]="maxDate"
|
||||
[disabled]="disabled"
|
||||
>
|
||||
@@ -196,8 +196,8 @@
|
||||
<mat-form-field appearance="none" class="width-100 date-hour-picker d-none d-md-block">
|
||||
<input matInput [ngxMatDatetimePicker]="fim"
|
||||
placeholder="Choose a date"
|
||||
[formControl]="dateControlEnd"
|
||||
[min]="minDate" [max]="maxDate"
|
||||
[(ngModel)]="eventProcess.workflowInstanceDataFields.EndDate"
|
||||
[min]="endMinDate" [max]="maxDate"
|
||||
[disabled]="disabled"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
|
||||
|
||||
@@ -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 => {
|
||||
@@ -274,7 +315,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
|
||||
@@ -289,13 +333,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,
|
||||
@@ -506,7 +551,6 @@ export class EditEventToApprovePage implements OnInit {
|
||||
}
|
||||
|
||||
getDatepickerData() {
|
||||
|
||||
this.eventProcess.workflowInstanceDataFields.StartDate = this.dateStart
|
||||
this.eventProcess.workflowInstanceDataFields.EndDate = this.dateEnd
|
||||
|
||||
|
||||
@@ -118,6 +118,7 @@
|
||||
[(ngModel)]="postEvent.StartDate"
|
||||
[max]="maxDate"
|
||||
[disabled]="disabled"
|
||||
[min]="currentDate"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #picker1
|
||||
@@ -146,6 +147,7 @@
|
||||
[(ngModel)]="postEvent.EndDate"
|
||||
[max]="maxDate"
|
||||
[disabled]="disabled"
|
||||
[min]="currentDate"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #fim
|
||||
|
||||
@@ -48,6 +48,7 @@ export class EditEventPage implements OnInit {
|
||||
public stepHour = 1;
|
||||
public stepMinute = 5;
|
||||
public stepSecond = 5;
|
||||
currentDate = new Date();
|
||||
|
||||
Form: FormGroup;
|
||||
validateFrom = false
|
||||
@@ -118,14 +119,6 @@ export class EditEventPage implements OnInit {
|
||||
this.setIntervenient.emit(this.taskParticipants);
|
||||
this.setIntervenientCC.emit(this.taskParticipantsCc);
|
||||
|
||||
this.isEventEdited = false;
|
||||
|
||||
if(this.postEvent.IsRecurring == false) {
|
||||
this.isRecurring = "Não se repete";
|
||||
}
|
||||
else{
|
||||
this.isRecurring = "Repete";
|
||||
}
|
||||
}
|
||||
|
||||
this.initCalendarName = this.postEvent.CalendarName;
|
||||
@@ -136,6 +129,8 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString();
|
||||
|
||||
this.postEvent.EventRecurrence.LastOccurrence = this.currentDate;
|
||||
|
||||
setTimeout(() => {
|
||||
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() {
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -128,6 +128,7 @@
|
||||
placeholder="Choose a date"
|
||||
[(ngModel)]="postEvent.StartDate"
|
||||
[disabled]="disabled"
|
||||
[min]="currentDate"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #picker1
|
||||
@@ -159,6 +160,7 @@
|
||||
placeholder="Choose a date"
|
||||
[(ngModel)]="postEvent.EndDate"
|
||||
[disabled]="disabled"
|
||||
[min]="currentDate"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #fim
|
||||
|
||||
@@ -63,6 +63,7 @@ export class NewEventPage implements OnInit {
|
||||
public stepHour = 1;
|
||||
public stepMinute = 5;
|
||||
public stepSecond = 5;
|
||||
currentDate = new Date();
|
||||
public color: ThemePalette = 'primary';
|
||||
recurringTypes = []
|
||||
selectedRecurringType: any;
|
||||
@@ -364,6 +365,8 @@ export class NewEventPage implements OnInit {
|
||||
|
||||
onSelectedRecurringChanged(ev:any){
|
||||
|
||||
this.calculetedLastOccurrence(ev);
|
||||
|
||||
if(ev.length > 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()
|
||||
|
||||
@@ -53,13 +53,12 @@
|
||||
<p>{{customDate}}</p>
|
||||
<p *ngIf="toDateString(loadedEvent.StartDate) == toDateString(loadedEvent.EndDate)">das {{loadedEvent.StartDate | date: 'HH:mm'}} às {{loadedEvent.EndDate | date: 'HH:mm'}}</p>
|
||||
<p *ngIf="toDateString(loadedEvent.StartDate) != toDateString(loadedEvent.EndDate)">{{loadedEvent.StartDate | date: 'd/M/yy' }} - {{ loadedEvent.StartDate | date: 'dd/M/yy'}} </p>
|
||||
<p *ngIf="!loadedEvent.IsRecurring">(Não se repete)</p>
|
||||
<p *ngIf="loadedEvent.IsRecurring">
|
||||
<p>
|
||||
<span *ngIf="loadedEvent.EventRecurrence.Type == 0">Diário</span>
|
||||
<span *ngIf="loadedEvent.EventRecurrence.Type == 1">Semanal</span>
|
||||
<span *ngIf="loadedEvent.EventRecurrence.Type == 2">Mensal</span>
|
||||
<span *ngIf="loadedEvent.EventRecurrence.Type == 3">Anual</span>
|
||||
<span *ngIf="loadedEvent.EventRecurrence.Type == -1">Nunca</span>
|
||||
<span *ngIf="loadedEvent.EventRecurrence.Type == -1">(Não se repete)</span>
|
||||
</p>
|
||||
|
||||
</ion-label>
|
||||
|
||||
@@ -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)=> {
|
||||
|
||||
@@ -36,7 +36,7 @@
|
||||
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||
placeholder="Choose a date*"
|
||||
[(ngModel)]="folder.DateBegin"
|
||||
[min]="minDate"
|
||||
[min]="currentDate"
|
||||
[disabled]="disabled"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
placeholder="Choose a date*"
|
||||
[(ngModel)]="folder.DateBegin"
|
||||
[disabled]="disabled"
|
||||
[min]="currentDate"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker1"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #picker1
|
||||
@@ -82,6 +83,7 @@
|
||||
placeholder="Choose a date*"
|
||||
[(ngModel)]="folder.DateEnd"
|
||||
[disabled]="disabled"
|
||||
[min]="currentDate"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-inicio" matSuffix [for]="picker2"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #picker2
|
||||
|
||||
@@ -25,6 +25,7 @@ export class NewActionPage implements OnInit {
|
||||
public stepHour = 1;
|
||||
public stepMinute = 5;
|
||||
public stepSecond = 5;
|
||||
currentDate = new Date();
|
||||
public endMinDate = new Date(new Date().getTime() + 15 * 60000);
|
||||
|
||||
Form: FormGroup;
|
||||
|
||||
@@ -53,10 +53,10 @@ export class ViewPublicationsPage implements OnInit {
|
||||
this.folderId = this.folderId['ProcessId']
|
||||
}
|
||||
|
||||
this.getPublicationsIds();
|
||||
this.getPublicationDetail();
|
||||
//this.getPublicationsIds();
|
||||
|
||||
window['app-view-publications-page-doRefresh'] = this.doRefresh
|
||||
this.getPublicationDetail();
|
||||
}
|
||||
|
||||
ngOnChanges(changes: any): void {
|
||||
@@ -196,6 +196,7 @@ export class ViewPublicationsPage implements OnInit {
|
||||
}
|
||||
|
||||
async openEditPublication(folderId?:any){
|
||||
|
||||
if( window.innerWidth < 701) {
|
||||
const modal = await this.modalController.create({
|
||||
component: EditActionPage,
|
||||
|
||||
Reference in New Issue
Block a user