mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-21 05:45:50 +00:00
improve
This commit is contained in:
+24
-38
@@ -24,7 +24,28 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div" >
|
||||
<div class="ion-item-class-2 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class flex-grow-1 justify-center align-center material-inputs " [class.input-error]="Form?.get('CalendarName')?.invalid && validateFrom ">
|
||||
|
||||
<mat-form-field appearance="none" class="width-100" color="ion-color-secondary" placeholder="Selecione agenda">
|
||||
<mat-select [(value)]="CalendarOwnerName" (selectionChange)="changeAgenda()">
|
||||
|
||||
<mat-option *ngFor="let calendars of calendarService.calendarNamesAry" value="{{calendars}}">
|
||||
<div *ngIf="calendars != 'Meu calendario' "> Calendário de {{calendars}} </div>
|
||||
<div *ngIf="calendars == 'Meu calendario'"> {{calendars}} </div>
|
||||
|
||||
</mat-option>
|
||||
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div width-100">
|
||||
<div class="ion-item-class-2 width-100">
|
||||
@@ -37,7 +58,7 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div" *ngIf="calendarService.hasOwnCalendar == true && calendarService.hasSharedCalendar == true" >
|
||||
<div class="container-div" >
|
||||
<div class="ion-item-class-2 d-flex">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
@@ -46,12 +67,8 @@
|
||||
|
||||
<mat-form-field appearance="none" class="width-100" color="ion-color-secondary" placeholder="Selecione agenda">
|
||||
<mat-select [(value)]="CalendarName" >
|
||||
<!-- <mat-select [(value)]="postEvent.CalendarName" > -->
|
||||
<mat-option value="myCalendar">
|
||||
Meu Calendário
|
||||
</mat-option>
|
||||
<mat-option value="sharedCalendar">
|
||||
Calendário de {{ sessionStore.user.ManagerName}}
|
||||
<mat-option *ngFor="let calendars of CalendarNamesOptions" value="{{calendars}}">
|
||||
{{ calendars }}
|
||||
</mat-option>
|
||||
|
||||
</mat-select>
|
||||
@@ -61,37 +78,6 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="container-div">
|
||||
<div class="ion-item-class-2">
|
||||
<div class="ion-icon-class">
|
||||
<ion-icon slot="start" src="assets/images/icons-calendar.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class" >
|
||||
<ion-select
|
||||
class="d-block d-md-none"
|
||||
[(ngModel)]="postData.CalendarName"
|
||||
placeholder="Selecione repetição"
|
||||
interface="action-sheet"
|
||||
Cancel-text="Cancelar" required>
|
||||
<ion-select-option value="Oficial">Oficial</ion-select-option>
|
||||
<ion-select-option value="Pessoal">Pessoal</ion-select-option>
|
||||
</ion-select>
|
||||
|
||||
|
||||
<mat-form-field floatLabel="never" appearance="none" class="d-none d-md-block width-100">
|
||||
<mat-select placeholder="Selecione agenda" [(ngModel)]="postData.CalendarName" >
|
||||
<mat-option value="Oficial">
|
||||
Oficial
|
||||
</mat-option>
|
||||
<mat-option value="Pessoal">
|
||||
Pessoal
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</mat-form-field>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="container-div">
|
||||
|
||||
+47
-15
@@ -64,6 +64,7 @@ export class BookMeetingModalPage implements OnInit {
|
||||
|
||||
public dateControlStart = new FormControl(moment("DD MM YYYY hh"));
|
||||
public dateControlEnd = new FormControl(moment("DD MM YYYY hh"));
|
||||
CalendarNamesOptions = ['Oficial', 'Pessoal']
|
||||
|
||||
Form: FormGroup;
|
||||
validateFrom = false
|
||||
@@ -116,7 +117,9 @@ export class BookMeetingModalPage implements OnInit {
|
||||
loggeduser: LoginUserRespose;
|
||||
emptyTextDescription = "Sem intervenientes selecionados";
|
||||
|
||||
CalendarName: 'myCalendar' | 'sharedCalendar' = 'myCalendar'
|
||||
CalendarName = ''
|
||||
CalendarOwnerName = ''
|
||||
|
||||
sessionStore = SessionStore;
|
||||
|
||||
constructor(
|
||||
@@ -145,17 +148,6 @@ export class BookMeetingModalPage implements OnInit {
|
||||
|
||||
this.postData.Category = 'Reunião'
|
||||
|
||||
|
||||
|
||||
if(this.calendarService.hasOwnCalendar == false || !this.calendarService.hasSharedCalendar == false) {
|
||||
|
||||
if(this.calendarService.hasOwnCalendar == false && this.calendarService.hasSharedCalendar == true) {
|
||||
this.CalendarName = 'sharedCalendar'
|
||||
} else if (this.calendarService.hasOwnCalendar == true && this.calendarService.hasSharedCalendar == false) {
|
||||
this.CalendarName = 'myCalendar'
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -174,6 +166,29 @@ export class BookMeetingModalPage implements OnInit {
|
||||
}
|
||||
|
||||
|
||||
changeAgenda() {
|
||||
|
||||
setTimeout(() => {
|
||||
|
||||
if(this.calendarService.calendarNamesType[this.CalendarOwnerName]?.['Oficial'] && this.calendarService.calendarNamesType[this.CalendarOwnerName]?.['Pessoal']) {
|
||||
|
||||
this.CalendarNamesOptions = ['Oficial', 'Pessoal']
|
||||
} else if (this.calendarService.calendarNamesType[this.CalendarOwnerName]?.['Oficial']) {
|
||||
|
||||
this.CalendarNamesOptions = ['Oficial']
|
||||
this.CalendarName = 'Oficial'
|
||||
} else if (this.calendarService.calendarNamesType[this.CalendarOwnerName]?.['Pessoal']) {
|
||||
|
||||
this.CalendarNamesOptions = ['Pessoal']
|
||||
this.CalendarName = 'Pessoal'
|
||||
} else {
|
||||
|
||||
this.CalendarNamesOptions = ['Oficial', 'Pessoal']
|
||||
}
|
||||
}, 50)
|
||||
|
||||
}
|
||||
|
||||
setDefaultTime() {
|
||||
this.postData.StartDate = new Date()
|
||||
this.postData.EndDate = (new Date(new Date().getTime() + 15 * 60000))
|
||||
@@ -278,8 +293,8 @@ export class BookMeetingModalPage implements OnInit {
|
||||
const loader = this.toastService.loading()
|
||||
|
||||
try {
|
||||
|
||||
await this.calendarService.genericPostExpedientEvent(this.task.DocId, this.postData, "",this.task.SerialNumber, this.task.FsId, this.CalendarName).toPromise();
|
||||
const CalendarId = this.selectedCalendarId()
|
||||
await this.calendarService.genericPostExpedientEvent(this.task.DocId, this.postData, "",this.task.SerialNumber, this.task.FsId, CalendarId).toPromise();
|
||||
|
||||
this.modalController.dismiss();
|
||||
this.toastService._successMessage('Reunião criada');
|
||||
@@ -298,7 +313,8 @@ export class BookMeetingModalPage implements OnInit {
|
||||
const loader = this.toastService.loading()
|
||||
try {
|
||||
|
||||
await this.calendarService.genericCreateTaskEvent(this.task.FolderID | this.task.FolderId, this.postData, "",this.task.SerialNumber, this.task.FsId, this.CalendarName).toPromise();
|
||||
const CalendarId = this.selectedCalendarId()
|
||||
await this.calendarService.genericCreateTaskEvent(this.task.FolderID | this.task.FolderId, this.postData, "",this.task.SerialNumber, this.task.FsId, CalendarId).toPromise();
|
||||
|
||||
this.close();
|
||||
this.toastService._successMessage('Reunião criada');
|
||||
@@ -315,6 +331,22 @@ export class BookMeetingModalPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
selectedCalendarId () {
|
||||
|
||||
if (this.calendarService.calendarNamesType[this.CalendarOwnerName]?.['Oficial']) {
|
||||
return this.calendarService.calendarNamesType[this.CalendarOwnerName]['OficialId']
|
||||
|
||||
} else if (this.calendarService.calendarNamesType[this.CalendarOwnerName]?.['Pessoal']) {
|
||||
|
||||
return this.calendarService.calendarNamesType[this.CalendarOwnerName]['PessoalId']
|
||||
|
||||
} else {
|
||||
return '11:11'
|
||||
}
|
||||
}
|
||||
|
||||
async addParticipants() {
|
||||
|
||||
this.adding = "intervenient";
|
||||
|
||||
Reference in New Issue
Block a user