mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
save
This commit is contained in:
@@ -41,7 +41,7 @@ export class EventsService {
|
||||
|
||||
if(this.loggeduser){
|
||||
if(this.loggeduser.Profile == 'MDGPR') {
|
||||
|
||||
|
||||
this.loggeduser.OwnerCalendars.forEach(calendar => {
|
||||
if(calendar.CalendarName == 'Oficial') {
|
||||
this.headersMdOficial = this.headersMdOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
@@ -52,10 +52,10 @@ export class EventsService {
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('CalendarId', calendar.CalendarId);
|
||||
this.headersMdPessoal = this.headersMdPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.loggeduser.SharedCalendars.forEach(sharedCalendar => {
|
||||
if(sharedCalendar.CalendarName == 'Oficial') {
|
||||
this.headersSharedOficial = this.headersSharedOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
@@ -70,7 +70,7 @@ export class EventsService {
|
||||
});
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR') {
|
||||
|
||||
|
||||
this.loggeduser.OwnerCalendars.forEach(calendar =>{
|
||||
if(calendar.CalendarName == 'Oficial'){
|
||||
this.headersPrOficial = this.headersPrOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
@@ -81,11 +81,11 @@ export class EventsService {
|
||||
this.headersPrPessoal = this.headersPrPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
this.headersPrPessoal = this.headersPrPessoal.set('CalendarId', calendar.CalendarId);
|
||||
this.headersPrPessoal = this.headersPrPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
this.headers = new HttpHeaders();
|
||||
this.headers = this.headers.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||
}
|
||||
@@ -99,10 +99,10 @@ export class EventsService {
|
||||
|
||||
params = params.set("StartDate", startdate);
|
||||
params = params.set("EndDate", enddate);
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
return this.http.get<Event[]>(`${geturl}`, options);
|
||||
} */
|
||||
@@ -116,10 +116,10 @@ export class EventsService {
|
||||
|
||||
params = params.set("Start", startdate);
|
||||
params = params.set("End", enddate);
|
||||
|
||||
let options = {
|
||||
headers: this.headersPrOficial,
|
||||
params: params
|
||||
|
||||
let options = {
|
||||
headers: this.headersPrOficial,
|
||||
params: params
|
||||
};
|
||||
return this.http.get<EventList[]>(`${geturl}`, options);
|
||||
}
|
||||
@@ -132,10 +132,10 @@ export class EventsService {
|
||||
|
||||
params = params.set("Start", startdate);
|
||||
params = params.set("End", enddate);
|
||||
|
||||
let options = {
|
||||
headers: this.headersPrPessoal,
|
||||
params: params
|
||||
|
||||
let options = {
|
||||
headers: this.headersPrPessoal,
|
||||
params: params
|
||||
};
|
||||
return this.http.get<EventList[]>(`${geturl}`, options);
|
||||
}
|
||||
@@ -156,25 +156,25 @@ export class EventsService {
|
||||
|
||||
params = params.set("Start", startdate);
|
||||
params = params.set("End", enddate);
|
||||
|
||||
let options = {
|
||||
headers: this.headersMdOficial,
|
||||
params: params
|
||||
|
||||
let options = {
|
||||
headers: this.headersMdOficial,
|
||||
params: params
|
||||
};
|
||||
return this.http.get<EventList[]>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
getAllMdPessoalEvents(startdate:string, enddate:string): any{
|
||||
let geturl = environment.apiURL + 'calendar/md';
|
||||
|
||||
|
||||
let params = new HttpParams();
|
||||
|
||||
params = params.set("Start", startdate);
|
||||
params = params.set("End", enddate);
|
||||
|
||||
let options = {
|
||||
headers: this.headersMdPessoal,
|
||||
params: params
|
||||
|
||||
let options = {
|
||||
headers: this.headersMdPessoal,
|
||||
params: params
|
||||
};
|
||||
return this.http.get<any>(`${geturl}`, options)
|
||||
}
|
||||
@@ -192,7 +192,7 @@ export class EventsService {
|
||||
let prO = await this.getAllSharedOficialEvents(startdate, enddate).toPromise();
|
||||
let prP = await this.getAllSharedPessoalEvents(startdate, enddate).toPromise();
|
||||
const resFinal = prO.concat(prP);
|
||||
|
||||
|
||||
return new Promise(resolve =>{
|
||||
return resolve(resFinal)
|
||||
});
|
||||
@@ -208,13 +208,13 @@ export class EventsService {
|
||||
|
||||
params = params.set("Start", startdate);
|
||||
params = params.set("End", enddate);
|
||||
|
||||
let options = {
|
||||
headers: this.headersSharedOficial,
|
||||
params: params
|
||||
|
||||
let options = {
|
||||
headers: this.headersSharedOficial,
|
||||
params: params
|
||||
};
|
||||
console.log(options);
|
||||
|
||||
|
||||
return this.http.get<Event[]>(`${geturl}`, options);
|
||||
}
|
||||
|
||||
@@ -226,10 +226,10 @@ export class EventsService {
|
||||
|
||||
params = params.set("Start", startdate);
|
||||
params = params.set("End", enddate);
|
||||
|
||||
let options = {
|
||||
headers: this.headersSharedPessoal,
|
||||
params: params
|
||||
|
||||
let options = {
|
||||
headers: this.headersSharedPessoal,
|
||||
params: params
|
||||
};
|
||||
return this.http.get<Event[]>(`${geturl}`, options);
|
||||
}
|
||||
@@ -238,8 +238,8 @@ export class EventsService {
|
||||
|
||||
getRecurrenceTypes(): any{
|
||||
const geturl = environment.apiURL + 'Calendar/RecurrenceTypes';
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
};
|
||||
return this.http.get<any>(`${geturl}`, options);
|
||||
}
|
||||
@@ -254,10 +254,10 @@ export class EventsService {
|
||||
params = params.set("CalendarName", calendarname);
|
||||
params = params.set("StartDate", startdate);
|
||||
params = params.set("EndDate", enddate);
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
return this.http.get<Event[]>(`${geturl}`, options);
|
||||
}
|
||||
@@ -265,12 +265,12 @@ export class EventsService {
|
||||
getEvent(eventid: string): Observable<Event>{
|
||||
let geturl = environment.apiURL + 'calendar/GetEvent';
|
||||
let params = new HttpParams();
|
||||
|
||||
|
||||
params = params.set("EventId", eventid);
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
|
||||
return this.http.get<Event>(`${geturl}`, options);
|
||||
@@ -284,10 +284,10 @@ export class EventsService {
|
||||
|
||||
params = params.set("conflictResolutionMode", conflictResolutionMode.toString());
|
||||
params = params.set("sendInvitationsOrCancellationsMode", sendInvitationsOrCancellationsMode.toString());
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
|
||||
return this.http.put<Event>(`${puturl}`, event, options)
|
||||
@@ -305,10 +305,27 @@ export class EventsService {
|
||||
params.set('CalendarName', event.CalendarName)
|
||||
this.headers['CalendarId'] = event.CalendarId
|
||||
this.headers['CalendarName'] = event.CalendarName
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
|
||||
if(event.CalendarName == 'Oficial'){
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
this.headers = this.headersMdOficial;
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR'){
|
||||
this.headers = this.headersPrOficial;
|
||||
}
|
||||
}
|
||||
else{
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
this.headers = this.headersMdPessoal;
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR'){
|
||||
this.headers = this.headersPrPessoal;
|
||||
}
|
||||
}
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
|
||||
return this.http.put<Event>(`${puturl}`, event, options)
|
||||
@@ -316,7 +333,7 @@ export class EventsService {
|
||||
|
||||
changeAgenda(body:any){
|
||||
const puturl = environment.apiURL + 'Calendar/MoveEvent';
|
||||
let options = {
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
};
|
||||
return this.http.post<any>(`${puturl}`, body, options);
|
||||
@@ -329,14 +346,14 @@ export class EventsService {
|
||||
|
||||
params = params.set("CalendarName", calendarName);
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
|
||||
|
||||
return this.http.post<Event>(`${puturl}`, event, options)
|
||||
} */
|
||||
|
||||
|
||||
postEventMd(event:Event, calendarName:string)
|
||||
{
|
||||
const puturl = environment.apiURL + 'calendar/md';
|
||||
@@ -348,17 +365,17 @@ export class EventsService {
|
||||
switch (calendarName) {
|
||||
case 'Oficial':
|
||||
console.log(calendarName);
|
||||
options = {
|
||||
headers: this.headersMdOficial,
|
||||
params: params
|
||||
options = {
|
||||
headers: this.headersMdOficial,
|
||||
params: params
|
||||
};
|
||||
break;
|
||||
|
||||
|
||||
case 'Pessoal':
|
||||
console.log(calendarName);
|
||||
options = {
|
||||
headers: this.headersMdPessoal,
|
||||
params: params
|
||||
options = {
|
||||
headers: this.headersMdPessoal,
|
||||
params: params
|
||||
};
|
||||
break;
|
||||
}
|
||||
@@ -377,21 +394,21 @@ export class EventsService {
|
||||
switch (calendarName) {
|
||||
case 'Oficial':
|
||||
console.log(calendarName);
|
||||
options = {
|
||||
headers: this.headersPrOficial,
|
||||
params: params
|
||||
options = {
|
||||
headers: this.headersPrOficial,
|
||||
params: params
|
||||
};
|
||||
break;
|
||||
|
||||
|
||||
case 'Pessoal':
|
||||
console.log(calendarName);
|
||||
options = {
|
||||
headers: this.headersPrPessoal,
|
||||
params: params
|
||||
options = {
|
||||
headers: this.headersPrPessoal,
|
||||
params: params
|
||||
};
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
return this.http.post<string>(`${puturl}`, event, options)
|
||||
}
|
||||
|
||||
@@ -404,11 +421,11 @@ export class EventsService {
|
||||
// 0 for occurence and 1 for serie (delete all events)
|
||||
params = params.set("eventDeleteType", eventDeleteType.toString());
|
||||
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
params: params
|
||||
};
|
||||
|
||||
|
||||
return this.http.delete(`${puturl}`, options)
|
||||
}
|
||||
postExpedientEvent(docId:any, body:any, sharedagenda:string, serialNumber:any, applicationID:any){
|
||||
@@ -423,29 +440,29 @@ export class EventsService {
|
||||
switch (this.loggeduser.Profile) {
|
||||
case 'MDGPR':
|
||||
if(body.CalendarName == 'Pessoal'){
|
||||
options = {
|
||||
options = {
|
||||
headers: this.headersMdPessoal,
|
||||
params: params
|
||||
params: params
|
||||
};
|
||||
}
|
||||
else if(body.CalendarName == 'Oficial'){
|
||||
options = {
|
||||
options = {
|
||||
headers: this.headersMdOficial,
|
||||
params: params
|
||||
params: params
|
||||
};
|
||||
}
|
||||
break;
|
||||
case 'PR':
|
||||
if(body.CalendarName == 'Pessoal'){
|
||||
options = {
|
||||
options = {
|
||||
headers: this.headersPrPessoal,
|
||||
params: params
|
||||
params: params
|
||||
};
|
||||
}
|
||||
else if(body.CalendarName == 'Oficial'){
|
||||
options = {
|
||||
options = {
|
||||
headers: this.headersPrOficial,
|
||||
params: params
|
||||
params: params
|
||||
};
|
||||
}
|
||||
break;
|
||||
@@ -464,29 +481,29 @@ export class EventsService {
|
||||
switch (this.loggeduser.Profile) {
|
||||
case 'MDGPR':
|
||||
if(body.CalendarName == 'Pessoal'){
|
||||
options = {
|
||||
options = {
|
||||
headers: this.headersMdPessoal,
|
||||
params: params
|
||||
params: params
|
||||
};
|
||||
}
|
||||
else if(body.CalendarName == 'Oficial'){
|
||||
options = {
|
||||
options = {
|
||||
headers: this.headersMdOficial,
|
||||
params: params
|
||||
params: params
|
||||
};
|
||||
}
|
||||
break;
|
||||
case 'PR':
|
||||
if(body.CalendarName == 'Pessoal'){
|
||||
options = {
|
||||
options = {
|
||||
headers: this.headersPrPessoal,
|
||||
params: params
|
||||
params: params
|
||||
};
|
||||
}
|
||||
else if(body.CalendarName == 'Oficial'){
|
||||
options = {
|
||||
options = {
|
||||
headers: this.headersPrOficial,
|
||||
params: params
|
||||
params: params
|
||||
};
|
||||
}
|
||||
break;
|
||||
@@ -497,7 +514,7 @@ export class EventsService {
|
||||
postEventToApproveEdit(body: EventToApproveEdit) {
|
||||
const geturl = environment.apiURL + 'Tasks/EditEventTask';
|
||||
|
||||
let options = {
|
||||
let options = {
|
||||
headers: this.headers,
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user