mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-19 04:57:52 +00:00
Merge branch 'developer' of bitbucket.org:equilibriumito/gabinete-digital into developer
This commit is contained in:
@@ -0,0 +1 @@
|
|||||||
|
{}
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>Document</title>
|
|
||||||
<script src="https://cdn.jsdelivr.net/npm/alasql@0.4"></script>
|
|
||||||
<script>
|
|
||||||
|
|
||||||
var data = [ {a: 11, b: 10}, {a: 2, b: 20}, {a: 1, b: 30} ];
|
|
||||||
|
|
||||||
var res = alasql('SELECT * FROM ? WHERE a = 1',[data]);
|
|
||||||
|
|
||||||
console.log(res)
|
|
||||||
|
|
||||||
|
|
||||||
var data= [
|
|
||||||
{ a:{aa:10}, b:2 },
|
|
||||||
{ a:{aa:10}, b:2 },
|
|
||||||
{ a:{aa:2} , b:2 },
|
|
||||||
{ a:{aa:3} , b:3}
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
function db(table, sql) {
|
|
||||||
const data = indexedDB.gettable(table)
|
|
||||||
return alasql(sql, [data]);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
var res = alasql('SELECT a, b FROM ? WHERE b = 2',[ data ]);
|
|
||||||
|
|
||||||
|
|
||||||
console.log(res)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
alasql("INSERT INTO Persons VALUES (100, 'maquiran', 'peter', 18)");
|
|
||||||
console.log(alasql("SELECT * FROM Persons "))
|
|
||||||
|
|
||||||
|
|
||||||
</script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
@@ -17,12 +17,14 @@ export class InactivityGuard implements CanActivate {
|
|||||||
private router:Router,
|
private router:Router,
|
||||||
private platform: Platform,
|
private platform: Platform,
|
||||||
public permissionService: PermissionService,
|
public permissionService: PermissionService,
|
||||||
|
private alertController: AlertController
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
canActivate(
|
canActivate(
|
||||||
route: ActivatedRouteSnapshot,
|
route: ActivatedRouteSnapshot,
|
||||||
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
state: RouterStateSnapshot): Observable<boolean | UrlTree> | Promise<boolean | UrlTree> | boolean | UrlTree {
|
||||||
|
|
||||||
|
|
||||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
console.log(this.permissionList);
|
console.log(this.permissionList);
|
||||||
if(this.permissionService.userPermission(this.permissionList.Agenda.access) || this.permissionService.userPermission(this.permissionList.Gabinete.access)){
|
if(this.permissionService.userPermission(this.permissionList.Agenda.access) || this.permissionService.userPermission(this.permissionList.Gabinete.access)){
|
||||||
@@ -33,7 +35,23 @@ export class InactivityGuard implements CanActivate {
|
|||||||
}
|
}
|
||||||
else if(this.permissionService.userPermission(this.permissionList.Actions.access)){
|
else if(this.permissionService.userPermission(this.permissionList.Actions.access)){
|
||||||
this.router.navigate(['/home/publications']);
|
this.router.navigate(['/home/publications']);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.alertController.create({
|
||||||
|
cssClass: 'my-custom-class',
|
||||||
|
header: 'Utilizador sem acesso a aplicação',
|
||||||
|
buttons: [{
|
||||||
|
text: 'Ok',
|
||||||
|
handler: () => {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
}]
|
||||||
|
}).then( async (alertPopup) => {
|
||||||
|
await alertPopup.present();
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return false
|
return false
|
||||||
} else if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin ) {
|
} else if(SessionStore.exist && SessionStore.user.Inactivity && !SessionStore.hasPin ) {
|
||||||
return true
|
return true
|
||||||
@@ -41,6 +59,7 @@ export class InactivityGuard implements CanActivate {
|
|||||||
return true
|
return true
|
||||||
}//Mobile or Tablet without session
|
}//Mobile or Tablet without session
|
||||||
else {
|
else {
|
||||||
|
|
||||||
if(this.permissionService.userPermission(this.permissionList.Agenda.access) || this.permissionService.userPermission(this.permissionList.Gabinete.access)){
|
if(this.permissionService.userPermission(this.permissionList.Agenda.access) || this.permissionService.userPermission(this.permissionList.Gabinete.access)){
|
||||||
this.router.navigate(['/home/events']);
|
this.router.navigate(['/home/events']);
|
||||||
}
|
}
|
||||||
@@ -49,6 +68,19 @@ export class InactivityGuard implements CanActivate {
|
|||||||
}
|
}
|
||||||
else if(this.permissionService.userPermission(this.permissionList.Actions.access)){
|
else if(this.permissionService.userPermission(this.permissionList.Actions.access)){
|
||||||
this.router.navigate(['/home/publications']);
|
this.router.navigate(['/home/publications']);
|
||||||
|
} else {
|
||||||
|
this.alertController.create({
|
||||||
|
cssClass: 'my-custom-class',
|
||||||
|
header: 'Utilizador sem acesso a aplicação',
|
||||||
|
buttons: [{
|
||||||
|
text: 'Ok',
|
||||||
|
handler: () => {
|
||||||
|
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
}).then( async (alertPopup)=>{
|
||||||
|
await alertPopup.present();
|
||||||
|
})
|
||||||
}
|
}
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
|
|
||||||
<ion-tabs class="tab" >
|
<ion-tabs class="tab" >
|
||||||
<ion-tab-bar class="bottoms" slot="bottom">
|
<ion-tab-bar *ngIf="p.userPermissionCount([permissionList.Agenda.access, permissionList.Gabinete.access, permissionList.Actions.access, permissionList.Chat.access]) >= 2" class="bottoms" slot="bottom">
|
||||||
|
|
||||||
<ion-tab-button *ngIf="p.userPermission([permissionList.Agenda.access]) || p.userPermission([permissionList.Gabinete.access])" tab="events" [class.active]="pathname === '/home/events'">
|
<ion-tab-button *ngIf="p.userPermission([permissionList.Agenda.access]) || p.userPermission([permissionList.Gabinete.access])" tab="events" [class.active]="pathname === '/home/events'">
|
||||||
<!-- <ion-icon name="home"></ion-icon> -->
|
<!-- <ion-icon name="home"></ion-icon> -->
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ export interface EventListStore {
|
|||||||
calendarName: "Oficial" |"Pessoal"
|
calendarName: "Oficial" |"Pessoal"
|
||||||
profile: "md" | "pr",
|
profile: "md" | "pr",
|
||||||
id: string
|
id: string
|
||||||
|
CalendarId: any
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EventList {
|
export interface EventList {
|
||||||
|
|||||||
@@ -40,11 +40,13 @@ export class UserSession {
|
|||||||
Authorization: string;
|
Authorization: string;
|
||||||
Email: string
|
Email: string
|
||||||
FullName: string
|
FullName: string
|
||||||
|
ManagerName: string
|
||||||
OwnerCalendars: {
|
OwnerCalendars: {
|
||||||
CalendarId: string
|
CalendarId: string
|
||||||
CalendarName: "Oficial" | "Pessoal";
|
CalendarName: "Oficial" | "Pessoal";
|
||||||
CalendarRoleId: string;
|
CalendarRoleId: string;
|
||||||
Id: number;
|
Id: number;
|
||||||
|
OwnerUserId: any
|
||||||
}[]
|
}[]
|
||||||
RoleDescription: string
|
RoleDescription: string
|
||||||
RoleID: number
|
RoleID: number
|
||||||
@@ -55,12 +57,13 @@ export class UserSession {
|
|||||||
Id: number;
|
Id: number;
|
||||||
OwnerUserId: string;
|
OwnerUserId: string;
|
||||||
TypeShare: number;
|
TypeShare: number;
|
||||||
|
CalendarToken: string;
|
||||||
}[]
|
}[]
|
||||||
UserName: string
|
UserName: string
|
||||||
Password: string
|
Password: string
|
||||||
RochetChatUser: string
|
RochetChatUser: string
|
||||||
RochetChatUserId: string
|
RochetChatUserId: string
|
||||||
Profile: any;
|
Profile: 'PR' | 'MDGPR' | 'Consultant' | 'Department boss' | 'Assistant' | 'Director' | 'Deputy Director' | 'Secretariat' | 'Deputy Director' | 'General secretary' ;
|
||||||
LoginPreference: 'None' | 'Password' | 'Pin' | null;
|
LoginPreference: 'None' | 'Password' | 'Pin' | null;
|
||||||
PIN: string
|
PIN: string
|
||||||
Inactivity: boolean
|
Inactivity: boolean
|
||||||
|
|||||||
@@ -93,14 +93,6 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- <div class="drop-down">
|
|
||||||
<ion-icon slot="icon-only" class="arrow-down" src="assets/images/icons-arrow-arrow-down.svg"></ion-icon>
|
|
||||||
<div class="drop-down-container">
|
|
||||||
<ul>
|
|
||||||
<li *ngFor="let month of monthList" (click)="dropDownChangeDate(month.id)" >{{ month.name }}</li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
</div> -->
|
|
||||||
<!-- Move forward one screen of the slides -->
|
<!-- Move forward one screen of the slides -->
|
||||||
<div (click)="next()" class="arrow cursor-pointer resize">
|
<div (click)="next()" class="arrow cursor-pointer resize">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="icon-only" src="assets/images/icons-calendar-arrow-right.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " slot="icon-only" src="assets/images/icons-calendar-arrow-right.svg"></ion-icon>
|
||||||
@@ -111,11 +103,24 @@
|
|||||||
</ion-row>
|
</ion-row>
|
||||||
<ion-row class="ion-align-items-center">
|
<ion-row class="ion-align-items-center">
|
||||||
|
|
||||||
<button *ngIf="profile == 'mdgpr' && loggeduser.Profile =='MDGPR' " (click)="changeProfile()" class="d-md-none btn-no-color resize">
|
<!-- <div *ngIf="loggeduser.Profile != 'PR' && loggeduser.Profile != 'MDGPR'" class="calendar-letters"> -->
|
||||||
|
<div class="calendar-letters cal-reverse" *ngIf="loggeduser.Profile != 'PR' && loggeduser.Profile != 'MDGPR' && eventService.calendarOwnerIds.length >= 2" class="calendar-letters" [class.cal-reverse]="loggeduser.Profile != 'PR' && loggeduser.Profile != 'MDGPR' && profile == 'mdgpr' " (click)="changeProfile()">
|
||||||
|
<div class="text" *ngIf="profile == 'mdgpr'">
|
||||||
|
{{ sessionStore.getInitials }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<div class="text" *ngIf="profile == 'pr'">
|
||||||
|
{{ sessionStore.getManagerInitials }}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<button *ngIf="profile == 'mdgpr' && eventService.calendarOwnerIds.length >= 2 && ( loggeduser.Profile == 'PR' || loggeduser.Profile == 'MDGPR') " (click)="changeProfile()" class="d-md-none btn-no-color resize">
|
||||||
<ion-icon class="right-icons" src="assets/images/icons-profile-calendar-md.svg"></ion-icon>
|
<ion-icon class="right-icons" src="assets/images/icons-profile-calendar-md.svg"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button title="Mudar de Agenda" *ngIf="profile == 'pr' && loggeduser.Profile =='MDGPR' " (click)="changeProfile()" class="btn-no-color resize">
|
<button title="Mudar de Agenda" *ngIf="profile == 'pr'&& eventService.calendarOwnerIds.length >= 2 && ( loggeduser.Profile == 'PR' || loggeduser.Profile == 'MDGPR')" (click)="changeProfile()" class="btn-no-color resize">
|
||||||
<ion-icon class="right-icons d-md-none" src="assets/images/icons-profile-calendar-pr.svg"></ion-icon>
|
<ion-icon class="right-icons d-md-none" src="assets/images/icons-profile-calendar-pr.svg"></ion-icon>
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
@@ -184,9 +189,7 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="calendar-border">
|
<div class="calendar-border"></div>
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Calendar currente date -->
|
<!-- Calendar currente date -->
|
||||||
<ion-row class="timeline-header pb-0 ion-justify-content-between ion-align-items-center currente-date-timelien">
|
<ion-row class="timeline-header pb-0 ion-justify-content-between ion-align-items-center currente-date-timelien">
|
||||||
@@ -228,11 +231,11 @@
|
|||||||
|
|
||||||
<div class="calendar-title-container px-20 d-none d-md-flex" *ngIf="loggeduser.Profile == 'MDGPR'">
|
<div class="calendar-title-container px-20 d-none d-md-flex" *ngIf="loggeduser.Profile == 'MDGPR'">
|
||||||
<div class="calendar-title-description flex-grow-1 text-grey d-flex justify-center align-center">
|
<div class="calendar-title-description flex-grow-1 text-grey d-flex justify-center align-center">
|
||||||
<div>Calendário do MDGPR</div>
|
<div *ngIf="loggeduser.Profile == 'PR' || loggeduser.Profile == 'MDGPR'">Calendário do MDGPR</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="calendar-title-description text-black align-center">
|
<div class="calendar-title-description text-black align-center">
|
||||||
<div class="flex-grow-1 text-grey d-flex justify-center align-center">
|
<div class="flex-grow-1 text-grey d-flex justify-center align-center">
|
||||||
<div>Calendário do Presidente da República</div>
|
<div *ngIf="loggeduser.Profile == 'PR' || loggeduser.Profile == 'MDGPR'">Calendário do Presidente da República</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -248,6 +251,7 @@
|
|||||||
<div class="timeline-container height-100 d-flex pt-20 pl-20 pl-20 filter-{{segment}}" >
|
<div class="timeline-container height-100 d-flex pt-20 pl-20 pl-20 filter-{{segment}}" >
|
||||||
|
|
||||||
<div class="ss-timeline timeline-mobile flex-grow-1 d-md-none text-black height-100 width-100 overflow-y-auto" >
|
<div class="ss-timeline timeline-mobile flex-grow-1 d-md-none text-black height-100 width-100 overflow-y-auto" >
|
||||||
|
|
||||||
<div *ngFor="let events of TimelineMDList | keyvalue;" >
|
<div *ngFor="let events of TimelineMDList | keyvalue;" >
|
||||||
|
|
||||||
<div class="EventListBox-container" >
|
<div class="EventListBox-container" >
|
||||||
@@ -290,7 +294,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="fs-timeline flex-grow-1 d-none d-md-block d-md-block text-black pr-20 width-100 height-100 overflow-y-auto" *ngIf="loggeduser.Profile == 'MDGPR'">
|
<div class="fs-timeline flex-grow-1 d-none d-md-block d-md-block text-black pr-20 width-100 height-100 overflow-y-auto" *ngIf="eventService.calendarOwnerIds.length >= 2">
|
||||||
<div *ngFor="let events of TimelineMDList | keyvalue;" >
|
<div *ngFor="let events of TimelineMDList | keyvalue;" >
|
||||||
|
|
||||||
<div class="EventListBox-container" >
|
<div class="EventListBox-container" >
|
||||||
|
|||||||
@@ -857,3 +857,26 @@ $font-size: 11pt;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.calendar-letters {
|
||||||
|
width: 36px;
|
||||||
|
height: 36px;
|
||||||
|
background-color: #f05d5e;
|
||||||
|
border-radius: 44px;
|
||||||
|
text-align: center;
|
||||||
|
align-items: center;
|
||||||
|
display: flex;
|
||||||
|
justify-content: center;
|
||||||
|
margin-top: -3px;
|
||||||
|
border: 1.5px solid black;
|
||||||
|
color: white;
|
||||||
|
.text{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.cal-reverse {
|
||||||
|
background: white !important;
|
||||||
|
color: black !important;
|
||||||
|
border-color: #f05d5e !important;
|
||||||
|
}
|
||||||
@@ -32,6 +32,7 @@ import { ChangeProfileService } from 'src/app/services/change-profile.service';
|
|||||||
import { SqliteService } from 'src/app/services/sqlite.service';
|
import { SqliteService } from 'src/app/services/sqlite.service';
|
||||||
import { BackgroundService } from 'src/app/services/background.service';
|
import { BackgroundService } from 'src/app/services/background.service';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -163,11 +164,13 @@ export class AgendaPage implements OnInit {
|
|||||||
listToPresent
|
listToPresent
|
||||||
array = []
|
array = []
|
||||||
|
|
||||||
|
sessionStore = SessionStore;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private alertCtrl: AlertController,
|
private alertCtrl: AlertController,
|
||||||
@Inject(LOCALE_ID) private locale: string,
|
@Inject(LOCALE_ID) private locale: string,
|
||||||
private modalCtrl: ModalController,
|
private modalCtrl: ModalController,
|
||||||
private eventService: EventsService,
|
public eventService: EventsService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private sanitizer: DomSanitizer,
|
private sanitizer: DomSanitizer,
|
||||||
authService: AuthService,
|
authService: AuthService,
|
||||||
@@ -192,16 +195,27 @@ export class AgendaPage implements OnInit {
|
|||||||
if (this.loggeduser.Profile == 'MDGPR') {
|
if (this.loggeduser.Profile == 'MDGPR') {
|
||||||
this.mobileComponent.showEventList = true;
|
this.mobileComponent.showEventList = true;
|
||||||
this.profile = "mdgpr";
|
this.profile = "mdgpr";
|
||||||
} else {
|
} else if (this.loggeduser.Profile == 'PR') {
|
||||||
this.profile = "pr";
|
this.profile = "pr";
|
||||||
|
} else {
|
||||||
|
this.profile = "mdgpr";
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
if (this.loggeduser.Profile == 'MDGPR') {
|
if (this.loggeduser.Profile == 'MDGPR') {
|
||||||
this.mobileComponent.showEventList = true;
|
this.mobileComponent.showEventList = true;
|
||||||
this.profile = "mdgpr";
|
this.profile = "mdgpr";
|
||||||
} else {
|
} else if (this.loggeduser.Profile == 'PR') {
|
||||||
this.profile = "pr";
|
this.profile = "pr";
|
||||||
|
} else {
|
||||||
|
if(this.eventService.calendarOwnerIds.length >= 2) {
|
||||||
|
this.profile = "mdgpr";
|
||||||
|
} else if (this.eventService.hasOwnCalendar) {
|
||||||
|
this.profile = "mdgpr";
|
||||||
|
} else if (this.eventService.hasSharedCalendar) {
|
||||||
|
this.profile = "pr";
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.calendarHeight = "356px";
|
this.calendarHeight = "356px";
|
||||||
@@ -285,6 +299,7 @@ export class AgendaPage implements OnInit {
|
|||||||
/* console.log('Event clicked', event); */
|
/* console.log('Event clicked', event); */
|
||||||
//clear
|
//clear
|
||||||
|
|
||||||
|
console.log(event)
|
||||||
|
|
||||||
this.setIntervenient([]);
|
this.setIntervenient([]);
|
||||||
this.setIntervenientCC([]);
|
this.setIntervenientCC([]);
|
||||||
@@ -529,8 +544,7 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
this.getFromDB();
|
this.getFromDB();
|
||||||
})
|
}).finally(() => {
|
||||||
.finally(() => {
|
|
||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
})
|
})
|
||||||
|
|
||||||
@@ -597,6 +611,69 @@ export class AgendaPage implements OnInit {
|
|||||||
.finally(() => {
|
.finally(() => {
|
||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
})
|
})
|
||||||
|
} else if (this.loggeduser.Profile != 'PR' && this.loggeduser.Profile != 'MDGPR'){
|
||||||
|
if(this.profile == "mdgpr") {
|
||||||
|
|
||||||
|
this.eventService.getAllOwnEvents(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('ALL MD EVENTS', response);
|
||||||
|
|
||||||
|
this.addEventToDB(response, "md");
|
||||||
|
|
||||||
|
// calendar
|
||||||
|
this.CalendarStore.removeRange(startTime, endTime, 'md')
|
||||||
|
|
||||||
|
// loop
|
||||||
|
this.CalendarStore.pushEvent(response, 'md');
|
||||||
|
|
||||||
|
console.log('CALENDAR STORE', this.CalendarStore.eventSource)
|
||||||
|
this.listToPresent = this.CalendarStore.eventSource
|
||||||
|
this.trasnformData(response, 'md');
|
||||||
|
|
||||||
|
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||||
|
|
||||||
|
console.log('check list to present data', this.listToPresent);
|
||||||
|
this.myCal.update();
|
||||||
|
this.myCal.loadEvents();
|
||||||
|
|
||||||
|
this.showLoader = false;
|
||||||
|
this.showTimeline = true;
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
this.getFromDB();
|
||||||
|
}).finally(() => {
|
||||||
|
this.showLoader = false;
|
||||||
|
})
|
||||||
|
|
||||||
|
} else if (this.profile == "pr" ) {
|
||||||
|
|
||||||
|
this.eventService.genericGetAllSharedEvents(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59')).then((response: any) => {
|
||||||
|
this.addEventToDB(response, "pr");
|
||||||
|
|
||||||
|
this.CalendarStore.removeRange(startTime, endTime, 'pr')
|
||||||
|
// calendar
|
||||||
|
this.CalendarStore.pushEvent(response, 'pr');
|
||||||
|
|
||||||
|
this.listToPresent = this.CalendarStore.eventSource
|
||||||
|
|
||||||
|
|
||||||
|
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||||
|
|
||||||
|
console.log('check list to present data', this.listToPresent);
|
||||||
|
this.myCal.update();
|
||||||
|
this.myCal.loadEvents();
|
||||||
|
|
||||||
|
this.showLoader = false;
|
||||||
|
this.showTimeline = true;
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
this.getFromDB()
|
||||||
|
}).finally(() => {
|
||||||
|
this.showLoader = false;
|
||||||
|
})
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
@@ -604,7 +681,6 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
let counter = 0;
|
let counter = 0;
|
||||||
|
|
||||||
// view MDGPR calendar with MDGPR profile
|
|
||||||
if (this.loggeduser.Profile == 'MDGPR') {
|
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) => {
|
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) => {
|
||||||
@@ -635,8 +711,7 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
this.getFromDB()
|
this.getFromDB()
|
||||||
})
|
}).finally(() => {
|
||||||
.finally(() => {
|
|
||||||
counter++;
|
counter++;
|
||||||
if (counter == 2) {
|
if (counter == 2) {
|
||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
@@ -673,15 +748,14 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
this.getFromDB()
|
this.getFromDB()
|
||||||
})
|
}).finally(() => {
|
||||||
.finally(() => {
|
|
||||||
counter++;
|
counter++;
|
||||||
if (counter == 2) {
|
if (counter == 2) {
|
||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
} else {
|
} else if(this.loggeduser.Profile == 'PR') {
|
||||||
|
|
||||||
// view PR calendar with PR profile
|
// view PR calendar with PR profile
|
||||||
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.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) => {
|
||||||
@@ -719,13 +793,105 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
this.getFromDB()
|
this.getFromDB()
|
||||||
})
|
}).finally(() => {
|
||||||
.finally(() => {
|
|
||||||
if (counter == 1 || this.loggeduser.Profile == 'PR') {
|
if (counter == 1 || this.loggeduser.Profile == 'PR') {
|
||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if(this.loggeduser.OwnerCalendars.length != 0) {
|
||||||
|
|
||||||
|
this.eventService.getAllOwnEvents(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59')).then((response: any) => {
|
||||||
|
|
||||||
|
this.addEventToDB(response, "md");
|
||||||
|
let eventsList = response;
|
||||||
|
|
||||||
|
this.CalendarStore.removeRange(startTime, endTime, 'md')
|
||||||
|
|
||||||
|
// loop
|
||||||
|
this.CalendarStore.pushEvent(eventsList, 'md');
|
||||||
|
|
||||||
|
this.listToPresent = this.CalendarStore.eventSource
|
||||||
|
|
||||||
|
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||||
|
|
||||||
|
this.myCal.update();
|
||||||
|
this.myCal.loadEvents();
|
||||||
|
|
||||||
|
this.showTimelineMD = true;
|
||||||
|
|
||||||
|
counter++;
|
||||||
|
if (counter == 2) {
|
||||||
|
this.showLoader = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
this.getFromDB()
|
||||||
|
}).finally(() => {
|
||||||
|
counter++;
|
||||||
|
if (counter == 2) {
|
||||||
|
this.showLoader = false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
counter++;
|
||||||
|
if (counter == 2) {
|
||||||
|
this.showLoader = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(this.loggeduser.SharedCalendars)
|
||||||
|
|
||||||
|
if(this.loggeduser.SharedCalendars.length != 0) {
|
||||||
|
|
||||||
|
|
||||||
|
this.eventService.genericGetAllSharedEvents(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59')).then((response: any) => {
|
||||||
|
|
||||||
|
this.addEventToDB(response, "pr");
|
||||||
|
let eventsList = response;
|
||||||
|
|
||||||
|
// clear the current month only
|
||||||
|
this.CalendarStore.removeRange(startTime, endTime, 'pr')
|
||||||
|
|
||||||
|
|
||||||
|
this.CalendarStore.pushEvent(eventsList, 'pr');
|
||||||
|
this.listToPresent = this.CalendarStore.eventSource
|
||||||
|
|
||||||
|
|
||||||
|
this.TimelinePRList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||||
|
|
||||||
|
console.log('check list to present data', this.listToPresent);
|
||||||
|
|
||||||
|
this.myCal.update();
|
||||||
|
this.myCal.loadEvents();
|
||||||
|
|
||||||
|
this.showTimelinePR = true;
|
||||||
|
|
||||||
|
counter++;
|
||||||
|
|
||||||
|
if (counter == 2 || this.loggeduser.Profile == 'PR') {
|
||||||
|
this.showLoader = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
}).catch((error) => {
|
||||||
|
this.getFromDB()
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
counter++;
|
||||||
|
if (counter == 2) {
|
||||||
|
this.showLoader = false;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
counter++;
|
||||||
|
if (counter == 2) {
|
||||||
|
this.showLoader = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -751,6 +917,8 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
//Deve ser removido para ficar só um method transform
|
//Deve ser removido para ficar só um method transform
|
||||||
trasnformDataDB(response) {
|
trasnformDataDB(response) {
|
||||||
|
|
||||||
|
if(response) {
|
||||||
console.log('Transform ', response)
|
console.log('Transform ', response)
|
||||||
response.forEach(element => {
|
response.forEach(element => {
|
||||||
let event = {
|
let event = {
|
||||||
@@ -768,6 +936,8 @@ export class AgendaPage implements OnInit {
|
|||||||
console.log('LIST TO PRESET', this.listToPresent)
|
console.log('LIST TO PRESET', this.listToPresent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
addEventToDB(response, profile) {
|
addEventToDB(response, profile) {
|
||||||
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
let responseArray = [];
|
let responseArray = [];
|
||||||
@@ -848,6 +1018,25 @@ export class AgendaPage implements OnInit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
getEventsFromDB () {
|
||||||
|
|
||||||
|
new Promise((resolve, reject)=>{
|
||||||
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
|
this.storage.get('agendaResponse').then((events) => {
|
||||||
|
resolve(events)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.sqliteservice.getAllEvents().then((events: any[]) => {
|
||||||
|
resolve(events)
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
updateEventListBox() {
|
updateEventListBox() {
|
||||||
|
|
||||||
if (window.innerWidth < 800) {
|
if (window.innerWidth < 800) {
|
||||||
@@ -866,6 +1055,14 @@ export class AgendaPage implements OnInit {
|
|||||||
}
|
}
|
||||||
else if (this.loggeduser.Profile == 'PR') {
|
else if (this.loggeduser.Profile == 'PR') {
|
||||||
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if(this.profile == "pr") {
|
||||||
|
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||||
|
} else if (this.profile == "mdgpr") {
|
||||||
|
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -875,9 +1072,15 @@ export class AgendaPage implements OnInit {
|
|||||||
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else if(this.loggeduser.Profile == 'PR') {
|
||||||
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||||
this.TimelinePRList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
this.TimelinePRList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||||
|
} else {
|
||||||
|
if(this.profile == "pr") {
|
||||||
|
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||||
|
} else if (this.profile == "mdgpr") {
|
||||||
|
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@@ -886,15 +1089,22 @@ export class AgendaPage implements OnInit {
|
|||||||
if (this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') {
|
if (this.profile == "mdgpr" && this.loggeduser.Profile == 'MDGPR') {
|
||||||
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, {segment: this.segment, selectedDate: this.eventSelectedDate})
|
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, {segment: this.segment, selectedDate: this.eventSelectedDate})
|
||||||
|
|
||||||
} else {
|
} else if(this.loggeduser.Profile == 'PR') {
|
||||||
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||||
this.TimelinePRList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
this.TimelinePRList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||||
|
|
||||||
|
} else {
|
||||||
|
if(this.profile == "pr") {
|
||||||
|
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||||
|
} else if (this.profile == "mdgpr") {
|
||||||
|
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this.TimelinePRList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
this.TimelinePRList = this.listBoxService.list(this.listToPresent, 'pr', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||||
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
this.TimelineMDList = this.listBoxService.list(this.listToPresent, 'md', this.rangeStartDate, this.rangeEndDate, { segment: this.segment, selectedDate: this.eventSelectedDate })
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ import { SearchPage } from '../../search/search.page';
|
|||||||
import { ThemeService } from 'src/app/services/theme.service';
|
import { ThemeService } from 'src/app/services/theme.service';
|
||||||
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
||||||
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||||
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
|
|
||||||
|
|
||||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||||
parse: {
|
parse: {
|
||||||
@@ -79,6 +81,8 @@ export class EditEventPage implements OnInit {
|
|||||||
public stepMinutes = [1, 5, 10, 15, 20, 25];
|
public stepMinutes = [1, 5, 10, 15, 20, 25];
|
||||||
public stepSeconds = [1, 5, 10, 15, 20, 25];
|
public stepSeconds = [1, 5, 10, 15, 20, 25];
|
||||||
|
|
||||||
|
sesseionStora = SessionStore
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
private navParams: NavParams,
|
private navParams: NavParams,
|
||||||
@@ -249,6 +253,7 @@ export class EditEventPage implements OnInit {
|
|||||||
|
|
||||||
this.postEvent.EventRecurrence.Type = this.selectedRecurringType;
|
this.postEvent.EventRecurrence.Type = this.selectedRecurringType;
|
||||||
|
|
||||||
|
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
|
||||||
this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
|
this.eventsService.editEvent(this.postEvent, 2, 3).subscribe(async () => {
|
||||||
|
|
||||||
if(this.initCalendarName != this.postEvent.CalendarName) {
|
if(this.initCalendarName != this.postEvent.CalendarName) {
|
||||||
@@ -272,6 +277,33 @@ export class EditEventPage implements OnInit {
|
|||||||
if(error.status != 0)
|
if(error.status != 0)
|
||||||
this.toastService.badRequest()
|
this.toastService.badRequest()
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.eventsService.editEvent(this.postEvent, 2, 3, this.postEvent.CalendarId).subscribe(async () => {
|
||||||
|
|
||||||
|
if(this.initCalendarName != this.postEvent.CalendarName) {
|
||||||
|
|
||||||
|
let body = {
|
||||||
|
"EventId": this.postEvent.EventId,
|
||||||
|
"CalendarDestinationName": this.postEvent.CalendarName,
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
await this.eventsService.changeAgenda(body).toPromise();
|
||||||
|
} catch (error) {}
|
||||||
|
finally {
|
||||||
|
this.goBack();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
this.toastService.successMessage();
|
||||||
|
|
||||||
|
}, error => {
|
||||||
|
if(error.status != 0)
|
||||||
|
this.toastService.badRequest()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
this.isEventEdited = true;
|
this.isEventEdited = true;
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,6 @@ import { AttendeesPageModal } from '../../events/attendees/attendees.page';
|
|||||||
import { SearchPage } from '../../search/search.page';
|
import { SearchPage } from '../../search/search.page';
|
||||||
import { ThemePalette } from '@angular/material/core';
|
import { ThemePalette } from '@angular/material/core';
|
||||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||||
import { EventRecurrence } from 'src/app/models/agenda/eventrecurrence.model';
|
|
||||||
import { ThemeService } from 'src/app/services/theme.service';
|
import { ThemeService } from 'src/app/services/theme.service';
|
||||||
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
import { NgxMatDateFormats } from '@angular-material-components/datetime-picker';
|
||||||
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||||
@@ -129,7 +128,6 @@ export class NewEventPage implements OnInit {
|
|||||||
console.log(this.postEvent);
|
console.log(this.postEvent);
|
||||||
console.log(this.selectedSegment);
|
console.log(this.selectedSegment);
|
||||||
|
|
||||||
|
|
||||||
this.getRecurrenceTypes();
|
this.getRecurrenceTypes();
|
||||||
|
|
||||||
if(this.selectedSegment != "Combinada"){
|
if(this.selectedSegment != "Combinada"){
|
||||||
@@ -302,7 +300,7 @@ export class NewEventPage implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if(this.CalendarName == 'MDGPR') {
|
if(this.loggeduser.Profile == 'MDGPR') {
|
||||||
console.log(this.loggeduser.Profile);
|
console.log(this.loggeduser.Profile);
|
||||||
|
|
||||||
console.log(this.postEvent);
|
console.log(this.postEvent);
|
||||||
@@ -311,10 +309,12 @@ export class NewEventPage implements OnInit {
|
|||||||
console.log(eventId);
|
console.log(eventId);
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(this.CalendarName == 'PR'){
|
else if(this.loggeduser.Profile == 'PR') {
|
||||||
console.log(this.loggeduser.Profile);
|
console.log(this.loggeduser.Profile);
|
||||||
|
|
||||||
eventId = await this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).toPromise();
|
eventId = await this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).toPromise();
|
||||||
|
} else {
|
||||||
|
eventId = await this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName).toPromise();
|
||||||
}
|
}
|
||||||
|
|
||||||
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ import { StorageService } from 'src/app/services/storage.service';
|
|||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { RouteService } from 'src/app/services/route.service';
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
import { Storage } from '@ionic/storage';
|
import { Storage } from '@ionic/storage';
|
||||||
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
|
import { CalendarService } from 'src/app/store/calendar.service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -55,7 +57,7 @@ export class ViewEventPage implements OnInit {
|
|||||||
header = true
|
header = true
|
||||||
task: ExpedientTaskModalPageNavParamsTask;
|
task: ExpedientTaskModalPageNavParamsTask;
|
||||||
LoadedDocument: any = null;
|
LoadedDocument: any = null;
|
||||||
|
sesseionStora = SessionStore
|
||||||
constructor(
|
constructor(
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
/* private navParams: NavParams, */
|
/* private navParams: NavParams, */
|
||||||
@@ -75,7 +77,8 @@ export class ViewEventPage implements OnInit {
|
|||||||
private storage: StorageService,
|
private storage: StorageService,
|
||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
private RouteService: RouteService,
|
private RouteService: RouteService,
|
||||||
private ionicStorage: Storage
|
private ionicStorage: Storage,
|
||||||
|
private CalendarService: CalendarService
|
||||||
) {
|
) {
|
||||||
this.isEventEdited = false;
|
this.isEventEdited = false;
|
||||||
this.loadedEvent = new Event();
|
this.loadedEvent = new Event();
|
||||||
@@ -96,13 +99,6 @@ export class ViewEventPage implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
/* this.activatedRoute.queryParams.subscribe(params => {
|
|
||||||
if(params["eventId"]) {
|
|
||||||
this.eventId = params["eventId"];
|
|
||||||
console.log(params["eventId"]);
|
|
||||||
}
|
|
||||||
}); */
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@@ -137,6 +133,23 @@ export class ViewEventPage implements OnInit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getEventsFromDB () {
|
||||||
|
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
|
this.storage.get('agendaResponse').then((events) => {
|
||||||
|
resolve(events)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
this.sqliteservice.getAllEvents().then((events: any[]) => {
|
||||||
|
resolve(events)
|
||||||
|
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
close() {
|
close() {
|
||||||
|
|
||||||
this.modalController.dismiss(this.isEventEdited);
|
this.modalController.dismiss(this.isEventEdited);
|
||||||
@@ -166,6 +179,8 @@ export class ViewEventPage implements OnInit {
|
|||||||
|
|
||||||
loadEvent() {
|
loadEvent() {
|
||||||
const loader = this.toastService.loading();
|
const loader = this.toastService.loading();
|
||||||
|
|
||||||
|
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
|
||||||
this.eventsService.getEvent(this.eventId).subscribe(res => {
|
this.eventsService.getEvent(this.eventId).subscribe(res => {
|
||||||
this.loadedEvent = res;
|
this.loadedEvent = res;
|
||||||
this.addEventToDb(res);
|
this.addEventToDb(res);
|
||||||
@@ -177,6 +192,34 @@ export class ViewEventPage implements OnInit {
|
|||||||
|
|
||||||
console.log('errorstatus ss',error.status)
|
console.log('errorstatus ss',error.status)
|
||||||
|
|
||||||
|
if (error.status === 0) {
|
||||||
|
this.getFromDb();
|
||||||
|
} else {
|
||||||
|
this.toastService.badRequest('Este evento já não existe na sua agenda')
|
||||||
|
loader.remove()
|
||||||
|
this.modalController.dismiss('Eevent not Foud');
|
||||||
|
this.RouteService.goBack();
|
||||||
|
}
|
||||||
|
loader.remove()
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
|
||||||
|
const event = this.CalendarService.eventSource.find((ele) => ele.id == this.eventId)
|
||||||
|
|
||||||
|
// console.log('View event details', event)
|
||||||
|
|
||||||
|
if(event?.CalendarId) {
|
||||||
|
this.eventsService.genericGetEvent(this.eventId, event.CalendarId).subscribe(res => {
|
||||||
|
this.loadedEvent = res;
|
||||||
|
this.addEventToDb(res);
|
||||||
|
console.log('Loaded one event', res)
|
||||||
|
/* this.today = new Date(res.StartDate);
|
||||||
|
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]); */
|
||||||
|
loader.remove()
|
||||||
|
}, (error) => {
|
||||||
|
|
||||||
|
console.log('errorstatus ss',error.status)
|
||||||
|
|
||||||
if (error.status === 0) {
|
if (error.status === 0) {
|
||||||
this.getFromDb();
|
this.getFromDb();
|
||||||
} else {
|
} else {
|
||||||
@@ -189,10 +232,17 @@ export class ViewEventPage implements OnInit {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
deleteEvent() {
|
deleteEvent() {
|
||||||
|
|
||||||
const loader = this.toastService.loading()
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
|
||||||
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => {
|
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => {
|
||||||
const alert = await this.alertController.create({
|
const alert = await this.alertController.create({
|
||||||
cssClass: 'my-custom-class',
|
cssClass: 'my-custom-class',
|
||||||
@@ -210,7 +260,27 @@ export class ViewEventPage implements OnInit {
|
|||||||
loader.remove();
|
loader.remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.eventsService.genericDeleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName, this.loadedEvent.CalendarId).subscribe(async () => {
|
||||||
|
const alert = await this.alertController.create({
|
||||||
|
cssClass: 'my-custom-class',
|
||||||
|
header: 'Evento removido',
|
||||||
|
buttons: ['OK']
|
||||||
|
});
|
||||||
|
|
||||||
|
setTimeout(() => {
|
||||||
|
alert.dismiss();
|
||||||
|
}, 1500);
|
||||||
|
this.goBack();
|
||||||
|
this.toastService.successMessage('Evento apagado');
|
||||||
|
}, () => { },
|
||||||
|
() => {
|
||||||
loader.remove();
|
loader.remove();
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -65,6 +65,14 @@
|
|||||||
<div class="message">
|
<div class="message">
|
||||||
<ion-label *ngIf="msg.delate == false">{{msg.msg}}</ion-label>
|
<ion-label *ngIf="msg.delate == false">{{msg.msg}}</ion-label>
|
||||||
<ion-label *ngIf="msg.delate == true">{{msg.msg}}</ion-label>
|
<ion-label *ngIf="msg.delate == true">{{msg.msg}}</ion-label>
|
||||||
|
|
||||||
|
<ion-label class="float-status-all float-status" >
|
||||||
|
|
||||||
|
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon>
|
||||||
|
</ion-label>
|
||||||
{{last ? scrollToBottom() : ''}}
|
{{last ? scrollToBottom() : ''}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -108,6 +116,12 @@
|
|||||||
<div *ngIf="msg.file.type == 'application/img' && msg.attachments[0].image_url" (click)="openPreview(msg)">
|
<div *ngIf="msg.file.type == 'application/img' && msg.attachments[0].image_url" (click)="openPreview(msg)">
|
||||||
<img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image" >
|
<img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image" >
|
||||||
<ion-icon *ngIf="msg.attachments[0].image_url == null" name="download-outline"></ion-icon>
|
<ion-icon *ngIf="msg.attachments[0].image_url == null" name="download-outline"></ion-icon>
|
||||||
|
<ion-label class="float-status-all float-status" >
|
||||||
|
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon>
|
||||||
|
</ion-label>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="msg.file.type != 'application/img'">
|
<div *ngIf="msg.file.type != 'application/img'">
|
||||||
<div class="file add-attachment-bg-color" *ngIf="msg.file.type != 'application/audio'">
|
<div class="file add-attachment-bg-color" *ngIf="msg.file.type != 'application/audio'">
|
||||||
@@ -115,6 +129,7 @@
|
|||||||
<span *ngIf="msg.file.type">
|
<span *ngIf="msg.file.type">
|
||||||
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
|
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
|
||||||
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon>
|
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon>
|
||||||
|
<fa-icon *ngIf="msg.file.type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'" icon="file-word" class="word-icon"></fa-icon>
|
||||||
<fa-icon *ngIf="msg.file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'" icon="file-word" class="excel-icon"></fa-icon>
|
<fa-icon *ngIf="msg.file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'" icon="file-word" class="excel-icon"></fa-icon>
|
||||||
<ion-icon *ngIf="msg.file.type == 'application/webtrix'" src="assets/icon/webtrix.svg"></ion-icon>
|
<ion-icon *ngIf="msg.file.type == 'application/webtrix'" src="assets/icon/webtrix.svg"></ion-icon>
|
||||||
</span>
|
</span>
|
||||||
@@ -138,6 +153,13 @@
|
|||||||
<span *ngIf="file.description && msg.file.type != 'application/webtrix'"> • </span>
|
<span *ngIf="file.description && msg.file.type != 'application/webtrix'"> • </span>
|
||||||
<span *ngIf="msg.file.type != 'application/webtrix' && msg.file.type != 'application/audio'">{{msg.displayType}}</span>
|
<span *ngIf="msg.file.type != 'application/webtrix' && msg.file.type != 'application/audio'">{{msg.displayType}}</span>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
|
<ion-label class="float-status-all float-status" >
|
||||||
|
|
||||||
|
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon>
|
||||||
|
</ion-label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -359,3 +359,31 @@
|
|||||||
.typing ngx-letters-avatar {
|
.typing ngx-letters-avatar {
|
||||||
padding-right: 5px;
|
padding-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.float-status{
|
||||||
|
position: relative !important;
|
||||||
|
float: right;
|
||||||
|
display: flex;
|
||||||
|
align-items: self-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.float-status-image{
|
||||||
|
position: relative !important;
|
||||||
|
float: right;
|
||||||
|
display: flex;
|
||||||
|
align-items: self-end;
|
||||||
|
top: -15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.float-status-webtrix {
|
||||||
|
position: relative !important;
|
||||||
|
top: 0px !important;
|
||||||
|
float: right;
|
||||||
|
display: flex;
|
||||||
|
align-items: self-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.float-status-all {
|
||||||
|
font-size: 10pt !important;
|
||||||
|
}
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ import { VoiceRecorder, VoiceRecorderPlugin, RecordingData, GenericResponse, Cur
|
|||||||
import { Filesystem, Directory, Encoding } from '@capacitor/filesystem';
|
import { Filesystem, Directory, Encoding } from '@capacitor/filesystem';
|
||||||
import { DomSanitizer } from '@angular/platform-browser';
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
import { MessageService } from 'src/app/services/chat/message.service';
|
import { MessageService } from 'src/app/services/chat/message.service';
|
||||||
|
import { AlertController } from '@ionic/angular';
|
||||||
import { File } from '@awesome-cordova-plugins/file/ngx';
|
import { File } from '@awesome-cordova-plugins/file/ngx';
|
||||||
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
|
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
|
||||||
|
|
||||||
@@ -87,6 +88,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
durationDisplay = '';
|
durationDisplay = '';
|
||||||
duration = 0;
|
duration = 0;
|
||||||
showAvatar = true;
|
showAvatar = true;
|
||||||
|
audioPermissionStatus: 'granted'| 'denied' | 'prompt' | null = null
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private menu: MenuController,
|
private menu: MenuController,
|
||||||
@@ -113,6 +115,7 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
private processesService: ProcessesService,
|
private processesService: ProcessesService,
|
||||||
private CameraService: CameraService,
|
private CameraService: CameraService,
|
||||||
private sanitiser: DomSanitizer,
|
private sanitiser: DomSanitizer,
|
||||||
|
private alertController: AlertController,
|
||||||
private file: File,
|
private file: File,
|
||||||
private fileOpener: FileOpener,
|
private fileOpener: FileOpener,
|
||||||
) {
|
) {
|
||||||
@@ -165,9 +168,9 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
message: '',
|
message: '',
|
||||||
status: status,
|
status: status,
|
||||||
}
|
}
|
||||||
this.chatService.setUserStatus(body).subscribe(res => {
|
// this.chatService.setUserStatus(body).subscribe(res => {
|
||||||
console.log(res);
|
// console.log(res);
|
||||||
})
|
// })
|
||||||
}
|
}
|
||||||
|
|
||||||
deleteMessage(msgId: string) {
|
deleteMessage(msgId: string) {
|
||||||
@@ -374,15 +377,15 @@ export class GroupMessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
|
|
||||||
getRoomInfo() {
|
getRoomInfo() {
|
||||||
this.showLoader = true;
|
this.showLoader = true;
|
||||||
this.chatService.getRoomInfo(this.roomId).subscribe(room => {
|
// this.chatService.getRoomInfo(this.roomId).subscribe(room => {
|
||||||
this.room = room['room'];
|
// this.room = room['room'];
|
||||||
this.roomName = this.room.name.split('-').join(' ');
|
// this.roomName = this.room.name.split('-').join(' ');
|
||||||
if (this.room.customFields.countDownDate) {
|
// if (this.room.customFields.countDownDate) {
|
||||||
this.roomCountDownDate = this.timeService.countDownDateTimer(this.room.customFields.countDownDate, this.room._id);
|
// this.roomCountDownDate = this.timeService.countDownDateTimer(this.room.customFields.countDownDate, this.room._id);
|
||||||
}
|
// }
|
||||||
this.getGroupContacts(this.room);
|
// this.getGroupContacts(this.room);
|
||||||
this.showLoader = false;
|
// this.showLoader = false;
|
||||||
});
|
// });
|
||||||
}
|
}
|
||||||
|
|
||||||
async getChatMembers() {
|
async getChatMembers() {
|
||||||
|
|||||||
@@ -46,11 +46,6 @@
|
|||||||
|
|
||||||
<ion-content>
|
<ion-content>
|
||||||
|
|
||||||
<!-- <ion-refresher name="refresher" slot="fixed" (ionRefresh)="doRefresh($event)">
|
|
||||||
<ion-progress-bar type="indeterminate" *ngIf="showLoader"></ion-progress-bar>
|
|
||||||
<ion-refresher-content>
|
|
||||||
</ion-refresher-content>
|
|
||||||
</ion-refresher> -->
|
|
||||||
<div (click)="handleClick()" class="messages" #scrollMe>
|
<div (click)="handleClick()" class="messages" #scrollMe>
|
||||||
<div class="messages-list-item-wrapper container-width-100"
|
<div class="messages-list-item-wrapper container-width-100"
|
||||||
*ngFor="let msg of wsChatMethodsService.getDmRoom(this.roomId).messages; let last = last"
|
*ngFor="let msg of wsChatMethodsService.getDmRoom(this.roomId).messages; let last = last"
|
||||||
@@ -62,8 +57,13 @@
|
|||||||
<span class="time">{{msg.duration}}</span>
|
<span class="time">{{msg.duration}}</span>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
<ion-label *ngIf="msg.delate == false">{{msg.msg}}</ion-label>
|
<ion-label class="float-status-all float-status" >
|
||||||
<ion-label *ngIf="msg.delate == true">{{msg.msg}}</ion-label>
|
|
||||||
|
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon>
|
||||||
|
</ion-label>
|
||||||
{{last ? scrollToBottom() : ''}}
|
{{last ? scrollToBottom() : ''}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -80,6 +80,12 @@
|
|||||||
<div *ngFor="let file of msg.attachments let i = index">
|
<div *ngFor="let file of msg.attachments let i = index">
|
||||||
<div *ngIf="msg.file.type == 'application/img'" (click)="openPreview(msg)">
|
<div *ngIf="msg.file.type == 'application/img'" (click)="openPreview(msg)">
|
||||||
<img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image">
|
<img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image">
|
||||||
|
<ion-label class="float-status-all float-status" >
|
||||||
|
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon>
|
||||||
|
</ion-label>
|
||||||
<ion-icon *ngIf="msg.attachments[0].image_url == null" name="download-outline"></ion-icon>
|
<ion-icon *ngIf="msg.attachments[0].image_url == null" name="download-outline"></ion-icon>
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="msg.file.type != 'application/img'">
|
<div *ngIf="msg.file.type != 'application/img'">
|
||||||
@@ -118,6 +124,15 @@
|
|||||||
<span
|
<span
|
||||||
*ngIf="msg.file.type != 'application/webtrix' && msg.file.type != 'application/audio'">{{msg.displayType}}</span>
|
*ngIf="msg.file.type != 'application/webtrix' && msg.file.type != 'application/audio'">{{msg.displayType}}</span>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
|
|
||||||
|
<ion-label class="float-status-all float-status" >
|
||||||
|
|
||||||
|
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon>
|
||||||
|
</ion-label>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -328,3 +328,31 @@ button::-moz-focus-inner {
|
|||||||
padding: 0px;
|
padding: 0px;
|
||||||
border: 0px;
|
border: 0px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.float-status{
|
||||||
|
position: relative !important;
|
||||||
|
float: right;
|
||||||
|
display: flex;
|
||||||
|
align-items: self-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.float-status-image{
|
||||||
|
position: relative !important;
|
||||||
|
float: right;
|
||||||
|
display: flex;
|
||||||
|
align-items: self-end;
|
||||||
|
top: -15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.float-status-webtrix {
|
||||||
|
position: relative !important;
|
||||||
|
top: 0px !important;
|
||||||
|
float: right;
|
||||||
|
display: flex;
|
||||||
|
align-items: self-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.float-status-all {
|
||||||
|
font-size: 10pt !important;
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { AfterViewChecked, AfterViewInit, ChangeDetectorRef, Component, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
import { AfterViewChecked, AfterViewInit, ChangeDetectorRef, Component, ElementRef, OnDestroy, OnInit, ViewChild } from '@angular/core';
|
||||||
import { ActivatedRoute, Router } from '@angular/router'
|
import { ActivatedRoute, Router } from '@angular/router'
|
||||||
import { GestureController, Gesture, ModalController, NavParams, PopoverController, Platform } from '@ionic/angular';
|
import { GestureController, Gesture, ModalController, NavParams, PopoverController, Platform, AlertController } from '@ionic/angular';
|
||||||
import { map } from 'rxjs/operators';
|
import { map } from 'rxjs/operators';
|
||||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||||
import { EventPerson } from 'src/app/models/eventperson.model';
|
import { EventPerson } from 'src/app/models/eventperson.model';
|
||||||
@@ -41,7 +41,6 @@ import { Storage } from '@ionic/storage';
|
|||||||
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
|
import { FileToBase64Service } from 'src/app/services/file/file-to-base64.service';
|
||||||
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
|
import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
|
||||||
import { Plugins, Capacitor } from '@capacitor/core';
|
import { Plugins, Capacitor } from '@capacitor/core';
|
||||||
import { MultipleDocumentsPicker } from '@awesome-cordova-plugins/multiple-document-picker/ngx';
|
|
||||||
import { DomSanitizer } from '@angular/platform-browser';
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
import { StringDecoder } from 'string_decoder';
|
import { StringDecoder } from 'string_decoder';
|
||||||
import { File } from '@awesome-cordova-plugins/file/ngx';
|
import { File } from '@awesome-cordova-plugins/file/ngx';
|
||||||
@@ -109,6 +108,8 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
base64File: string;
|
base64File: string;
|
||||||
downloadProgess: number;
|
downloadProgess: number;
|
||||||
|
|
||||||
|
audioPermissionStatus: 'granted'| 'denied' | 'prompt' | null = null
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public popoverController: PopoverController,
|
public popoverController: PopoverController,
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
@@ -133,12 +134,11 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
private processesService: ProcessesService,
|
private processesService: ProcessesService,
|
||||||
private storage: Storage,
|
private storage: Storage,
|
||||||
private fileToBase64Service: FileToBase64Service,
|
private fileToBase64Service: FileToBase64Service,
|
||||||
private multipleDocumentsPicker: MultipleDocumentsPicker,
|
|
||||||
private sant: DomSanitizer,
|
private sant: DomSanitizer,
|
||||||
private file: File,
|
//private fileOpener: FileOpener,
|
||||||
private fileOpener: FileOpener,
|
|
||||||
private sanitiser: DomSanitizer,
|
private sanitiser: DomSanitizer,
|
||||||
private document: DocumentViewer
|
private alertController: AlertController,
|
||||||
|
// private document: DocumentViewer
|
||||||
) {
|
) {
|
||||||
this.loggedUser = authService.ValidatedUserChat['data'];
|
this.loggedUser = authService.ValidatedUserChat['data'];
|
||||||
this.roomId = this.navParams.get('roomId');
|
this.roomId = this.navParams.get('roomId');
|
||||||
@@ -148,7 +148,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
if (window.innerWidth > 701) {
|
if (window.innerWidth > 701) {
|
||||||
this.modalController.dismiss();
|
this.modalController.dismiss();
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
console.log(this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({}));
|
console.log(this.wsChatMethodsService.getDmRoom(this.roomId).loadHistory({}));
|
||||||
|
|
||||||
@@ -160,6 +160,7 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
this.scrollToBottomClicked()
|
this.scrollToBottomClicked()
|
||||||
}, 150)
|
}, 150)
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@@ -956,27 +957,27 @@ export class MessagesPage implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
openFile(pdfString, filename, type) {
|
openFile(pdfString, filename, type) {
|
||||||
const blob = this.b64toBlob(pdfString, type)
|
// const blob = this.b64toBlob(pdfString, type)
|
||||||
let pathFile = ''
|
// let pathFile = ''
|
||||||
const fileName = filename
|
// const fileName = filename
|
||||||
const contentFile = blob
|
// const contentFile = blob
|
||||||
if (this.platform.is('ios')) {
|
// if (this.platform.is('ios')) {
|
||||||
pathFile = this.file.documentsDirectory
|
// pathFile = this.file.documentsDirectory
|
||||||
} else {
|
// } else {
|
||||||
pathFile = this.file.externalRootDirectory
|
// pathFile = this.file.externalRootDirectory
|
||||||
}
|
// }
|
||||||
console.log(pdfString)
|
// console.log(pdfString)
|
||||||
console.log(pathFile)
|
// console.log(pathFile)
|
||||||
console.log(contentFile)
|
// console.log(contentFile)
|
||||||
this.file
|
// this.file
|
||||||
.writeFile(pathFile, fileName, contentFile, { replace: true })
|
// .writeFile(pathFile, fileName, contentFile, { replace: true })
|
||||||
.then(success => {
|
// .then(success => {
|
||||||
this.fileOpener
|
// this.fileOpener
|
||||||
.open(pathFile + fileName, type)
|
// .open(pathFile + fileName, type)
|
||||||
.then(() => console.log('File is opened'))
|
// .then(() => console.log('File is opened'))
|
||||||
.catch(e => console.log('Error opening file', e));
|
// .catch(e => console.log('Error opening file', e));
|
||||||
})
|
// })
|
||||||
.catch(e => console.log('Error writing file', e))
|
// .catch(e => console.log('Error writing file', e))
|
||||||
}
|
}
|
||||||
|
|
||||||
downloadFileFromBrowser(fileName: string, data: any): void {
|
downloadFileFromBrowser(fileName: string, data: any): void {
|
||||||
|
|||||||
@@ -201,16 +201,22 @@ export class InactivityPage implements OnInit {
|
|||||||
if(pathName) {
|
if(pathName) {
|
||||||
this.router.navigate([pathName],{replaceUrl: true});
|
this.router.navigate([pathName],{replaceUrl: true});
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
setTimeout(()=>{
|
||||||
this.router.navigate(['/home/events'], {replaceUrl: true});
|
this.router.navigate(['/home/events'], {replaceUrl: true});
|
||||||
|
}, 5000)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
storePin() {
|
storePin() {
|
||||||
|
|
||||||
|
setTimeout(()=>{
|
||||||
const code = this.code.join('');
|
const code = this.code.join('');
|
||||||
SessionStore.setPin(code);
|
SessionStore.setPin(code);
|
||||||
this.router.navigate(['/home/events']);
|
this.router.navigate(['/home/events']);
|
||||||
|
}, 5000)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -138,8 +138,8 @@ export class LoginPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.getToken();
|
this.getToken();
|
||||||
this.router.navigateByUrl('/pin', { replaceUrl: true });
|
|
||||||
|
|
||||||
|
this.router.navigateByUrl('/pin', { replaceUrl: true });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
@@ -153,6 +153,8 @@ export class LoginPage implements OnInit {
|
|||||||
else {
|
else {
|
||||||
this.toastService._badRequest('Por favor, insira o seu nome de utilizador');
|
this.toastService._badRequest('Por favor, insira o seu nome de utilizador');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
goback() {
|
goback() {
|
||||||
|
|||||||
@@ -199,7 +199,8 @@ export class ListBoxService {
|
|||||||
EndDate: event.event.EndDate,
|
EndDate: event.event.EndDate,
|
||||||
Location: event.event.Location,
|
Location: event.event.Location,
|
||||||
EventId: event.event.EventId,
|
EventId: event.event.EventId,
|
||||||
CalendarName: event.event.CalendarName
|
CalendarName: event.event.CalendarName,
|
||||||
|
CalendarId: event.event.CalendarId
|
||||||
},
|
},
|
||||||
Subject: event.event.Subject,
|
Subject: event.event.Subject,
|
||||||
startMany: false,
|
startMany: false,
|
||||||
|
|||||||
@@ -55,8 +55,6 @@ export class AuthService {
|
|||||||
if (SessionStore.exist) {
|
if (SessionStore.exist) {
|
||||||
this.ValidatedUser = SessionStore.user
|
this.ValidatedUser = SessionStore.user
|
||||||
|
|
||||||
// console.log('login', SessionStore.user.RochetChatUser, SessionStore.user.Password)
|
|
||||||
|
|
||||||
if(this.p.userPermission(this.p.permissionList.Chat.access) == true ){
|
if(this.p.userPermission(this.p.permissionList.Chat.access) == true ){
|
||||||
this.loginToChatWs()
|
this.loginToChatWs()
|
||||||
}
|
}
|
||||||
@@ -101,9 +99,26 @@ export class AuthService {
|
|||||||
session.Profile = 'PR'
|
session.Profile = 'PR'
|
||||||
} else if(session.RoleID == 100000011) {
|
} else if(session.RoleID == 100000011) {
|
||||||
session.Profile = 'MDGPR'
|
session.Profile = 'MDGPR'
|
||||||
|
} else if(session.RoleID == 99999872) {
|
||||||
|
session.Profile = 'Consultant'
|
||||||
}
|
}
|
||||||
else{
|
else if(session.RoleID == 99999873) {
|
||||||
session.Profile = this.initialsService.getInitials(session.FullName);
|
session.Profile = 'Assistant'
|
||||||
|
}
|
||||||
|
else if(session.RoleID == 99999874) {
|
||||||
|
session.Profile = 'Department boss'
|
||||||
|
}
|
||||||
|
else if(session.RoleID == 99999875) {
|
||||||
|
session.Profile = 'Director'
|
||||||
|
}
|
||||||
|
else if(session.RoleID == 99999876) {
|
||||||
|
session.Profile = 'Deputy Director'
|
||||||
|
}
|
||||||
|
else if(session.RoleID == 99999885) {
|
||||||
|
session.Profile = 'Secretariat'
|
||||||
|
}
|
||||||
|
else if(session.RoleID == 99999886) {
|
||||||
|
session.Profile = 'General secretary'
|
||||||
}
|
}
|
||||||
|
|
||||||
session.Password = user.password
|
session.Password = user.password
|
||||||
@@ -117,6 +132,8 @@ export class AuthService {
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.initialsService.getInitials(session.FullName);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Login to rocketChat server2
|
//Login to rocketChat server2
|
||||||
@@ -135,7 +152,7 @@ export class AuthService {
|
|||||||
let responseChat = await this.httpService.post('login', postData).toPromise();
|
let responseChat = await this.httpService.post('login', postData).toPromise();
|
||||||
|
|
||||||
if(responseChat) {
|
if(responseChat) {
|
||||||
console.log('Login to Rocket chat OK', responseChat);
|
|
||||||
this.ValidatedUserChat = responseChat;
|
this.ValidatedUserChat = responseChat;
|
||||||
localStorage.setItem('userChat', JSON.stringify(responseChat));
|
localStorage.setItem('userChat', JSON.stringify(responseChat));
|
||||||
this.storageService.store(AuthConnstants.AUTH, responseChat);
|
this.storageService.store(AuthConnstants.AUTH, responseChat);
|
||||||
@@ -162,6 +179,10 @@ export class AuthService {
|
|||||||
|
|
||||||
SessionStore.user.RochetChatUserId = message.result.id
|
SessionStore.user.RochetChatUserId = message.result.id
|
||||||
SessionStore.save()
|
SessionStore.save()
|
||||||
|
|
||||||
|
// console.log('user session', SessionStore.user)
|
||||||
|
|
||||||
|
|
||||||
this.WsChatService.setStatus('online')
|
this.WsChatService.setStatus('online')
|
||||||
|
|
||||||
}).catch((message) => {
|
}).catch((message) => {
|
||||||
@@ -215,7 +236,7 @@ export class AuthService {
|
|||||||
|
|
||||||
this.NfService.downloadFileMsg = async (message: MessageService, room?: RoomService) => {
|
this.NfService.downloadFileMsg = async (message: MessageService, room?: RoomService) => {
|
||||||
|
|
||||||
console.log('FILE TYPE', message.file.type)
|
// console.log('FILE TYPE', message.file.type)
|
||||||
let downloadFile = "";
|
let downloadFile = "";
|
||||||
if (message.file.type == "application/img") {
|
if (message.file.type == "application/img") {
|
||||||
const event: any = await this.AttachmentsService.downloadFile(message.file.guid).toPromise();
|
const event: any = await this.AttachmentsService.downloadFile(message.file.guid).toPromise();
|
||||||
@@ -224,7 +245,7 @@ export class AuthService {
|
|||||||
|
|
||||||
if (event.type === HttpEventType.DownloadProgress) {
|
if (event.type === HttpEventType.DownloadProgress) {
|
||||||
//this.downloadProgess = Math.round((100 * event.loaded) / event.total);
|
//this.downloadProgess = Math.round((100 * event.loaded) / event.total);
|
||||||
console.log('FILE TYPE 33', message.file.type)
|
// console.log('FILE TYPE 33', message.file.type)
|
||||||
return true
|
return true
|
||||||
} else if (event.type === HttpEventType.Response) {
|
} else if (event.type === HttpEventType.Response) {
|
||||||
downloadFile = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
|
downloadFile = 'data:image/jpeg;base64,' + btoa(new Uint8Array(event.body).reduce((data, byte) => data + String.fromCharCode(byte), ''));
|
||||||
@@ -236,7 +257,7 @@ export class AuthService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
await this.storage.set(message.file.guid, downloadFile).then(() => {
|
await this.storage.set(message.file.guid, downloadFile).then(() => {
|
||||||
console.log('IMAGE SAVED')
|
// console.log('IMAGE SAVED')
|
||||||
});
|
});
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
@@ -279,8 +300,8 @@ export class AuthService {
|
|||||||
this.userData$.next('');
|
this.userData$.next('');
|
||||||
this.router.navigate(['']);
|
this.router.navigate(['']);
|
||||||
}) */
|
}) */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async presentAlert(message: string) {
|
async presentAlert(message: string) {
|
||||||
const alert = await this.alertController.create({
|
const alert = await this.alertController.create({
|
||||||
cssClass: 'my-custom-class',
|
cssClass: 'my-custom-class',
|
||||||
|
|||||||
@@ -30,12 +30,14 @@ export class ChatService {
|
|||||||
private authService: AuthService,
|
private authService: AuthService,
|
||||||
private storage: Storage,
|
private storage: Storage,
|
||||||
private storageService:StorageService,
|
private storageService:StorageService,
|
||||||
public p:PermissionService
|
public p: PermissionService) {
|
||||||
)
|
|
||||||
{
|
|
||||||
if(this.p.userPermission(this.p.permissionList.Chat.access)){
|
if(this.p.userPermission(this.p.permissionList.Chat.access)){
|
||||||
this.loggedUserChat = authService.ValidatedUserChat;
|
this.loggedUserChat = authService.ValidatedUserChat;
|
||||||
this.headers = new HttpHeaders();
|
this.headers = new HttpHeaders();
|
||||||
|
|
||||||
|
|
||||||
|
if(this.p.userPermission(this.p.permissionList.Chat.access)) {
|
||||||
this.headers = this.headers.set('X-User-Id', this.loggedUserChat['data'].userId);
|
this.headers = this.headers.set('X-User-Id', this.loggedUserChat['data'].userId);
|
||||||
this.headers = this.headers.set('X-Auth-Token', this.loggedUserChat['data'].authToken);
|
this.headers = this.headers.set('X-Auth-Token', this.loggedUserChat['data'].authToken);
|
||||||
this.options = {
|
this.options = {
|
||||||
@@ -45,6 +47,8 @@ export class ChatService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
getDocumentDetails(url:string){
|
getDocumentDetails(url:string){
|
||||||
let headersc = new HttpHeaders();
|
let headersc = new HttpHeaders();
|
||||||
headersc = headersc.set('X-User-Id', this.loggedUserChat['data'].userId);
|
headersc = headersc.set('X-User-Id', this.loggedUserChat['data'].userId);
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ export class WsChatMethodsService {
|
|||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.sortRoomList()
|
this.sortRoomList()
|
||||||
}, 1000)
|
}, 10000)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -214,6 +214,11 @@ export class WsChatMethodsService {
|
|||||||
this.sortRoomList()
|
this.sortRoomList()
|
||||||
}, 1000)
|
}, 1000)
|
||||||
|
|
||||||
|
|
||||||
|
setTimeout(()=>{
|
||||||
|
this.sortRoomList()
|
||||||
|
}, 10000)
|
||||||
|
|
||||||
this.loadingWholeList = false
|
this.loadingWholeList = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -28,9 +28,21 @@ export class EventsService {
|
|||||||
headersMdOficial: HttpHeaders;
|
headersMdOficial: HttpHeaders;
|
||||||
headersMdPessoal: HttpHeaders;
|
headersMdPessoal: HttpHeaders;
|
||||||
|
|
||||||
|
headerOwnOficial: HttpHeaders;
|
||||||
|
headerOwnPessoal: HttpHeaders;
|
||||||
|
|
||||||
|
headerSharedOficial: HttpHeaders;
|
||||||
|
headerSharedPessoal: HttpHeaders;
|
||||||
|
|
||||||
headersSharedOficial: HttpHeaders;
|
headersSharedOficial: HttpHeaders;
|
||||||
headersSharedPessoal: HttpHeaders;
|
headersSharedPessoal: HttpHeaders;
|
||||||
|
|
||||||
|
hasSharedCalendar = false
|
||||||
|
hasOwnCalendar = false
|
||||||
|
|
||||||
|
|
||||||
|
calendarOwnerIds = []
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private http: HttpClient,
|
private http: HttpClient,
|
||||||
public user: AuthService,
|
public user: AuthService,
|
||||||
@@ -51,6 +63,13 @@ export class EventsService {
|
|||||||
this.headersSharedPessoal = new HttpHeaders();
|
this.headersSharedPessoal = new HttpHeaders();
|
||||||
|
|
||||||
|
|
||||||
|
this.headerOwnOficial= new HttpHeaders();
|
||||||
|
this.headerOwnPessoal= new HttpHeaders();
|
||||||
|
|
||||||
|
this.headerSharedOficial= new HttpHeaders();
|
||||||
|
this.headerSharedPessoal= new HttpHeaders();
|
||||||
|
|
||||||
|
|
||||||
this.setHeader()
|
this.setHeader()
|
||||||
this.changeProfileService.registerCallback(() => {
|
this.changeProfileService.registerCallback(() => {
|
||||||
this.loggeduser = this.user.ValidatedUser;
|
this.loggeduser = this.user.ValidatedUser;
|
||||||
@@ -61,10 +80,22 @@ export class EventsService {
|
|||||||
|
|
||||||
setHeader() {
|
setHeader() {
|
||||||
|
|
||||||
|
this.hasSharedCalendar = false
|
||||||
|
this.hasOwnCalendar = false
|
||||||
|
|
||||||
|
this.calendarOwnerIds = []
|
||||||
|
|
||||||
if (this.loggeduser) {
|
if (this.loggeduser) {
|
||||||
if (this.loggeduser.Profile == 'MDGPR') {
|
if (this.loggeduser.Profile == 'MDGPR') {
|
||||||
|
|
||||||
this.loggeduser.OwnerCalendars.forEach(calendar => {
|
this.loggeduser.OwnerCalendars.forEach(calendar => {
|
||||||
|
|
||||||
|
if(!this.calendarOwnerIds.includes(calendar.OwnerUserId)) {
|
||||||
|
this.calendarOwnerIds.push(calendar.OwnerUserId)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.hasOwnCalendar = true
|
||||||
|
|
||||||
if (calendar.CalendarName == 'Oficial') {
|
if (calendar.CalendarName == 'Oficial') {
|
||||||
this.headersMdOficial = this.headersMdOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
this.headersMdOficial = this.headersMdOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||||
this.headersMdOficial = this.headersMdOficial.set('CalendarId', calendar.CalendarId);
|
this.headersMdOficial = this.headersMdOficial.set('CalendarId', calendar.CalendarId);
|
||||||
@@ -79,6 +110,13 @@ export class EventsService {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.loggeduser.SharedCalendars.forEach(sharedCalendar => {
|
this.loggeduser.SharedCalendars.forEach(sharedCalendar => {
|
||||||
|
|
||||||
|
if(!this.calendarOwnerIds.includes(sharedCalendar.OwnerUserId)) {
|
||||||
|
this.calendarOwnerIds.push(sharedCalendar.OwnerUserId)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.hasSharedCalendar = true
|
||||||
|
|
||||||
if (sharedCalendar.CalendarName == 'Oficial') {
|
if (sharedCalendar.CalendarName == 'Oficial') {
|
||||||
this.headersSharedOficial = this.headersSharedOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
this.headersSharedOficial = this.headersSharedOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||||
this.headersSharedOficial = this.headersSharedOficial.set('CalendarId', sharedCalendar.CalendarId);
|
this.headersSharedOficial = this.headersSharedOficial.set('CalendarId', sharedCalendar.CalendarId);
|
||||||
@@ -94,6 +132,13 @@ export class EventsService {
|
|||||||
else if (this.loggeduser.Profile == 'PR') {
|
else if (this.loggeduser.Profile == 'PR') {
|
||||||
|
|
||||||
this.loggeduser.OwnerCalendars.forEach(calendar => {
|
this.loggeduser.OwnerCalendars.forEach(calendar => {
|
||||||
|
|
||||||
|
if(!this.calendarOwnerIds.includes(calendar.OwnerUserId)) {
|
||||||
|
this.calendarOwnerIds.push(calendar.OwnerUserId)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.hasOwnCalendar = true
|
||||||
|
|
||||||
if (calendar.CalendarName == 'Oficial') {
|
if (calendar.CalendarName == 'Oficial') {
|
||||||
this.headersPrOficial = this.headersPrOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
this.headersPrOficial = this.headersPrOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||||
this.headersPrOficial = this.headersPrOficial.set('CalendarId', calendar.CalendarId);
|
this.headersPrOficial = this.headersPrOficial.set('CalendarId', calendar.CalendarId);
|
||||||
@@ -106,6 +151,55 @@ export class EventsService {
|
|||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
|
||||||
|
|
||||||
|
this.loggeduser.OwnerCalendars.forEach(calendar => {
|
||||||
|
|
||||||
|
if(!this.calendarOwnerIds.includes(calendar.OwnerUserId)) {
|
||||||
|
this.calendarOwnerIds.push(calendar.OwnerUserId)
|
||||||
|
}
|
||||||
|
this.hasOwnCalendar = true
|
||||||
|
|
||||||
|
if (calendar.CalendarName == 'Oficial') {
|
||||||
|
this.headerOwnOficial = this.headerOwnOficial.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||||
|
this.headerOwnOficial = this.headerOwnOficial.set('CalendarId', calendar.CalendarId);
|
||||||
|
this.headerOwnOficial = this.headerOwnOficial.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||||
|
this.headerOwnOficial = this.headerOwnOficial.set('CalendarName', calendar.CalendarName);
|
||||||
|
}
|
||||||
|
else if (calendar.CalendarName == 'Pessoal') {
|
||||||
|
this.headerOwnPessoal = this.headerOwnPessoal.set('Authorization', this.loggeduser.BasicAuthKey);
|
||||||
|
this.headerOwnPessoal =this.headerOwnPessoal.set('CalendarId', calendar.CalendarId);
|
||||||
|
this.headerOwnPessoal =this.headerOwnPessoal.set('CalendarRoleId', calendar.CalendarRoleId);
|
||||||
|
this.headerOwnPessoal = this.headerOwnPessoal.set('CalendarName', calendar.CalendarName);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
for (let sharedCalendar of this.loggeduser.SharedCalendars) {
|
||||||
|
|
||||||
|
|
||||||
|
if(!this.calendarOwnerIds.includes(sharedCalendar.OwnerUserId)) {
|
||||||
|
this.calendarOwnerIds.push(sharedCalendar.OwnerUserId)
|
||||||
|
}
|
||||||
|
|
||||||
|
this.hasSharedCalendar = true
|
||||||
|
|
||||||
|
if (sharedCalendar.CalendarName == 'Oficial') {
|
||||||
|
sharedCalendar.CalendarName
|
||||||
|
this.headerSharedOficial = this.headerSharedOficial.set('Authorization', 'Basic '+sharedCalendar.CalendarToken);
|
||||||
|
this.headerSharedOficial = this.headerSharedOficial.set('CalendarId', sharedCalendar.CalendarId);
|
||||||
|
this.headerSharedOficial = this.headerSharedOficial.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||||
|
this.headerSharedOficial = this.headerSharedOficial.set('CalendarName', sharedCalendar.CalendarName);
|
||||||
|
}
|
||||||
|
else if (sharedCalendar.CalendarName == 'Pessoal') {
|
||||||
|
this.headerSharedPessoal = this.headerSharedPessoal.set('Authorization', 'Basic '+sharedCalendar.CalendarToken);
|
||||||
|
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarId', sharedCalendar.CalendarId);
|
||||||
|
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarRoleId', sharedCalendar.CalendarRoleId);
|
||||||
|
this.headerSharedPessoal = this.headerSharedPessoal.set('CalendarName', sharedCalendar.CalendarName);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
this.headers = new HttpHeaders();
|
this.headers = new HttpHeaders();
|
||||||
@@ -113,20 +207,6 @@ export class EventsService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* getAllEvents(startdate:string, enddate:string): Observable<Event[]>{
|
|
||||||
const geturl = environment.apiURL + 'calendar/GetAllEvents';
|
|
||||||
let params = new HttpParams();
|
|
||||||
|
|
||||||
params = params.set("StartDate", startdate);
|
|
||||||
params = params.set("EndDate", enddate);
|
|
||||||
|
|
||||||
let options = {
|
|
||||||
headers: this.headers,
|
|
||||||
params: params
|
|
||||||
};
|
|
||||||
return this.http.get<Event[]>(`${geturl}`, options);
|
|
||||||
} */
|
|
||||||
|
|
||||||
|
|
||||||
getAllPrOficialEvents(startdate: string, enddate: string): Observable<EventList[]> {
|
getAllPrOficialEvents(startdate: string, enddate: string): Observable<EventList[]> {
|
||||||
let geturl = environment.apiURL + 'calendar/pr';
|
let geturl = environment.apiURL + 'calendar/pr';
|
||||||
@@ -208,6 +288,93 @@ export class EventsService {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async getAllOwnEvents(startdate: string, enddate: string) {
|
||||||
|
let ownO = await this.getAllOwnOficialEvents(startdate, enddate).toPromise();
|
||||||
|
let ownP = await this.getAllOwnPessoalEvents(startdate, enddate).toPromise();
|
||||||
|
const resFinal = ownO.concat(ownP);
|
||||||
|
return new Promise(resolve => {
|
||||||
|
return resolve(resFinal)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
getAllOwnOficialEvents(startdate: string, enddate: string): Observable<EventList[]> {
|
||||||
|
let geturl = environment.apiURL + 'calendar/GetEvents';
|
||||||
|
|
||||||
|
let params = new HttpParams();
|
||||||
|
|
||||||
|
params = params.set("StartDate", startdate);
|
||||||
|
params = params.set("EndDate", enddate);
|
||||||
|
|
||||||
|
|
||||||
|
let options = {
|
||||||
|
headers: this.headerOwnOficial,
|
||||||
|
params: params
|
||||||
|
};
|
||||||
|
return this.http.get<EventList[]>(`${geturl}`, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
getAllOwnPessoalEvents(startdate: string, enddate: string): any {
|
||||||
|
let geturl = environment.apiURL + 'calendar/GetEvents';
|
||||||
|
|
||||||
|
let params = new HttpParams();
|
||||||
|
|
||||||
|
params = params.set("StartDate", startdate);
|
||||||
|
params = params.set("EndDate", enddate);
|
||||||
|
|
||||||
|
let options = {
|
||||||
|
headers: this.headerOwnPessoal,
|
||||||
|
params: params
|
||||||
|
};
|
||||||
|
return this.http.get<any>(`${geturl}`, options)
|
||||||
|
}
|
||||||
|
|
||||||
|
async genericGetAllSharedEvents(startdate: string, enddate: string) {
|
||||||
|
|
||||||
|
let prO = await this.genericGetAllSharedOficialEvents(startdate, enddate).toPromise();
|
||||||
|
let prP = await this.genericGetAllSharedPessoalEvents(startdate, enddate).toPromise();
|
||||||
|
const resFinal = prO.concat(prP);
|
||||||
|
|
||||||
|
return new Promise(resolve => {
|
||||||
|
return resolve(resFinal)
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
genericGetAllSharedOficialEvents(startdate: string, enddate: string): Observable<Event[]> {
|
||||||
|
let geturl = environment.apiURL + 'calendar/GetEvents';
|
||||||
|
geturl = geturl.replace('/V4/', '/V5/')
|
||||||
|
|
||||||
|
let params = new HttpParams();
|
||||||
|
|
||||||
|
params = params.set("StartDate", startdate);
|
||||||
|
params = params.set("EndDate", enddate);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
let options = {
|
||||||
|
headers: this.headerSharedOficial,
|
||||||
|
params: params
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.http.get<Event[]>(`${geturl}`, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
genericGetAllSharedPessoalEvents(startdate: string, enddate: string): Observable<Event[]> {
|
||||||
|
let geturl = environment.apiURL + 'calendar/GetEvents';
|
||||||
|
geturl = geturl.replace('/V4/', '/V5/')
|
||||||
|
|
||||||
|
let params = new HttpParams();
|
||||||
|
|
||||||
|
params = params.set("StartDate", startdate);
|
||||||
|
params = params.set("EndDate", enddate);
|
||||||
|
|
||||||
|
let options = {
|
||||||
|
headers: this.headerSharedPessoal,
|
||||||
|
params: params
|
||||||
|
};
|
||||||
|
return this.http.get<Event[]>(`${geturl}`, options);
|
||||||
|
}
|
||||||
|
|
||||||
async getAllSharedEvents(startdate: string, enddate: string) {
|
async getAllSharedEvents(startdate: string, enddate: string) {
|
||||||
let prO = await this.getAllSharedOficialEvents(startdate, enddate).toPromise();
|
let prO = await this.getAllSharedOficialEvents(startdate, enddate).toPromise();
|
||||||
let prP = await this.getAllSharedPessoalEvents(startdate, enddate).toPromise();
|
let prP = await this.getAllSharedPessoalEvents(startdate, enddate).toPromise();
|
||||||
@@ -293,6 +460,39 @@ export class EventsService {
|
|||||||
return this.http.get<Event>(`${geturl}`, options);
|
return this.http.get<Event>(`${geturl}`, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
genericGetEvent(eventid: string, calendarId: string) {
|
||||||
|
let geturl = environment.apiURL + 'calendar/GetEvent';
|
||||||
|
let params = new HttpParams();
|
||||||
|
|
||||||
|
params = params.set("EventId", eventid);
|
||||||
|
|
||||||
|
const headers = [
|
||||||
|
this.headerSharedOficial,
|
||||||
|
this.headerSharedPessoal,
|
||||||
|
this.headerOwnPessoal,
|
||||||
|
this.headerOwnOficial
|
||||||
|
]
|
||||||
|
|
||||||
|
const header = headers.find((header)=> {
|
||||||
|
return header?.get('CalendarId')?.includes(calendarId)
|
||||||
|
})
|
||||||
|
|
||||||
|
if(header) {
|
||||||
|
let options = {
|
||||||
|
headers: header,
|
||||||
|
params: params
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.http.get<Event>(`${geturl}`, options);
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
throw('error')
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
putEvent(event: Event, conflictResolutionMode: number, sendInvitationsOrCancellationsMode: number, sharedagenda: string): Observable<Event> {
|
putEvent(event: Event, conflictResolutionMode: number, sendInvitationsOrCancellationsMode: number, sharedagenda: string): Observable<Event> {
|
||||||
const puturl = environment.apiURL + 'calendar/' + ((sharedagenda != '') ? sharedagenda : 'PutEvent');
|
const puturl = environment.apiURL + 'calendar/' + ((sharedagenda != '') ? sharedagenda : 'PutEvent');
|
||||||
|
|
||||||
@@ -309,7 +509,7 @@ export class EventsService {
|
|||||||
return this.http.put<Event>(`${puturl}`, event, options)
|
return this.http.put<Event>(`${puturl}`, event, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
editEvent(event: Event, conflictResolutionMode: number, sendInvitationsOrCancellationsMode: number): Observable<Event> {
|
editEvent(event: Event, conflictResolutionMode: number, sendInvitationsOrCancellationsMode: number, CalendarId? ): Observable<Event> {
|
||||||
let arrayReq = [];
|
let arrayReq = [];
|
||||||
arrayReq.push(event);
|
arrayReq.push(event);
|
||||||
const puturl = environment.apiURL + 'calendar/PutEvent';
|
const puturl = environment.apiURL + 'calendar/PutEvent';
|
||||||
@@ -328,6 +528,20 @@ export class EventsService {
|
|||||||
}
|
}
|
||||||
else if (this.loggeduser.Profile == 'PR') {
|
else if (this.loggeduser.Profile == 'PR') {
|
||||||
this.headers = this.headersPrOficial;
|
this.headers = this.headersPrOficial;
|
||||||
|
} else {
|
||||||
|
|
||||||
|
const headers = [
|
||||||
|
this.headerSharedOficial,
|
||||||
|
this.headerSharedPessoal,
|
||||||
|
this.headerOwnPessoal,
|
||||||
|
this.headerOwnOficial
|
||||||
|
]
|
||||||
|
|
||||||
|
const header = headers.find((header)=> {
|
||||||
|
return header?.get('CalendarId')?.includes(CalendarId)
|
||||||
|
})
|
||||||
|
|
||||||
|
this.headers = header
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -337,6 +551,20 @@ export class EventsService {
|
|||||||
else if (this.loggeduser.Profile == 'PR') {
|
else if (this.loggeduser.Profile == 'PR') {
|
||||||
this.headers = this.headersPrPessoal;
|
this.headers = this.headersPrPessoal;
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
const headers = [
|
||||||
|
this.headerSharedOficial,
|
||||||
|
this.headerSharedPessoal,
|
||||||
|
this.headerOwnPessoal,
|
||||||
|
this.headerOwnOficial
|
||||||
|
]
|
||||||
|
|
||||||
|
const header = headers.find((header)=> {
|
||||||
|
return header?.get('CalendarId')?.includes(CalendarId)
|
||||||
|
})
|
||||||
|
|
||||||
|
this.headers = header
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let options = {
|
let options = {
|
||||||
@@ -353,6 +581,7 @@ export class EventsService {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
changeAgenda(body: any) {
|
changeAgenda(body: any) {
|
||||||
const puturl = environment.apiURL + 'Calendar/MoveEvent';
|
const puturl = environment.apiURL + 'Calendar/MoveEvent';
|
||||||
let options = {
|
let options = {
|
||||||
@@ -361,21 +590,6 @@ export class EventsService {
|
|||||||
return this.http.post<any>(`${puturl}`, body, options);
|
return this.http.post<any>(`${puturl}`, body, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* postEvent(event:Event, calendarName:string, sharedagenda:string)
|
|
||||||
{
|
|
||||||
const puturl = environment.apiURL + 'calendar/' + ((sharedagenda != '') ? sharedagenda : 'PostEvent');
|
|
||||||
let params = new HttpParams();
|
|
||||||
|
|
||||||
params = params.set("CalendarName", calendarName);
|
|
||||||
|
|
||||||
let options = {
|
|
||||||
headers: this.headers,
|
|
||||||
params: params
|
|
||||||
};
|
|
||||||
|
|
||||||
return this.http.post<Event>(`${puturl}`, event, options)
|
|
||||||
} */
|
|
||||||
|
|
||||||
postEventMd(event: Event, calendarName: string) {
|
postEventMd(event: Event, calendarName: string) {
|
||||||
const puturl = environment.apiURL + 'calendar/md';
|
const puturl = environment.apiURL + 'calendar/md';
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
@@ -432,6 +646,58 @@ export class EventsService {
|
|||||||
return this.http.post<string>(`${puturl}`, event, options)
|
return this.http.post<string>(`${puturl}`, event, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
postEventGeneric(event: Event, calendarName: string) {
|
||||||
|
const puturl = environment.apiURL + 'Calendar/PostEvent';
|
||||||
|
let params = new HttpParams();
|
||||||
|
|
||||||
|
params = params.set("CalendarName", calendarName);
|
||||||
|
|
||||||
|
let options: any;
|
||||||
|
|
||||||
|
|
||||||
|
if(this.hasOwnCalendar) {
|
||||||
|
switch (calendarName) {
|
||||||
|
case 'Oficial':
|
||||||
|
options = {
|
||||||
|
headers: this.headerOwnOficial,
|
||||||
|
params: params
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Pessoal':
|
||||||
|
|
||||||
|
options = {
|
||||||
|
headers: this.headerOwnPessoal,
|
||||||
|
params: params
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
switch (calendarName) {
|
||||||
|
case 'Oficial':
|
||||||
|
options = {
|
||||||
|
headers: this.headerSharedOficial,
|
||||||
|
params: params
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
|
||||||
|
case 'Pessoal':
|
||||||
|
|
||||||
|
options = {
|
||||||
|
headers: this.headerSharedPessoal,
|
||||||
|
params: params
|
||||||
|
};
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
return this.http.post<string>(`${puturl}`, event, options)
|
||||||
|
}
|
||||||
|
|
||||||
deleteEvent(eventid: string, eventDeleteType: number, calendarName: string) {
|
deleteEvent(eventid: string, eventDeleteType: number, calendarName: string) {
|
||||||
let arrayReq = [];
|
let arrayReq = [];
|
||||||
let Object = {
|
let Object = {
|
||||||
@@ -488,6 +754,92 @@ export class EventsService {
|
|||||||
})
|
})
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
genericDeleteEvent(eventid: string, eventDeleteType: number, calendarName: string, calendarId: string) {
|
||||||
|
let arrayReq = [];
|
||||||
|
let Object = {
|
||||||
|
eventid: eventid,
|
||||||
|
eventDeleteType: eventDeleteType,
|
||||||
|
calendarName: calendarName
|
||||||
|
}
|
||||||
|
arrayReq.push(Object)
|
||||||
|
const puturl = environment.apiURL + 'calendar/DeleteEvent';
|
||||||
|
let params = new HttpParams();
|
||||||
|
|
||||||
|
params = params.set("EventId", eventid);
|
||||||
|
// 0 for occurence and 1 for serie (delete all events)
|
||||||
|
params = params.set("eventDeleteType", eventDeleteType.toString());
|
||||||
|
|
||||||
|
let options;
|
||||||
|
|
||||||
|
if(this.loggeduser.Profile == 'MDGPR') {
|
||||||
|
if (calendarName == 'Pessoal') {
|
||||||
|
options = {
|
||||||
|
headers: this.headersMdPessoal,
|
||||||
|
params: params
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else if (calendarName == 'Oficial') {
|
||||||
|
options = {
|
||||||
|
headers: this.headersMdOficial,
|
||||||
|
params: params
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (this.loggeduser.Profile == 'PR') {
|
||||||
|
if (calendarName == 'Pessoal') {
|
||||||
|
options = {
|
||||||
|
headers: this.headersPrPessoal,
|
||||||
|
params: params
|
||||||
|
};
|
||||||
|
}
|
||||||
|
else if (calendarName == 'Oficial') {
|
||||||
|
options = {
|
||||||
|
headers: this.headersPrOficial,
|
||||||
|
params: params
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
const headers = [
|
||||||
|
this.headerSharedOficial,
|
||||||
|
this.headerSharedPessoal,
|
||||||
|
this.headerOwnPessoal,
|
||||||
|
this.headerOwnOficial
|
||||||
|
]
|
||||||
|
|
||||||
|
const header = headers.find((header)=> {
|
||||||
|
return header?.get('CalendarId')?.includes(calendarId)
|
||||||
|
})
|
||||||
|
|
||||||
|
if (header) {
|
||||||
|
|
||||||
|
|
||||||
|
options = {
|
||||||
|
headers: header,
|
||||||
|
params: params
|
||||||
|
};
|
||||||
|
|
||||||
|
return this.http.delete(`${puturl}`, options).pipe(
|
||||||
|
catchError(err => {
|
||||||
|
console.log('Event edit saved offline')
|
||||||
|
this.offlinemanager.storeRequestData('eventDelete', arrayReq);
|
||||||
|
throw new Error(err);
|
||||||
|
})
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
throw('header not found')
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
postExpedientEvent(docId: any, body: any, sharedagenda: string, serialNumber: any, applicationID: any) {
|
postExpedientEvent(docId: any, body: any, sharedagenda: string, serialNumber: any, applicationID: any) {
|
||||||
const geturl = environment.apiURL + 'calendar/' + ((sharedagenda != '') ? sharedagenda : 'CreateEventExpediente') + '/event';
|
const geturl = environment.apiURL + 'calendar/' + ((sharedagenda != '') ? sharedagenda : 'CreateEventExpediente') + '/event';
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
|
|||||||
@@ -35,6 +35,23 @@ export class PermissionService {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
userPermissionCount(args) {
|
||||||
|
if(!Array.isArray(args)) {
|
||||||
|
args = [args]
|
||||||
|
}
|
||||||
|
|
||||||
|
let count = 0
|
||||||
|
|
||||||
|
for(let permission of (this.SessionStore.user.UserPermissions || [])) {
|
||||||
|
if (args.includes(permission)) {
|
||||||
|
count++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
role(args: any) {
|
role(args: any) {
|
||||||
|
|
||||||
let UserRoleIsValid = this.userRole(args)
|
let UserRoleIsValid = this.userRole(args)
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { ToastService } from 'src/app/services/toast.service';
|
|||||||
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
import { FormControl, FormGroup, Validators } from '@angular/forms';
|
||||||
import { ParticipantsPipe } from 'src/app/pipes/participants.pipe';
|
import { ParticipantsPipe } from 'src/app/pipes/participants.pipe';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-edit-event',
|
selector: 'app-edit-event',
|
||||||
@@ -83,6 +84,7 @@ export class EditEventPage implements OnInit {
|
|||||||
public stepSeconds = [1, 5, 10, 15, 20, 25];
|
public stepSeconds = [1, 5, 10, 15, 20, 25];
|
||||||
|
|
||||||
private participantsPipe = new ParticipantsPipe()
|
private participantsPipe = new ParticipantsPipe()
|
||||||
|
sesseionStora = SessionStore
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
@@ -258,6 +260,7 @@ export class EditEventPage implements OnInit {
|
|||||||
this.showLoader = true;
|
this.showLoader = true;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
|
||||||
await this.eventsService.editEvent(this.postEvent, 2, 3).toPromise()
|
await this.eventsService.editEvent(this.postEvent, 2, 3).toPromise()
|
||||||
if(this.initCalendarName != this.postEvent.CalendarName) {
|
if(this.initCalendarName != this.postEvent.CalendarName) {
|
||||||
let body = {
|
let body = {
|
||||||
@@ -271,6 +274,23 @@ export class EditEventPage implements OnInit {
|
|||||||
}
|
}
|
||||||
this.showLoader = false;
|
this.showLoader = false;
|
||||||
this.toastService.successMessage()
|
this.toastService.successMessage()
|
||||||
|
} else {
|
||||||
|
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,
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
await this.eventsService.changeAgenda(body).toPromise();
|
||||||
|
} catch (e) {}
|
||||||
|
}
|
||||||
|
this.showLoader = false;
|
||||||
|
this.toastService.successMessage()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} catch(error) {
|
} catch(error) {
|
||||||
this.showLoader = false
|
this.showLoader = false
|
||||||
this.toastService.badRequest()
|
this.toastService.badRequest()
|
||||||
|
|||||||
@@ -413,7 +413,7 @@ export class NewEventPage implements OnInit {
|
|||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(this.CalendarName == 'PR') {
|
else if(this.loggeduser.Profile == 'PR') {
|
||||||
console.log('PR - Aqui');
|
console.log('PR - Aqui');
|
||||||
console.log(this.postEvent);
|
console.log(this.postEvent);
|
||||||
this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).subscribe(
|
this.eventService.postEventPr(this.postEvent, this.postEvent.CalendarName).subscribe(
|
||||||
@@ -448,6 +448,39 @@ export class NewEventPage implements OnInit {
|
|||||||
}
|
}
|
||||||
this.toastService.successMessage('Evento criado')
|
this.toastService.successMessage('Evento criado')
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName).subscribe(
|
||||||
|
(id) => {
|
||||||
|
console.log(id);
|
||||||
|
|
||||||
|
const eventId: any = id;
|
||||||
|
|
||||||
|
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
||||||
|
return {
|
||||||
|
SourceTitle: e.Assunto,
|
||||||
|
ParentId: eventId,
|
||||||
|
Source: '1',
|
||||||
|
SourceId: e.Id,
|
||||||
|
ApplicationId: e.ApplicationType.toString(),
|
||||||
|
Id: '',
|
||||||
|
Link: '',
|
||||||
|
SerialNumber: ''
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
DocumentToSave.forEach((attachments, i) => {
|
||||||
|
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) =>{
|
||||||
|
if(DocumentToSave.length == (i+1)){
|
||||||
|
this.afterSave();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
if(DocumentToSave.length == 0){
|
||||||
|
this.afterSave();
|
||||||
|
}
|
||||||
|
this.toastService.successMessage('Evento criado')
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ import { ExpedientTaskModalPage } from 'src/app/pages/gabinete-digital/expedient
|
|||||||
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
import { ViewDocumentPage } from 'src/app/modals/view-document/view-document.page';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { RouteService } from 'src/app/services/route.service';
|
import { RouteService } from 'src/app/services/route.service';
|
||||||
|
import { CalendarService } from 'src/app/store/calendar.service';
|
||||||
|
import { SessionStore } from 'src/app/store/session.service';
|
||||||
|
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@@ -23,7 +25,7 @@ import { RouteService } from 'src/app/services/route.service';
|
|||||||
})
|
})
|
||||||
export class ViewEventPage implements OnInit {
|
export class ViewEventPage implements OnInit {
|
||||||
|
|
||||||
loadedEvent: any;
|
loadedEvent: Event;
|
||||||
isEventEdited: boolean;
|
isEventEdited: boolean;
|
||||||
eventBody: EventBody;
|
eventBody: EventBody;
|
||||||
loadedAttachments:any;
|
loadedAttachments:any;
|
||||||
@@ -46,6 +48,7 @@ export class ViewEventPage implements OnInit {
|
|||||||
@Input() eventId: string;
|
@Input() eventId: string;
|
||||||
|
|
||||||
@Output() viewEventDetailDismiss = new EventEmitter<any>();
|
@Output() viewEventDetailDismiss = new EventEmitter<any>();
|
||||||
|
sesseionStora = SessionStore
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private eventsService: EventsService,
|
private eventsService: EventsService,
|
||||||
@@ -55,7 +58,8 @@ export class ViewEventPage implements OnInit {
|
|||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
public popoverController: PopoverController,
|
public popoverController: PopoverController,
|
||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
public ThemeService: ThemeService
|
public ThemeService: ThemeService,
|
||||||
|
private CalendarService: CalendarService
|
||||||
) {
|
) {
|
||||||
this.isEventEdited = false;
|
this.isEventEdited = false;
|
||||||
this.loadedEvent = new Event();
|
this.loadedEvent = new Event();
|
||||||
@@ -97,6 +101,7 @@ export class ViewEventPage implements OnInit {
|
|||||||
|
|
||||||
loadEvent() {
|
loadEvent() {
|
||||||
|
|
||||||
|
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
|
||||||
this.eventsService.getEvent(this.eventId).subscribe(res => {
|
this.eventsService.getEvent(this.eventId).subscribe(res => {
|
||||||
console.log(res);
|
console.log(res);
|
||||||
this.loadedEvent = res;
|
this.loadedEvent = res;
|
||||||
@@ -115,6 +120,32 @@ export class ViewEventPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
|
||||||
|
const event = this.CalendarService.eventSource.find((ele) => ele.id == this.eventId)
|
||||||
|
|
||||||
|
|
||||||
|
if(event?.CalendarId) {
|
||||||
|
|
||||||
|
this.eventsService.genericGetEvent(this.eventId, event.CalendarId).subscribe(res => {
|
||||||
|
this.loadedEvent = res;
|
||||||
|
this.today = new Date(res.StartDate);
|
||||||
|
this.customDate = this.days[this.today.getDay()]+ ", " + this.today.getDate() +" de " + ( this.months[this.today.getMonth()]);
|
||||||
|
}, (error)=> {
|
||||||
|
|
||||||
|
this.viewEventDetailDismiss.emit({
|
||||||
|
type: 'close'
|
||||||
|
})
|
||||||
|
|
||||||
|
if(error.status == 0) {
|
||||||
|
this.toastService.badRequest('Não é possível visualizar este evento no modo offline')
|
||||||
|
} else {
|
||||||
|
this.toastService.badRequest('Este evento já não existe na sua agenda')
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async deleteEvent() {
|
async deleteEvent() {
|
||||||
@@ -122,6 +153,7 @@ export class ViewEventPage implements OnInit {
|
|||||||
if (this.loadedEvent.IsRecurring) {
|
if (this.loadedEvent.IsRecurring) {
|
||||||
const loader = this.toastService.loading()
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
|
||||||
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => {
|
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => {
|
||||||
this.toastService.successMessage('Evento apagado');
|
this.toastService.successMessage('Evento apagado');
|
||||||
this.close();
|
this.close();
|
||||||
@@ -129,10 +161,27 @@ export class ViewEventPage implements OnInit {
|
|||||||
()=>{
|
()=>{
|
||||||
loader.remove();
|
loader.remove();
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
|
||||||
|
const event = this.CalendarService.eventSource.find((ele) => ele.id == this.eventId)
|
||||||
|
|
||||||
|
if(event?.CalendarId) {
|
||||||
|
this.eventsService.genericDeleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName, event?.CalendarId).subscribe(async () => {
|
||||||
|
this.toastService.successMessage('Evento apagado');
|
||||||
|
this.close();
|
||||||
|
},()=>{},
|
||||||
|
()=>{
|
||||||
|
loader.remove();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
const loader = this.toastService.loading()
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
if(this.sesseionStora.user.Profile == 'MDGPR' || this.sesseionStora.user.Profile == 'PR') {
|
||||||
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => {
|
this.eventsService.deleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName).subscribe(async () => {
|
||||||
this.toastService.successMessage('Evento apagado');
|
this.toastService.successMessage('Evento apagado');
|
||||||
this.close();
|
this.close();
|
||||||
@@ -140,6 +189,16 @@ export class ViewEventPage implements OnInit {
|
|||||||
()=>{
|
()=>{
|
||||||
loader.remove();
|
loader.remove();
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
this.eventsService.genericDeleteEvent(this.loadedEvent.EventId, 0, this.loadedEvent.CalendarName, this.loadedEvent.CalendarId).subscribe(async () => {
|
||||||
|
this.toastService.successMessage('Evento apagado');
|
||||||
|
this.close();
|
||||||
|
},()=>{},
|
||||||
|
()=>{
|
||||||
|
loader.remove();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -188,7 +247,7 @@ export class ViewEventPage implements OnInit {
|
|||||||
workflowInstanceDataFields: {
|
workflowInstanceDataFields: {
|
||||||
FolderID: '',
|
FolderID: '',
|
||||||
Subject: selectedDoc.SourceName,
|
Subject: selectedDoc.SourceName,
|
||||||
SourceSecFsID: selectedDoc.ApplicationId || selectedDoc.ApplicationID,
|
SourceSecFsID: selectedDoc.ApplicationId || selectedDoc['ApplicationID'],
|
||||||
SourceType: 'DOC',
|
SourceType: 'DOC',
|
||||||
SourceID: selectedDoc.SourceId,
|
SourceID: selectedDoc.SourceId,
|
||||||
DispatchNumber: ''
|
DispatchNumber: ''
|
||||||
@@ -254,7 +313,7 @@ export class ViewEventPage implements OnInit {
|
|||||||
taskAction: taskAction,
|
taskAction: taskAction,
|
||||||
task: this.task,
|
task: this.task,
|
||||||
seachDocuments: this.loadedEvent.Attachments[ this.dicIndex],
|
seachDocuments: this.loadedEvent.Attachments[ this.dicIndex],
|
||||||
aplicationId: this.loadedEvent.Attachments[ this.dicIndex].ApplicationId || this.loadedEvent.Attachments[ this.dicIndex].ApplicationID
|
aplicationId: this.loadedEvent.Attachments[ this.dicIndex].ApplicationId || this.loadedEvent.Attachments[ this.dicIndex]['ApplicationID']
|
||||||
},
|
},
|
||||||
cssClass: classs,
|
cssClass: classs,
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import { FontAwesomeModule } from '@fortawesome/angular-fontawesome';
|
|||||||
import {MatMenuModule} from '@angular/material/menu';
|
import {MatMenuModule} from '@angular/material/menu';
|
||||||
import { LettersAvatarModule } from "ngx-letters-avatar";
|
import { LettersAvatarModule } from "ngx-letters-avatar";
|
||||||
import { PipesModule } from 'src/app/pipes/pipes.module';
|
import { PipesModule } from 'src/app/pipes/pipes.module';
|
||||||
|
import { SafehtmlPipe } from 'src/app/pipes/safehtml.pipe';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
|
|||||||
@@ -56,6 +56,14 @@
|
|||||||
<div class="message">
|
<div class="message">
|
||||||
<ion-label *ngIf="msg.delate == false">{{msg.msg}}</ion-label>
|
<ion-label *ngIf="msg.delate == false">{{msg.msg}}</ion-label>
|
||||||
<ion-label *ngIf="msg.delate == true">{{msg.msg}}</ion-label>
|
<ion-label *ngIf="msg.delate == true">{{msg.msg}}</ion-label>
|
||||||
|
|
||||||
|
<ion-label class="float-status-all float-status" >
|
||||||
|
|
||||||
|
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon>
|
||||||
|
</ion-label>
|
||||||
{{last ? scrollToBottom() : ''}}
|
{{last ? scrollToBottom() : ''}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -83,6 +91,13 @@
|
|||||||
msg.attachments[0].image_url" (click)="openPreview(msg)">
|
msg.attachments[0].image_url" (click)="openPreview(msg)">
|
||||||
<img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image">
|
<img *ngIf="msg.attachments[0].image_url" src="{{msg.attachments[0].image_url}}" alt="image">
|
||||||
<ion-icon *ngIf="msg.attachments[0].image_url == null" name="download-outline"></ion-icon>
|
<ion-icon *ngIf="msg.attachments[0].image_url == null" name="download-outline"></ion-icon>
|
||||||
|
<ion-label class="float-status-all float-status" >
|
||||||
|
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon>
|
||||||
|
</ion-label>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div *ngIf="msg.file.type != 'application/img'">
|
<div *ngIf="msg.file.type != 'application/img'">
|
||||||
<div *ngIf="msg.file.type != 'application/audio'" class="file add-attachment-bg-color">
|
<div *ngIf="msg.file.type != 'application/audio'" class="file add-attachment-bg-color">
|
||||||
@@ -90,6 +105,7 @@
|
|||||||
<span *ngIf="msg.file.type">
|
<span *ngIf="msg.file.type">
|
||||||
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
|
<fa-icon *ngIf="msg.file.type == 'application/pdf'" icon="file-pdf" class="pdf-icon"></fa-icon>
|
||||||
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon>
|
<fa-icon *ngIf="msg.file.type == 'application/word'" icon="file-word" class="word-icon"></fa-icon>
|
||||||
|
<fa-icon *ngIf="msg.file.type == 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'" icon="file-word" class="word-icon"></fa-icon>
|
||||||
<fa-icon *ngIf="msg.file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'" icon="file-word" class="excel-icon"></fa-icon>
|
<fa-icon *ngIf="msg.file.type == 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'" icon="file-word" class="excel-icon"></fa-icon>
|
||||||
<ion-icon *ngIf="msg.file.type == 'application/webtrix'" src="assets/icon/webtrix.svg"></ion-icon>
|
<ion-icon *ngIf="msg.file.type == 'application/webtrix'" src="assets/icon/webtrix.svg"></ion-icon>
|
||||||
</span>
|
</span>
|
||||||
@@ -113,6 +129,13 @@
|
|||||||
<span *ngIf="file.description && msg.file.type != 'application/webtrix'"> • </span>
|
<span *ngIf="file.description && msg.file.type != 'application/webtrix'"> • </span>
|
||||||
<span *ngIf="msg.file.type != 'application/webtrix' && msg.file.type != 'application/audio'">{{msg.displayType}}</span>
|
<span *ngIf="msg.file.type != 'application/webtrix' && msg.file.type != 'application/audio'">{{msg.displayType}}</span>
|
||||||
</ion-label>
|
</ion-label>
|
||||||
|
<ion-label class="float-status-all float-status" >
|
||||||
|
|
||||||
|
<ion-icon *ngIf="msg.messageSend == false" src="assets/images/clock-regular.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.messageSend == true && msg.received.length == 0" src="assets/images/check-solid.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.messageSend && msg.received.length >= 1 && msg.viewed.length == 0" src="assets/images/check-double-solid.svg"></ion-icon>
|
||||||
|
<ion-icon *ngIf="msg.viewed.length >= 1" src="assets/images/check-double-solid -viewed.svg"></ion-icon>
|
||||||
|
</ion-label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -293,3 +293,31 @@
|
|||||||
.typing ngx-letters-avatar {
|
.typing ngx-letters-avatar {
|
||||||
padding-right: 5px;
|
padding-right: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.float-status{
|
||||||
|
position: relative !important;
|
||||||
|
float: right;
|
||||||
|
display: flex;
|
||||||
|
align-items: self-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.float-status-image{
|
||||||
|
position: relative !important;
|
||||||
|
float: right;
|
||||||
|
display: flex;
|
||||||
|
align-items: self-end;
|
||||||
|
top: -15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.float-status-webtrix {
|
||||||
|
position: relative !important;
|
||||||
|
top: 0px !important;
|
||||||
|
float: right;
|
||||||
|
display: flex;
|
||||||
|
align-items: self-end;
|
||||||
|
}
|
||||||
|
|
||||||
|
.float-status-all {
|
||||||
|
font-size: 10pt !important;
|
||||||
|
}
|
||||||
|
|||||||
@@ -36,9 +36,11 @@ import { Camera, CameraResultType, CameraSource } from '@capacitor/camera';
|
|||||||
import { VoiceRecorder, VoiceRecorderPlugin, RecordingData, GenericResponse, CurrentRecordingStatus } from 'capacitor-voice-recorder';
|
import { VoiceRecorder, VoiceRecorderPlugin, RecordingData, GenericResponse, CurrentRecordingStatus } from 'capacitor-voice-recorder';
|
||||||
import { Filesystem, Directory, Encoding } from '@capacitor/filesystem';
|
import { Filesystem, Directory, Encoding } from '@capacitor/filesystem';
|
||||||
import { DomSanitizer } from '@angular/platform-browser';
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
|
import { AlertController, NavParams } from '@ionic/angular';
|
||||||
import { File } from '@awesome-cordova-plugins/file/ngx';
|
import { File } from '@awesome-cordova-plugins/file/ngx';
|
||||||
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
|
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
import * as pdfjsLib from 'pdfjs-dist';
|
import * as pdfjsLib from 'pdfjs-dist';
|
||||||
if( pdfjsLib !== undefined ){
|
if( pdfjsLib !== undefined ){
|
||||||
@@ -101,6 +103,8 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
durationDisplay = '';
|
durationDisplay = '';
|
||||||
duration = 0;
|
duration = 0;
|
||||||
|
|
||||||
|
audioPermissionStatus: 'granted'| 'denied' | 'prompt' | null = null
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public wsChatMethodsService: WsChatMethodsService,
|
public wsChatMethodsService: WsChatMethodsService,
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
@@ -123,10 +127,12 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
private CameraService: CameraService,
|
private CameraService: CameraService,
|
||||||
private toastService: ToastService,
|
private toastService: ToastService,
|
||||||
private sanitiser: DomSanitizer,
|
private sanitiser: DomSanitizer,
|
||||||
|
private alertController: AlertController,
|
||||||
private file: File,
|
private file: File,
|
||||||
private platform: Platform,
|
private platform: Platform,
|
||||||
private fileOpener: FileOpener,
|
private fileOpener: FileOpener,
|
||||||
|
|
||||||
|
|
||||||
) {
|
) {
|
||||||
console.log('OnCONSTRUCTOR');
|
console.log('OnCONSTRUCTOR');
|
||||||
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
this.loggedUserChat = authService.ValidatedUserChat['data'];
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import { MatButtonModule } from '@angular/material/button';
|
|||||||
import {MatMenuModule} from '@angular/material/menu';
|
import {MatMenuModule} from '@angular/material/menu';
|
||||||
import { LettersAvatarModule } from "ngx-letters-avatar";
|
import { LettersAvatarModule } from "ngx-letters-avatar";
|
||||||
import { PipesModule } from 'src/app/pipes/pipes.module';
|
import { PipesModule } from 'src/app/pipes/pipes.module';
|
||||||
|
import { SafehtmlPipe } from 'src/app/pipes/safehtml.pipe';
|
||||||
|
|
||||||
@NgModule({
|
@NgModule({
|
||||||
imports: [
|
imports: [
|
||||||
@@ -25,7 +26,6 @@ import { PipesModule } from 'src/app/pipes/pipes.module';
|
|||||||
MatMenuModule,
|
MatMenuModule,
|
||||||
LettersAvatarModule,
|
LettersAvatarModule,
|
||||||
PipesModule,
|
PipesModule,
|
||||||
|
|
||||||
],
|
],
|
||||||
exports: [MessagesPage],
|
exports: [MessagesPage],
|
||||||
declarations: [MessagesPage]
|
declarations: [MessagesPage]
|
||||||
|
|||||||
@@ -233,6 +233,7 @@
|
|||||||
<button #recordbtn *ngIf="!wsChatMethodsService.getDmRoom(roomId).message && !lastAudioRecorded" (click)="startRecording()" class="btn-no-color">
|
<button #recordbtn *ngIf="!wsChatMethodsService.getDmRoom(roomId).message && !lastAudioRecorded" (click)="startRecording()" class="btn-no-color">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/default/icons-chat-record-audio.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/default/icons-chat-record-audio.svg"></ion-icon>
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-record-audio.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-record-audio.svg"></ion-icon>
|
||||||
|
<!-- <ion-icon *ngIf="audioPermissionStatus != 'granted' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-record-audio-disable.svg"></ion-icon> -->
|
||||||
</button>
|
</button>
|
||||||
<button *ngIf="wsChatMethodsService.getDmRoom(roomId).message" class="btn-no-color" (click)="sendMessage()">
|
<button *ngIf="wsChatMethodsService.getDmRoom(roomId).message" class="btn-no-color" (click)="sendMessage()">
|
||||||
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
<ion-icon *ngIf="ThemeService.currentTheme == 'default' " class="chat-icon-send" src="assets/icon/theme/gov/icons-chat-send.svg"></ion-icon>
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { AfterViewChecked, AfterViewInit, Component, ElementRef, ChangeDetectorRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';
|
import { AfterViewChecked, AfterViewInit, Component, ElementRef, ChangeDetectorRef, EventEmitter, Input, OnChanges, OnDestroy, OnInit, Output, SimpleChanges, ViewChild } from '@angular/core';
|
||||||
import { AnimationController, GestureController, IonSlides, ModalController, PopoverController, Platform } from '@ionic/angular';
|
import { AnimationController, GestureController, IonSlides, ModalController, PopoverController } from '@ionic/angular';
|
||||||
import { AlertService } from 'src/app/services/alert.service';
|
import { AlertService } from 'src/app/services/alert.service';
|
||||||
import { AuthService } from 'src/app/services/auth.service';
|
import { AuthService } from 'src/app/services/auth.service';
|
||||||
import { ChatService } from 'src/app/services/chat.service';
|
import { ChatService } from 'src/app/services/chat.service';
|
||||||
@@ -35,9 +35,11 @@ import { DocumentViewer, DocumentViewerOptions } from '@ionic-native/document-vi
|
|||||||
import { VoiceRecorder, VoiceRecorderPlugin, RecordingData, GenericResponse, CurrentRecordingStatus } from 'capacitor-voice-recorder';
|
import { VoiceRecorder, VoiceRecorderPlugin, RecordingData, GenericResponse, CurrentRecordingStatus } from 'capacitor-voice-recorder';
|
||||||
import { Filesystem, Directory, Encoding } from '@capacitor/filesystem';
|
import { Filesystem, Directory, Encoding } from '@capacitor/filesystem';
|
||||||
import { DomSanitizer } from '@angular/platform-browser';
|
import { DomSanitizer } from '@angular/platform-browser';
|
||||||
|
import { AlertController, Platform, NavParams } from '@ionic/angular';
|
||||||
import { File } from '@awesome-cordova-plugins/file/ngx';
|
import { File } from '@awesome-cordova-plugins/file/ngx';
|
||||||
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
|
import { FileOpener } from '@awesome-cordova-plugins/file-opener/ngx';
|
||||||
|
|
||||||
|
|
||||||
const IMAGE_DIR = 'stored-images';
|
const IMAGE_DIR = 'stored-images';
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-messages',
|
selector: 'app-messages',
|
||||||
@@ -92,6 +94,8 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
durationDisplay = '';
|
durationDisplay = '';
|
||||||
duration = 0;
|
duration = 0;
|
||||||
|
|
||||||
|
audioPermissionStatus: 'granted'| 'denied' | 'prompt' | null = null
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
public popoverController: PopoverController,
|
public popoverController: PopoverController,
|
||||||
private modalController: ModalController,
|
private modalController: ModalController,
|
||||||
@@ -120,11 +124,14 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
private processesService: ProcessesService,
|
private processesService: ProcessesService,
|
||||||
private fileToBase64Service: FileToBase64Service,
|
private fileToBase64Service: FileToBase64Service,
|
||||||
private sanitiser: DomSanitizer,
|
private sanitiser: DomSanitizer,
|
||||||
|
private alertController: AlertController,
|
||||||
private file: File,
|
private file: File,
|
||||||
private platform: Platform,
|
private platform: Platform,
|
||||||
private fileOpener: FileOpener,
|
private fileOpener: FileOpener,
|
||||||
) {
|
) {
|
||||||
this.loggedUser = authService.ValidatedUserChat['data'];
|
this.loggedUser = authService.ValidatedUserChat['data'];
|
||||||
|
|
||||||
|
this.checkAudioPermission()
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnChanges(changes: SimpleChanges): void {
|
ngOnChanges(changes: SimpleChanges): void {
|
||||||
@@ -149,6 +156,20 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async checkAudioPermission() {
|
||||||
|
const permissionStatus = await navigator.permissions.query({ name: 'microphone' } as any)
|
||||||
|
|
||||||
|
console.log('permission', permissionStatus.state); // granted, denied, prompt
|
||||||
|
|
||||||
|
this.audioPermissionStatus = permissionStatus.state
|
||||||
|
|
||||||
|
permissionStatus.onchange = (data : any) => {
|
||||||
|
// console.log("Permission changed to " + data.state);
|
||||||
|
// console.log('permission', permissionStatus.state); // granted, denied, prompt
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
this.scrollToBottom();
|
this.scrollToBottom();
|
||||||
|
|
||||||
|
|||||||
@@ -64,7 +64,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="d-flex flex-1 pr-20 pl-50">
|
<div class="d-flex flex-1 pr-20 pl-50" *ngIf="p.userPermissionCount([permissionList.Agenda.access, permissionList.Gabinete.access, permissionList.Actions.access, permissionList.Chat.access]) >= 2">
|
||||||
|
|
||||||
<div *ngIf="p.userPermission([permissionList.Agenda.access]) || p.userPermission([permissionList.Gabinete.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/events')"
|
<div *ngIf="p.userPermission([permissionList.Agenda.access]) || p.userPermission([permissionList.Gabinete.access])" class="tab mr-20 d-flex align-center cursor-pointer" (click)="changeRoute('/home/events')"
|
||||||
[class.active]="locationPathname() == '/home/events'">
|
[class.active]="locationPathname() == '/home/events'">
|
||||||
|
|||||||
@@ -21,7 +21,6 @@ export class CalendarService {
|
|||||||
|
|
||||||
let restore = this.localstoreService.get(this.keyName, [])
|
let restore = this.localstoreService.get(this.keyName, [])
|
||||||
|
|
||||||
setTimeout(()=>{
|
|
||||||
restore.forEach((element:EventListStore, eventIndex) => {
|
restore.forEach((element:EventListStore, eventIndex) => {
|
||||||
this._eventSource.push({
|
this._eventSource.push({
|
||||||
startTime: new Date(element.startTime),
|
startTime: new Date(element.startTime),
|
||||||
@@ -29,12 +28,12 @@ export class CalendarService {
|
|||||||
allDay: element.allDay,
|
allDay: element.allDay,
|
||||||
event: element.event,
|
event: element.event,
|
||||||
calendarName: element.calendarName,
|
calendarName: element.calendarName,
|
||||||
|
CalendarId: element.CalendarId,
|
||||||
profile: element.profile,
|
profile: element.profile,
|
||||||
id: element.id,
|
id: element.id,
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
},10)
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -75,6 +74,7 @@ export class CalendarService {
|
|||||||
calendarName: element.CalendarName,
|
calendarName: element.CalendarName,
|
||||||
profile: profile,
|
profile: profile,
|
||||||
id: element.EventId,
|
id: element.EventId,
|
||||||
|
CalendarId: element.CalendarId
|
||||||
});
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -95,6 +95,29 @@ class SessionService {
|
|||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
get getInitials() {
|
||||||
|
let names = this._user.FullName.split(' ') || ' ',
|
||||||
|
initials = names[0].substring(0, 1).toUpperCase();
|
||||||
|
if (names.length > 1) {
|
||||||
|
initials += names[names.length - 1].substring(0, 1).toUpperCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
return initials;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
get getManagerInitials() {
|
||||||
|
let names = this._user.ManagerName.split(' ') || ' ',
|
||||||
|
initials = names[0].substring(0, 1).toUpperCase();
|
||||||
|
if (names.length > 1) {
|
||||||
|
initials += names[names.length - 1].substring(0, 1).toUpperCase();
|
||||||
|
}
|
||||||
|
|
||||||
|
return initials;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,8 @@
|
|||||||
|
<svg width="45" height="45" viewBox="0 0 45 45" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<path d="M22.5 45C34.9264 45 45 34.9264 45 22.5C45 10.0736 34.9264 0 22.5 0C10.0736 0 0 10.0736 0 22.5C0 34.9264 10.0736 45 22.5 45Z" fill="#CDCCCA"/>
|
||||||
|
<path d="M27.7273 12.7273C27.7273 9.56419 25.1631 7 22 7C18.8369 7 16.2727 9.56419 16.2727 12.7273V20.9091C16.2727 24.0722 18.8369 26.6364 22 26.6364C25.1631 26.6364 27.7273 24.0722 27.7273 20.9091V12.7273Z" stroke="white" stroke-width="2"/>
|
||||||
|
<path d="M26.0909 11.9091H24.4545C23.5508 11.9091 22.8182 12.6417 22.8182 13.5455C22.8182 14.4492 23.5508 15.1818 24.4545 15.1818H26.0909C26.9946 15.1818 27.7273 14.4492 27.7273 13.5455C27.7273 12.6417 26.9946 11.9091 26.0909 11.9091Z" fill="white"/>
|
||||||
|
<path fill-rule="evenodd" clip-rule="evenodd" d="M21.1818 29.9091H22.8182V36.4545H21.1818V29.9091Z" fill="white"/>
|
||||||
|
<path d="M26.9091 36.4546H17.0909C16.639 36.4546 16.2727 36.8209 16.2727 37.2727C16.2727 37.7246 16.639 38.0909 17.0909 38.0909H26.9091C27.3609 38.0909 27.7273 37.7246 27.7273 37.2727C27.7273 36.8209 27.3609 36.4546 26.9091 36.4546Z" fill="white"/>
|
||||||
|
<path d="M31 19.2727C31 25.3731 28.7778 29.9091 22 29.9091C15.2222 29.9091 13 25.3731 13 19.2727" stroke="white" stroke-linecap="round" stroke-linejoin="round"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -2,6 +2,23 @@
|
|||||||
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
|
// `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
|
||||||
// The list of file replacements can be found in `angular.json`.
|
// The list of file replacements can be found in `angular.json`.
|
||||||
|
|
||||||
|
|
||||||
|
// const DEV = {
|
||||||
|
// apiURL: 'http://gpr-dev-01.gabinetedigital.local/GabineteDigital.Services/V5/api/',
|
||||||
|
// apiChatUrl: 'https://www.tabularium.pt/api/v1/',
|
||||||
|
// apiWsChatUrl: 'wss://www.tabularium.pt/websocket',
|
||||||
|
// defaultuser: 'paulo.pinto@gabinetedigital.local',//paulo.pinto paulo.pinto@gabinetedigital.local
|
||||||
|
// defaultuserpwd: 'tabteste@006', //tabteste@006,
|
||||||
|
// }
|
||||||
|
|
||||||
|
// const QEI = {
|
||||||
|
// apiChatUrl: 'https://gabinetedigitalchat.dyndns.info/api/v1/',
|
||||||
|
// apiWsChatUrl: 'wss://gabinetedigitalchat.dyndns.info/websocket',
|
||||||
|
// apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/',
|
||||||
|
// defaultuser: 'paulo.pinto@gabinetedigital.local',//paulo.pinto paulo.pinto@gabinetedigital.local
|
||||||
|
// defaultuserpwd: 'tabteste@006', //tabteste@006,
|
||||||
|
// }
|
||||||
|
|
||||||
export const environment = {
|
export const environment = {
|
||||||
production: false,
|
production: false,
|
||||||
//apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/',
|
//apiURL: 'https://gabinetedigital.dyndns.info/GabineteDigital.Services/V5/api/',
|
||||||
|
|||||||
Reference in New Issue
Block a user