mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
git pull made
This commit is contained in:
@@ -343,7 +343,7 @@ export class CreateProcessPage implements OnInit {
|
||||
DispatchFolder: this.dispatchFolder,
|
||||
AttachmentList: docs
|
||||
}
|
||||
|
||||
|
||||
try {
|
||||
if (this.task.activityInstanceName == 'Tarefa de Despacho' || this.task.activityInstanceName == 'Reexecutar Despacho') {
|
||||
await this.despachoService.createParecer(this.postData).toPromise();
|
||||
|
||||
@@ -147,6 +147,11 @@ ion-list {
|
||||
.notification-icon {
|
||||
font-size: rem(35) !important;
|
||||
}
|
||||
|
||||
.notification-icon-error {
|
||||
width: 30px !important;
|
||||
height: 30px !important;
|
||||
}
|
||||
.approve-event-time {
|
||||
width: fit-content !important;
|
||||
float: left;
|
||||
@@ -161,6 +166,17 @@ ion-list {
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
.approve-event-detail-error {
|
||||
width: calc(100% - 115px) !important;
|
||||
float: left;
|
||||
#profile-title-error {
|
||||
width: 250px;
|
||||
white-space: nowrap;
|
||||
font-size: small
|
||||
;
|
||||
}
|
||||
}
|
||||
.notification-label-MD-official {
|
||||
float: right;
|
||||
width: 5px;
|
||||
|
||||
@@ -5,6 +5,7 @@ export interface Attachment {
|
||||
export interface AttachmentList {
|
||||
ProcessInstanceID?: string;
|
||||
Attachments?: Attachment[];
|
||||
DraftIds?: any
|
||||
}
|
||||
export interface Excludetask {
|
||||
serialNumber: string;
|
||||
@@ -13,6 +14,8 @@ export interface Excludetask {
|
||||
dataFields: {
|
||||
ReviewUserComment?: string,
|
||||
Note?: any
|
||||
InstanceIDNew?: any
|
||||
DraftIds?: any
|
||||
}
|
||||
FolderId?: number;
|
||||
AttachmentList?: AttachmentList | any;
|
||||
|
||||
@@ -33,6 +33,7 @@ import { PermissionService } from 'src/app/services/permission.service';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { RoleIdService } from 'src/app/services/role-id.service'
|
||||
import { EventListStore } from 'src/app/models/agenda/AgendaEventList';
|
||||
import { ContactsService } from 'src/app/services/contacts.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-agenda',
|
||||
@@ -180,7 +181,8 @@ export class AgendaPage implements OnInit {
|
||||
private backgroundservice: BackgroundService,
|
||||
public ThemeService: ThemeService,
|
||||
public p: PermissionService,
|
||||
public RoleIdService: RoleIdService
|
||||
public RoleIdService: RoleIdService,
|
||||
private ContactsService: ContactsService
|
||||
) {
|
||||
|
||||
this.dateAdapter.setLocale('es');
|
||||
|
||||
@@ -17,6 +17,7 @@ import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-pick
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { ContactsService } from 'src/app/services/contacts.service';
|
||||
|
||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||
parse: {
|
||||
@@ -96,7 +97,8 @@ export class EditEventPage implements OnInit {
|
||||
private toastService: ToastService,
|
||||
private router: Router,
|
||||
public ThemeService: ThemeService,
|
||||
private httpErrorHandle: HttpErrorHandle
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
private contactsService: ContactsService
|
||||
) {
|
||||
|
||||
/* this.postEvent = new Event(); */
|
||||
@@ -108,6 +110,20 @@ export class EditEventPage implements OnInit {
|
||||
this.caller = this.navParams.get('caller');
|
||||
this.initCalendarName = this.postEvent.CalendarName;
|
||||
|
||||
|
||||
|
||||
for(const index in this.postEvent.Attendees) {
|
||||
const user = this.postEvent.Attendees[index]
|
||||
|
||||
const userData = this.contactsService.constacts.find(e => user.EmailAddress == e.EmailAddress)
|
||||
if(userData) {
|
||||
this.postEvent.Attendees[index].UserType = userData.UserType
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
if(this.postEvent){
|
||||
if( this.postEvent.Body){
|
||||
if(typeof(this.postEvent.Body.Text) == 'string'){
|
||||
|
||||
@@ -44,6 +44,10 @@ export class DiplomaPage implements OnInit {
|
||||
customDate: any;
|
||||
mergedArray: any = [];
|
||||
|
||||
|
||||
DraftNames = ""
|
||||
DraftIds = ""
|
||||
|
||||
constructor(
|
||||
private processes: ProcessesService,
|
||||
public popoverController: PopoverController,
|
||||
@@ -520,29 +524,34 @@ export class DiplomaPage implements OnInit {
|
||||
this.mergedArray.push(docObject);
|
||||
});
|
||||
}
|
||||
getDraft(split_stringDraft: string[]) {
|
||||
split_stringDraft.forEach(element => {
|
||||
console.log('List of ids', element)
|
||||
this.processes.GetDraftByID(element).subscribe((resd) => {
|
||||
let object = {
|
||||
"ApplicationId": "",
|
||||
"Assunto": resd.data.description,
|
||||
"DocDate": "",
|
||||
"DocId": resd.data.id,
|
||||
"DocNumber": "",
|
||||
"FolderId": "",
|
||||
"Sender": "",
|
||||
"SourceDocId": "",
|
||||
"content": resd.data.content,
|
||||
"path": resd.data.path,
|
||||
"ownerId": resd.data.ownerId,
|
||||
"status": resd.data.status,
|
||||
}
|
||||
this.mergedArray.push(object)
|
||||
console.log('List of draff', resd)
|
||||
})
|
||||
async getDraft(split_stringDraft: string[]) {
|
||||
this.DraftNames = ""
|
||||
|
||||
});
|
||||
for(const strg of split_stringDraft) {
|
||||
console.log('List of ids', strg)
|
||||
const resd = await this.processes.GetDraftByID(strg).toPromise()
|
||||
|
||||
let object = {
|
||||
"ApplicationId": "",
|
||||
"Assunto": resd.data.description,
|
||||
"DocDate": "",
|
||||
"DocId": resd.data.id,
|
||||
"DocNumber": "",
|
||||
"FolderId": "",
|
||||
"Sender": "",
|
||||
"SourceDocId": "",
|
||||
"content": resd.data.content,
|
||||
"path": resd.data.path,
|
||||
"ownerId": resd.data.ownerId,
|
||||
"status": resd.data.status,
|
||||
}
|
||||
this.mergedArray.push(object)
|
||||
this.DraftNames = this.DraftNames + resd.data.description+";"
|
||||
console.log('List of draff', resd)
|
||||
}
|
||||
|
||||
this.DraftNames = this.DraftNames.slice(0, -1);
|
||||
this.DraftIds = this.DraftIds.slice(0, -1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -17,6 +17,8 @@ export class ContactsService {
|
||||
loggeduser: LoginUserRespose;
|
||||
headers: HttpHeaders;
|
||||
|
||||
constacts: EventPerson[] = []
|
||||
|
||||
constructor(
|
||||
private http: HttpClient,
|
||||
user: AuthService,
|
||||
@@ -26,6 +28,10 @@ export class ContactsService {
|
||||
this.changeProfileService.registerCallback(() => {
|
||||
this.setHeader()
|
||||
})
|
||||
|
||||
this.getContacts("").subscribe( result => {
|
||||
this.constacts = result
|
||||
})
|
||||
}
|
||||
|
||||
setHeader() {
|
||||
|
||||
@@ -275,6 +275,8 @@ export class ProcessesService {
|
||||
}
|
||||
|
||||
CompleteTask(body:Excludetask) {
|
||||
|
||||
// double check
|
||||
const geturl = environment.apiURL + 'Tasks/CompleteTask';
|
||||
|
||||
let options = {
|
||||
@@ -283,7 +285,7 @@ export class ProcessesService {
|
||||
return this.http.post<any>(`${geturl}`, body, options)
|
||||
}
|
||||
|
||||
CompleteParecerPrTask(body:any){
|
||||
CompleteParecerPrTask(body:any) {
|
||||
const geturl = environment.apiURL + 'Tasks/CompleteTaskParecerPr';
|
||||
|
||||
let options = {
|
||||
@@ -335,7 +337,24 @@ export class ProcessesService {
|
||||
return this.http.post<any>(`${geturl}`, body, options)
|
||||
}
|
||||
|
||||
postParecer(body:any){
|
||||
postParecer(body:any) {
|
||||
|
||||
try {
|
||||
if(!body.AttachmentList) {
|
||||
body.AttachmentList = {}
|
||||
}
|
||||
if(!body?.dataFields) {
|
||||
body.dataFields = {}
|
||||
}
|
||||
if(!body.dataFields?.DraftIds) {
|
||||
body.dataFields.DraftIds = ""
|
||||
}
|
||||
if(!body.AttachmentList?.DraftIds) {
|
||||
body.AttachmentList.DraftIds = ""
|
||||
}
|
||||
} catch (error) {}
|
||||
|
||||
|
||||
const geturl = environment.apiURL + 'Processes/CreateParecer';
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
@@ -343,7 +362,23 @@ export class ProcessesService {
|
||||
return this.http.post<any>(`${geturl}`, body, options)
|
||||
}
|
||||
|
||||
postParecerPr(body:any){
|
||||
postParecerPr(body:any) {
|
||||
try {
|
||||
if(!body.AttachmentList) {
|
||||
body.AttachmentList = {}
|
||||
}
|
||||
if(!body?.dataFields) {
|
||||
body.dataFields = {}
|
||||
}
|
||||
if(!body.dataFields?.DraftIds) {
|
||||
body.dataFields.DraftIds = ""
|
||||
}
|
||||
if(!body.AttachmentList?.DraftIds) {
|
||||
body.AttachmentList.DraftIds = ""
|
||||
}
|
||||
} catch(error) {}
|
||||
|
||||
|
||||
const geturl = environment.apiURL + 'Processes/CreateParecerPR';
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<ion-content>
|
||||
<div class="main-content">
|
||||
<div class="ion-item-container" [class.input-error]="Form?.get('Subject')?.invalid && validateFrom ">
|
||||
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Assunto*" [(ngModel)]="postEvent.Subject"></ion-input>
|
||||
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Assunto*" [(ngModel)]="_postEvent.Subject"></ion-input>
|
||||
</div>
|
||||
<div *ngIf="Form && validateFrom" >
|
||||
<div *ngIf="Form.get('Subject').invalid " class="input-errror-message">
|
||||
@@ -34,7 +34,7 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-location.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class flex-grow-1" [class.input-error]="Form?.get('Location')?.invalid && validateFrom ">
|
||||
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Localização*" [(ngModel)]="postEvent.Location"></ion-input>
|
||||
<ion-input autocomplete="on" autocorrect="on" spellcheck="true" placeholder="Localização*" [(ngModel)]="_postEvent.Location"></ion-input>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Error messages -->
|
||||
@@ -80,7 +80,7 @@
|
||||
<div class="ion-input-class flex-grow-1">
|
||||
|
||||
<mat-form-field appearance="none" floatLabel="never" class="width-100 " >
|
||||
<mat-select placeholder="Selecione agenda*" [(ngModel)]="postEvent.CalendarName" [disabled]=true>
|
||||
<mat-select placeholder="Selecione agenda*" [(ngModel)]="_postEvent.CalendarName" [disabled]=true>
|
||||
<mat-option *ngFor="let calendars of CalendarNamesOptions" value="{{calendars}}">
|
||||
Agenda {{ calendars }}
|
||||
</mat-option>
|
||||
@@ -100,7 +100,7 @@
|
||||
|
||||
<mat-form-field appearance="none" floatLabel="never" class="width-100" required>
|
||||
<!-- <input matInput type="text" > -->
|
||||
<mat-select placeholder="Selecione o tipo de evento*" matInput [(ngModel)]="postEvent.Category" >
|
||||
<mat-select placeholder="Selecione o tipo de evento*" matInput [(ngModel)]="_postEvent.Category" >
|
||||
<mat-option value="Reunião">
|
||||
Reunião
|
||||
</mat-option>
|
||||
@@ -130,7 +130,7 @@
|
||||
<mat-form-field appearance="none" floatLabel="never" class="date-hour-picker">
|
||||
<input matInput [ngxMatDatetimePicker]="picker1"
|
||||
placeholder="Choose a date"
|
||||
[(ngModel)]="postEvent.StartDate"
|
||||
[(ngModel)]="_postEvent.StartDate"
|
||||
[max]="maxDate"
|
||||
[disabled]="disabled"
|
||||
>
|
||||
@@ -158,10 +158,10 @@
|
||||
<mat-form-field appearance="none" floatLabel="never" floatLabel="never" class="date-hour-picker">
|
||||
<input matInput [ngxMatDatetimePicker]="fim"
|
||||
placeholder="Choose a date"
|
||||
[(ngModel)]="postEvent.EndDate"
|
||||
[(ngModel)]="_postEvent.EndDate"
|
||||
[max]="maxDate"
|
||||
[disabled]="disabled"
|
||||
[min]="postEvent.StartDate"
|
||||
[min]="_postEvent.StartDate"
|
||||
>
|
||||
<mat-datepicker-toggle id="new-fim" matSuffix [for]="fim"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #fim
|
||||
@@ -186,7 +186,7 @@
|
||||
<mat-form-field appearance="none" floatLabel="never" class="width-100" value="false" interface="action-sheet" required>
|
||||
<mat-select
|
||||
placeholder="Selecione repetição*"
|
||||
[(ngModel)]="postEvent.EventRecurrence.Type"
|
||||
[(ngModel)]="_postEvent.EventRecurrence.Type"
|
||||
(ngModelChange)="onSelectedRecurringChanged($event)">
|
||||
<mat-option
|
||||
*ngFor="let recurring of recurringTypes"
|
||||
@@ -200,7 +200,7 @@
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div *ngIf="postEvent.EventRecurrence.Type != '-1'" class="container-div width-100">
|
||||
<div *ngIf="_postEvent.EventRecurrence.Type != '-1'" class="container-div width-100">
|
||||
<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>
|
||||
@@ -210,9 +210,9 @@
|
||||
<mat-form-field class="date-hour-picker">
|
||||
<input matInput [ngxMatDatetimePicker]="occurrrence"
|
||||
placeholder="Choose a date"
|
||||
[(ngModel)]="postEvent.EventRecurrence.LastOccurrence"
|
||||
[(ngModel)]="_postEvent.EventRecurrence.LastOccurrence"
|
||||
[disabled]="disabled"
|
||||
[min]="postEvent.EndDate"
|
||||
[min]="_postEvent.EndDate"
|
||||
>
|
||||
<mat-datepicker-toggle id="last-occurrence" matSuffix [for]="occurrrence"></mat-datepicker-toggle>
|
||||
<ngx-mat-datetime-picker #occurrrence
|
||||
@@ -285,7 +285,7 @@
|
||||
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
|
||||
</div>
|
||||
<div class="ion-input-class-no-height width-100">
|
||||
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="postEvent.Body.Text" placeholder="Detalhes" rows="6" cols="20"></ion-textarea>
|
||||
<ion-textarea autocomplete="on" autocorrect="on" spellcheck="true" [(ngModel)]="_postEvent.Body.Text" placeholder="Detalhes" rows="6" cols="20"></ion-textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -14,6 +14,7 @@ import { ParticipantsPipe } from 'src/app/pipes/participants.pipe';
|
||||
import { ThemeService } from 'src/app/services/theme.service'
|
||||
import { SessionStore } from 'src/app/store/session.service';
|
||||
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
||||
import { ContactsService } from 'src/app/services/contacts.service'
|
||||
|
||||
@Component({
|
||||
selector: 'app-edit-event',
|
||||
@@ -73,6 +74,9 @@ export class EditEventPage implements OnInit {
|
||||
@ViewChild('inicio') inicio: any;
|
||||
@ViewChild('picker1') picker1: any;
|
||||
|
||||
|
||||
@Input() _postEvent: Event;
|
||||
|
||||
public options = [
|
||||
{ value: true, label: 'True' },
|
||||
{ value: false, label: 'False' }
|
||||
@@ -95,24 +99,39 @@ export class EditEventPage implements OnInit {
|
||||
public alertController: AlertController,
|
||||
private attachmentsService: AttachmentsService,
|
||||
public ThemeService: ThemeService,
|
||||
private httpErrorHandle: HttpErrorHandle
|
||||
private httpErrorHandle: HttpErrorHandle,
|
||||
private contactsService: ContactsService
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this._postEvent = this.postEvent
|
||||
if(!this.restoreTemporaryData()) {
|
||||
// clear
|
||||
|
||||
if(this.postEvent) {
|
||||
if( this.postEvent.Body){
|
||||
if(typeof(this.postEvent.Body.Text) == 'string'){
|
||||
this.postEvent.Body.Text = this.postEvent.Body.Text.replace(/<[^>]+>/g, '');
|
||||
if(this._postEvent) {
|
||||
if( this._postEvent.Body){
|
||||
if(typeof(this._postEvent.Body.Text) == 'string'){
|
||||
this._postEvent.Body.Text = this._postEvent.Body.Text.replace(/<[^>]+>/g, '');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this.postEvent.Attendees != null) {
|
||||
const result = this.participantsPipe.transform(this.postEvent.Attendees)
|
||||
|
||||
|
||||
for(const index in this._postEvent.Attendees) {
|
||||
const user = this._postEvent.Attendees[index]
|
||||
|
||||
const userData = this.contactsService.constacts.find(e => user.EmailAddress == e.EmailAddress)
|
||||
if(userData) {
|
||||
this._postEvent.Attendees[index].UserType = userData.UserType
|
||||
} else {
|
||||
console.log('user not set')
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (this._postEvent.Attendees != null) {
|
||||
const result = this.participantsPipe.transform(this._postEvent.Attendees)
|
||||
this.taskParticipants = result.taskParticipants
|
||||
this.taskParticipantsCc = result.taskParticipantsCc
|
||||
|
||||
@@ -124,23 +143,25 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
}
|
||||
|
||||
this.initCalendarName = this.postEvent.CalendarName;
|
||||
this.initCalendarName = this._postEvent.CalendarName;
|
||||
|
||||
this.getRecurrenceTypes();
|
||||
|
||||
setTimeout(() => {
|
||||
this.postEvent.EventRecurrence.Type = this.postEvent.EventRecurrence.Type.toString();
|
||||
this._postEvent.EventRecurrence.Type = this._postEvent.EventRecurrence.Type.toString();
|
||||
|
||||
}, 500);
|
||||
|
||||
|
||||
this.CalendarNameOwnerName = this.eventsService.detectCalendarNameByCalendarId(this.postEvent.CalendarId)
|
||||
this.CalendarNameOwnerName = this.eventsService.detectCalendarNameByCalendarId(this._postEvent.CalendarId)
|
||||
this.changeAgenda()
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
ngOnChanges(changes: any): void {
|
||||
this.loadedEventAttachments = this.postEvent.Attachments
|
||||
this.loadedEventAttachments = this._postEvent.Attachments
|
||||
}
|
||||
|
||||
close() {
|
||||
@@ -166,30 +187,30 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
injectValidation() {
|
||||
|
||||
if (typeof(this.postEvent.EventRecurrence.Type) == 'number') {
|
||||
const str: any = this.postEvent.EventRecurrence.Type.toString()
|
||||
this.postEvent.EventRecurrence.Type = str
|
||||
if (typeof(this._postEvent.EventRecurrence.Type) == 'number') {
|
||||
const str: any = this._postEvent.EventRecurrence.Type.toString()
|
||||
this._postEvent.EventRecurrence.Type = str
|
||||
}
|
||||
|
||||
this.Form = new FormGroup({
|
||||
Subject: new FormControl(this.postEvent.Subject, [
|
||||
Subject: new FormControl(this._postEvent.Subject, [
|
||||
Validators.required,
|
||||
// Validators.minLength(4)
|
||||
]),
|
||||
Location: new FormControl(this.postEvent.Location, [
|
||||
Location: new FormControl(this._postEvent.Location, [
|
||||
Validators.required,
|
||||
]),
|
||||
CalendarName: new FormControl(this.postEvent.CalendarName),
|
||||
Categories: new FormControl(this.postEvent.Category, [
|
||||
CalendarName: new FormControl(this._postEvent.CalendarName),
|
||||
Categories: new FormControl(this._postEvent.Category, [
|
||||
Validators.required
|
||||
]),
|
||||
dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok']: this.postEvent.EventRecurrence.LastOccurrence && new Date(this.postEvent.EventRecurrence.LastOccurrence).getTime() > new Date(this.postEvent.EndDate).getTime() ? 'ok': null, [
|
||||
dateOccurrence: new FormControl(this._postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok']: this._postEvent.EventRecurrence.LastOccurrence && new Date(this._postEvent.EventRecurrence.LastOccurrence).getTime() > new Date(this._postEvent.EndDate).getTime() ? 'ok': null, [
|
||||
Validators.required
|
||||
]),
|
||||
participantes: new FormControl(this.taskParticipants, [
|
||||
// Validators.required
|
||||
]),
|
||||
Date: new FormControl( new Date(this.postEvent.StartDate).toLocaleString('pt') <= new Date(this.postEvent.EndDate).toLocaleString('pt')? 'ok': null,[
|
||||
Date: new FormControl( new Date(this._postEvent.StartDate).toLocaleString('pt') <= new Date(this._postEvent.EndDate).toLocaleString('pt')? 'ok': null,[
|
||||
Validators.required
|
||||
]),
|
||||
|
||||
@@ -254,10 +275,10 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
if(ev.length > 1){
|
||||
|
||||
this.postEvent.EventRecurrence.Type = ev.filter(data => data != '-1');
|
||||
this._postEvent.EventRecurrence.Type = ev.filter(data => data != '-1');
|
||||
}
|
||||
if(ev.length == 0){
|
||||
this.postEvent.EventRecurrence.Type = "-1";
|
||||
this._postEvent.EventRecurrence.Type = "-1";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -282,10 +303,10 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
|
||||
defineLastOccurrence(valor:number, opcao:boolean){
|
||||
var time = new Date(this.postEvent.EndDate);
|
||||
var time = new Date(this._postEvent.EndDate);
|
||||
if (opcao == true) {
|
||||
time.setDate(time.getDate() + valor);
|
||||
this.postEvent.EventRecurrence.LastOccurrence = time;
|
||||
this._postEvent.EventRecurrence.LastOccurrence = time;
|
||||
} else {
|
||||
time = new Date(
|
||||
time.getFullYear() + valor,
|
||||
@@ -294,7 +315,7 @@ export class EditEventPage implements OnInit {
|
||||
time.getHours(),
|
||||
time.getMinutes()
|
||||
);
|
||||
this.postEvent.EventRecurrence.LastOccurrence = time;
|
||||
this._postEvent.EventRecurrence.LastOccurrence = time;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -309,27 +330,27 @@ export class EditEventPage implements OnInit {
|
||||
return false
|
||||
}
|
||||
|
||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
this._postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||
|
||||
if(!this.postEvent.EventRecurrence.hasOwnProperty('Type')) {
|
||||
this.postEvent.EventRecurrence.Type = '-1'
|
||||
if(!this._postEvent.EventRecurrence.hasOwnProperty('Type')) {
|
||||
this._postEvent.EventRecurrence.Type = '-1'
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
if(this.postEvent.EventRecurrence.Type == undefined) {
|
||||
this.postEvent.EventRecurrence.Type = '-1'
|
||||
if(this._postEvent.EventRecurrence.Type == undefined) {
|
||||
this._postEvent.EventRecurrence.Type = '-1'
|
||||
}
|
||||
|
||||
this.showLoader = true;
|
||||
|
||||
try {
|
||||
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
|
||||
await this.eventsService.editEvent(this.postEvent, 2, 3).toPromise()
|
||||
if(this.initCalendarName != this.postEvent.CalendarName) {
|
||||
await this.eventsService.editEvent(this._postEvent, 2, 3).toPromise()
|
||||
if(this.initCalendarName != this._postEvent.CalendarName) {
|
||||
let body = {
|
||||
"EventId": this.postEvent.EventId,
|
||||
"CalendarDestinationName": this.postEvent.CalendarName,
|
||||
"EventId": this._postEvent.EventId,
|
||||
"CalendarDestinationName": this._postEvent.CalendarName,
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -339,11 +360,11 @@ export class EditEventPage implements OnInit {
|
||||
this.showLoader = false;
|
||||
this.httpErrorHandle.httpsSucessMessagge('Editar evento')
|
||||
} else {
|
||||
await this.eventsService.editEvent(this.postEvent, 2, 3, this.postEvent.CalendarId).toPromise()
|
||||
if(this.initCalendarName != this.postEvent.CalendarName) {
|
||||
await this.eventsService.editEvent(this._postEvent, 2, 3, this._postEvent.CalendarId).toPromise()
|
||||
if(this.initCalendarName != this._postEvent.CalendarName) {
|
||||
let body = {
|
||||
"EventId": this.postEvent.EventId,
|
||||
"CalendarDestinationName": this.postEvent.CalendarName,
|
||||
"EventId": this._postEvent.EventId,
|
||||
"CalendarDestinationName": this._postEvent.CalendarName,
|
||||
}
|
||||
|
||||
try {
|
||||
@@ -382,7 +403,7 @@ export class EditEventPage implements OnInit {
|
||||
//data.selected
|
||||
const DocumentToSave = {
|
||||
SourceTitle: e.SourceName,
|
||||
ParentId: this.postEvent.EventId,
|
||||
ParentId: this._postEvent.EventId,
|
||||
Source: '1',
|
||||
SourceId: e.SourceId,
|
||||
ApplicationId: e.ApplicationId.toString(),
|
||||
@@ -429,7 +450,7 @@ export class EditEventPage implements OnInit {
|
||||
saveTemporaryData() {
|
||||
|
||||
window['temp.path:/home/agenda/edit-event.component.ts'] = {
|
||||
postEvent: this.postEvent,
|
||||
postEvent: this._postEvent,
|
||||
eventBody: this.eventBody,
|
||||
segment: this.segment
|
||||
}
|
||||
@@ -440,7 +461,7 @@ export class EditEventPage implements OnInit {
|
||||
const restoredData = window['temp.path:/home/agenda/edit-event.component.ts']
|
||||
|
||||
if(JSON.stringify(restoredData) != "{}" && undefined != restoredData){
|
||||
this.postEvent = restoredData.postEvent
|
||||
this._postEvent = restoredData.postEvent
|
||||
this.eventBody = restoredData.eventBody
|
||||
this.segment = restoredData.segment
|
||||
|
||||
@@ -456,7 +477,7 @@ export class EditEventPage implements OnInit {
|
||||
}
|
||||
|
||||
async getAttachments(eventId: string){
|
||||
if(this.postEvent.HasAttachments) {
|
||||
if(this._postEvent.HasAttachments) {
|
||||
let rest: any;
|
||||
try {
|
||||
rest = this.attachmentsService.getAttachmentsById(eventId).toPromise()
|
||||
@@ -497,7 +518,7 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
const ApplicationIdDocumentToSave: any = {
|
||||
SourceName: data.selected.Assunto,
|
||||
ParentId: this.postEvent.EventId,
|
||||
ParentId: this._postEvent.EventId,
|
||||
SourceId: data.selected.Id,
|
||||
Stakeholders: data.selected.Stakeholders | data.selected.EntidadeOrganicaNome,
|
||||
ApplicationId: data.selected.ApplicationType.toString(),
|
||||
@@ -528,11 +549,11 @@ export class EditEventPage implements OnInit {
|
||||
|
||||
} else if (this.eventsService.calendarNamesType[this.CalendarNameOwnerName]?.['Oficial']) {
|
||||
this.CalendarNamesOptions = ['Oficial']
|
||||
this.postEvent.CalendarName = 'Oficial'
|
||||
this._postEvent.CalendarName = 'Oficial'
|
||||
|
||||
} else if (this.eventsService.calendarNamesType[this.CalendarNameOwnerName]?.['Pessoal']) {
|
||||
this.CalendarNamesOptions = ['Pessoal']
|
||||
this.postEvent.CalendarName = 'Pessoal'
|
||||
this._postEvent.CalendarName = 'Pessoal'
|
||||
|
||||
} else {
|
||||
this.CalendarNamesOptions = ['Oficial', 'Pessoal']
|
||||
|
||||
Reference in New Issue
Block a user