mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-20 13:26:08 +00:00
Merge branch 'developer' of bitbucket.org:equilibriumito/gabinete-digital into developer
This commit is contained in:
+107
-105
@@ -41,7 +41,7 @@ import { CalendarService } from 'src/app/store/calendar.service';
|
||||
],
|
||||
})
|
||||
export class AgendaPage implements OnInit {
|
||||
|
||||
|
||||
view: CalendarView = CalendarView.Day;
|
||||
|
||||
viewDate: Date = new Date();
|
||||
@@ -73,16 +73,16 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
showTimelinePR = false;
|
||||
showTimelineMD = false;
|
||||
|
||||
|
||||
// timeline filter
|
||||
timelineFilterState: string = 'Todos';
|
||||
showTimelineFilterState: boolean;
|
||||
showTimeline=true;
|
||||
|
||||
|
||||
/* List of events of our calendar */
|
||||
eventSource : eventSource[] = []
|
||||
|
||||
|
||||
|
||||
|
||||
/* The title of the calendar */
|
||||
viewTitle: string;
|
||||
@@ -108,12 +108,12 @@ export class AgendaPage implements OnInit {
|
||||
taskParticipants: any = [];
|
||||
taskParticipantsCc: any = [];
|
||||
adding: "intervenient" | "CC" = "intervenient";
|
||||
|
||||
|
||||
@ViewChild(CalendarComponent) myCal: CalendarComponent;
|
||||
|
||||
segment: "Combinado" | "Pessoal" | "Oficial" = "Combinado";
|
||||
timelineSedment : "Combinado" | "Pessoal" | "Oficial";
|
||||
|
||||
|
||||
profile:'mdgpr' | 'pr';
|
||||
|
||||
// this will make toggle add event and.
|
||||
@@ -153,7 +153,7 @@ export class AgendaPage implements OnInit {
|
||||
IsEvent: "edit" | "add" | "view";
|
||||
viewingEventObject: CalendarEvent ;
|
||||
loggeduser: User;
|
||||
|
||||
|
||||
constructor(
|
||||
private alertCtrl: AlertController,
|
||||
@Inject(LOCALE_ID) private locale: string,
|
||||
@@ -194,7 +194,7 @@ export class AgendaPage implements OnInit {
|
||||
this.updateEventListBox()
|
||||
|
||||
}, 1000)
|
||||
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -215,7 +215,7 @@ export class AgendaPage implements OnInit {
|
||||
if ( realoadCounter != 0) {
|
||||
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
|
||||
|
||||
}
|
||||
realoadCounter++;
|
||||
}
|
||||
@@ -258,7 +258,7 @@ export class AgendaPage implements OnInit {
|
||||
this.clearPostEvent();
|
||||
|
||||
this.IsEvent= "view";
|
||||
|
||||
|
||||
this.viewingEventObject = event;
|
||||
|
||||
this.eventSelectedDate = event.start;
|
||||
@@ -266,7 +266,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.cloneAllmobileComponent();
|
||||
|
||||
|
||||
|
||||
this.showEventEditOrOpen = 'edit';
|
||||
|
||||
if( window.innerWidth <= 1024) {
|
||||
@@ -289,7 +289,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
onCurrentChanged = (ev: Date) => {
|
||||
// timeline change date
|
||||
this.timelineDate = momentG(new Date(ev),'dd MMMM yyyy');
|
||||
this.timelineDate = momentG(new Date(ev),'dd MMMM yyyy');
|
||||
this.viewDate = new Date(ev);
|
||||
// calendar change date
|
||||
this.eventSelectedDate = new Date(ev);
|
||||
@@ -313,7 +313,7 @@ export class AgendaPage implements OnInit {
|
||||
this.rangeEndDate = ev.endTime;
|
||||
|
||||
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
|
||||
|
||||
|
||||
|
||||
try {
|
||||
this.myCal.update();
|
||||
@@ -326,19 +326,19 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
// for calendar
|
||||
currentDayEventDisplayBorder(day: any, id: any) {
|
||||
|
||||
|
||||
const events = day[id].events;
|
||||
|
||||
if (events.length == 0) {
|
||||
|
||||
|
||||
return "";
|
||||
|
||||
} else if (events.length >= 1) {
|
||||
|
||||
|
||||
let classs = [];
|
||||
|
||||
events.forEach(element => {
|
||||
|
||||
|
||||
const profile_ = element.profile == 'md'? 'mdgpr': 'pr';
|
||||
const eventtype = element.event.CalendarName;
|
||||
|
||||
@@ -347,11 +347,11 @@ export class AgendaPage implements OnInit {
|
||||
// // console.log(id, (endMinutes + endHours))
|
||||
// classs.push(`calendar-event-border`);
|
||||
// }
|
||||
|
||||
|
||||
classs.push(`calendar-event-border calendar-${profile_}-event-type-${eventtype}`);
|
||||
|
||||
});
|
||||
|
||||
|
||||
return classs.join(' ');
|
||||
}
|
||||
|
||||
@@ -389,7 +389,7 @@ export class AgendaPage implements OnInit {
|
||||
this.showTimelineFilterState = false;
|
||||
|
||||
eventsList.forEach((element, eventIndex) => {
|
||||
|
||||
|
||||
// timeline start
|
||||
const startHours = new Date(element.StartDate).getHours().toLocaleString();
|
||||
const EndHours = new Date(element.EndDate).getHours().toLocaleString();
|
||||
@@ -413,7 +413,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
return events;
|
||||
}
|
||||
|
||||
|
||||
eventFilter() {}
|
||||
|
||||
TimelineDayEvent(day): string {
|
||||
@@ -421,7 +421,7 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
|
||||
get calendarDay(): string {
|
||||
|
||||
|
||||
return ((new Date(this.timelineDate)).getDate()).toString().padStart(2,'0')
|
||||
}
|
||||
|
||||
@@ -431,7 +431,7 @@ export class AgendaPage implements OnInit {
|
||||
const endTimeSamp = new Date(endTime).toLocaleDateString()
|
||||
|
||||
const endMinutes = new Date(endTime).getMinutes()
|
||||
const endHours = new Date(endTime).getHours()
|
||||
const endHours = new Date(endTime).getHours()
|
||||
|
||||
|
||||
if (startTimeSamp < endTimeSamp && (endMinutes + endHours) == 0) {
|
||||
@@ -449,7 +449,7 @@ export class AgendaPage implements OnInit {
|
||||
this.showLoader = true;
|
||||
|
||||
if(window.innerWidth < 800){
|
||||
|
||||
|
||||
// this.showTimeline = false;
|
||||
|
||||
switch (this.segment) {
|
||||
@@ -458,27 +458,29 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR' ) {
|
||||
this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).then(
|
||||
|
||||
|
||||
(response:any) => {
|
||||
console.log(response);
|
||||
|
||||
|
||||
// calendar
|
||||
this.calendarService.removeRange(startTime, endTime, 'md')
|
||||
|
||||
// loop
|
||||
this.calendarService.pushEvent(response, 'md');
|
||||
|
||||
|
||||
this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
|
||||
}).finally(()=>{
|
||||
this.showLoader = false;
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
else if(this.profile == "pr" && this.loggeduser.Profile == 'MDGPR') {
|
||||
|
||||
@@ -487,7 +489,7 @@ export class AgendaPage implements OnInit {
|
||||
this.calendarService.removeRange(startTime, endTime, 'pr')
|
||||
// calendar
|
||||
this.calendarService.pushEvent(response, 'pr');
|
||||
|
||||
|
||||
this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
|
||||
this.myCal.update();
|
||||
@@ -495,31 +497,31 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
|
||||
}).finally(()=>{
|
||||
this.showLoader = false;
|
||||
})
|
||||
})
|
||||
|
||||
}
|
||||
else if(this.loggeduser.Profile == 'PR') {
|
||||
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then(
|
||||
(response:any) => {
|
||||
|
||||
|
||||
// calendar
|
||||
// this.eventSource=[];
|
||||
|
||||
// clear the current month only
|
||||
this.calendarService.removeRange(startTime, endTime, 'pr')
|
||||
|
||||
|
||||
this.calendarService.pushEvent(response, 'pr');
|
||||
|
||||
|
||||
|
||||
|
||||
this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
|
||||
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
@@ -529,21 +531,21 @@ export class AgendaPage implements OnInit {
|
||||
})
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case "Pessoal":
|
||||
//Inicializa o array eventSource
|
||||
if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') {
|
||||
this.eventService.getAllMdPessoalEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => {
|
||||
|
||||
|
||||
this.calendarService.removeRange(startTime, endTime, 'md')
|
||||
|
||||
const eventsList = response.filter(data => data.CalendarName == "Pessoal");
|
||||
// loop
|
||||
this.calendarService.pushEvent(eventsList, 'md');
|
||||
|
||||
|
||||
|
||||
|
||||
this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
@@ -552,22 +554,22 @@ export class AgendaPage implements OnInit {
|
||||
}).finally(()=>{
|
||||
this.showLoader = false;
|
||||
})
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => {
|
||||
//this.eventSource=[];
|
||||
|
||||
|
||||
// clear the current month only
|
||||
this.calendarService.removeRange(startTime, endTime, 'pr')
|
||||
|
||||
const eventsList = response.filter(data => data.CalendarName == "Pessoal");
|
||||
this.calendarService.pushEvent(eventsList, 'pr');
|
||||
|
||||
|
||||
|
||||
this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
|
||||
|
||||
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
@@ -579,7 +581,7 @@ export class AgendaPage implements OnInit {
|
||||
})
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case "Oficial":
|
||||
|
||||
//Inicializa o array eventSource
|
||||
@@ -587,37 +589,37 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
if(this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') {
|
||||
this.eventService.getAllMdEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((res:any) => {
|
||||
|
||||
|
||||
|
||||
this.calendarService.removeRange(startTime, endTime, 'md')
|
||||
|
||||
const eventsList = res.filter(data => data.CalendarName == "Oficial");
|
||||
|
||||
|
||||
this.calendarService.pushEvent(eventsList, 'md');
|
||||
|
||||
|
||||
|
||||
this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
|
||||
this.showLoader = false;
|
||||
this.showTimeline = true;
|
||||
|
||||
|
||||
}).finally(()=>{
|
||||
this.showLoader = false;
|
||||
})
|
||||
} else {
|
||||
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((res:any) => {
|
||||
|
||||
// this.eventSource=[];
|
||||
|
||||
// this.eventSource=[];
|
||||
|
||||
this.calendarService.removeRange(startTime, endTime, 'pr')
|
||||
|
||||
const eventsList = res.filter(data => data.CalendarName == "Oficial");
|
||||
this.calendarService.pushEvent(eventsList, 'pr');
|
||||
|
||||
|
||||
|
||||
this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
|
||||
this.myCal.update();
|
||||
@@ -631,24 +633,24 @@ export class AgendaPage implements OnInit {
|
||||
})
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
// calendar
|
||||
|
||||
let counter = 0;
|
||||
|
||||
|
||||
if(this.loggeduser.Profile == 'MDGPR') {
|
||||
|
||||
|
||||
this.eventService.getAllMdEvents( momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59') ).then( (response:any) => {
|
||||
|
||||
|
||||
let eventsList = response;
|
||||
|
||||
this.calendarService.removeRange(startTime, endTime, 'md')
|
||||
|
||||
// loop
|
||||
this.calendarService.pushEvent(eventsList, 'md');
|
||||
|
||||
|
||||
this.TimelineMDList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'md', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
|
||||
this.myCal.update();
|
||||
@@ -660,7 +662,7 @@ export class AgendaPage implements OnInit {
|
||||
if(counter==2) {
|
||||
this.showLoader = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}).finally(()=> {
|
||||
counter++;
|
||||
@@ -670,21 +672,21 @@ export class AgendaPage implements OnInit {
|
||||
})
|
||||
|
||||
this.eventService.getAllSharedEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => {
|
||||
|
||||
|
||||
let eventsList = response;
|
||||
|
||||
|
||||
// clear the current month only
|
||||
this.calendarService.removeRange(startTime, endTime, 'pr')
|
||||
|
||||
this.calendarService.pushEvent(eventsList, 'pr');
|
||||
|
||||
this.TimelinePRList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
this.showTimelinePR = true;
|
||||
|
||||
|
||||
counter++;
|
||||
|
||||
if(counter==2 || this.loggeduser.Profile == 'PR') {
|
||||
@@ -701,7 +703,7 @@ export class AgendaPage implements OnInit {
|
||||
} else {
|
||||
|
||||
this.eventService.getAllPrEvents(momentG(new Date(startTime),'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime),'yyyy-MM-dd 23:59:59')).then((response:any) => {
|
||||
|
||||
|
||||
let eventsList;
|
||||
if(this.segment == 'Oficial') {
|
||||
eventsList = response.filter(data => data.CalendarName == "Oficial");
|
||||
@@ -710,20 +712,20 @@ export class AgendaPage implements OnInit {
|
||||
} else {
|
||||
eventsList = response;
|
||||
}
|
||||
|
||||
|
||||
// clear the current month only
|
||||
this.calendarService.removeRange(startTime, endTime, 'pr')
|
||||
|
||||
this.calendarService.pushEvent(eventsList, 'pr');
|
||||
|
||||
this.TimelinePRList = this.eventListBoxComponent.list(this.calendarService.eventSource, 'pr', this.rangeStartDate, this.rangeEndDate, 'date')
|
||||
|
||||
|
||||
|
||||
this.myCal.update();
|
||||
this.myCal.loadEvents();
|
||||
|
||||
this.showTimelinePR = true;
|
||||
|
||||
|
||||
counter++;
|
||||
|
||||
if(counter==1 || this.loggeduser.Profile == 'PR') {
|
||||
@@ -737,7 +739,7 @@ export class AgendaPage implements OnInit {
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -756,34 +758,34 @@ export class AgendaPage implements OnInit {
|
||||
var startDate: any = new Date(event.start);
|
||||
|
||||
var endDate: any = this.EventTretment({
|
||||
startTime: startDate,
|
||||
startTime: startDate,
|
||||
endTime: event.end
|
||||
})
|
||||
|
||||
|
||||
const day = (((new Date (event.start)).getDate())).toString().padStart(2,'0')
|
||||
|
||||
|
||||
event.manyDays = false
|
||||
|
||||
|
||||
event.todayOnly = new Date(event.start).toLocaleDateString() == new Date(event.end).toLocaleDateString()
|
||||
|
||||
|
||||
|
||||
|
||||
if(!days.hasOwnProperty(day)) {
|
||||
days[day] = []
|
||||
}
|
||||
|
||||
if (new Date(startDate).toLocaleDateString() != new Date(endDate).toLocaleDateString()) {
|
||||
|
||||
|
||||
// difference
|
||||
const diffTime = Math.abs(endDate - startDate);
|
||||
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
||||
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24));
|
||||
|
||||
if (diffDays <= 150 && !event.event.IsAllDayEvent ) {
|
||||
|
||||
|
||||
if (diffDays >= 1) {
|
||||
|
||||
|
||||
const StartEvent = Object.assign({}, {
|
||||
title: event.title,
|
||||
start: event.start,
|
||||
@@ -805,28 +807,28 @@ export class AgendaPage implements OnInit {
|
||||
endMany: false,
|
||||
middle: false
|
||||
})
|
||||
|
||||
|
||||
days[day].push(StartEvent)
|
||||
|
||||
|
||||
let i = 1;
|
||||
|
||||
while (startDate.getFullYear() != endDate.getFullYear() ||
|
||||
|
||||
while (startDate.getFullYear() != endDate.getFullYear() ||
|
||||
startDate.getMonth() != endDate.getMonth() ||
|
||||
startDate.getDate() != endDate.getDate()) {
|
||||
|
||||
const newDate = startDate.setDate(startDate.getDate()+ i)
|
||||
|
||||
let otherDays = (((new Date (newDate)).getDate())).toString().padStart(2,'0')
|
||||
|
||||
|
||||
event.other = true
|
||||
|
||||
|
||||
event.start = newDate
|
||||
if(!days.hasOwnProperty(otherDays)) {
|
||||
|
||||
days[otherDays] = []
|
||||
}
|
||||
|
||||
if (!(startDate.getFullYear() != endDate.getFullYear() ||
|
||||
|
||||
if (!(startDate.getFullYear() != endDate.getFullYear() ||
|
||||
startDate.getMonth() != endDate.getMonth() ||
|
||||
startDate.getDate() != endDate.getDate())) {
|
||||
// last push
|
||||
@@ -881,7 +883,7 @@ export class AgendaPage implements OnInit {
|
||||
})
|
||||
days[otherDays].push(EndEvent)
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
} else {
|
||||
@@ -893,7 +895,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
days[day].push(event)
|
||||
|
||||
@@ -908,7 +910,7 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
})
|
||||
}, 10)
|
||||
|
||||
|
||||
return days
|
||||
}
|
||||
|
||||
@@ -955,7 +957,7 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
|
||||
async openAddEvent() {
|
||||
|
||||
|
||||
await this.cloneAllmobileComponent();
|
||||
|
||||
this.showEventEditOrOpen = 'add';
|
||||
@@ -975,7 +977,7 @@ export class AgendaPage implements OnInit {
|
||||
await modal.present();
|
||||
modal.onDidDismiss().then((data) => {
|
||||
if(data){
|
||||
|
||||
|
||||
}
|
||||
this.openAddEventDismiss(data['data'])
|
||||
});
|
||||
@@ -1015,7 +1017,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
this.router.navigate(['/home/agenda', eventId, 'agenda']);
|
||||
/* console.log(this.profile);
|
||||
|
||||
|
||||
const modal = await this.modalCtrl.create({
|
||||
component: ViewEventPage,
|
||||
componentProps:{
|
||||
@@ -1035,11 +1037,11 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
// open component
|
||||
async viewEventDetailDismiss(data) {
|
||||
|
||||
|
||||
await this.cloneAllmobileComponent()
|
||||
|
||||
if (data.type == 'edit') {
|
||||
|
||||
|
||||
this.selectedEvent = data.event;
|
||||
this.postEvent = data.event;
|
||||
|
||||
@@ -1079,7 +1081,7 @@ export class AgendaPage implements OnInit {
|
||||
approveEventDismiss({saveData, serialNumber, action}) {
|
||||
|
||||
window['temp.path:/shared/agenda/edit-event-to-approve.ts'] = {}
|
||||
|
||||
|
||||
if(action == 'Aprovar') {
|
||||
this.eventToaprove = {
|
||||
back: true,
|
||||
@@ -1111,7 +1113,7 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
closeEventToApproveGoBack() {
|
||||
if( window.innerWidth <= 801){
|
||||
this.router.navigate(['/home/agenda/event-list']);
|
||||
@@ -1154,7 +1156,7 @@ export class AgendaPage implements OnInit {
|
||||
async openAttendeesComponent(data) {
|
||||
|
||||
this.adding = data.type
|
||||
|
||||
|
||||
this.cloneAllmobileComponent();
|
||||
this.mobileComponent.showAttendees = true;
|
||||
}
|
||||
@@ -1174,7 +1176,7 @@ export class AgendaPage implements OnInit {
|
||||
|
||||
|
||||
async GoBackEditOrAdd() {
|
||||
|
||||
|
||||
if(this.showEventEditOrOpen == "edit") {
|
||||
this.cloneAllmobileComponent();
|
||||
|
||||
@@ -1210,7 +1212,7 @@ export class AgendaPage implements OnInit {
|
||||
this.taskParticipants = removeDuplicate(data)
|
||||
|
||||
}
|
||||
|
||||
|
||||
async setIntervenientCC(data) {
|
||||
this.taskParticipantsCc = removeDuplicate(data)
|
||||
}
|
||||
@@ -1255,11 +1257,11 @@ export class AgendaPage implements OnInit {
|
||||
}
|
||||
})
|
||||
}, 100)
|
||||
|
||||
|
||||
}
|
||||
|
||||
async showEventBox(event) {
|
||||
|
||||
|
||||
if ( event.event.CalendarName == this.segment || this.segment == 'Combinado') {
|
||||
return true
|
||||
}
|
||||
@@ -1279,4 +1281,4 @@ export class AgendaPage implements OnInit {
|
||||
return reuslt.length != 0
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<ion-buttons slot="start">
|
||||
<ion-back-button defaultHref="{{ backURL }}"></ion-back-button>
|
||||
</ion-buttons>
|
||||
<ion-title class="header-title">21Visualizar Evento</ion-title>
|
||||
<ion-title class="header-title">Visualizar Evento</ion-title>
|
||||
<ion-buttons slot="end">
|
||||
<button (click)="deleteConfirm()" class="ion-icon-delete">
|
||||
<ion-icon name="trash"></ion-icon>
|
||||
@@ -23,7 +23,7 @@
|
||||
<!-- Error messages -->
|
||||
<span class="error ion-padding" *ngIf="errorControl.subject.errors?.required">
|
||||
Campo obrigatório
|
||||
</span>
|
||||
</span>
|
||||
<ion-item>
|
||||
<ion-label position="stacked">Descrição</ion-label>
|
||||
<ion-input class="capitalizeText" [(ngModel)]='loadedEvent.Body.Text'></ion-input>
|
||||
@@ -60,7 +60,7 @@
|
||||
displayFormat="D MMM YYYY HH:mm" minuteValues="0,15,30,45"
|
||||
monthShortNames="Jan, Fev, Mar, Abr, Mai, Jun, Jul, Aug, Sep, Out, Nov, Dez"></ion-datetime>
|
||||
</ion-item>
|
||||
|
||||
|
||||
<div class="div-attach" >
|
||||
<ion-item>
|
||||
<ion-buttons slot="end" (click)="openAttendees()">
|
||||
@@ -74,11 +74,11 @@
|
||||
<ion-list >
|
||||
<ion-item class="attendees" lines="none" >
|
||||
<ion-icon class="attendees-icon" name="person" slot="start"></ion-icon>
|
||||
<ion-label class="capitalizeText" class="attendees-list">{{attendee.Name}}</ion-label>
|
||||
<ion-label class="capitalizeText" class="attendees-list">{{attendee.Name}}</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div *ngIf="loadedEvent.Attendees.length > 1">
|
||||
<ion-button class="see-more-button" fill="none" shape="round" (click)="openAttendees()">
|
||||
@@ -104,7 +104,7 @@
|
||||
<ion-label>
|
||||
<p>{{ att.Description }}</p>
|
||||
<p>{{ att.CreateDate }}</p>
|
||||
</ion-label>
|
||||
</ion-label>
|
||||
</ion-item>
|
||||
</ion-list>
|
||||
</div>
|
||||
|
||||
@@ -16,7 +16,6 @@ import { HeaderNoSearchPageModule } from 'src/app/shared/headers/header-no-searc
|
||||
CommonModule,
|
||||
FormsModule,
|
||||
IonicModule,
|
||||
|
||||
EventsPageRoutingModule,
|
||||
HeaderNoSearchPageModule,
|
||||
],
|
||||
|
||||
@@ -28,7 +28,7 @@ import { ExpedienteStorage } from 'src/app/store/expediente-storage-service.serv
|
||||
export class EventsPage implements OnInit {
|
||||
/* Get current system date */
|
||||
today = new Date();
|
||||
|
||||
|
||||
months = ["Janeiro", "Fevereiro", "Março", "Abril", "Maio", "Junho", "Julho", "Agosto", "Setembro", "Outubro", "Novembro", "Dezembro"];
|
||||
days = ["Domingo", "Segunda-feira", "Terça-feira", "Quarta-feira", "Quinta-feira", "Sexta-feira", "Sábado"];
|
||||
|
||||
@@ -59,7 +59,7 @@ export class EventsPage implements OnInit {
|
||||
currentHoursMinutes: Date;
|
||||
|
||||
showLoader: boolean;
|
||||
|
||||
|
||||
taskslist:DailyWorkTask[] = [];
|
||||
expedientList:any;
|
||||
|
||||
@@ -72,8 +72,8 @@ export class EventsPage implements OnInit {
|
||||
loggeduser: User;
|
||||
|
||||
constructor(
|
||||
private eventService: EventsService,
|
||||
private router: Router,
|
||||
private eventService: EventsService,
|
||||
private router: Router,
|
||||
private storageService:StorageService,
|
||||
public activatedRoute: ActivatedRoute,
|
||||
private alertController: AlertService,
|
||||
@@ -89,7 +89,7 @@ export class EventsPage implements OnInit {
|
||||
|
||||
// list
|
||||
this.LoadList();
|
||||
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
@@ -102,7 +102,7 @@ export class EventsPage implements OnInit {
|
||||
this.showGreeting();
|
||||
|
||||
const pathname = window.location.pathname
|
||||
|
||||
|
||||
this.router.events.forEach((event) => {
|
||||
if(event instanceof NavigationEnd && event.url == pathname) {
|
||||
this.RefreshEvents();
|
||||
@@ -130,30 +130,30 @@ export class EventsPage implements OnInit {
|
||||
let start = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" "+date.getHours()+":"+date.getMinutes()+ ":"+date.getSeconds();
|
||||
let end = date.getFullYear()+"-"+ date.getMonth()+"-"+date.getDate()+" 23:59:59";
|
||||
|
||||
|
||||
|
||||
if(this.loggeduser.Profile == 'MDGPR') {
|
||||
|
||||
let mdOficialEvents = await this.eventService.getAllMdOficialEvents(start, end).toPromise();
|
||||
let mdPessoalEvents = await this.eventService.getAllMdPessoalEvents(start, end).toPromise();
|
||||
|
||||
|
||||
const list = mdOficialEvents.concat(mdPessoalEvents);
|
||||
|
||||
this.toDayEventStorage.reset(list)
|
||||
|
||||
|
||||
if(this.toDayEventStorage.eventsList.length > 0){
|
||||
this.currentEvent = this.toDayEventStorage.eventsList[0].Subject;
|
||||
this.currentHoursMinutes = this.toDayEventStorage.eventsList[0].StartDate;
|
||||
}
|
||||
|
||||
|
||||
this.totalEvent = this.toDayEventStorage.eventsList.length;
|
||||
this.showLoader = false;
|
||||
|
||||
|
||||
}
|
||||
else if (this.loggeduser.Profile == 'PR') {
|
||||
|
||||
let prOficialEvents= await this.eventService.getAllPrOficialEvents(start, end).toPromise();
|
||||
let prPessoalEvents= await this.eventService.getAllPrPessoalEvents(start, end).toPromise();
|
||||
|
||||
|
||||
const list = prOficialEvents.concat(prPessoalEvents);
|
||||
|
||||
this.toDayEventStorage.reset(list)
|
||||
@@ -165,7 +165,7 @@ export class EventsPage implements OnInit {
|
||||
|
||||
this.totalEvent = this.toDayEventStorage.eventsList.length;
|
||||
this.showLoader = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -176,17 +176,17 @@ export class EventsPage implements OnInit {
|
||||
|
||||
let mdOficialEvents = await this.eventService.getAllMdOficialEvents(start, end).toPromise();
|
||||
let mdPessoalEvents = await this.eventService.getAllMdPessoalEvents(start, end).toPromise();
|
||||
|
||||
|
||||
this.eventsList = mdOficialEvents.concat(mdPessoalEvents);
|
||||
|
||||
|
||||
if(this.eventsList.length > 0){
|
||||
this.currentEvent = this.eventsList[0].Subject;
|
||||
this.currentHoursMinutes = this.eventsList[0].StartDate;
|
||||
}
|
||||
|
||||
|
||||
this.totalEvent = this.eventsList.length;
|
||||
this.showLoader = false;
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
|
||||
@@ -203,9 +203,9 @@ export class EventsPage implements OnInit {
|
||||
|
||||
this.totalEvent = this.eventsList.length;
|
||||
this.showLoader = false;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
case "Pessoal":
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
@@ -220,7 +220,7 @@ export class EventsPage implements OnInit {
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
case "Oficial":
|
||||
if(this.loggeduser.Profile == 'MDGPR'){
|
||||
@@ -234,7 +234,7 @@ export class EventsPage implements OnInit {
|
||||
this.officialeventsList = res.filter(data => data.CalendarName == "Oficial");;
|
||||
this.showLoader = false;
|
||||
});
|
||||
}
|
||||
}
|
||||
break;
|
||||
} */
|
||||
}
|
||||
@@ -276,7 +276,7 @@ export class EventsPage implements OnInit {
|
||||
|
||||
async openEventDetail1(id:any){
|
||||
console.log(id);
|
||||
|
||||
|
||||
const modal = await this.modalController.create({
|
||||
component: EventDetailPage,
|
||||
componentProps: {
|
||||
@@ -294,6 +294,7 @@ export class EventsPage implements OnInit {
|
||||
switch (this.loggeduser.Profile) {
|
||||
case 'MDGPR':
|
||||
this.processes.GetTasksList("Expediente", false).subscribe(result => {
|
||||
console.log(result);
|
||||
this.expedienteStorage.reset(result)
|
||||
});
|
||||
break;
|
||||
@@ -301,7 +302,7 @@ export class EventsPage implements OnInit {
|
||||
this.processes.GetTasksList("Expediente do Presidente", false).subscribe(result => {
|
||||
this.expedienteStorage.reset(result)
|
||||
});
|
||||
break;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
@@ -346,7 +347,7 @@ export class EventsPage implements OnInit {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,77 +1,84 @@
|
||||
<ion-header class="ion-no-border">
|
||||
<app-header></app-header>
|
||||
</ion-header>
|
||||
|
||||
<ion-header class="ion-no-border header-2">
|
||||
<div class="header-content">
|
||||
<div class="header-icon-left">
|
||||
<button class="btn-no-color cursor-pointer" (click)="goBack()">
|
||||
<ion-icon src="assets/images/icons-arrow-arrow-left.svg"></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="header-title">
|
||||
<label>Eventos para Aprovação</label>
|
||||
</div>
|
||||
<ion-toolbar>
|
||||
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
|
||||
<ion-segment-button value="MDGPR">
|
||||
Meu calendário
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="PR">
|
||||
Presidente da República
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
</ion-toolbar>
|
||||
|
||||
</div>
|
||||
</ion-header>
|
||||
|
||||
<ion-content>
|
||||
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh()">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
||||
<ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
||||
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
|
||||
<ion-refresher-content>
|
||||
</ion-refresher-content>
|
||||
</ion-refresher>
|
||||
<div class="main-content d-flex height-100" [ngSwitch]="segment">
|
||||
<div class="content d-flex flex-column">
|
||||
<div class="header-content">
|
||||
<div class="header-icon-left">
|
||||
<button class="btn-no-color cursor-pointer" (click)="goBack()">
|
||||
<ion-icon src="assets/images/icons-arrow-arrow-left.svg"></ion-icon>
|
||||
</button>
|
||||
</div>
|
||||
<div class="header-title">
|
||||
<label>Eventos para Aprovação</label>
|
||||
</div>
|
||||
<ion-toolbar>
|
||||
<ion-segment [(ngModel)]="segment" (ionChange)="segmentChanged($event)">
|
||||
<ion-segment-button value="MDGPR">
|
||||
Meu calendário
|
||||
</ion-segment-button>
|
||||
<ion-segment-button value="PR">
|
||||
Presidente da República
|
||||
</ion-segment-button>
|
||||
</ion-segment>
|
||||
</ion-toolbar>
|
||||
<ion-progress-bar type="indeterminate" *ngIf="skeletonLoader"></ion-progress-bar>
|
||||
</div>
|
||||
<div class="main-content d-flex height-100" >
|
||||
|
||||
<ion-list *ngSwitchCase="'MDGPR'">
|
||||
<div *ngIf="eventaprovacaostore.listmd" class="overflow-y-auto height-100">
|
||||
<div class="content d-flex flex-column">
|
||||
<div [ngSwitch]="segment">
|
||||
<ion-list *ngSwitchCase="'MDGPR'">
|
||||
<div *ngIf="eventaprovacaostore.listmd" class="overflow-y-auto height-100">
|
||||
<ion-item-sliding>
|
||||
<ion-item class="Rectangle cursor-pointer" lines="none"
|
||||
*ngFor="let event of eventaprovacaostore.listmd" (click)="goToEventToApproveDetail(event.serialNumber)">
|
||||
|
||||
<div class="content-mdgpr-{{event.workflowInstanceDataFields.Agenda}} width-100">
|
||||
<div class="approve-event-time">
|
||||
<p>{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}</p>
|
||||
<p>{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}</p>
|
||||
</div>
|
||||
<div class="approve-event-detail">
|
||||
<p *ngIf="event.workflowInstanceDataFields.StartDate != event.workflowInstanceDataFields.EndDate">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}</p>
|
||||
<p *ngIf="event.workflowInstanceDataFields.StartDate == event.workflowInstanceDataFields.EndDate">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}</p>
|
||||
<h3>{{event.workflowInstanceDataFields.Subject}}</h3>
|
||||
</div>
|
||||
</div>
|
||||
</ion-item>
|
||||
</ion-item-sliding>
|
||||
</div>
|
||||
</ion-list>
|
||||
|
||||
<ion-list *ngSwitchCase="'PR'">
|
||||
<div *ngIf="eventaprovacaostore.listpr" class="overflow-y-auto height-100">
|
||||
<ion-item-sliding>
|
||||
<ion-item class="Rectangle cursor-pointer" lines="none"
|
||||
*ngFor="let event of eventaprovacaostore.listmd" (click)="goToEventToApproveDetail(event.serialNumber)">
|
||||
|
||||
<div class="content-mdgpr-{{event.workflowInstanceDataFields.Agenda}} width-100">
|
||||
<div class="approve-event-time">
|
||||
<p>{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}</p>
|
||||
<p>{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}</p>
|
||||
*ngFor="let event of eventaprovacaostore.listpr" (click)="goToEventToApproveDetail(event.serialNumber)">
|
||||
<div class="content-pr-{{event.workflowInstanceDataFields.Agenda}} width-100">
|
||||
<div class="approve-event-time">
|
||||
<p>{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}</p>
|
||||
<p>{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}</p>
|
||||
</div>
|
||||
<div class="approve-event-detail">
|
||||
<p *ngIf="event.workflowInstanceDataFields.StartDate != event.workflowInstanceDataFields.EndDate">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}</p>
|
||||
<p *ngIf="event.workflowInstanceDataFields.StartDate == event.workflowInstanceDataFields.EndDate">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}</p>
|
||||
<h3>{{event.workflowInstanceDataFields.Subject}}</h3>
|
||||
</div>
|
||||
</div>
|
||||
<div class="approve-event-detail">
|
||||
<p *ngIf="event.workflowInstanceDataFields.StartDate != event.workflowInstanceDataFields.EndDate">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}</p>
|
||||
<p *ngIf="event.workflowInstanceDataFields.StartDate == event.workflowInstanceDataFields.EndDate">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}</p>
|
||||
<h3>{{event.workflowInstanceDataFields.Subject}}</h3>
|
||||
</div>
|
||||
</div>
|
||||
</ion-item>
|
||||
</ion-item>
|
||||
</ion-item-sliding>
|
||||
</div>
|
||||
</ion-list>
|
||||
<ion-list *ngSwitchCase="'PR'">
|
||||
<div *ngIf="eventaprovacaostore.listpr" class="overflow-y-auto height-100">
|
||||
<ion-item-sliding>
|
||||
<ion-item class="Rectangle cursor-pointer" lines="none"
|
||||
*ngFor="let event of eventaprovacaostore.listpr" (click)="goToEventToApproveDetail(event.serialNumber)">
|
||||
<div class="content-pr-{{event.workflowInstanceDataFields.Agenda}} width-100">
|
||||
<div class="approve-event-time">
|
||||
<p>{{event.workflowInstanceDataFields.StartDate | date: 'HH:mm'}}</p>
|
||||
<p>{{event.workflowInstanceDataFields.EndDate | date: 'HH:mm'}}</p>
|
||||
</div>
|
||||
<div class="approve-event-detail">
|
||||
<p *ngIf="event.workflowInstanceDataFields.StartDate != event.workflowInstanceDataFields.EndDate">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} - {{ event.workflowInstanceDataFields.EndDate | date: 'dd/M/yy'}} | {{event.workflowInstanceDataFields.Location}}</p>
|
||||
<p *ngIf="event.workflowInstanceDataFields.StartDate == event.workflowInstanceDataFields.EndDate">{{event.workflowInstanceDataFields.StartDate | date: 'd/M/yy' }} | {{event.workflowInstanceDataFields.Location}}</p>
|
||||
<h3>{{event.workflowInstanceDataFields.Subject}}</h3>
|
||||
</div>
|
||||
</div>
|
||||
</ion-item>
|
||||
</ion-item-sliding>
|
||||
</div>
|
||||
</ion-list>
|
||||
</div>
|
||||
</ion-list>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</ion-content>
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
@import '~src/function.scss';
|
||||
.header-2 {
|
||||
border-top-right-radius: 24px;
|
||||
border-top-left-radius: 24px;
|
||||
}
|
||||
.header-2{
|
||||
padding: 30px 20px 0 20px !important;
|
||||
background-color: white;
|
||||
}
|
||||
.main-content{
|
||||
background-color: #fff !important;
|
||||
border-top-left-radius: 25px;
|
||||
border-top-right-radius: 25px;
|
||||
}
|
||||
.content{
|
||||
padding: 30px 20px 0 20px !important;
|
||||
padding: 0px 20px 0 20px !important;
|
||||
/* margin: 0 auto; */
|
||||
float: left;
|
||||
overflow: auto;
|
||||
|
||||
@@ -45,7 +45,7 @@ export class EventListPage implements OnInit {
|
||||
this.router.events.forEach((event) => {
|
||||
if (event instanceof NavigationStart && event.url.startsWith(pathname)) {
|
||||
if(window.location.pathname.split('/').length >= 4 && window.location.pathname.startsWith('/home/gabinete-digital')) {
|
||||
this.doRefresh()
|
||||
this.refreshing()
|
||||
} else {
|
||||
this.LoadToApproveEvents()
|
||||
}
|
||||
@@ -76,12 +76,16 @@ export class EventListPage implements OnInit {
|
||||
let mdEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal MDGPR', false).toPromise();
|
||||
this.eventsMDGPRList = mdEventsOficial.concat(mdEventsPessoal);
|
||||
this.eventaprovacaostore.resetmd(this.eventsMDGPRList);
|
||||
console.log(this.eventsMDGPRList);
|
||||
|
||||
}
|
||||
else if(this.segment == 'PR'){
|
||||
let prEventsOficial = await this.processes.GetTasksList('Agenda Oficial PR', false).toPromise();
|
||||
let prEventsPessoal = await this.processes.GetTasksList('Agenda Pessoal PR', false).toPromise();
|
||||
this.eventsPRList = prEventsOficial.concat(prEventsPessoal);
|
||||
this.eventaprovacaostore.resetpr(this.eventsPRList);
|
||||
console.log(this.eventsMDGPRList);
|
||||
|
||||
}
|
||||
this.showLoader = false;
|
||||
this.skeletonLoader = false
|
||||
@@ -124,10 +128,11 @@ export class EventListPage implements OnInit {
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
doRefresh() {
|
||||
|
||||
doRefresh(event) {
|
||||
|
||||
setTimeout(() => {
|
||||
this.LoadToApproveEvents();
|
||||
event.target.complete();
|
||||
}, 1000);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user