This commit is contained in:
Peter Maquiran
2023-11-09 12:07:33 +01:00
31 changed files with 398 additions and 77492 deletions
-77279
View File
File diff suppressed because it is too large Load Diff
+1
View File
@@ -176,6 +176,7 @@
"rxjs": "~6.6.3", "rxjs": "~6.6.3",
"rxjs-compat": "^6.6.7", "rxjs-compat": "^6.6.7",
"sanitize-filename-ts": "^1.0.2", "sanitize-filename-ts": "^1.0.2",
"send-intent": "^5.0.0",
"sharp": "^0.30.7", "sharp": "^0.30.7",
"socket.io-client": "^2.3.0", "socket.io-client": "^2.3.0",
"tinymce": "^6.6.0", "tinymce": "^6.6.0",
@@ -62,14 +62,14 @@
<div class="ion-icon-class"> <div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon> <ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
</div> </div>
<div class="ion-input-class" [class.input-error]="Form?.get('selectedTypes')?.invalid && validateFrom "> <div class="ion-input-class" [class.input-error]="Form?.get('selectedTypes')?.invalid && validateFrom || validateField ">
<mat-form-field <mat-form-field
floatLabel="never" floatLabel="never"
appearance="fill" appearance="fill"
class="width-100 d-block" class="width-100 d-block"
appearance="none"> appearance="none">
<mat-select [(ngModel)]="selectedTypes" placeholder="Selecione o tipo de assunto*"> <mat-select [multiple]="false" [(ngModel)]="selectedTypes" placeholder="{{placeholderSubject}}">
<mat-option *ngFor="let type of subjectTypes" value="{{type.Code}}">{{type.Description}}</mat-option> <mat-option *ngFor="let type of subjectTypes" value="{{type.Code}}">{{type.Description}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
@@ -63,6 +63,7 @@ export class CreateProcessPage implements OnInit {
loadedAttachments: any; loadedAttachments: any;
subjectTypes: any; subjectTypes: any;
selectedTypes: string[] = []; selectedTypes: string[] = [];
placeholderSubject: string;
postData: Despacho; postData: Despacho;
dispatchFolder: Folder; dispatchFolder: Folder;
@@ -125,7 +126,13 @@ export class CreateProcessPage implements OnInit {
this.postData = new Despacho(); this.postData = new Despacho();
this.participants = this.participants = new Array(); this.participants = this.participants = new Array();
//Initialize SubjectTypes Array with the value "Indefinido" //Initialize SubjectTypes Array with the value "Indefinido"
this.selectedTypes = ['99999850']; if(this.loggeduser.Profile == 'PR') {
this.selectedTypes = ['99999850'];
this.placeholderSubject = 'Indefinido'
} else {
this.placeholderSubject = 'Selecione o tipo de assunto*'
}
let NumberPDPP; let NumberPDPP;
@@ -179,9 +186,9 @@ export class CreateProcessPage implements OnInit {
ngOnInit() { ngOnInit() {
console.log('crete process') console.log('crete process')
this.getSubjectType(); this.getSubjectType();
setTimeout(() => { /* setTimeout(() => {
this.selectedTypes = ['99999850']; this.selectedTypes = ['99999850'];
}, 500); }, 500); */
this.taskDate = new Date(this.task.taskStartDate); this.taskDate = new Date(this.task.taskStartDate);
@@ -420,7 +427,7 @@ export class CreateProcessPage implements OnInit {
AttachmentList: docs AttachmentList: docs
} }
if (this.postData.DispatchFolder.Message) { /* if (this.postData.DispatchFolder.Message) { */
try { try {
await this.despachoService.createDespacho(this.postData).toPromise(); await this.despachoService.createDespacho(this.postData).toPromise();
await this.despachoService.CompleteTask({ serialNumber: this.task.serialNumber, note: this.dispatchFolder.Message }).toPromise(); await this.despachoService.CompleteTask({ serialNumber: this.task.serialNumber, note: this.dispatchFolder.Message }).toPromise();
@@ -432,11 +439,11 @@ export class CreateProcessPage implements OnInit {
} finally { } finally {
loader.remove(); loader.remove();
} }
} /* }
else { else {
this.validateField = true; this.validateField = true;
this.toastService._badRequest('Por favor adicione uma descrição'); this.toastService._badRequest('Por favor adicione uma descrição');
} } */
loader.remove(); loader.remove();
break; break;
case '1': // Pedido de Parecer case '1': // Pedido de Parecer
@@ -331,7 +331,7 @@
</div> </div>
</div> </div>
<div *ngIf="loggeduser.Profile != 'PR'" class="aside-righ flex-grow-1"> <div class="aside-righ flex-grow-1">
<app-empty-container <app-empty-container
[texto]="emptyTextDescription" [texto]="emptyTextDescription"
*ngIf="!showAttendees" *ngIf="!showAttendees"
@@ -22,6 +22,7 @@ import { SessionStore } from 'src/app/store/session.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { TaskService } from 'src/app/services/task.service' import { TaskService } from 'src/app/services/task.service'
import { ContactsService } from 'src/app/services/contacts.service';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
@@ -75,8 +76,8 @@ export class DocumentSetUpMeetingPage implements OnInit {
taskParticipants: EventPerson[] = []; taskParticipants: EventPerson[] = [];
taskParticipantsCc: EventPerson[] = []; taskParticipantsCc: EventPerson[] = [];
taskDocId:string; taskDocId: string;
loadedAttachments:any; loadedAttachments: any;
attachments: SearchList[] = []; attachments: SearchList[] = [];
@@ -85,24 +86,26 @@ export class DocumentSetUpMeetingPage implements OnInit {
postData: Event; postData: Event;
formLocationSatus: boolean = false; formLocationSatus: boolean = false;
showAttendees= false; showAttendees = false;
loggeduser: LoginUserRespose; loggeduser: LoginUserRespose;
emptyTextDescription = "Selecionar intervenientes"; emptyTextDescription = "Selecionar intervenientes";
document: SearchFolderDetails | SearchDocumentDetails | any; document: SearchFolderDetails | SearchDocumentDetails | any;
subject: string; subject: string;
docs:any[] = []; docs: any[] = [];
eventPipe = new EventPipe() eventPipe = new EventPipe()
CalendarName; CalendarName;
CalendarNameShow = true CalendarNameShow = true
CalendarNamesOptions CalendarNamesOptions
testeFormDefaul = "Eudes" testeFormDefaul = "Eudes"
environment = environment environment = environment
eventPersons: EventPerson[];
contacts: EventPerson[];
constructor( constructor(
private modalController: ModalController, private modalController: ModalController,
private router:Router, private router: Router,
private navParams: NavParams, private navParams: NavParams,
authService: AuthService, authService: AuthService,
private toastService: ToastService, private toastService: ToastService,
@@ -111,15 +114,16 @@ export class DocumentSetUpMeetingPage implements OnInit {
public ThemeService: ThemeService, public ThemeService: ThemeService,
public _eventService: EventsService, public _eventService: EventsService,
private httpErroHandle: HttpErrorHandle, private httpErroHandle: HttpErrorHandle,
public TaskService: TaskService public TaskService: TaskService,
private contactsService: ContactsService,
) { ) {
this.loggeduser = SessionStore.user; this.loggeduser = SessionStore.user;
this.document = this.navParams.get('document') this.document = this.navParams.get('document')
if(Array.isArray(this.document)) { if (Array.isArray(this.document)) {
const E = this.document const E = this.document
this.document = [] this.document = []
E.forEach((e)=> { E.forEach((e) => {
this.document.push({ this.document.push({
ApplicationId: e.ApplicationId || e.ApplicationType, ApplicationId: e.ApplicationId || e.ApplicationType,
Source: 1, Source: 1,
@@ -151,7 +155,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
if(Array.isArray(this.document)) { if (Array.isArray(this.document)) {
this.attachments = this.document this.attachments = this.document
} else { } else {
this.attachments = [this.document] this.attachments = [this.document]
@@ -160,22 +164,22 @@ export class DocumentSetUpMeetingPage implements OnInit {
this.subject = this.navParams.get('subject') this.subject = this.navParams.get('subject')
this.postData = new Event(); this.postData = new Event();
this.postData.Body ={ BodyType : "1", Text : ""}; this.postData.Body = { BodyType: "1", Text: "" };
this.postData.Subject = this.subject this.postData.Subject = this.subject
this.postData.CalendarName = "Oficial"; this.postData.CalendarName = "Oficial";
this.postData.Category = 'Reunião' this.postData.Category = 'Reunião'
if(!this.CalendarName) { if (!this.CalendarName) {
if(this._eventService.calendarNamesAry.includes('Meu calendario')) { if (this._eventService.calendarNamesAry.includes('Meu calendario')) {
this.CalendarName = 'Meu calendario'; this.CalendarName = 'Meu calendario';
} else { } else {
this.CalendarName = this._eventService.calendarNamesAry[0] this.CalendarName = this._eventService.calendarNamesAry[0]
} }
} }
if(this.taskParticipants.length == 0) { if (this.taskParticipants.length == 0) {
this.taskParticipants = [ this.taskParticipants = [
// { // {
// EmailAddress: SessionStore.user.Email, // EmailAddress: SessionStore.user.Email,
@@ -194,6 +198,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
this.adding = "intervenient"; this.adding = "intervenient";
this.setDefaultTime() this.setDefaultTime()
this.getRecurrenceTypes(); this.getRecurrenceTypes();
this.fetchContacts("")
} }
@@ -203,15 +208,15 @@ export class DocumentSetUpMeetingPage implements OnInit {
} }
myInterval = setInterval(() => { myInterval = setInterval(() => {
document.querySelectorAll('.ngx-mat-timepicker input').forEach((e :any) => { document.querySelectorAll('.ngx-mat-timepicker input').forEach((e: any) => {
if(e) { if (e) {
e.disabled = true; e.disabled = true;
} }
}) })
}, 1000); }, 1000);
getRecurrenceTypes() { getRecurrenceTypes() {
this.calendarService.getRecurrenceTypes().subscribe( res=> { this.calendarService.getRecurrenceTypes().subscribe(res => {
this.recurringTypes = res; this.recurringTypes = res;
}); });
} }
@@ -222,13 +227,13 @@ export class DocumentSetUpMeetingPage implements OnInit {
} }
setStartDate() { setStartDate() {
if(!this.postData.StartDate) { if (!this.postData.StartDate) {
this.postData.StartDate = this.roundTimeQuarterHour(); this.postData.StartDate = this.roundTimeQuarterHour();
} }
} }
setEndDate() { setEndDate() {
if(!this.postData.EndDate) { if (!this.postData.EndDate) {
this.postData.EndDate = this.roundTimeQuarterHourPlus15(this.postData.StartDate); this.postData.EndDate = this.roundTimeQuarterHourPlus15(this.postData.StartDate);
} }
} }
@@ -238,11 +243,11 @@ export class DocumentSetUpMeetingPage implements OnInit {
} }
runValidation() { runValidation() {
this.validateFrom = true this.validateFrom = true
} }
get dateValid() { get dateValid() {
return new Date(this.postData.StartDate).getTime() < new Date(this.postData.EndDate).getTime() ? 'ok': null return new Date(this.postData.StartDate).getTime() < new Date(this.postData.EndDate).getTime() ? 'ok' : null
} }
injectValidation() { injectValidation() {
@@ -258,7 +263,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
CalendarName: new FormControl(this.postData.CalendarName, [ CalendarName: new FormControl(this.postData.CalendarName, [
// Validators.required // Validators.required
]), ]),
Date: new FormControl( (this.dateValid), [ Date: new FormControl((this.dateValid), [
Validators.required Validators.required
]), ]),
participantes: new FormControl(this.taskParticipants, [ participantes: new FormControl(this.taskParticipants, [
@@ -279,7 +284,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
this.CalendarNameShow = true this.CalendarNameShow = true
if(this._eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this._eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) { if (this._eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this._eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) {
this.CalendarNamesOptions = ['Oficial', 'Pessoal'] this.CalendarNamesOptions = ['Oficial', 'Pessoal']
@@ -300,10 +305,10 @@ export class DocumentSetUpMeetingPage implements OnInit {
async saveTask() { async saveTask() {
if(this.loggeduser.Profile == 'MDGPR') { if (this.loggeduser.Profile == 'MDGPR') {
this.injectValidation() this.injectValidation()
this.runValidation() this.runValidation()
if(this.Form.invalid) return false if (this.Form.invalid) return false
} }
let Attendees = this.taskParticipants.concat(this.taskParticipantsCc); let Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
@@ -343,7 +348,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
}, (error) => { }, (error) => {
laoder.remove(); laoder.remove();
this.httpErroHandle.httpStatusHandle(error) this.httpErroHandle.httpStatusHandle(error)
}, ()=>{ }, () => {
laoder.remove(); laoder.remove();
}); });
@@ -353,10 +358,10 @@ export class DocumentSetUpMeetingPage implements OnInit {
this.adding = "intervenient"; this.adding = "intervenient";
if(window.innerWidth <= 801){ if (window.innerWidth <= 801) {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: AttendeesPageModal, component: AttendeesPageModal,
componentProps: { componentProps: {
adding: this.adding, adding: this.adding,
taskParticipants: this.taskParticipants, taskParticipants: this.taskParticipants,
taskParticipantsCc: this.taskParticipantsCc taskParticipantsCc: this.taskParticipantsCc
@@ -367,7 +372,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
modal.onDidDismiss().then((data) => { modal.onDidDismiss().then((data) => {
if(data) { if (data) {
data = data['data']; data = data['data'];
const newAttendees: EventPerson[] = data['taskParticipants']; const newAttendees: EventPerson[] = data['taskParticipants'];
@@ -391,10 +396,10 @@ export class DocumentSetUpMeetingPage implements OnInit {
this.adding = "CC"; this.adding = "CC";
if(window.innerWidth <= 800) { if (window.innerWidth <= 800) {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: AttendeesPageModal, component: AttendeesPageModal,
componentProps: { componentProps: {
adding: this.adding, adding: this.adding,
taskParticipants: this.taskParticipants, taskParticipants: this.taskParticipants,
taskParticipantsCc: this.taskParticipantsCc taskParticipantsCc: this.taskParticipantsCc
@@ -407,7 +412,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
modal.onDidDismiss().then((data) => { modal.onDidDismiss().then((data) => {
if(data){ if (data) {
data = data['data']; data = data['data'];
const newAttendees: EventPerson[] = data['taskParticipants']; const newAttendees: EventPerson[] = data['taskParticipants'];
@@ -437,30 +442,30 @@ export class DocumentSetUpMeetingPage implements OnInit {
} }
}); });
modal.onDidDismiss().then((res)=> { modal.onDidDismiss().then((res) => {
if(res){ if (res) {
const data = res.data; const data = res.data;
this.attachments.push(data.selected); this.attachments.push(data.selected);
} }
}, (error) => { }, (error) => {
console.log(error) console.log(error)
}); });
await modal.present(); await modal.present();
} }
removeAttachment(index: number) { removeAttachment(index: number) {
this.attachments = this.attachments.filter( (e, i) => index != i); this.attachments = this.attachments.filter((e, i) => index != i);
} }
validateFormInputs() { validateFormInputs() {
let formLocation = this.postData.Location.trim(); let formLocation = this.postData.Location.trim();
if(!this.postData.Location && formLocation.length <= 0){ if (!this.postData.Location && formLocation.length <= 0) {
this.formLocationSatus = true; this.formLocationSatus = true;
} }
} }
selectedCalendarId () { selectedCalendarId() {
if (this._eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postData.CalendarName == 'Oficial') { if (this._eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postData.CalendarName == 'Oficial') {
return this._eventService.calendarNamesType[this.CalendarName]['OficialId'] return this._eventService.calendarNamesType[this.CalendarName]['OficialId']
@@ -474,7 +479,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
} }
} }
dynamicSetIntervenient({taskParticipants, taskParticipantsCc}) { dynamicSetIntervenient({ taskParticipants, taskParticipantsCc }) {
this.taskParticipants = taskParticipants; this.taskParticipants = taskParticipants;
this.taskParticipantsCc = taskParticipantsCc; this.taskParticipantsCc = taskParticipantsCc;
} }
@@ -497,7 +502,7 @@ export class DocumentSetUpMeetingPage implements OnInit {
const minutes = date.getMinutes(); const minutes = date.getMinutes();
date.setSeconds(0); date.setSeconds(0);
if(minutes % 15 != 0) { if (minutes % 15 != 0) {
if (minutes > 45) { if (minutes > 45) {
date.setMinutes(60) date.setMinutes(60)
@@ -514,10 +519,10 @@ export class DocumentSetUpMeetingPage implements OnInit {
return date return date
} }
roundTimeQuarterHourPlus15(date:Date) { roundTimeQuarterHourPlus15(date: Date) {
const _date = new Date(date); const _date = new Date(date);
const minutes = _date .getMinutes(); const minutes = _date.getMinutes();
_date .setMinutes(minutes + 15) _date.setMinutes(minutes + 15)
return _date return _date
} }
@@ -525,5 +530,34 @@ export class DocumentSetUpMeetingPage implements OnInit {
return this._eventService.calendarRole.includes(str); return this._eventService.calendarRole.includes(str);
} }
async fetchContacts(filter: string) {
if (this.loggeduser.Profile == 'PR') {
this.contactsService.getContacts(filter).subscribe(result => {
if (this.eventPersons != null) {
this.eventPersons.forEach(attendee => {
const index: number = result.findIndex((cont) => {
return cont.EmailAddress.toLocaleLowerCase() == attendee.EmailAddress.toLocaleLowerCase()
});
result.splice(index, 1);
});
}
this.contacts = result;
console.log('Attendes Email', this.loggeduser.Email)
let filterLoggedUserEmail = this.contacts.filter(item => item.RoleDescription == "Ministro e Director do Gabinete do PR")
console.log('Attendes Email', filterLoggedUserEmail)
this.contacts = filterLoggedUserEmail;
const newAttendees: EventPerson[] = this.contacts;
this.setIntervenient(newAttendees);
console.log('Attendes Email', this.contacts)
}
);
}
}
} }
@@ -61,16 +61,16 @@
<div class="d-flex align-center flex-column" (click)="takePicture()"> <div class="d-flex align-center flex-column" (click)="takePicture()">
<div *ngIf="profilePicture == '' "> <div *ngIf="profilePicture == '' ">
<ion-icon <img
*ngIf="SessionStore.user.RoleDescription != 'Presidente da República' && SessionStore.user.RoleDescription != 'Ministro e Director do Gabinete do PR' && SessionStore.user.RoleDescription != 'Secretário Geral' "
class="profile-pic" src="assets/images/theme/gov/icons-profile.svg"></ion-icon> class="profile-pic" src="assets/images/theme/gov/icons-profile.svg">
<img *ngIf="SessionStore.user.RoleDescription == 'Presidente da República' " class="profile-pic" <!-- <img *ngIf="SessionStore.user.RoleDescription == 'Presidente da República' " class="profile-pic"
src='assets/images/presidente.png'> src='assets/images/presidente.png'>
<img *ngIf="SessionStore.user.RoleDescription == 'Ministro e Director do Gabinete do PR' " <img *ngIf="SessionStore.user.RoleDescription == 'Ministro e Director do Gabinete do PR' "
class="profile-pic" src='assets/images/ministro.png'> class="profile-pic" src='assets/images/ministro.png'>
<img *ngIf="SessionStore.user.RoleDescription == 'Secretário Geral' " class="profile-pic" <img *ngIf="SessionStore.user.RoleDescription == 'Secretário Geral' " class="profile-pic"
src='assets/images/secretaria_geral.png'> src='assets/images/secretaria_geral.png'> -->
</div> </div>
<div *ngIf="profilePicture != '' "> <div *ngIf="profilePicture != '' ">
@@ -44,8 +44,12 @@ export class EditProfilePage implements OnInit {
} }
getProfilpictureFromStorage() { getProfilpictureFromStorage() {
this.storageService.get(this.SessionStore.user.RoleID.toString()).then((picture) => { this.storageService.get(this.SessionStore.user.RoleID.toString()).then((picture) => {
console.log(picture) if(picture) {
this.profilePicture = picture this.profilePicture = picture
} else {
this.profilePicture = "";
}
/* console.log(picture) */
}).catch((error) => { }).catch((error) => {
this.profilePicture = ""; this.profilePicture = "";
}) })
+6 -6
View File
@@ -37,18 +37,18 @@
<ion-header class=" bg-blue ion-no-border"> <ion-header class=" bg-blue ion-no-border">
<div class="profile-content"> <div class="profile-content">
<div class="d-flex align-center"> <div class="d-flex align-center flex-column">
<div *ngIf="profilePicture == ''" class="profile-pic"> <div *ngIf="profilePicture == ''">
<ion-icon *ngIf="SessionStore.user.RoleDescription != 'Presidente da República' && SessionStore.user.RoleDescription != 'Ministro e Director do Gabinete do PR' && SessionStore.user.RoleDescription != 'Secretário Geral' " class="profile-pic" <img
src="assets/images/theme/gov/icons-profile.svg"></ion-icon> class="profile-pic" src="assets/images/theme/gov/icons-profile.svg">
<img *ngIf="SessionStore.user.RoleDescription == 'Presidente da República' " class="profile-pic" <!-- <img *ngIf="SessionStore.user.RoleDescription == 'Presidente da República' " class="profile-pic"
src='assets/images/presidente.png'> src='assets/images/presidente.png'>
<img *ngIf="SessionStore.user.RoleDescription == 'Ministro e Director do Gabinete do PR' " class="profile-pic" <img *ngIf="SessionStore.user.RoleDescription == 'Ministro e Director do Gabinete do PR' " class="profile-pic"
src='assets/images/ministro.png'> src='assets/images/ministro.png'>
<img *ngIf="SessionStore.user.RoleDescription == 'Secretário Geral' " class="profile-pic" <img *ngIf="SessionStore.user.RoleDescription == 'Secretário Geral' " class="profile-pic"
src='assets/images/secretaria_geral.png'> src='assets/images/secretaria_geral.png'> -->
</div> </div>
<div *ngIf="profilePicture != ''" class="profile-pic"> <div *ngIf="profilePicture != ''" class="profile-pic">
+6 -2
View File
@@ -98,8 +98,12 @@ export class ProfilePage implements OnInit {
getProfilpicture() { getProfilpicture() {
this.storageService.get(this.SessionStore.user.RoleID.toString()).then((picture) => { this.storageService.get(this.SessionStore.user.RoleID.toString()).then((picture) => {
console.log(picture) if(picture) {
this.profilePicture = picture this.profilePicture = picture
} else {
this.profilePicture = "";
}
/* console.log(picture) */
}).catch((error ) => { }).catch((error ) => {
this.profilePicture = ""; this.profilePicture = "";
}) })
+2 -1
View File
@@ -3,5 +3,6 @@ export class EventPerson{
Name: string; Name: string;
IsRequired: boolean; IsRequired: boolean;
UserType: string; UserType: string;
IsPR: boolean IsPR: boolean;
RoleDescription: string;
} }
+2 -1
View File
@@ -228,6 +228,7 @@
<!-- {{year.yearInfo.yearName}} --> <!-- {{year.yearInfo.yearName}} -->
<div *ngFor="let month of year.months " class="header-day" > <div *ngFor="let month of year.months " class="header-day" >
<!-- {{ month.monthInfo.monthName | json }} --> <!-- {{ month.monthInfo.monthName | json }} -->
<!-- <hr> -->
<div *ngFor="let day of month.days " class="EventListBox-container" > <div *ngFor="let day of month.days " class="EventListBox-container" >
@@ -237,7 +238,7 @@
<div *ngFor="let event of day.events " class="EventListBox mb-10" > <div *ngFor="let event of day.events " class="EventListBox mb-10" >
<div class="d-flex content-{{event.profile}}-{{event.event.CalendarName}} mt-10 cursor-pointer width-100 " (click)="eventClicked(event)" <div class="d-flex content-{{event.profile}}-{{event.event.CalendarName}} mt-10 cursor-pointer width-100 " (click)="eventClicked(event)"
*ngIf="viewEventMonth <= dateMonth(event) "> >
<div class="schedule-time" *ngIf="!event.event.IsAllDayEvent"> <div class="schedule-time" *ngIf="!event.event.IsAllDayEvent">
+75 -72
View File
@@ -105,7 +105,7 @@ export class AgendaPage implements OnInit {
selectedEvent: Event; selectedEvent: Event;
selectedEventId: string | number; selectedEventId: string | number;
selectedEventCalendarId : string | number; selectedEventCalendarId: string | number;
postEvent: any; postEvent: any;
// temporary data // temporary data
@@ -213,7 +213,7 @@ export class AgendaPage implements OnInit {
} else if (this.loggeduser.Profile == 'PR') { } else if (this.loggeduser.Profile == 'PR') {
this.profile = "pr"; this.profile = "pr";
} else { } else {
if(this.eventService.usersCalendarIds.length >= 2) { if (this.eventService.usersCalendarIds.length >= 2) {
this.profile = "mdgpr"; this.profile = "mdgpr";
} else if (this.eventService.hasOwnCalendar) { } else if (this.eventService.hasOwnCalendar) {
this.profile = "mdgpr"; this.profile = "mdgpr";
@@ -309,8 +309,8 @@ export class AgendaPage implements OnInit {
let weekNum = 0; let weekNum = 0;
function Week(a) { function Week(a) {
for(let b of a.querySelectorAll('td')) { for (let b of a.querySelectorAll('td')) {
if(!b.className.includes('text-muted')) { if (!b.className.includes('text-muted')) {
weekNum++; weekNum++;
return true return true
} }
@@ -320,18 +320,18 @@ export class AgendaPage implements OnInit {
const dayBoxHeight = document.querySelector('.monthview-container .swiper-container .swiper-slide-active table tbody tr td').clientHeight const dayBoxHeight = document.querySelector('.monthview-container .swiper-container .swiper-slide-active table tbody tr td').clientHeight
const weeks = document.querySelectorAll('.monthview-container .swiper-container .swiper-slide-active table tbody tr'); const weeks = document.querySelectorAll('.monthview-container .swiper-container .swiper-slide-active table tbody tr');
for (let week of weeks as any ){ for (let week of weeks as any) {
Week(week) Week(week)
} }
this.showCalendar = true this.showCalendar = true
this.listBoxService.height = (weekNum * dayBoxHeight) +'px' this.listBoxService.height = (weekNum * dayBoxHeight) + 'px'
if(dayBoxHeight == 0) { if (dayBoxHeight == 0) {
this.weekToShow() this.weekToShow()
} }
} catch (e) { } catch (e) {
setTimeout(()=> { setTimeout(() => {
this.weekToShow() this.weekToShow()
}, 100) }, 100)
} }
@@ -339,8 +339,8 @@ export class AgendaPage implements OnInit {
} }
setCalendarByDefault() { setCalendarByDefault() {
if(!this.CalendarName) { if (!this.CalendarName) {
if(this.eventService.calendarNamesAry.includes('Meu calendario')) { if (this.eventService.calendarNamesAry.includes('Meu calendario')) {
this.CalendarName = 'Meu calendario'; this.CalendarName = 'Meu calendario';
} else { } else {
this.CalendarName = this.eventService.calendarNamesAry[0] this.CalendarName = this.eventService.calendarNamesAry[0]
@@ -421,13 +421,16 @@ export class AgendaPage implements OnInit {
onDropDownScrollWeal() { onDropDownScrollWeal() {
setTimeout(() => { try {
document.querySelector('.dropdown-scroll-weel').querySelectorAll('.active')[0].scrollIntoView({ behavior: 'smooth', block: 'center' });
setTimeout(() => { setTimeout(() => {
document.querySelector('.dropdown-scroll-weel').querySelectorAll('.active')[1].scrollIntoView({ behavior: 'smooth', block: 'center' }); document.querySelector('.dropdown-scroll-weel').querySelectorAll('.active')[0].scrollIntoView({ behavior: 'smooth', block: 'center' });
}, 300) setTimeout(() => {
}, 10) document.querySelector('.dropdown-scroll-weel').querySelectorAll('.active')[1].scrollIntoView({ behavior: 'smooth', block: 'center' });
}, 300)
}, 10)
} catch (error) {
console.log(error)
}
} }
@@ -445,7 +448,7 @@ export class AgendaPage implements OnInit {
this.rangeStartDate = ev.startTime; this.rangeStartDate = ev.startTime;
this.rangeEndDate = ev.endTime; this.rangeEndDate = ev.endTime;
if(this.currentMoth.rangeEndDate == null) { if (this.currentMoth.rangeEndDate == null) {
this.currentMoth = { this.currentMoth = {
rangeStartDate: ev.startTime, rangeStartDate: ev.startTime,
rangeEndDate: ev.endTime rangeEndDate: ev.endTime
@@ -579,7 +582,7 @@ export class AgendaPage implements OnInit {
loadRangeEvents(startTime: Date, endTime: Date) { loadRangeEvents(startTime: Date, endTime: Date) {
this.weekToShow() this.weekToShow()
if(!this.eventService.hasAnyCalendar) { if (!this.eventService.hasAnyCalendar) {
return false return false
} }
@@ -589,9 +592,9 @@ export class AgendaPage implements OnInit {
this.showLoader = true; this.showLoader = true;
const index = `${startTime}${endTime}` const index = `${startTime}${endTime}`
if(!this.loadRequest[index]) { if (!this.loadRequest[index]) {
this.loadRequest[index] = {startTime, endTime} this.loadRequest[index] = { startTime, endTime }
this.loadRequestHistory[index] = {lastTimeUpdate: new Date()} this.loadRequestHistory[index] = { lastTimeUpdate: new Date() }
this.loadRangeEventRun(startTime, endTime) this.loadRangeEventRun(startTime, endTime)
} else { } else {
@@ -606,7 +609,7 @@ export class AgendaPage implements OnInit {
loadRangeEventRun(startTime: Date, endTime: Date) { loadRangeEventRun(startTime: Date, endTime: Date) {
if(SessionStore.user.OwnerCalendars.length == 0 && SessionStore.user.SharedCalendars.length == 0) { if (SessionStore.user.OwnerCalendars.length == 0 && SessionStore.user.SharedCalendars.length == 0) {
return false return false
} }
@@ -628,16 +631,16 @@ export class AgendaPage implements OnInit {
} }
let load = 0; let load = 0;
for ( const selectedCalendar of selectedCalendarIds) { for (const selectedCalendar of selectedCalendarIds) {
this.eventService.getEventsByCalendarId(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59'), selectedCalendar.CalendarId).then((response: any) => { this.eventService.getEventsByCalendarId(momentG(new Date(startTime), 'yyyy-MM-dd HH:mm:ss'), momentG(new Date(endTime), 'yyyy-MM-dd 23:59:59'), selectedCalendar.CalendarId).then((response: any) => {
let label; let label;
if(SessionStore.user.Profile == 'PR') { if (SessionStore.user.Profile == 'PR') {
label = "pr" label = "pr"
} else if(SessionStore.user.OwnerCalendars.find(e => e.CalendarId == selectedCalendar.CalendarId)) { } else if (SessionStore.user.OwnerCalendars.find(e => e.CalendarId == selectedCalendar.CalendarId)) {
label = 'md' label = 'md'
} else { } else {
label = "pr" label = "pr"
@@ -656,7 +659,7 @@ export class AgendaPage implements OnInit {
this.deleteLoadRangeEvent(startTime, endTime); this.deleteLoadRangeEvent(startTime, endTime);
load++ load++
if(load == selectedCalendarIds.length) { if (load == selectedCalendarIds.length) {
this.showLoader = false; this.showLoader = false;
} }
@@ -669,9 +672,9 @@ export class AgendaPage implements OnInit {
selectedAgenda = {} selectedAgenda = {}
getSelectedAgendaCalendars () { getSelectedAgendaCalendars() {
if(this.CalendarName == 'PR+MDGPR') { if (this.CalendarName == 'PR+MDGPR') {
let result = this.SessionStore.user.OwnerCalendars let result = this.SessionStore.user.OwnerCalendars
@@ -682,46 +685,46 @@ export class AgendaPage implements OnInit {
return result.concat(join) return result.concat(join)
} else { } else {
const calendar = this.eventService.calendarNamesType[this.CalendarName]; const calendar = this.eventService.calendarNamesType[this.CalendarName];
let Oficial = calendar?.['OficialId'] let Oficial = calendar?.['OficialId']
let Pessoal = calendar?.['PessoalId'] let Pessoal = calendar?.['PessoalId']
if(Oficial && Pessoal) { if (Oficial && Pessoal) {
return [ return [
{ {
CalendarId : Oficial, CalendarId: Oficial,
OwnerId: calendar.OwnerId, OwnerId: calendar.OwnerId,
CalendarName: calendar.CalendarName CalendarName: calendar.CalendarName
}, },
{ {
OwnerId: calendar.OwnerId, OwnerId: calendar.OwnerId,
CalendarId : Pessoal, CalendarId: Pessoal,
CalendarName: calendar.CalendarName CalendarName: calendar.CalendarName
}
]
} else if (Oficial) {
try {
return [{
OwnerId: calendar.OwnerId,
CalendarId: Oficial,
CalendarName: calendar.CalendarName
}]
} catch (error) {
console.log(error)
}
} else {
try {
return [{
OwnerId: calendar.OwnerId,
CalendarId: Pessoal,
CalendarName: calendar.CalendarName
}]
} catch (error) {
console.log(error)
} }
]
} else if (Oficial) {
try {
return [{
OwnerId: calendar.OwnerId,
CalendarId : Oficial,
CalendarName: calendar.CalendarName
}]
} catch (error) {
console.log(error)
} }
} else {
try {
return [{
OwnerId: calendar.OwnerId,
CalendarId : Pessoal,
CalendarName: calendar.CalendarName
}]
} catch (error) {
console.log(error)
}
}
} }
@@ -781,7 +784,7 @@ export class AgendaPage implements OnInit {
} catch (e) { } } catch (e) { }
this.updateEventListBox() this.updateEventListBox()
} else {} } else { }
} }
@@ -920,7 +923,7 @@ export class AgendaPage implements OnInit {
this.myCal.loadEvents(); this.myCal.loadEvents();
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate); this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
} }
} catch (error) { } catch (error) {
} }
@@ -935,7 +938,7 @@ export class AgendaPage implements OnInit {
let navigationExtras: NavigationExtras = { queryParams: { CalendarId } } let navigationExtras: NavigationExtras = { queryParams: { CalendarId } }
this.router.navigate(['/home/agenda/',eventId,'agenda'], navigationExtras); this.router.navigate(['/home/agenda/', eventId, 'agenda'], navigationExtras);
} }
@@ -950,13 +953,13 @@ export class AgendaPage implements OnInit {
this.postEvent = data.event; this.postEvent = data.event;
this.mobileComponent.showEditEvent = true; this.mobileComponent.showEditEvent = true;
} else if(data.type == 'delete') { } else if (data.type == 'delete') {
} }
this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate); this.loadRangeEvents(this.rangeStartDate, this.rangeEndDate);
setTimeout(()=>{ setTimeout(() => {
this.onCurrentChanged(this.eventSelectedDate) this.onCurrentChanged(this.eventSelectedDate)
}, 500) }, 500)
@@ -1185,10 +1188,10 @@ export class AgendaPage implements OnInit {
} }
function endOfMonth(myDate){ function endOfMonth(myDate) {
let date = new Date(myDate); let date = new Date(myDate);
date.setDate(1); // Avoids edge cases on the 31st day of some months date.setDate(1); // Avoids edge cases on the 31st day of some months
date.setMonth(date.getMonth() +1); date.setMonth(date.getMonth() + 1);
date.setDate(0); date.setDate(0);
date.setHours(23); date.setHours(23);
date.setMinutes(59); date.setMinutes(59);
@@ -22,6 +22,7 @@ import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { ProcessesService } from 'src/app/services/processes.service'; import { ProcessesService } from 'src/app/services/processes.service';
import { TaskService } from 'src/app/services/task.service' import { TaskService } from 'src/app/services/task.service'
import { ContactsService } from 'src/app/services/contacts.service';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: { parse: {
@@ -93,6 +94,9 @@ export class NewEventPage implements OnInit {
roomId: string; roomId: string;
globalEnd = new Date('1999') globalEnd = new Date('1999')
environment = environment environment = environment
eventPersons: EventPerson[];
contacts: EventPerson[];
constructor( constructor(
private modalController: ModalController, private modalController: ModalController,
@@ -105,7 +109,8 @@ export class NewEventPage implements OnInit {
private chatMethodService: ChatMethodsService, private chatMethodService: ChatMethodsService,
private hhtpErrorHandle: HttpErrorHandle, private hhtpErrorHandle: HttpErrorHandle,
private processeService: ProcessesService, private processeService: ProcessesService,
public TaskService: TaskService public TaskService: TaskService,
private contactsService: ContactsService,
) { ) {
this.loggeduser = SessionStore.user; this.loggeduser = SessionStore.user;
this.postEvent = new Event(); this.postEvent = new Event();
@@ -196,6 +201,7 @@ export class NewEventPage implements OnInit {
this.checkRoleInArray() this.checkRoleInArray()
this.changeAgenda() this.changeAgenda()
this.fetchContacts("")
} }
ngOnDestroy() { ngOnDestroy() {
@@ -831,4 +837,33 @@ export class NewEventPage implements OnInit {
return toAproveObject; return toAproveObject;
} }
async fetchContacts(filter: string) {
if (this.loggeduser.Profile == 'PR') {
this.contactsService.getContacts(filter).subscribe(result => {
if (this.eventPersons != null) {
this.eventPersons.forEach(attendee => {
const index: number = result.findIndex((cont) => {
return cont.EmailAddress.toLocaleLowerCase() == attendee.EmailAddress.toLocaleLowerCase()
});
result.splice(index, 1);
});
}
this.contacts = result;
console.log('Attendes Email', this.loggeduser.Email)
let filterLoggedUserEmail = this.contacts.filter(item => item.RoleDescription == "Ministro e Director do Gabinete do PR")
console.log('Attendes Email', filterLoggedUserEmail)
this.contacts = filterLoggedUserEmail;
const newAttendees: EventPerson[] = this.contacts;
this.setIntervenient(newAttendees);
console.log('Attendes Email', this.contacts)
}
);
}
}
} }
@@ -97,7 +97,7 @@
</div> </div>
<div class="buttons px-20" *ngIf="task.activityInstanceName == 'Concluir Despacho'"> <div class="buttons px-20" *ngIf="task.activityInstanceName == 'Concluir Despacho'">
<button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Concluido')" class="btn-cancel" shape="round" >Marcar como Concluído</button>
<button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Reexecução')" class="btn-cancel" shape="round" >Enviar para Reexecução</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks])" (click)="openAddNoteModal('Reexecutar')" class="btn-cancel" shape="round" >Enviar para Reexecução</button>
<button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button> <button *ngIf="p.userPermission([p.permissionList.Agenda.access])" (click)="openBookMeetingModal(task)" class="btn-cancel" shape="round" >Marcar Reunião</button>
<button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks]) && task.Status != 'Pending'" (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button> <button *ngIf="p.userPermission([p.permissionList.Gabinete.pr_tasks]) && task.Status != 'Pending'" (click)="sendExpedienteToPending()" class="btn-cancel" shape="round" >Enviar para Pendentes</button>
</div> </div>
@@ -328,7 +328,7 @@ export class DespachoPrPage implements OnInit {
async reexecutar(note: string, documents: any) { async reexecutar(note: string, documents: any) {
let body = { let body = {
"serialNumber": this.serialNumber, "serialNumber": this.serialNumber,
"action": "Reexecução", "action": "Reexecutar",
"ActionTypeId": 100000010, "ActionTypeId": 100000010,
"dataFields": { "dataFields": {
"ReviewUserComment": note, "ReviewUserComment": note,
@@ -416,7 +416,7 @@ export class DespachoPrPage implements OnInit {
// console.log('actionName', actionName) // console.log('actionName', actionName)
await this.concluir(res.data.note, docs); await this.concluir(res.data.note, docs);
} }
else if (actionName == 'Reexecução') { else if (actionName == 'Reexecutar') {
await this.reexecutar(res.data.note, docs); await this.reexecutar(res.data.note, docs);
} }
@@ -21,7 +21,7 @@
<div class="solid"></div> <div class="solid"></div>
</div> </div>
<div class="buttons"> <div class="buttons">
<button class="btn-cancel" shape="round" >Arquivar</button> <button class="btn-cancel" shape="round" (click)="openAddNoteModal('Arquivo')">Arquivar</button>
<!-- <div class="solid"></div> --> <!-- <div class="solid"></div> -->
</div> </div>
<div class="buttons"> <div class="buttons">
@@ -39,6 +39,7 @@ export class DiplomaAssinarPage implements OnInit {
customDate: any; customDate: any;
caller: string; caller: string;
mergedArray: any = []; mergedArray: any = [];
draftArray: any = [];
DraftIds = "" DraftIds = ""
DraftNames = "" DraftNames = ""
asDraft = true; asDraft = true;
@@ -492,6 +493,7 @@ export class DiplomaAssinarPage implements OnInit {
"ownerId": resd.data.ownerId, "ownerId": resd.data.ownerId,
"status": resd.data.status, "status": resd.data.status,
}; };
this.draftArray.push(object);
this.mergedArray.push(object); this.mergedArray.push(object);
this.DraftNames += resd.data.description + ";"; this.DraftNames += resd.data.description + ";";
this.DraftIds += resd.data.id + ";"; this.DraftIds += resd.data.id + ";";
@@ -502,13 +504,14 @@ export class DiplomaAssinarPage implements OnInit {
}); });
await Promise.all(draftPromises); await Promise.all(draftPromises);
if (this.draftArray.length == 0) {
console.log('No draft found.');
this.asDraft = false
}
if (this.DraftNames) { if (this.DraftNames) {
this.DraftNames = this.DraftNames.slice(0, -1); this.DraftNames = this.DraftNames.slice(0, -1);
this.DraftIds = this.DraftIds.slice(0, -1); this.DraftIds = this.DraftIds.slice(0, -1);
} else {
console.log('No draft found.');
this.asDraft = false
} }
} }
@@ -294,7 +294,7 @@
</div> </div>
</div> </div>
<div *ngIf="sessionStore.user.Profile != 'PR'" class="aside-righ flex-grow-1"> <div class="aside-righ flex-grow-1">
<app-empty-container <app-empty-container
[texto]="emptyTextDescription" [texto]="emptyTextDescription"
*ngIf="!showAttendees" *ngIf="!showAttendees"
@@ -23,6 +23,7 @@ import { RoleIdService } from 'src/app/services/role-id.service';
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service'; import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
import { environment } from 'src/environments/environment'; import { environment } from 'src/environments/environment';
import { TaskService } from 'src/app/services/task.service' import { TaskService } from 'src/app/services/task.service'
import { ContactsService } from 'src/app/services/contacts.service';
const moment = _rollupMoment || _moment; const moment = _rollupMoment || _moment;
@@ -114,6 +115,9 @@ export class BookMeetingModalPage implements OnInit {
sessionStore = SessionStore; sessionStore = SessionStore;
environment = environment environment = environment
loggeduser: LoginUserRespose;
eventPersons: EventPerson[];
contacts: EventPerson[];
constructor( constructor(
private modalController: ModalController, private modalController: ModalController,
@@ -125,7 +129,8 @@ export class BookMeetingModalPage implements OnInit {
public eventService: EventsService, public eventService: EventsService,
public RoleIdService: RoleIdService, public RoleIdService: RoleIdService,
private httpErroHandle: HttpErrorHandle, private httpErroHandle: HttpErrorHandle,
public TaskService: TaskService public TaskService: TaskService,
private contactsService: ContactsService,
) { ) {
@@ -136,7 +141,7 @@ export class BookMeetingModalPage implements OnInit {
console.log('fulltask', this.fulltask) console.log('fulltask', this.fulltask)
if(this.fulltask?.Documents) { if (this.fulltask?.Documents) {
this.documents = this.fulltask.Documents this.documents = this.fulltask.Documents
} }
@@ -174,6 +179,7 @@ export class BookMeetingModalPage implements OnInit {
} }
this.changeAgenda(); this.changeAgenda();
this.loggeduser = SessionStore.user;
} }
ngOnInit() { ngOnInit() {
@@ -182,6 +188,7 @@ export class BookMeetingModalPage implements OnInit {
this.getAttachments(); this.getAttachments();
this.setDefaultTime() this.setDefaultTime()
this.getRecurrenceTypes(); this.getRecurrenceTypes();
this.fetchContacts("")
} }
@@ -191,8 +198,8 @@ export class BookMeetingModalPage implements OnInit {
} }
myInterval = setInterval(() => { myInterval = setInterval(() => {
document.querySelectorAll('.ngx-mat-timepicker input').forEach((e :any) => { document.querySelectorAll('.ngx-mat-timepicker input').forEach((e: any) => {
if(e) { if (e) {
e.disabled = true; e.disabled = true;
} }
}) })
@@ -327,8 +334,8 @@ export class BookMeetingModalPage implements OnInit {
return { return {
ApplicationId: e.ApplicationType || e.ApplicationId, ApplicationId: e.ApplicationType || e.ApplicationId,
Source: 1, Source: 1,
SourceId: e.Id || e.DocId || e.SourceId, SourceId: e.Id || e.DocId || e.SourceId,
SourceName:e.Assunto, SourceName: e.Assunto,
Description: e.Assunto, Description: e.Assunto,
Stakeholders: e.EntidadeOrganicaNome Stakeholders: e.EntidadeOrganicaNome
} }
@@ -417,7 +424,7 @@ export class BookMeetingModalPage implements OnInit {
modal.onDidDismiss().then((data) => { modal.onDidDismiss().then((data) => {
console.log('attenes return', data)
if (data) { if (data) {
data = data['data']; data = data['data'];
@@ -587,4 +594,33 @@ export class BookMeetingModalPage implements OnInit {
this.postData.EndDate = this.postData.StartDate; this.postData.EndDate = this.postData.StartDate;
} }
async fetchContacts(filter: string) {
console.log(this.loggeduser)
if (this.loggeduser.Profile == 'PR') {
this.contactsService.getContacts(filter).subscribe(result => {
if (this.eventPersons != null) {
this.eventPersons.forEach(attendee => {
const index: number = result.findIndex((cont) => {
return cont.EmailAddress.toLocaleLowerCase() == attendee.EmailAddress.toLocaleLowerCase()
});
result.splice(index, 1);
});
}
this.contacts = result;
console.log('Attendes Email', this.loggeduser.Email)
let filterLoggedUserEmail = this.contacts.filter(item => item.RoleDescription == "Ministro e Director do Gabinete do PR")
console.log('Attendes Email', filterLoggedUserEmail)
this.contacts = filterLoggedUserEmail;
const newAttendees: EventPerson[] = this.contacts;
this.setIntervenient(newAttendees);
console.log('Attendes Email', this.contacts)
}
);
}
}
} }
@@ -97,7 +97,7 @@
<div class="ion-icon-class"> <div class="ion-icon-class">
<ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon> <ion-icon slot="start" src="assets/images/icons-description.svg"></ion-icon>
</div> </div>
<div class="ion-input-class" [class.input-error]="Form?.get('selectedTypes')?.invalid && validateFrom "> <div class="ion-input-class" [class.input-error]="Form?.get('selectedTypes')?.invalid && validateFrom || validateField ">
<!-- <ion-item <!-- <ion-item
class="ion-no-border ion-no-padding ion-no-margin d-block d-md-none"> class="ion-no-border ion-no-padding ion-no-margin d-block d-md-none">
<ion-select <ion-select
@@ -112,7 +112,7 @@
appearance="fill" appearance="fill"
class="width-100 d-block" class="width-100 d-block"
appearance="none"> appearance="none">
<mat-select [(ngModel)]="selectedTypes" multiple placeholder="Selecione o tipo de assunto*"> <mat-select [multiple]="false" [(ngModel)]="selectedTypes" placeholder="{{placeholderSubject}}">
<mat-option *ngFor="let type of subjectTypes" value="{{type.Code}}">{{type.Description}}</mat-option> <mat-option *ngFor="let type of subjectTypes" value="{{type.Code}}">{{type.Description}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
@@ -69,7 +69,7 @@ export class ExpedientTaskModalPage implements OnInit {
loadedAttachments:any; loadedAttachments:any;
documents:SearchList[] = []; documents:SearchList[] = [];
subjectTypes:any[] = []; subjectTypes:any;
selectedTypes: string[]=[]; selectedTypes: string[]=[];
SearchFolder: any = [] SearchFolder: any = []
@@ -96,6 +96,7 @@ export class ExpedientTaskModalPage implements OnInit {
validateFrom = false; validateFrom = false;
validateField = false; validateField = false;
document: any document: any
placeholderSubject: string;
get toppingsValues() { get toppingsValues() {
return this.toppings.value; return this.toppings.value;
@@ -150,7 +151,12 @@ export class ExpedientTaskModalPage implements OnInit {
// console.log('this.document', this.document) // console.log('this.document', this.document)
this.selectedTypes = ['99999850']; if(this.loggeduser.Profile == 'PR') {
this.selectedTypes = ['99999850'];
this.placeholderSubject = 'Indefinido'
} else {
this.placeholderSubject = 'Selecione o tipo de assunto*'
}
this.postData = new Despacho(); this.postData = new Despacho();
this.participants = this.participants = new Array(); this.participants = this.participants = new Array();
@@ -454,21 +460,27 @@ export class ExpedientTaskModalPage implements OnInit {
} }
} }
if(this.postData.DispatchFolder.Message){ /* if(this.postData.DispatchFolder.Message){
try { if(this.selectedTypes.length > 0) { */
this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise(); try {
await this.httpErroHandle.httpsSucessMessagge('Efetuar Despacho') this.taskResult = await this.despachoService.createDespacho(this.postData).toPromise();
this.modalController.dismiss(action_despacho_pr); await this.httpErroHandle.httpsSucessMessagge('Efetuar Despacho')
} catch (error) { this.modalController.dismiss(action_despacho_pr);
this.httpErroHandle.httpStatusHandle(error) } catch (error) {
} finally { this.httpErroHandle.httpStatusHandle(error)
//loader.remove() } finally {
} //loader.remove()
} }
/* } else {
this.validateField = true;
this.toastService._badRequest('Por favor selecione um assunto');
} */
/* }
else{ else{
this.validateField = true; this.validateField = true;
this.toastService._badRequest('Por favor adicione uma descrição'); this.toastService._badRequest('Por favor adicione uma descrição');
} } */
loader.remove(); loader.remove();
break; break;
+12 -1
View File
@@ -112,8 +112,15 @@ export class LoginPage implements OnInit {
if (this.validateUsername()) { if (this.validateUsername()) {
if (this.validatePassword()) { if (this.validatePassword()) {
let newUserName = ""
if (this.usernameAsDomain(environment.domain, this.username.trim())) {
newUserName = this.username.trim();
} else {
newUserName = this.username.trim() + "@" + environment.domain;
}
this.userattempt = { this.userattempt = {
username: this.username.trim(), username: newUserName.trim(),
password: this.password.trim(), password: this.password.trim(),
domainName: environment.domain, domainName: environment.domain,
BasicAuthKey: "" BasicAuthKey: ""
@@ -233,4 +240,8 @@ export class LoginPage implements OnInit {
} }
usernameAsDomain(substring, mainString) {
return mainString.includes(substring);
}
} }
@@ -403,6 +403,3 @@ const years: Year[] = [
}, },
// Add more years here as needed // Add more years here as needed
]; ];
years[0].months[0].days[0].events
@@ -91,7 +91,7 @@ export class HttpErrorHandle {
validationMessagge(service: string, callback?: any) { validationMessagge(service: string, callback?: any) {
switch (service) { switch (service) {
case 'diplomaAsDraft': case 'diplomaAsDraft':
this.toastService._badRequest('Este diploma não contem um draft para ser assinado!') this.toastService._badRequest('Este diploma não contem um rascunho para ser assinado!')
break; break;
default: default:
@@ -34,6 +34,7 @@ import { ProcessesService } from 'src/app/services/processes.service';
import { Subject } from 'rxjs'; import { Subject } from 'rxjs';
import { TaskService } from 'src/app/services/task.service' import { TaskService } from 'src/app/services/task.service'
import { ContactsService } from 'src/app/services/contacts.service';
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = { const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
parse: { parse: {
dateInput: "YYYY-MMMM-DD HH:mm" dateInput: "YYYY-MMMM-DD HH:mm"
@@ -131,6 +132,8 @@ export class NewEventPage implements OnInit {
CalendarNamesOptions = ['Oficial', 'Pessoal'] CalendarNamesOptions = ['Oficial', 'Pessoal']
environment = environment environment = environment
eventPersons: EventPerson[];
contacts: EventPerson[] = [];
constructor( constructor(
private modalController: ModalController, private modalController: ModalController,
@@ -142,7 +145,8 @@ export class NewEventPage implements OnInit {
private chatMethodService: ChatMethodsService, private chatMethodService: ChatMethodsService,
private hhtpErrorHandle: HttpErrorHandle, private hhtpErrorHandle: HttpErrorHandle,
private processeService: ProcessesService, private processeService: ProcessesService,
public TaskService: TaskService public TaskService: TaskService,
private contactsService: ContactsService,
) { ) {
this.dateAdapter.setLocale('pt'); this.dateAdapter.setLocale('pt');
this.loggeduser = SessionStore.user; this.loggeduser = SessionStore.user;
@@ -220,6 +224,7 @@ export class NewEventPage implements OnInit {
} }
}) })
} }
console.log('Attendes',this.taskParticipants)
this.taskParticipants = removeDuplicate(this.taskParticipants); this.taskParticipants = removeDuplicate(this.taskParticipants);
this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc); this.taskParticipantsCc = removeDuplicate(this.taskParticipantsCc);
@@ -234,6 +239,7 @@ export class NewEventPage implements OnInit {
this.injectValidation(); this.injectValidation();
this.changeAgenda() this.changeAgenda()
this.fetchContacts("")
} }
@@ -987,5 +993,34 @@ export class NewEventPage implements OnInit {
return toAproveObject; return toAproveObject;
} }
async fetchContacts(filter: string) {
if (this.loggeduser.Profile == 'PR') {
this.contactsService.getContacts(filter).subscribe(result => {
if (this.eventPersons != null) {
this.eventPersons.forEach(attendee => {
const index: number = result.findIndex((cont) => {
return cont.EmailAddress.toLocaleLowerCase() == attendee.EmailAddress.toLocaleLowerCase()
});
result.splice(index, 1);
});
}
this.contacts = result;
console.log('Attendes Email', this.loggeduser.Email)
let filterLoggedUserEmail = this.contacts.filter(item => item.RoleDescription == "Ministro e Director do Gabinete do PR")
console.log('Attendes Email', filterLoggedUserEmail)
this.contacts = filterLoggedUserEmail;
this.taskParticipants.push(this.contacts[0]);
this.setIntervenient.emit(this.taskParticipants);
console.log('Attendes Email', this.taskParticipants)
}
);
}
}
} }
+4 -6
View File
@@ -48,15 +48,14 @@
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon font-45-em" src='assets/images/theme/gov/icons-profile.svg'></ion-icon> --> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon font-45-em" src='assets/images/theme/gov/icons-profile.svg'></ion-icon> -->
<div *ngIf="profilePicture == ''" class="profile-image"> <div *ngIf="profilePicture == ''" class="profile-image">
<img *ngIf="loggeduser.RoleDescription == 'Presidente da República' " class="profile-image" <!-- <img *ngIf="loggeduser.RoleDescription == 'Presidente da República' " class="profile-image"
src='assets/images/presidente.png'> src='assets/images/presidente.png'>
<img *ngIf="loggeduser.RoleDescription == 'Ministro e Director do Gabinete do PR' " class="profile-image" <img *ngIf="loggeduser.RoleDescription == 'Ministro e Director do Gabinete do PR' " class="profile-image"
src='assets/images/ministro.png'> src='assets/images/ministro.png'>
<img *ngIf="loggeduser.RoleDescription == 'Secretário Geral' " class="profile-image" <img *ngIf="loggeduser.RoleDescription == 'Secretário Geral' " class="profile-image"
src='assets/images/secretaria_geral.png'> src='assets/images/secretaria_geral.png'> -->
<ion-icon <ion-icon
*ngIf="loggeduser.RoleDescription != 'Presidente da República'&& loggeduser.RoleDescription != 'Ministro e Director do Gabinete do PR' && loggeduser.RoleDescription != 'Secretário Geral' "
class="icon font-45-em" src='assets/images/theme/gov/icons-profile.svg'></ion-icon> class="icon font-45-em" src='assets/images/theme/gov/icons-profile.svg'></ion-icon>
</div> </div>
@@ -212,15 +211,14 @@
<ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon" src='assets/images/theme/gov/icons-profile.svg'></ion-icon> --> <ion-icon *ngIf="ThemeService.currentTheme == 'gov' " class="icon" src='assets/images/theme/gov/icons-profile.svg'></ion-icon> -->
<div *ngIf="profilePicture == ''" class="profile-image"> <div *ngIf="profilePicture == ''" class="profile-image">
<img *ngIf="loggeduser.RoleDescription == 'Presidente da República' " class="profile-image" <!-- <img *ngIf="loggeduser.RoleDescription == 'Presidente da República' " class="profile-image"
src='assets/images/presidente.png'> src='assets/images/presidente.png'>
<img *ngIf="loggeduser.RoleDescription == 'Ministro e Director do Gabinete do PR' " class="profile-image" <img *ngIf="loggeduser.RoleDescription == 'Ministro e Director do Gabinete do PR' " class="profile-image"
src='assets/images/ministro.png'> src='assets/images/ministro.png'>
<img *ngIf="loggeduser.RoleDescription == 'Secretário Geral' " class="profile-image" <img *ngIf="loggeduser.RoleDescription == 'Secretário Geral' " class="profile-image"
src='assets/images/secretaria_geral.png'> src='assets/images/secretaria_geral.png'> -->
<ion-icon <ion-icon
*ngIf="loggeduser.RoleDescription != 'Presidente da República'&& loggeduser.RoleDescription != 'Ministro e Director do Gabinete do PR' && loggeduser.RoleDescription != 'Secretário Geral' "
class="icon" src='assets/images/theme/gov/icons-profile.svg'></ion-icon> class="icon" src='assets/images/theme/gov/icons-profile.svg'></ion-icon>
</div> </div>
+20 -17
View File
@@ -102,26 +102,29 @@ export class HeaderPage implements OnInit {
getProfilpicture() { getProfilpicture() {
this.attachmentService.getUserProfilePhoto(this.SessionStore.user.UserPhoto).subscribe((base) => { if(this.SessionStore.user.UserPhoto) {
this.attachmentService.getUserProfilePhoto(this.SessionStore.user.UserPhoto).subscribe((base) => {
this.storageService.store(this.SessionStore.user.RoleID.toString(), 'data:image/jpeg;base64,' + base).then((value) => { this.storageService.store(this.SessionStore.user.RoleID.toString(), 'data:image/jpeg;base64,' + base).then((value) => {
this.profilePicture = 'data:image/jpeg;base64,' + base; this.profilePicture = 'data:image/jpeg;base64,' + base;
console.log('picture saved', value) console.log('picture saved')
}).catch((error) => { }).catch((error) => {
console.log('picture not saved') console.log('picture not saved')
}); });
}, (error) => { }, (error) => {
console.log('profile picture errro: ', error) console.log('profile picture errro: ', error)
this.storageService.get(this.SessionStore.user.RoleID.toString()).then((picture) => { this.storageService.get(this.SessionStore.user.RoleID.toString()).then((picture) => {
console.log(picture) /* console.log(picture) */
this.profilePicture = picture this.profilePicture = picture
}).catch((error) => { }).catch((error) => {
this.profilePicture = ""; this.profilePicture = "";
})
}) })
})
} else {
this.profilePicture = "";
}
} }
@@ -28,7 +28,7 @@ export class DiplomaOptionsPage implements OnInit {
fulltask: any fulltask: any
DraftIds = "" DraftIds = ""
DraftNames = "" DraftNames = ""
asDrat: boolean; asDraft: boolean;
constructor( constructor(
@@ -48,7 +48,7 @@ export class DiplomaOptionsPage implements OnInit {
this.DraftIds = this.navParams.get("DraftIds"); this.DraftIds = this.navParams.get("DraftIds");
this.DraftNames = this.navParams.get("DraftNames"); this.DraftNames = this.navParams.get("DraftNames");
this.asDrat = this.navParams.get('asDrat'); this.asDraft = this.navParams.get('asDraft');
console.log('this.task', this.task) console.log('this.task', this.task)
@@ -241,7 +241,7 @@ export class DiplomaOptionsPage implements OnInit {
async AssinarNew(note?, doc?) { async AssinarNew(note?, doc?) {
if (this.asDrat) { if (this.asDraft) {
const modal = await this.modalController.create({ const modal = await this.modalController.create({
component: PopupQuestionPage, component: PopupQuestionPage,
componentProps: { componentProps: {
@@ -9,7 +9,7 @@
</div> </div>
<div *ngIf="content != ''" class="buttons header-fix"> <div *ngIf="content != ''" class="buttons header-fix">
<!-- <button (click)="save(Document, content)" class="btn-cancel" shape="round" >Salvar</button> --> <!-- <button (click)="save(Document, content)" class="btn-cancel" shape="round" >Salvar</button> -->
<button (click)="AssinarDraft()" class="btn-cancel" shape="round" >Assinar</button> <button *ngIf="p.userRole('PR')" (click)="AssinarDraft()" class="btn-cancel" shape="round" >Assinar</button>
<button class="btn-cancel" shape="round" (click)="close()">Cancelar</button> <button class="btn-cancel" shape="round" (click)="close()">Cancelar</button>
</div> </div>
</ion-content> </ion-content>
File diff suppressed because one or more lines are too long