mirror of
https://code.equilibrium.co.ao/ITO/doneit-web.git
synced 2026-04-18 12:37:53 +00:00
a lot of changes
This commit is contained in:
@@ -36,9 +36,9 @@ export class DespachoService {
|
|||||||
public p: PermissionService,
|
public p: PermissionService,
|
||||||
public LoaderService: LoaderService,
|
public LoaderService: LoaderService,
|
||||||
private sortService: SortService,
|
private sortService: SortService,
|
||||||
) {}
|
) { }
|
||||||
|
|
||||||
arquivar(note:string, documents:AttachmentList, serialnumber) {
|
arquivar(note: string, documents: AttachmentList, serialnumber) {
|
||||||
|
|
||||||
let body = {
|
let body = {
|
||||||
"serialNumber": serialnumber,
|
"serialNumber": serialnumber,
|
||||||
@@ -47,13 +47,13 @@ export class DespachoService {
|
|||||||
"dataFields": {
|
"dataFields": {
|
||||||
"ReviewUserComment": note,
|
"ReviewUserComment": note,
|
||||||
},
|
},
|
||||||
"AttachmentList" :documents,
|
"AttachmentList": documents,
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.processes.CompleteTask(body)
|
return this.processes.CompleteTask(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
executado(note:string, documents:any , serialnumber) {
|
executado(note: string, documents: any, serialnumber) {
|
||||||
|
|
||||||
let body = {
|
let body = {
|
||||||
"serialNumber": serialnumber,
|
"serialNumber": serialnumber,
|
||||||
@@ -62,19 +62,19 @@ export class DespachoService {
|
|||||||
"dataFields": {
|
"dataFields": {
|
||||||
"ReviewUserComment": note,
|
"ReviewUserComment": note,
|
||||||
},
|
},
|
||||||
"AttachmentList" :documents,
|
"AttachmentList": documents,
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.processes.CompleteTask(body)
|
return this.processes.CompleteTask(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
solicitarParecer({note, documents = [], serialnumber, activityInstanceName}) {
|
solicitarParecer({ note, documents = [], serialnumber, activityInstanceName }) {
|
||||||
let body;
|
let body;
|
||||||
if(activityInstanceName == 'Concluir Despacho'
|
if (activityInstanceName == 'Concluir Despacho'
|
||||||
|| activityInstanceName == 'Concluir Parecer'
|
|| activityInstanceName == 'Concluir Parecer'
|
||||||
|| activityInstanceName == 'Concluir Deferimento'
|
|| activityInstanceName == 'Concluir Deferimento'
|
||||||
|| activityInstanceName == 'Tarefa de Deferimento'
|
|| activityInstanceName == 'Tarefa de Deferimento'
|
||||||
){
|
) {
|
||||||
body = {
|
body = {
|
||||||
"serialNumber": serialnumber,
|
"serialNumber": serialnumber,
|
||||||
"action": "Parecer",
|
"action": "Parecer",
|
||||||
@@ -82,11 +82,11 @@ export class DespachoService {
|
|||||||
"dataFields": {
|
"dataFields": {
|
||||||
"ReviewUserComment": note,
|
"ReviewUserComment": note,
|
||||||
},
|
},
|
||||||
"AttachmentList" :documents,
|
"AttachmentList": documents,
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
body = {
|
body = {
|
||||||
"serialNumber": serialnumber,
|
"serialNumber": serialnumber,
|
||||||
"action": "Conhecimento",
|
"action": "Conhecimento",
|
||||||
@@ -94,7 +94,7 @@ export class DespachoService {
|
|||||||
"dataFields": {
|
"dataFields": {
|
||||||
"ReviewUserComment": note,
|
"ReviewUserComment": note,
|
||||||
},
|
},
|
||||||
"AttachmentList" :documents,
|
"AttachmentList": documents,
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -102,13 +102,15 @@ export class DespachoService {
|
|||||||
return this.processes.CompleteTask(body)
|
return this.processes.CompleteTask(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
EfectuarDespacho({note, documents = [], serialnumber, activityInstanceName}) {
|
EfectuarDespacho({ note, documents = [], serialnumber, activityInstanceName }) {
|
||||||
|
console.log('activityInstanceName', activityInstanceName)
|
||||||
let body;
|
let body;
|
||||||
if(activityInstanceName == 'Concluir Despacho'
|
if (activityInstanceName == 'Concluir Despacho'
|
||||||
|| activityInstanceName == 'Concluir Parecer'
|
|| activityInstanceName == 'Concluir Parecer'
|
||||||
|| activityInstanceName == 'Concluir Deferimento'
|
|| activityInstanceName == 'Concluir Deferimento'
|
||||||
|| activityInstanceName == 'Tarefa de Deferimento'
|
|| activityInstanceName == 'Tarefa de Deferimento'
|
||||||
){
|
|| activityInstanceName == 'Diploma Assinado'
|
||||||
|
) {
|
||||||
body = {
|
body = {
|
||||||
"serialNumber": serialnumber,
|
"serialNumber": serialnumber,
|
||||||
"action": "Despacho",
|
"action": "Despacho",
|
||||||
@@ -116,10 +118,19 @@ export class DespachoService {
|
|||||||
"dataFields": {
|
"dataFields": {
|
||||||
"ReviewUserComment": note,
|
"ReviewUserComment": note,
|
||||||
},
|
},
|
||||||
"AttachmentList" :documents,
|
"AttachmentList": documents,
|
||||||
}
|
}
|
||||||
}
|
} else if (activityInstanceName == 'Revisar Diploma') {
|
||||||
else{
|
body = {
|
||||||
|
"serialNumber": serialnumber,
|
||||||
|
"action": "Aprovar",
|
||||||
|
"ActionTypeId": 94,
|
||||||
|
"dataFields": {
|
||||||
|
"ReviewUserComment": note,
|
||||||
|
},
|
||||||
|
"AttachmentList": documents,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
body = {
|
body = {
|
||||||
"serialNumber": serialnumber,
|
"serialNumber": serialnumber,
|
||||||
"action": "Conhecimento",
|
"action": "Conhecimento",
|
||||||
@@ -127,15 +138,15 @@ export class DespachoService {
|
|||||||
"dataFields": {
|
"dataFields": {
|
||||||
"ReviewUserComment": note,
|
"ReviewUserComment": note,
|
||||||
},
|
},
|
||||||
"AttachmentList" :documents,
|
"AttachmentList": documents,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return this.processes.CompleteTask(body)
|
return this.processes.CompleteTask(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
reexecute({note, documents, serialnumber}) {
|
reexecute({ note, documents, serialnumber }) {
|
||||||
let body = {
|
let body = {
|
||||||
"serialNumber": serialnumber,
|
"serialNumber": serialnumber,
|
||||||
"action": "Reexecução",
|
"action": "Reexecução",
|
||||||
@@ -143,7 +154,7 @@ export class DespachoService {
|
|||||||
"dataFields": {
|
"dataFields": {
|
||||||
"ReviewUserComment": note,
|
"ReviewUserComment": note,
|
||||||
},
|
},
|
||||||
"AttachmentList" :documents,
|
"AttachmentList": documents,
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.processes.CompleteTask(body)
|
return this.processes.CompleteTask(body)
|
||||||
@@ -152,7 +163,7 @@ export class DespachoService {
|
|||||||
/**
|
/**
|
||||||
* @description efetuar despacho
|
* @description efetuar despacho
|
||||||
*/
|
*/
|
||||||
CompleteTask({serialNumber, note}) {
|
CompleteTask({ serialNumber, note }) {
|
||||||
|
|
||||||
const body = {
|
const body = {
|
||||||
"serialNumber": serialNumber,
|
"serialNumber": serialNumber,
|
||||||
@@ -161,7 +172,7 @@ export class DespachoService {
|
|||||||
"dataFields": {
|
"dataFields": {
|
||||||
"ReviewUserComment": note,
|
"ReviewUserComment": note,
|
||||||
},
|
},
|
||||||
"AttachmentList" :null,
|
"AttachmentList": null,
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.processes.CompleteTask(body)
|
return this.processes.CompleteTask(body)
|
||||||
@@ -190,7 +201,7 @@ export class DespachoService {
|
|||||||
* @description for both profile PR and MDGPR
|
* @description for both profile PR and MDGPR
|
||||||
*/
|
*/
|
||||||
createDespacho(body: any) {
|
createDespacho(body: any) {
|
||||||
if(this.p.userRole(['PR'])) {
|
if (this.p.userRole(['PR'])) {
|
||||||
return this.processes.postDespatchoPr(body)
|
return this.processes.postDespatchoPr(body)
|
||||||
} else {
|
} else {
|
||||||
return this.processes.postDespatcho(body)
|
return this.processes.postDespatcho(body)
|
||||||
@@ -198,14 +209,14 @@ export class DespachoService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
createParecer(body: any) {
|
createParecer(body: any) {
|
||||||
if(this.p.userRole(['PR'])) {
|
if (this.p.userRole(['PR'])) {
|
||||||
return this.processes.postParecerPr(body)
|
return this.processes.postParecerPr(body)
|
||||||
} else {
|
} else {
|
||||||
return this.processes.postParecer(body)
|
return this.processes.postParecer(body)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
generateDiploma({note = '', documents = [], serialnumber}) {
|
generateDiploma({ note = '', documents = [], serialnumber }) {
|
||||||
let body = {
|
let body = {
|
||||||
"serialNumber": serialnumber,
|
"serialNumber": serialnumber,
|
||||||
"action": "Reencaminhar",
|
"action": "Reencaminhar",
|
||||||
@@ -213,14 +224,14 @@ export class DespachoService {
|
|||||||
"dataFields": {
|
"dataFields": {
|
||||||
"ReviewUserComment": note,
|
"ReviewUserComment": note,
|
||||||
},
|
},
|
||||||
"AttachmentList" :documents,
|
"AttachmentList": documents,
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.processes.CompleteTask(body)
|
return this.processes.CompleteTask(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
async getList({updateStore = false}) {
|
async getList({ updateStore = false }) {
|
||||||
|
|
||||||
if (this.LoaderService.loading) {
|
if (this.LoaderService.loading) {
|
||||||
return this.despachoStore.list
|
return this.despachoStore.list
|
||||||
@@ -234,7 +245,7 @@ export class DespachoService {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
result = await this.processes.GetTasksList("Despacho", false).toPromise();
|
result = await this.processes.GetTasksList("Despacho", false).toPromise();
|
||||||
result = result.filter((data:fullTaskList) => data.workflowInstanceDataFields.Status == "Active")
|
result = result.filter((data: fullTaskList) => data.workflowInstanceDataFields.Status == "Active")
|
||||||
result.forEach((element, index) => {
|
result.forEach((element, index) => {
|
||||||
|
|
||||||
let task: customTask = this.customTaskPipe.transform(element);
|
let task: customTask = this.customTaskPipe.transform(element);
|
||||||
@@ -244,7 +255,7 @@ export class DespachoService {
|
|||||||
|
|
||||||
despachoList = this.sortService.sortDate(despachoList, 'CreateDate')
|
despachoList = this.sortService.sortDate(despachoList, 'CreateDate')
|
||||||
|
|
||||||
if(updateStore) {
|
if (updateStore) {
|
||||||
this.despachoStore.reset(despachoList);
|
this.despachoStore.reset(despachoList);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,7 +264,7 @@ export class DespachoService {
|
|||||||
} finally {
|
} finally {
|
||||||
this.LoaderService.pop({})
|
this.LoaderService.pop({})
|
||||||
// this.loader.pop()
|
// this.loader.pop()
|
||||||
return this.despachoStore.list
|
return this.despachoStore.list
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -265,18 +276,18 @@ export class DespachoService {
|
|||||||
try {
|
try {
|
||||||
result = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
|
result = await this.processes.GetTasksList("Despacho do Presidente da República", false).toPromise();
|
||||||
|
|
||||||
} catch(error) {
|
} catch (error) {
|
||||||
// this.loader.pop()
|
// this.loader.pop()
|
||||||
}
|
}
|
||||||
|
|
||||||
// this.loader.pop()
|
// this.loader.pop()
|
||||||
|
|
||||||
let despachosPr;
|
let despachosPr;
|
||||||
let despachos = this.sortService.sortArrayByDate(result);
|
let despachos = this.sortService.sortArrayByDate(result);
|
||||||
|
|
||||||
if(SessionStore.user.Profile != 'PR') {
|
if (SessionStore.user.Profile != 'PR') {
|
||||||
despachosPr = despachos.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
despachosPr = despachos.reverse().filter(data => data.activityInstanceName == "Tarefa de Despacho");
|
||||||
} else if(SessionStore.user.Profile == 'PR') {
|
} else if (SessionStore.user.Profile == 'PR') {
|
||||||
despachosPr = despachos.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
|
despachosPr = despachos.reverse().filter(data => data.activityInstanceName == "Concluir Despacho");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -69,7 +69,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 [(ngModel)]="selectedTypes" placeholder="Selecione o tipo de assunto*">
|
||||||
<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>
|
||||||
|
|||||||
@@ -175,6 +175,7 @@ export class CreateProcessPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
console.log('crete process')
|
||||||
this.getSubjectType();
|
this.getSubjectType();
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.selectedTypes = ['99999850'];
|
this.selectedTypes = ['99999850'];
|
||||||
@@ -199,6 +200,7 @@ export class CreateProcessPage implements OnInit {
|
|||||||
|
|
||||||
getSubjectType() {
|
getSubjectType() {
|
||||||
this.processes.GetSubjectType().subscribe(res => {
|
this.processes.GetSubjectType().subscribe(res => {
|
||||||
|
console.log('subjectTypes',res)
|
||||||
this.subjectTypes = res;
|
this.subjectTypes = res;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -315,6 +317,7 @@ export class CreateProcessPage implements OnInit {
|
|||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (this.loggeduser.Profile != 'PR') {
|
if (this.loggeduser.Profile != 'PR') {
|
||||||
|
console.log('Despacho MD');
|
||||||
switch (this.taskType) {
|
switch (this.taskType) {
|
||||||
case '0': // Despacho
|
case '0': // Despacho
|
||||||
this.postData = {
|
this.postData = {
|
||||||
@@ -399,6 +402,7 @@ export class CreateProcessPage implements OnInit {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (this.loggeduser.Profile == 'PR') {
|
} else if (this.loggeduser.Profile == 'PR') {
|
||||||
|
console.log('Despacho PR');
|
||||||
switch (this.taskType) {
|
switch (this.taskType) {
|
||||||
case '0': // Despacho PR
|
case '0': // Despacho PR
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,202 @@
|
|||||||
|
import { Attachment } from './attachment.model';
|
||||||
|
import { EventBody } from './eventbody.model';
|
||||||
|
import { EventPerson } from './eventperson.model';
|
||||||
|
|
||||||
|
|
||||||
|
export interface EventRecurrence {
|
||||||
|
Type: number | string;
|
||||||
|
Day?: number;
|
||||||
|
DayOfWeek?: number;
|
||||||
|
Month?: number | string;
|
||||||
|
LastOccurrence?: Date | string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class EventToAprove {
|
||||||
|
EventProcess: {
|
||||||
|
EventId: string;
|
||||||
|
Subject: string;
|
||||||
|
Body: EventBody;
|
||||||
|
Location: string;
|
||||||
|
CalendarId: string;
|
||||||
|
CalendarName: string;
|
||||||
|
StartDate: Date;
|
||||||
|
EndDate: Date;
|
||||||
|
EventType: string;
|
||||||
|
ParticipantsList: EventPerson[];
|
||||||
|
IsAllDayEvent: boolean;
|
||||||
|
IsMeeting: boolean;
|
||||||
|
IsRecurring: boolean;
|
||||||
|
AppointmentState: number;
|
||||||
|
TimeZone: string;
|
||||||
|
Organizer: any
|
||||||
|
Category: string;
|
||||||
|
HasAttachments: boolean;
|
||||||
|
EventRecurrence: EventRecurrence;
|
||||||
|
Status: string;
|
||||||
|
wxUserID: number;
|
||||||
|
Role: number
|
||||||
|
}
|
||||||
|
Attachments?: Attachment[];
|
||||||
|
InstanceID: string
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
// event to approve details ================================================
|
||||||
|
export interface Originator {
|
||||||
|
email: string;
|
||||||
|
manager: string;
|
||||||
|
displayName: string;
|
||||||
|
fqn: string;
|
||||||
|
username: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface WorkflowInstanceDataFields {
|
||||||
|
Body: string;
|
||||||
|
Location: string;
|
||||||
|
Subject: string;
|
||||||
|
StartDate: string;
|
||||||
|
EndDate: string;
|
||||||
|
Participants?: string;
|
||||||
|
CC?: string;
|
||||||
|
ReviewUserComment?: string;
|
||||||
|
Role?: number;
|
||||||
|
MDName: string;
|
||||||
|
MDEmail: string;
|
||||||
|
OriginatorComments?: string;
|
||||||
|
Status?: string;
|
||||||
|
TimeZone?: string;
|
||||||
|
Agenda: string;
|
||||||
|
EventType: string;
|
||||||
|
EventID?: string;
|
||||||
|
IsRecurring?: any;
|
||||||
|
HasAttachments?: boolean;
|
||||||
|
ParticipantsList?: any;
|
||||||
|
EventOrganizer?: string;
|
||||||
|
CreateEvent?: string;
|
||||||
|
IsAllDayEvent: boolean;
|
||||||
|
SerializedItem?: string;
|
||||||
|
MDwxUserID?: number;
|
||||||
|
DeserializedItem?: string;
|
||||||
|
Message: string;
|
||||||
|
InstanceId: string;
|
||||||
|
Header?: string;
|
||||||
|
RecurringString?: string;
|
||||||
|
LastOccurrence: string;
|
||||||
|
OccurrenceType: string;
|
||||||
|
SerialNumber?: string;
|
||||||
|
UserEmail?: string;
|
||||||
|
PREmail?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface EventToApproveDetails {
|
||||||
|
serialNumber: string;
|
||||||
|
originator?: Originator;
|
||||||
|
actions?: string[];
|
||||||
|
activityInstanceName?: string;
|
||||||
|
workflowInstanceFolio?: string;
|
||||||
|
taskStartDate?: string;
|
||||||
|
workflowID?: number;
|
||||||
|
workflowInstanceID?: number;
|
||||||
|
workflowName?: string;
|
||||||
|
workflowDisplayName?: string;
|
||||||
|
formURL?: string;
|
||||||
|
workflowInstanceDataFields: WorkflowInstanceDataFields;
|
||||||
|
totalDocuments?: any;
|
||||||
|
Documents?: any;
|
||||||
|
}
|
||||||
|
// ================================================================================
|
||||||
|
|
||||||
|
|
||||||
|
// event event to approve ================
|
||||||
|
export interface ParticipantsList {
|
||||||
|
Id: number;
|
||||||
|
EmailAddress: string;
|
||||||
|
Name: string;
|
||||||
|
IsRequired: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export interface EventToApproveEdit {
|
||||||
|
SerialNumber: string;
|
||||||
|
Body: string;
|
||||||
|
Location: string;
|
||||||
|
Subject: string;
|
||||||
|
StartDate: Date | string;
|
||||||
|
EndDate: Date | string;
|
||||||
|
ReviewUserComment: string;
|
||||||
|
MDName: string;
|
||||||
|
MDEmail: string;
|
||||||
|
IsAllDayEvent: boolean;
|
||||||
|
Status: string;
|
||||||
|
Category: string
|
||||||
|
EventType: string;
|
||||||
|
IsRecurring: boolean;
|
||||||
|
ParticipantsList: ParticipantsList[];
|
||||||
|
Message: string;
|
||||||
|
EventRecurrence: EventRecurrence;
|
||||||
|
Participants?: string;
|
||||||
|
CC?: string;
|
||||||
|
Agenda: string;
|
||||||
|
HasAttachments?: boolean;
|
||||||
|
EventOrganizer?: string;
|
||||||
|
InstanceId?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
// // ================================================================================
|
||||||
|
// export interface EventToApproveDetails {
|
||||||
|
// serialNumber: string;
|
||||||
|
// originator: {
|
||||||
|
// email: string;
|
||||||
|
// manager: string;
|
||||||
|
// displayName: string;
|
||||||
|
// fqn: string;
|
||||||
|
// username: string;
|
||||||
|
// }[]
|
||||||
|
// actions: string[];
|
||||||
|
// activityInstanceName: string;
|
||||||
|
// workflowInstanceFolio: string;
|
||||||
|
// taskStartDate: string;
|
||||||
|
// workflowID: number;
|
||||||
|
// workflowInstanceID: number;
|
||||||
|
// workflowName: string;
|
||||||
|
// workflowDisplayName: string;
|
||||||
|
// formURL: string;
|
||||||
|
// workflowInstanceDataFields: {
|
||||||
|
// Body: string;
|
||||||
|
// Location: string;
|
||||||
|
// Subject: string;
|
||||||
|
// StartDate: string;
|
||||||
|
// EndDate: string;
|
||||||
|
// Participants: string;
|
||||||
|
// CC: string;
|
||||||
|
// Private: boolean;
|
||||||
|
// ReviewUserComment: string;
|
||||||
|
// MDName: string;
|
||||||
|
// MDEmail: string;
|
||||||
|
// OriginatorComments: string;
|
||||||
|
// Agenda: string;
|
||||||
|
// EventType: string;
|
||||||
|
// TimeZone: string;
|
||||||
|
// EventID: string;
|
||||||
|
// HasAttachments: boolean;
|
||||||
|
// ParticipantsList: {
|
||||||
|
// $type?: any;
|
||||||
|
// EmailAddress: string;
|
||||||
|
// Name: string;
|
||||||
|
// IsRequired: boolean;
|
||||||
|
// }[]
|
||||||
|
// EventOrganizer: string;
|
||||||
|
// CreatEvent: string;
|
||||||
|
// IsAllDayEvent: boolean;
|
||||||
|
// MDwxUserID: number;
|
||||||
|
// SerializedItem: string;
|
||||||
|
// DeserializedItem: string;
|
||||||
|
// Status: string;
|
||||||
|
// Message: string;
|
||||||
|
// InstanceId: string;
|
||||||
|
// }
|
||||||
|
// totalDocuments?: any;
|
||||||
|
// Documents?: any;
|
||||||
|
// }
|
||||||
@@ -90,7 +90,7 @@ export class UserSession {
|
|||||||
UserName: string
|
UserName: string
|
||||||
Password: string
|
Password: string
|
||||||
RochetChatUserId: string
|
RochetChatUserId: string
|
||||||
Profile: 'PR' | 'MDGPR' | 'Consultant' | 'Unknown' ;
|
Profile: 'PR' | 'MDGPR' | 'Consultant' | 'SGGPR' | 'Unknown' ;
|
||||||
LoginPreference: 'None' | 'Password' | 'Pin' | null;
|
LoginPreference: 'None' | 'Password' | 'Pin' | null;
|
||||||
PIN: string
|
PIN: string
|
||||||
Inactivity: boolean
|
Inactivity: boolean
|
||||||
|
|||||||
@@ -190,6 +190,10 @@ export class EditEventPage implements OnInit {
|
|||||||
})
|
})
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
|
ngOnChanges(changes: any): void {
|
||||||
|
this.loadedEventAttachments = this.postEvent?.Attachments
|
||||||
|
}
|
||||||
|
|
||||||
close() {
|
close() {
|
||||||
this.modalController.dismiss();
|
this.modalController.dismiss();
|
||||||
}
|
}
|
||||||
@@ -421,7 +425,7 @@ export class EditEventPage implements OnInit {
|
|||||||
this.isEventEdited = true;
|
this.isEventEdited = true;
|
||||||
|
|
||||||
|
|
||||||
await this.saveDocument()
|
/* await this.saveDocument() */
|
||||||
|
|
||||||
this.goBack();
|
this.goBack();
|
||||||
}
|
}
|
||||||
@@ -595,6 +599,7 @@ export class EditEventPage implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
this.loadedEventAttachments.push(ApplicationIdDocumentToSave)
|
this.loadedEventAttachments.push(ApplicationIdDocumentToSave)
|
||||||
|
this.postEvent.Attachments = this.loadedEventAttachments;
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ import { SessionStore } from 'src/app/store/session.service';
|
|||||||
import { ChatMethodsService } from 'src/app/services/chat/chat-methods.service';
|
import { ChatMethodsService } from 'src/app/services/chat/chat-methods.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 { ProcessesService } from 'src/app/services/processes.service';
|
||||||
|
|
||||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||||
parse: {
|
parse: {
|
||||||
@@ -59,8 +60,8 @@ export class NewEventPage implements OnInit {
|
|||||||
|
|
||||||
postEvent: Event;
|
postEvent: Event;
|
||||||
eventBody: EventBody;
|
eventBody: EventBody;
|
||||||
segment:string = "true";
|
segment: string = "true";
|
||||||
profile:string;
|
profile: string;
|
||||||
eventAttendees: EventPerson[];
|
eventAttendees: EventPerson[];
|
||||||
selectedSegment: string;
|
selectedSegment: string;
|
||||||
selectedDate: Date;
|
selectedDate: Date;
|
||||||
@@ -73,10 +74,10 @@ export class NewEventPage implements OnInit {
|
|||||||
taskParticipants: any = [];
|
taskParticipants: any = [];
|
||||||
taskParticipantsCc: any = [];
|
taskParticipantsCc: any = [];
|
||||||
|
|
||||||
documents:SearchList[] = [];
|
documents: SearchList[] = [];
|
||||||
|
|
||||||
loggeduser: LoginUserRespose;
|
loggeduser: LoginUserRespose;
|
||||||
members:any;
|
members: any;
|
||||||
CalendarName;
|
CalendarName;
|
||||||
SessionStore = SessionStore;
|
SessionStore = SessionStore;
|
||||||
|
|
||||||
@@ -88,7 +89,7 @@ export class NewEventPage implements OnInit {
|
|||||||
autoStartTime;
|
autoStartTime;
|
||||||
autoEndTime;
|
autoEndTime;
|
||||||
CalendarNamesOptions = ['Oficial', 'Pessoal']
|
CalendarNamesOptions = ['Oficial', 'Pessoal']
|
||||||
roomId:string;
|
roomId: string;
|
||||||
globalEnd = new Date('1999')
|
globalEnd = new Date('1999')
|
||||||
environment = environment
|
environment = environment
|
||||||
|
|
||||||
@@ -101,12 +102,13 @@ export class NewEventPage implements OnInit {
|
|||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
private platform: Platform,
|
private platform: Platform,
|
||||||
private chatMethodService: ChatMethodsService,
|
private chatMethodService: ChatMethodsService,
|
||||||
private hhtpErrorHandle: HttpErrorHandle
|
private hhtpErrorHandle: HttpErrorHandle,
|
||||||
|
private processeService: ProcessesService
|
||||||
) {
|
) {
|
||||||
this.loggeduser = SessionStore.user;
|
this.loggeduser = SessionStore.user;
|
||||||
this.postEvent = new Event();
|
this.postEvent = new Event();
|
||||||
this.postEvent.EventRecurrence = {Type:'-1'};
|
this.postEvent.EventRecurrence = { Type: '-1' };
|
||||||
this.eventBody = { BodyType : "1", Text : ""};
|
this.eventBody = { BodyType: "1", Text: "" };
|
||||||
this.postEvent.Body = this.eventBody;
|
this.postEvent.Body = this.eventBody;
|
||||||
|
|
||||||
this.roomId = this.navParams.get('roomId');
|
this.roomId = this.navParams.get('roomId');
|
||||||
@@ -121,9 +123,9 @@ export class NewEventPage implements OnInit {
|
|||||||
// this.taskParticipants = [];
|
// this.taskParticipants = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!this.CalendarName) {
|
if (!this.CalendarName) {
|
||||||
console.log('true', this.eventService.calendarNamesAry.includes('Meu calendario'))
|
console.log('true', this.eventService.calendarNamesAry.includes('Meu calendario'))
|
||||||
if(this.eventService.calendarNamesAry.includes('Meu calendario')) {
|
if (this.eventService.calendarNamesAry.includes('Meu calendario')) {
|
||||||
this.CalendarName = 'Meu calendario';
|
this.CalendarName = 'Meu calendario';
|
||||||
console.log(this.eventService.calendarNamesAry)
|
console.log(this.eventService.calendarNamesAry)
|
||||||
} else {
|
} else {
|
||||||
@@ -136,7 +138,7 @@ export class NewEventPage implements OnInit {
|
|||||||
|
|
||||||
this.getRecurrenceTypes();
|
this.getRecurrenceTypes();
|
||||||
|
|
||||||
if(this.selectedSegment != "Combinada"){
|
if (this.selectedSegment != "Combinada") {
|
||||||
this.postEvent = {
|
this.postEvent = {
|
||||||
EventId: '',
|
EventId: '',
|
||||||
Subject: '',
|
Subject: '',
|
||||||
@@ -155,10 +157,10 @@ export class NewEventPage implements OnInit {
|
|||||||
Organizer: '',
|
Organizer: '',
|
||||||
Category: 'Reunião',
|
Category: 'Reunião',
|
||||||
HasAttachments: false,
|
HasAttachments: false,
|
||||||
EventRecurrence: {Type:'-1',LastOccurrence:this.autoEndTime},
|
EventRecurrence: { Type: '-1', LastOccurrence: this.autoEndTime },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
this.postEvent = {
|
this.postEvent = {
|
||||||
EventId: '',
|
EventId: '',
|
||||||
Subject: '',
|
Subject: '',
|
||||||
@@ -177,15 +179,15 @@ export class NewEventPage implements OnInit {
|
|||||||
Organizer: '',
|
Organizer: '',
|
||||||
Category: 'Reunião',
|
Category: 'Reunião',
|
||||||
HasAttachments: false,
|
HasAttachments: false,
|
||||||
EventRecurrence: {Type:'-1',LastOccurrence:this.autoEndTime},
|
EventRecurrence: { Type: '-1', LastOccurrence: this.autoEndTime },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
window.onresize = (event) => {
|
window.onresize = (event) => {
|
||||||
if( window.innerWidth >= 1024) {
|
if (window.innerWidth >= 1024) {
|
||||||
this.modalController.dismiss();
|
this.modalController.dismiss();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.setDefaultTime()
|
this.setDefaultTime()
|
||||||
|
|
||||||
@@ -199,8 +201,8 @@ export class NewEventPage 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;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@@ -221,8 +223,8 @@ export class NewEventPage 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)
|
||||||
} else if (minutes > 30) {
|
} else if (minutes > 30) {
|
||||||
@@ -233,65 +235,65 @@ export class NewEventPage implements OnInit {
|
|||||||
date.setMinutes(15)
|
date.setMinutes(15)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
setStartDate() {
|
setStartDate() {
|
||||||
if(!this.postEvent.StartDate) {
|
if (!this.postEvent.StartDate) {
|
||||||
this.postEvent.StartDate = this.roundTimeQuarterHour();
|
this.postEvent.StartDate = this.roundTimeQuarterHour();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setEndDate(){
|
setEndDate() {
|
||||||
if(!this.postEvent.EndDate) {
|
if (!this.postEvent.EndDate) {
|
||||||
this.postEvent.EndDate = this.postEvent.StartDate;
|
this.postEvent.EndDate = this.postEvent.StartDate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
getRecurrenceTypes() {
|
getRecurrenceTypes() {
|
||||||
this.eventService.getRecurrenceTypes().subscribe( res => {
|
this.eventService.getRecurrenceTypes().subscribe(res => {
|
||||||
|
|
||||||
this.recurringTypes = res;
|
this.recurringTypes = res;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onSelectedRecurringChanged(ev:any) {
|
onSelectedRecurringChanged(ev: any) {
|
||||||
|
|
||||||
this.calculetedLastOccurrence(ev);
|
this.calculetedLastOccurrence(ev);
|
||||||
|
|
||||||
if(ev.length > 1) {
|
if (ev.length > 1) {
|
||||||
|
|
||||||
this.selectedRecurringType = ev.filter(data => data != '-1');
|
this.selectedRecurringType = ev.filter(data => data != '-1');
|
||||||
}
|
}
|
||||||
if(ev.length == 0) {
|
if (ev.length == 0) {
|
||||||
this.selectedRecurringType = "-1";
|
this.selectedRecurringType = "-1";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
calculetedLastOccurrence(type:number){
|
calculetedLastOccurrence(type: number) {
|
||||||
// console.log(type);
|
// console.log(type);
|
||||||
var valor;
|
var valor;
|
||||||
var opcao: boolean;
|
var opcao: boolean;
|
||||||
if (type == 0) {
|
if (type == 0) {
|
||||||
valor = 7;
|
valor = 7;
|
||||||
opcao = true;
|
opcao = true;
|
||||||
} else if(type == 1){
|
} else if (type == 1) {
|
||||||
valor = 30;
|
valor = 30;
|
||||||
opcao = true;
|
opcao = true;
|
||||||
} else if(type == 2){
|
} else if (type == 2) {
|
||||||
valor = 1;
|
valor = 1;
|
||||||
opcao = false;
|
opcao = false;
|
||||||
}else if(type == 3){
|
} else if (type == 3) {
|
||||||
valor = 5;
|
valor = 5;
|
||||||
opcao = false;
|
opcao = false;
|
||||||
}
|
}
|
||||||
@@ -299,28 +301,28 @@ export class NewEventPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
defineLastOccurrence(valor:number, opcao:boolean){
|
defineLastOccurrence(valor: number, opcao: boolean) {
|
||||||
var time = new Date(this.postEvent.EndDate);
|
var time = new Date(this.postEvent.EndDate);
|
||||||
if (opcao == true) {
|
if (opcao == true) {
|
||||||
time.setDate(time.getDate() + valor);
|
time.setDate(time.getDate() + valor);
|
||||||
this.postEvent.EventRecurrence.LastOccurrence = time;
|
this.postEvent.EventRecurrence.LastOccurrence = time;
|
||||||
} else {
|
} else {
|
||||||
time = new Date(
|
time = new Date(
|
||||||
time.getFullYear() + valor,
|
time.getFullYear() + valor,
|
||||||
time.getMonth(),
|
time.getMonth(),
|
||||||
time.getDate(),
|
time.getDate(),
|
||||||
time.getHours(),
|
time.getHours(),
|
||||||
time.getMinutes()
|
time.getMinutes()
|
||||||
);
|
);
|
||||||
this.postEvent.EventRecurrence.LastOccurrence = time;
|
this.postEvent.EventRecurrence.LastOccurrence = time;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
runValidation() {
|
runValidation() {
|
||||||
this.validateFrom = true;
|
this.validateFrom = true;
|
||||||
if(new Date(this.postEvent.StartDate).getTime() > new Date(this.postEvent.EndDate).getTime()){
|
if (new Date(this.postEvent.StartDate).getTime() > new Date(this.postEvent.EndDate).getTime()) {
|
||||||
this.toastService._badRequest("A data de fim não pode ser inferior a data de início do evento")
|
this.toastService._badRequest("A data de fim não pode ser inferior a data de início do evento")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -328,7 +330,7 @@ export class NewEventPage implements OnInit {
|
|||||||
|
|
||||||
get dateValid() {
|
get dateValid() {
|
||||||
if (window.innerWidth <= 800) {
|
if (window.innerWidth <= 800) {
|
||||||
return this.postEvent.StartDate < this.postEvent.EndDate? ['ok']: []
|
return this.postEvent.StartDate < this.postEvent.EndDate ? ['ok'] : []
|
||||||
} else {
|
} else {
|
||||||
return ['ok']
|
return ['ok']
|
||||||
}
|
}
|
||||||
@@ -347,7 +349,7 @@ export class NewEventPage implements OnInit {
|
|||||||
CalendarName: new FormControl(this.postEvent.CalendarName, [
|
CalendarName: new FormControl(this.postEvent.CalendarName, [
|
||||||
Validators.required
|
Validators.required
|
||||||
]),
|
]),
|
||||||
Date: new FormControl(new Date(this.postEvent.StartDate).getTime() < new Date(this.postEvent.EndDate).getTime()? 'ok': null,[
|
Date: new FormControl(new Date(this.postEvent.StartDate).getTime() < new Date(this.postEvent.EndDate).getTime() ? 'ok' : null, [
|
||||||
Validators.required
|
Validators.required
|
||||||
]),
|
]),
|
||||||
Categories: new FormControl(this.postEvent.Category, [
|
Categories: new FormControl(this.postEvent.Category, [
|
||||||
@@ -356,76 +358,83 @@ export class NewEventPage implements OnInit {
|
|||||||
participantes: new FormControl(this.taskParticipants, [
|
participantes: new FormControl(this.taskParticipants, [
|
||||||
Validators.required
|
Validators.required
|
||||||
]),
|
]),
|
||||||
dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok']: this.postEvent.EventRecurrence.LastOccurrence && new Date(this.postEvent.EventRecurrence.LastOccurrence).getTime() > new Date(this.postEvent.EndDate).getTime() ? 'ok': null, [
|
dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok'] : this.postEvent.EventRecurrence.LastOccurrence && new Date(this.postEvent.EventRecurrence.LastOccurrence).getTime() > new Date(this.postEvent.EndDate).getTime() ? 'ok' : null, [
|
||||||
Validators.required
|
Validators.required
|
||||||
]),
|
]),
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
openInicio() {
|
openInicio() {
|
||||||
let input: any = document.querySelector('#new-inicio')
|
let input: any = document.querySelector('#new-inicio')
|
||||||
if(input) {
|
if (input) {
|
||||||
|
|
||||||
input.click()
|
input.click()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
openFim() {
|
openFim() {
|
||||||
let input: any = document.querySelector('#new-fim')
|
let input: any = document.querySelector('#new-fim')
|
||||||
if(input) {
|
if (input) {
|
||||||
input.click()
|
input.click()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
openLastOccurrence() {
|
openLastOccurrence() {
|
||||||
let input: any = document.querySelector('#last-occurrence')
|
let input: any = document.querySelector('#last-occurrence')
|
||||||
if(input) {
|
if (input) {
|
||||||
input.click()
|
input.click()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async save() {
|
async save() {
|
||||||
|
|
||||||
this.injectValidation()
|
this.injectValidation()
|
||||||
this.runValidation()
|
this.runValidation()
|
||||||
|
|
||||||
if(this.Form.invalid) {
|
if (this.Form.invalid) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.documents.length >= 0) {
|
if (this.documents.length >= 0) {
|
||||||
this.postEvent.HasAttachments = true;
|
this.postEvent.HasAttachments = true;
|
||||||
}
|
}
|
||||||
if(this.selectedRecurringType != '-1') {
|
if (this.selectedRecurringType != '-1') {
|
||||||
this.postEvent.EventRecurrence.Type = this.selectedRecurringType;
|
this.postEvent.EventRecurrence.Type = this.selectedRecurringType;
|
||||||
}
|
}
|
||||||
|
|
||||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||||
|
|
||||||
let eventId: any;
|
let eventId: any;
|
||||||
|
|
||||||
const loader = this.toastService.loading()
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|
||||||
const CalendarId = this.selectedCalendarId()
|
const CalendarId = this.selectedCalendarId()
|
||||||
this.postEvent.CalendarId = CalendarId
|
this.postEvent.CalendarId = CalendarId
|
||||||
|
|
||||||
if(this.loggeduser.Profile == 'MDGPR') {
|
if (this.loggeduser.Profile == 'MDGPR') {
|
||||||
|
|
||||||
eventId = await this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).toPromise();
|
eventId = await this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).toPromise();
|
||||||
this.hhtpErrorHandle.httpsSucessMessagge('new event')
|
this.hhtpErrorHandle.httpsSucessMessagge('new event')
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(this.loggeduser.Profile == 'PR') {
|
else if (this.loggeduser.Profile == 'PR') {
|
||||||
|
|
||||||
const CalendarId = this.selectedCalendarId()
|
const CalendarId = this.selectedCalendarId()
|
||||||
this.postEvent.CalendarId = CalendarId
|
this.postEvent.CalendarId = CalendarId
|
||||||
|
|
||||||
eventId = await this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).toPromise();
|
eventId = await this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).toPromise();
|
||||||
this.hhtpErrorHandle.httpsSucessMessagge('new event')
|
this.hhtpErrorHandle.httpsSucessMessagge('new event')
|
||||||
|
|
||||||
|
} else if (this.loggeduser.Profile == 'SGGPR') {
|
||||||
|
|
||||||
|
|
||||||
|
this.saveAproveEvent();
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
const CalendarId = this.selectedCalendarId()
|
const CalendarId = this.selectedCalendarId()
|
||||||
@@ -433,50 +442,54 @@ export class NewEventPage implements OnInit {
|
|||||||
|
|
||||||
eventId = await this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).toPromise();
|
eventId = await this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).toPromise();
|
||||||
this.hhtpErrorHandle.httpsSucessMessagge('new event')
|
this.hhtpErrorHandle.httpsSucessMessagge('new event')
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
//foi adicionado este if para não ter de fazer muitas alterações sobre a criação dos eventos. Deve ser refatorado
|
||||||
return {
|
if (this.loggeduser.Profile != 'SGGPR') {
|
||||||
SourceTitle: e.Assunto,
|
|
||||||
ParentId: eventId,
|
|
||||||
Source: '1',
|
|
||||||
SourceId: e.Id,
|
|
||||||
ApplicationId: e.ApplicationType.toString(),
|
|
||||||
Id: '',
|
|
||||||
Link: '',
|
|
||||||
SerialNumber: ''
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
await DocumentToSave.forEach( async (attachments, i) => {
|
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
||||||
try {
|
return {
|
||||||
await this.attachmentsService.setEventAttachmentById(attachments).toPromise();
|
SourceTitle: e.Assunto,
|
||||||
} catch(error) {
|
ParentId: eventId,
|
||||||
|
Source: '1',
|
||||||
|
SourceId: e.Id,
|
||||||
|
ApplicationId: e.ApplicationType.toString(),
|
||||||
|
Id: '',
|
||||||
|
Link: '',
|
||||||
|
SerialNumber: ''
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
await DocumentToSave.forEach(async (attachments, i) => {
|
||||||
|
try {
|
||||||
|
await this.attachmentsService.setEventAttachmentById(attachments).toPromise();
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
let data1 = {
|
||||||
|
"subject": this.postEvent.Subject,
|
||||||
|
"start": this.postEvent.StartDate,
|
||||||
|
"end": this.postEvent.EndDate,
|
||||||
|
"venue": this.postEvent.Location,
|
||||||
|
"id": eventId,
|
||||||
|
"calendarId": CalendarId
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
if (this.roomId) {
|
||||||
|
this.chatMethodService.sendMessage(this.roomId, data1);
|
||||||
|
}
|
||||||
|
|
||||||
let data1 = {
|
this.hhtpErrorHandle.httpsSucessMessagge('new event');
|
||||||
"subject": this.postEvent.Subject,
|
let data = Object.assign(this.postEvent, { id: eventId })
|
||||||
"start": this.postEvent.StartDate,
|
this.modalController.dismiss(data);
|
||||||
"end": this.postEvent.EndDate,
|
|
||||||
"venue": this.postEvent.Location,
|
|
||||||
"id": eventId,
|
|
||||||
"calendarId": CalendarId
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.roomId) {
|
|
||||||
this.chatMethodService.sendMessage(this.roomId, data1);
|
|
||||||
}
|
|
||||||
|
|
||||||
this.hhtpErrorHandle.httpsSucessMessagge('new event');
|
|
||||||
let data = Object.assign(this.postEvent,{id:eventId})
|
|
||||||
this.modalController.dismiss(data);
|
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
this.hhtpErrorHandle.httpStatusHandle(error)
|
this.hhtpErrorHandle.httpStatusHandle(error)
|
||||||
} finally {
|
} finally {
|
||||||
loader.remove()
|
loader.remove()
|
||||||
}
|
}
|
||||||
@@ -484,7 +497,7 @@ export class NewEventPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
selectedCalendarId () {
|
selectedCalendarId() {
|
||||||
|
|
||||||
if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postEvent.CalendarName == 'Oficial') {
|
if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postEvent.CalendarName == 'Oficial') {
|
||||||
return this.eventService.calendarNamesType[this.CalendarName]['OficialId']
|
return this.eventService.calendarNamesType[this.CalendarName]['OficialId']
|
||||||
@@ -502,18 +515,18 @@ export class NewEventPage implements OnInit {
|
|||||||
|
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
||||||
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']
|
||||||
|
|
||||||
} else if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial']) {
|
} else if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial']) {
|
||||||
this.CalendarNamesOptions = ['Oficial']
|
this.CalendarNamesOptions = ['Oficial']
|
||||||
this.postEvent.CalendarName = 'Oficial'
|
this.postEvent.CalendarName = 'Oficial'
|
||||||
|
|
||||||
} else if (this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) {
|
} else if (this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) {
|
||||||
this.CalendarNamesOptions = ['Pessoal']
|
this.CalendarNamesOptions = ['Pessoal']
|
||||||
this.postEvent.CalendarName = 'Pessoal'
|
this.postEvent.CalendarName = 'Pessoal'
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.CalendarNamesOptions = ['Oficial', 'Pessoal']
|
this.CalendarNamesOptions = ['Oficial', 'Pessoal']
|
||||||
}
|
}
|
||||||
@@ -525,7 +538,7 @@ export class NewEventPage implements OnInit {
|
|||||||
|
|
||||||
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
|
||||||
@@ -538,9 +551,9 @@ export class NewEventPage implements OnInit {
|
|||||||
|
|
||||||
modal.onDidDismiss().then((data) => {
|
modal.onDidDismiss().then((data) => {
|
||||||
|
|
||||||
if(data) {
|
if (data) {
|
||||||
data = data['data'];
|
data = data['data'];
|
||||||
if(data) {
|
if (data) {
|
||||||
|
|
||||||
const newAttendees: EventPerson[] = data['taskParticipants'];
|
const newAttendees: EventPerson[] = data['taskParticipants'];
|
||||||
const newAttendeesCC: EventPerson[] = data['taskParticipantsCc'];
|
const newAttendeesCC: EventPerson[] = data['taskParticipantsCc'];
|
||||||
@@ -589,8 +602,8 @@ export class NewEventPage implements OnInit {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
modal.onDidDismiss().then((res)=>{
|
modal.onDidDismiss().then((res) => {
|
||||||
if(res){
|
if (res) {
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
this.documents.push(data.selected);
|
this.documents.push(data.selected);
|
||||||
}
|
}
|
||||||
@@ -601,19 +614,219 @@ export class NewEventPage implements OnInit {
|
|||||||
|
|
||||||
removeAttachment(index: number) {
|
removeAttachment(index: number) {
|
||||||
|
|
||||||
this.documents = this.documents.filter( (e, i) => index != i);
|
this.documents = this.documents.filter((e, i) => index != i);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
checkRoleInArray() {
|
checkRoleInArray() {
|
||||||
for (let index = 0; index < this.eventService.calendarNamesAry.length; index++) {
|
for (let index = 0; index < this.eventService.calendarNamesAry.length; index++) {
|
||||||
console.log('ROLE1', this.eventService.calendarNamesAry[index])
|
console.log('ROLE1', this.eventService.calendarNamesAry[index])
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let index = 0; index < this.eventService.calendarRole.length; index++) {
|
for (let index = 0; index < this.eventService.calendarRole.length; index++) {
|
||||||
console.log('ROLE2',this.eventService.calendarRole[index])
|
console.log('ROLE2', this.eventService.calendarRole[index])
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//Deve ser removido posteriormente
|
||||||
|
async saveAproveEvent() {
|
||||||
|
|
||||||
|
console.log(this.postEvent)
|
||||||
|
console.log(this.postEvent.CalendarName)
|
||||||
|
console.log(this.CalendarName)
|
||||||
|
console.log(this.eventService.calendarNamesAry)
|
||||||
|
const CalendarId = this.selectedCalendarId()
|
||||||
|
|
||||||
|
let selectedCalendar
|
||||||
|
try {
|
||||||
|
selectedCalendar = this.eventService.calendarNamesAry.find(calendar => calendar.Fullname === this.CalendarName)
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
console.log('selectedCalendar', selectedCalendar)
|
||||||
|
|
||||||
|
if (selectedCalendar) {
|
||||||
|
if (selectedCalendar.Role = 'Presidente da República') {
|
||||||
|
let loader = this.toastService.loading();
|
||||||
|
|
||||||
|
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
||||||
|
return {
|
||||||
|
SourceTitle: e.Assunto,
|
||||||
|
ParentId: "AGD_" + this.loggeduser.UserName + "_" + this.processeService.generateInstaceFormatDate(),
|
||||||
|
Source: '1',
|
||||||
|
SourceId: e.Id,
|
||||||
|
ApplicationId: e.ApplicationType.toString(),
|
||||||
|
Id: '',
|
||||||
|
Link: '',
|
||||||
|
SerialNumber: ''
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
let body = this.eventToaproveBody(this.postEvent, CalendarId, this.loggeduser.RoleID, this.loggeduser.UserId, DocumentToSave);
|
||||||
|
await this.processeService.createEventToAprove(this.postEvent.CalendarName, 'pr', body).subscribe((id) => {
|
||||||
|
loader.remove()
|
||||||
|
this.modalController.dismiss();
|
||||||
|
this.hhtpErrorHandle.httpsSucessMessagge('new event to aprove')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* DocumentToSave.forEach((attachments, i) => {
|
||||||
|
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => {
|
||||||
|
if (DocumentToSave.length == (i + 1)) {
|
||||||
|
this.afterSave();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
if (DocumentToSave.length == 0) {
|
||||||
|
this.afterSave();
|
||||||
|
} */
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
loader.remove()
|
||||||
|
this.hhtpErrorHandle.httpStatusHandle(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} else if (selectedCalendar.Role = 'Ministro e Director do Gabinete do PR') {
|
||||||
|
let loader = this.toastService.loading();
|
||||||
|
|
||||||
|
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
||||||
|
return {
|
||||||
|
SourceTitle: e.Assunto,
|
||||||
|
ParentId: "AGD_" + this.loggeduser.UserName + "_" + this.processeService.generateInstaceFormatDate(),
|
||||||
|
Source: '1',
|
||||||
|
SourceId: e.Id,
|
||||||
|
ApplicationId: e.ApplicationType.toString(),
|
||||||
|
Id: '',
|
||||||
|
Link: '',
|
||||||
|
SerialNumber: ''
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
let body = this.eventToaproveBody(this.postEvent, CalendarId, this.loggeduser.RoleID, this.loggeduser.UserId, DocumentToSave);
|
||||||
|
await this.processeService.createEventToAprove(this.postEvent.CalendarName, 'md', body).subscribe((id) => {
|
||||||
|
loader.remove()
|
||||||
|
this.modalController.dismiss();
|
||||||
|
this.hhtpErrorHandle.httpsSucessMessagge('new event to aprove')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* DocumentToSave.forEach((attachments, i) => {
|
||||||
|
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => {
|
||||||
|
if (DocumentToSave.length == (i + 1)) {
|
||||||
|
this.afterSave();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
if (DocumentToSave.length == 0) {
|
||||||
|
this.afterSave();
|
||||||
|
} */
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
loader.remove()
|
||||||
|
this.hhtpErrorHandle.httpStatusHandle(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!selectedCalendar && this.CalendarName == "Meu calendario") {
|
||||||
|
console.log('SG generic')
|
||||||
|
this.postEvent.CalendarName
|
||||||
|
|
||||||
|
const CalendarId = this.selectedCalendarId()
|
||||||
|
let loader = this.toastService.loading();
|
||||||
|
|
||||||
|
this.postEvent.CalendarId = CalendarId
|
||||||
|
|
||||||
|
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
|
||||||
|
(id) => {
|
||||||
|
loader.remove();
|
||||||
|
|
||||||
|
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)) {
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
if (DocumentToSave.length == 0) {
|
||||||
|
}
|
||||||
|
|
||||||
|
this.hhtpErrorHandle.httpsSucessMessagge('new event')
|
||||||
|
let data = {
|
||||||
|
"subject": this.postEvent.Subject,
|
||||||
|
"start": this.postEvent.StartDate,
|
||||||
|
"end": this.postEvent.EndDate,
|
||||||
|
"venue": this.postEvent.Location,
|
||||||
|
"id": id,
|
||||||
|
"calendarId": CalendarId
|
||||||
|
}
|
||||||
|
if (this.roomId) {
|
||||||
|
this.chatMethodService.sendMessage(this.roomId, data);
|
||||||
|
}
|
||||||
|
|
||||||
|
let dataa = Object.assign(this.postEvent, { id: eventId })
|
||||||
|
this.modalController.dismiss(dataa);
|
||||||
|
}, (error) => {
|
||||||
|
|
||||||
|
loader.remove()
|
||||||
|
this.hhtpErrorHandle.httpStatusHandle(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deve ser removido posteriormente
|
||||||
|
eventToaproveBody(event, calendarId, role, userId, attachments) {
|
||||||
|
let toAproveObject = {
|
||||||
|
"EventProcess": {
|
||||||
|
"Body": event.Body,
|
||||||
|
"Location": event.Location,
|
||||||
|
"Subject": event.Subject,
|
||||||
|
"StartDate": event.StartDate,
|
||||||
|
"EndDate": event.EndDate,
|
||||||
|
"Status": "Active",
|
||||||
|
"IsAllDayEvent": event.IsRecurring,
|
||||||
|
"EventType": event.EventType,
|
||||||
|
"ParticipantsList": event.Attendees,
|
||||||
|
"EventRecurrence": event.EventRecurrence,
|
||||||
|
"HasAttachments": event.HasAttachments,
|
||||||
|
"CalendarId": calendarId,
|
||||||
|
"Role": role,
|
||||||
|
"wxUserID": userId,
|
||||||
|
"TimeZone": "W. Central Africa Standard Time"
|
||||||
|
},
|
||||||
|
"Attachments": attachments,
|
||||||
|
"InstanceID": "AGD_" + this.loggeduser.UserName + "_" + this.processeService.generateInstaceFormatDate()
|
||||||
|
}
|
||||||
|
|
||||||
|
return toAproveObject;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -245,8 +245,8 @@
|
|||||||
<div></div>
|
<div></div>
|
||||||
</div>
|
</div>
|
||||||
<div class="schedule-details">
|
<div class="schedule-details">
|
||||||
<div class="location">{{event.Subject}}</div>
|
<div class="description">{{event.Subject}}</div>
|
||||||
<div class="description">
|
<div class="location">
|
||||||
<p>{{event.Location}}</p>
|
<p>{{event.Location}}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+3
-3
@@ -22,11 +22,11 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<button (click)="openAddNoteModal('Arquivo')" class="btn-cancel" shape="round" >Arquivar</button>
|
<button (click)="openAddNoteModal('Arquivo')" class="btn-cancel" shape="round" >Arquivar</button>
|
||||||
<div class="solid"></div>
|
<!-- <div class="solid"></div> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
<button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button>
|
<!-- <button (click)="openExpedientActionsModal('0',fulltask)" class="btn-cancel" shape="round" >Efetuar Despacho</button> -->
|
||||||
<div class="solid"></div>
|
<!-- <div class="solid"></div> -->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|||||||
+1
@@ -113,5 +113,6 @@
|
|||||||
<button class="btn-cancel cursor-pointer" shape="round" (click)="emendTask(loadedEvent.serialNumber)">Enviar para Revisão</button>
|
<button class="btn-cancel cursor-pointer" shape="round" (click)="emendTask(loadedEvent.serialNumber)">Enviar para Revisão</button>
|
||||||
<button class="btn-no-color cursor-pointer" shape="round" (click)="openMenu()"> <ion-icon name="ellipsis-vertical-outline"></ion-icon></button>
|
<button class="btn-no-color cursor-pointer" shape="round" (click)="openMenu()"> <ion-icon name="ellipsis-vertical-outline"></ion-icon></button>
|
||||||
<button class="btn-cancel cursor-pointer" shape="round" (click)="approveTask(loadedEvent.serialNumber)">Aprovar</button>
|
<button class="btn-cancel cursor-pointer" shape="round" (click)="approveTask(loadedEvent.serialNumber)">Aprovar</button>
|
||||||
|
<button class="btn-cancel cursor-pointer" shape="round" (click)="rejectTask(loadedEvent.serialNumber)">Eliminar</button>
|
||||||
</div>
|
</div>
|
||||||
</ion-footer>
|
</ion-footer>
|
||||||
|
|||||||
+2
-2
@@ -127,14 +127,14 @@ export class ApproveEventModalPage implements OnInit {
|
|||||||
|
|
||||||
async rejectTask(serialNumber:string) {
|
async rejectTask(serialNumber:string) {
|
||||||
|
|
||||||
let body = { "serialNumber": serialNumber, "action": "Descartar" }
|
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
|
||||||
|
|
||||||
const loader = this.toastService.loading()
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.processes.PostTaskAction(body).toPromise()
|
await this.processes.PostTaskAction(body).toPromise()
|
||||||
|
|
||||||
this.toastService._successMessage('Evento rejeitado', () =>{
|
this.toastService._successMessage('Evento Eliminado!', () =>{
|
||||||
this.router.navigate(['/home/gabinete-digital/event-list']);
|
this.router.navigate(['/home/gabinete-digital/event-list']);
|
||||||
})
|
})
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
+45
-44
@@ -62,7 +62,7 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
onlinecheck: boolean;
|
onlinecheck: boolean;
|
||||||
|
|
||||||
loggeduser: LoginUserRespose;
|
loggeduser: LoginUserRespose;
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private processes: ProcessesService,
|
private processes: ProcessesService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
@@ -84,7 +84,7 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
) {
|
) {
|
||||||
this.loggeduser = SessionStore.user
|
this.loggeduser = SessionStore.user
|
||||||
// console.log('SessionStore', SessionStore)
|
// console.log('SessionStore', SessionStore)
|
||||||
|
|
||||||
this.activatedRoute.paramMap.subscribe(params => {
|
this.activatedRoute.paramMap.subscribe(params => {
|
||||||
if (params["params"].SerialNumber) {
|
if (params["params"].SerialNumber) {
|
||||||
this.serialNumber = params["params"].SerialNumber;
|
this.serialNumber = params["params"].SerialNumber;
|
||||||
@@ -114,13 +114,13 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
// updateProcessDB(res) {
|
// updateProcessDB(res) {
|
||||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
// this.storage.set('expediente_details',res).then(() =>{
|
// this.storage.set('expediente_details',res).then(() =>{
|
||||||
|
|
||||||
// })
|
// })
|
||||||
// } else {
|
// } else {
|
||||||
// //this.sqliteservice.updateProcess(res)
|
// //this.sqliteservice.updateProcess(res)
|
||||||
// }
|
// }
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// getFromDB() {
|
// getFromDB() {
|
||||||
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
// if (this.platform.is('desktop') || this.platform.is('mobileweb')) {
|
||||||
// this.storage.get('expediente_details').then((process) => {
|
// this.storage.get('expediente_details').then((process) => {
|
||||||
@@ -165,7 +165,7 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
// this.platform.ready().then(() => {
|
// this.platform.ready().then(() => {
|
||||||
// this.onlinecheck = false;
|
// this.onlinecheck = false;
|
||||||
// this.sqliteservice.getProcessById(this.serialNumber).then((process) => {
|
// this.sqliteservice.getProcessById(this.serialNumber).then((process) => {
|
||||||
|
|
||||||
|
|
||||||
// var workflow = JSON.parse(process[0].workflowInstanceDataFields);
|
// var workflow = JSON.parse(process[0].workflowInstanceDataFields);
|
||||||
// var origina
|
// var origina
|
||||||
@@ -229,7 +229,7 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
"AttachmentList": documents,
|
"AttachmentList": documents,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const loader = this.toastService.loading()
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
@@ -283,7 +283,7 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
component: AddNotePage,
|
component: AddNotePage,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
showAttachmentBtn: false,
|
showAttachmentBtn: false,
|
||||||
actionName:actionName
|
actionName: actionName
|
||||||
},
|
},
|
||||||
cssClass: classs,
|
cssClass: classs,
|
||||||
//backdropDismiss: true
|
//backdropDismiss: true
|
||||||
@@ -292,7 +292,7 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
|
|
||||||
|
|
||||||
modal.onDidDismiss().then(res => {
|
modal.onDidDismiss().then(res => {
|
||||||
|
|
||||||
if (res.data) {
|
if (res.data) {
|
||||||
const DocumentToSave = res.data.documents.map((e) => {
|
const DocumentToSave = res.data.documents.map((e) => {
|
||||||
return {
|
return {
|
||||||
@@ -337,7 +337,7 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
sendExpedienteToPending() {
|
sendExpedienteToPending() {
|
||||||
const loader = this.toastService.loading()
|
const loader = this.toastService.loading()
|
||||||
this.processes.SetTaskToPending(this.serialNumber).subscribe(res => {
|
this.processes.SetTaskToPending(this.serialNumber).subscribe(res => {
|
||||||
|
|
||||||
this.httpErroHandle.httpsSucessMessagge('Enviar para Pendentes')
|
this.httpErroHandle.httpsSucessMessagge('Enviar para Pendentes')
|
||||||
this.TaskService.loadExpedientes()
|
this.TaskService.loadExpedientes()
|
||||||
this.goBack();
|
this.goBack();
|
||||||
@@ -352,7 +352,7 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
async LoadTaskDetail(serial: string) {
|
async LoadTaskDetail(serial: string) {
|
||||||
|
|
||||||
this.processes.GetTask(serial).subscribe(res => {
|
this.processes.GetTask(serial).subscribe(res => {
|
||||||
|
|
||||||
this.TaskService.loadExpedientes();
|
this.TaskService.loadExpedientes();
|
||||||
|
|
||||||
this.task = {
|
this.task = {
|
||||||
@@ -444,11 +444,11 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
getAttachments(serialNumber) {
|
getAttachments(serialNumber) {
|
||||||
|
|
||||||
|
|
||||||
this.attachmentsService.getAttachmentsBySerial(serialNumber).subscribe(res => {
|
this.attachmentsService.getAttachmentsBySerial(serialNumber).subscribe(res => {
|
||||||
this.attachments = res;
|
this.attachments = res;
|
||||||
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -472,9 +472,10 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
if (res) {
|
if (res) {
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
this.documents.push(data.selected);
|
this.documents.push(data.selected);
|
||||||
await this.documents.forEach( async (element: any) => {
|
let body
|
||||||
|
await this.documents.forEach(async (element: any) => {
|
||||||
|
|
||||||
let body = {
|
body = {
|
||||||
"InstanceID": this.task.InstanceID,
|
"InstanceID": this.task.InstanceID,
|
||||||
"WorkflowDisplayName": this.task.WorkflowName,
|
"WorkflowDisplayName": this.task.WorkflowName,
|
||||||
"FolderID": this.task.FolderId,
|
"FolderID": this.task.FolderId,
|
||||||
@@ -485,22 +486,22 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
|
|
||||||
const Attachments = this.searchDocumentPipe.transformToAttachment(element)
|
const Attachments = this.searchDocumentPipe.transformToAttachment(element)
|
||||||
body.Attachments = Attachments;
|
body.Attachments = Attachments;
|
||||||
|
|
||||||
const loader = this.toastService.loading()
|
|
||||||
|
|
||||||
try {
|
|
||||||
loader.remove()
|
|
||||||
await this.attachmentsService.AddAttachment(body).toPromise()
|
|
||||||
this.toastService._successMessage()
|
|
||||||
} catch(error) {
|
|
||||||
if(error.status == 0) {
|
|
||||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
|
||||||
} else {
|
|
||||||
|
|
||||||
this.toastService._badRequest()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
const loader = this.toastService.loading()
|
||||||
|
|
||||||
|
try {
|
||||||
|
loader.remove()
|
||||||
|
await this.attachmentsService.AddAttachment(body).toPromise()
|
||||||
|
this.toastService._successMessage()
|
||||||
|
} catch (error) {
|
||||||
|
if (error.status == 0) {
|
||||||
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
|
} else {
|
||||||
|
|
||||||
|
this.toastService._badRequest()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.LoadTaskDetail(this.serialNumber);
|
this.LoadTaskDetail(this.serialNumber);
|
||||||
@@ -563,8 +564,8 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
});
|
});
|
||||||
|
|
||||||
modal.onDidDismiss().then(async (res) => {
|
modal.onDidDismiss().then(async (res) => {
|
||||||
|
|
||||||
|
|
||||||
if (body == 'descartar') {
|
if (body == 'descartar') {
|
||||||
|
|
||||||
this.TaskService.loadExpedientes()
|
this.TaskService.loadExpedientes()
|
||||||
@@ -577,10 +578,10 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
this.toastService._successMessage('Processo descartado');
|
this.toastService._successMessage('Processo descartado');
|
||||||
this.goBack();
|
this.goBack();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if(error.status == 0) {
|
if (error.status == 0) {
|
||||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this.toastService._badRequest('Processo não descartado')
|
this.toastService._badRequest('Processo não descartado')
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
@@ -601,10 +602,10 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
//this.toastService._successMessage('Processo descartado');
|
//this.toastService._successMessage('Processo descartado');
|
||||||
this.goBack();
|
this.goBack();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if(error.status == 0) {
|
if (error.status == 0) {
|
||||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this.toastService._badRequest('Processo não descartado')
|
this.toastService._badRequest('Processo não descartado')
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
@@ -613,17 +614,17 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
|
|
||||||
}
|
}
|
||||||
else if (res['data'] == 'No') {
|
else if (res['data'] == 'No') {
|
||||||
|
|
||||||
const loader = this.toastService.loading()
|
const loader = this.toastService.loading()
|
||||||
try {
|
try {
|
||||||
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
|
await this.processes.UpdateTaskStatus(this.task.FolderId).toPromise();
|
||||||
this.toastService._successMessage();
|
this.toastService._successMessage();
|
||||||
this.goBack();
|
this.goBack();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if(error.status == 0) {
|
if (error.status == 0) {
|
||||||
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
this.toastService._badRequest('Sem acesso à internet. Por favor verifique sua conexão')
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this.toastService._badRequest()
|
this.toastService._badRequest()
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
@@ -639,7 +640,7 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async openBookMeetingModal(task: any) {
|
async openBookMeetingModal(task: any) {
|
||||||
|
|
||||||
|
|
||||||
let classs;
|
let classs;
|
||||||
if (window.innerWidth < 701) {
|
if (window.innerWidth < 701) {
|
||||||
@@ -651,7 +652,7 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
component: BookMeetingModalPage,
|
component: BookMeetingModalPage,
|
||||||
componentProps: {
|
componentProps: {
|
||||||
task: this.task,
|
task: this.task,
|
||||||
fulltask:this.fulltask
|
fulltask: this.fulltask
|
||||||
},
|
},
|
||||||
cssClass: classs,
|
cssClass: classs,
|
||||||
backdropDismiss: false
|
backdropDismiss: false
|
||||||
@@ -671,7 +672,7 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async viewEventDetail(eventId: any) {
|
async viewEventDetail(eventId: any) {
|
||||||
|
|
||||||
|
|
||||||
const modal = await this.modalController.create({
|
const modal = await this.modalController.create({
|
||||||
component: ViewEventPage,
|
component: ViewEventPage,
|
||||||
@@ -722,7 +723,7 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
this.dataService.set("newGroupName", this.task.Folio);
|
this.dataService.set("newGroupName", this.task.Folio);
|
||||||
this.dataService.set("documents", this.fulltask.Documents);
|
this.dataService.set("documents", this.fulltask.Documents);
|
||||||
this.dataService.set("link", window.location.pathname);
|
this.dataService.set("link", window.location.pathname);
|
||||||
setTimeout(()=> {
|
setTimeout(() => {
|
||||||
this.router.navigate(['/home/chat']);
|
this.router.navigate(['/home/chat']);
|
||||||
}, 100)
|
}, 100)
|
||||||
}
|
}
|
||||||
@@ -739,12 +740,12 @@ export class ExpedienteDetailPage implements OnInit {
|
|||||||
});
|
});
|
||||||
|
|
||||||
modal.onDidDismiss().then(
|
modal.onDidDismiss().then(
|
||||||
()=>{},
|
() => { },
|
||||||
(error) => {
|
(error) => {
|
||||||
console.log(error)
|
console.log(error)
|
||||||
})
|
})
|
||||||
|
|
||||||
await modal.present();
|
await modal.present();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -147,7 +147,9 @@ export class AuthService {
|
|||||||
session.Profile = 'MDGPR'
|
session.Profile = 'MDGPR'
|
||||||
} else if(session.RoleID == 99999872) {
|
} else if(session.RoleID == 99999872) {
|
||||||
session.Profile = 'Consultant'
|
session.Profile = 'Consultant'
|
||||||
} else {
|
} else if(session.RoleID == 99999886) {
|
||||||
|
session.Profile = 'SGGPR'
|
||||||
|
}else {
|
||||||
session.Profile = 'Unknown'
|
session.Profile = 'Unknown'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ export class HttpErrorHandle {
|
|||||||
this.toastService._successMessage('Evento aprovado!')
|
this.toastService._successMessage('Evento aprovado!')
|
||||||
break;
|
break;
|
||||||
case 'Rejeitar':
|
case 'Rejeitar':
|
||||||
this.toastService._successMessage('Evento Rejeitado!')
|
this.toastService._successMessage('Evento Eliminado!')
|
||||||
break;
|
break;
|
||||||
case 'Dar o meu Parecer':
|
case 'Dar o meu Parecer':
|
||||||
this.toastService._successMessage('Parecer enviado!')
|
this.toastService._successMessage('Parecer enviado!')
|
||||||
|
|||||||
@@ -20,8 +20,8 @@ export class ProcessesService {
|
|||||||
loggeduser: LoginUserRespose;
|
loggeduser: LoginUserRespose;
|
||||||
headers: HttpHeaders;
|
headers: HttpHeaders;
|
||||||
headers2: HttpHeaders;
|
headers2: HttpHeaders;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private http: HttpClient,
|
private http: HttpClient,
|
||||||
@@ -31,12 +31,12 @@ export class ProcessesService {
|
|||||||
this.loggeduser = SessionStore.user;
|
this.loggeduser = SessionStore.user;
|
||||||
|
|
||||||
this.setHeader()
|
this.setHeader()
|
||||||
this.changeProfileService.registerCallback(()=>{
|
this.changeProfileService.registerCallback(() => {
|
||||||
this.loggeduser = SessionStore.user;
|
this.loggeduser = SessionStore.user;
|
||||||
this.setHeader()
|
this.setHeader()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -50,11 +50,11 @@ export class ProcessesService {
|
|||||||
|
|
||||||
this.headers2 = new HttpHeaders();
|
this.headers2 = new HttpHeaders();
|
||||||
|
|
||||||
this.headers2 = this.headers2.set('Authorization',"Bearer "+ CPSession.AuthorizationJwt);
|
this.headers2 = this.headers2.set('Authorization', "Bearer " + CPSession.AuthorizationJwt);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uploadFile(formData:any){
|
uploadFile(formData: any) {
|
||||||
|
|
||||||
//const geturl = environment.apiURL + 'Tasks/DelegateTask';
|
//const geturl = environment.apiURL + 'Tasks/DelegateTask';
|
||||||
const geturl = environment.apiURL + 'lakefs/UploadFiles';
|
const geturl = environment.apiURL + 'lakefs/UploadFiles';
|
||||||
@@ -66,8 +66,7 @@ export class ProcessesService {
|
|||||||
return this.http.post(`${geturl}`, formData, options);
|
return this.http.post(`${geturl}`, formData, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
GetTasksList(processname: typeof GetTasksListType, onlycount:boolean): Observable<fullTaskList[]>
|
GetTasksList(processname: typeof GetTasksListType, onlycount: boolean): Observable<fullTaskList[]> {
|
||||||
{
|
|
||||||
const geturl = environment.apiURL + 'tasks/List';
|
const geturl = environment.apiURL + 'tasks/List';
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
|
|
||||||
@@ -119,7 +118,7 @@ export class ProcessesService {
|
|||||||
return this.http.get<ExpedienteFullTask[]>(`${geturl}`, options);
|
return this.http.get<ExpedienteFullTask[]>(`${geturl}`, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
GetTask(serialnumber:string): Observable<any> {
|
GetTask(serialnumber: string): Observable<any> {
|
||||||
|
|
||||||
const geturl = environment.apiURL + 'Tasks/FindTask';
|
const geturl = environment.apiURL + 'Tasks/FindTask';
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
@@ -133,7 +132,7 @@ export class ProcessesService {
|
|||||||
return this.http.get<any>(`${geturl}`, options);
|
return this.http.get<any>(`${geturl}`, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
GetDraftByID(id:string): Observable<any> {
|
GetDraftByID(id: string): Observable<any> {
|
||||||
|
|
||||||
const geturl = environment.apiPCURL + `Documents/${id}`;
|
const geturl = environment.apiPCURL + `Documents/${id}`;
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
@@ -147,7 +146,7 @@ export class ProcessesService {
|
|||||||
return this.http.get<any>(`${geturl}`, options);
|
return this.http.get<any>(`${geturl}`, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
SaveDraftByID(id:string, object): Observable<any> {
|
SaveDraftByID(id: string, object): Observable<any> {
|
||||||
const geturl = environment.apiPCURL + `Documents/${id}`;
|
const geturl = environment.apiPCURL + `Documents/${id}`;
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
|
|
||||||
@@ -160,7 +159,7 @@ export class ProcessesService {
|
|||||||
return this.http.put<any>(`${geturl}`, object, options);
|
return this.http.put<any>(`${geturl}`, object, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
SetTaskToPending(serialNumber:string): Observable<any>{
|
SetTaskToPending(serialNumber: string): Observable<any> {
|
||||||
const geturl = environment.apiURL + 'Tasks/SetTaskPending';
|
const geturl = environment.apiURL + 'Tasks/SetTaskPending';
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
|
|
||||||
@@ -170,10 +169,10 @@ export class ProcessesService {
|
|||||||
headers: this.headers,
|
headers: this.headers,
|
||||||
params: params
|
params: params
|
||||||
};
|
};
|
||||||
return this.http.post<any>(`${geturl}`,'', options);
|
return this.http.post<any>(`${geturl}`, '', options);
|
||||||
}
|
}
|
||||||
|
|
||||||
GetPendingTasks(onlyCount: boolean){
|
GetPendingTasks(onlyCount: boolean) {
|
||||||
const geturl = environment.apiURL + 'Tasks/ListPending';
|
const geturl = environment.apiURL + 'Tasks/ListPending';
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
|
|
||||||
@@ -187,7 +186,7 @@ export class ProcessesService {
|
|||||||
return this.http.get<any>(`${geturl}`, options);
|
return this.http.get<any>(`${geturl}`, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
DelegateTask(body:any){
|
DelegateTask(body: any) {
|
||||||
const geturl = environment.apiURL + 'Tasks/DelegateTask';
|
const geturl = environment.apiURL + 'Tasks/DelegateTask';
|
||||||
|
|
||||||
let options = {
|
let options = {
|
||||||
@@ -196,7 +195,7 @@ export class ProcessesService {
|
|||||||
return this.http.post<any>(`${geturl}`, body, options);
|
return this.http.post<any>(`${geturl}`, body, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
GetTaskParticipants(folderId): Observable<any>{
|
GetTaskParticipants(folderId): Observable<any> {
|
||||||
const geturl = environment.apiURL + 'Processes/GetUsersInDispash';
|
const geturl = environment.apiURL + 'Processes/GetUsersInDispash';
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
|
|
||||||
@@ -209,8 +208,7 @@ export class ProcessesService {
|
|||||||
return this.http.get<any>(`${geturl}`, options);
|
return this.http.get<any>(`${geturl}`, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
FindTaskDocId(serialnumber:string): Observable<any>
|
FindTaskDocId(serialnumber: string): Observable<any> {
|
||||||
{
|
|
||||||
const geturl = environment.apiURL + 'Tasks/FindExpedienteDocId';
|
const geturl = environment.apiURL + 'Tasks/FindExpedienteDocId';
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
|
|
||||||
@@ -223,8 +221,7 @@ export class ProcessesService {
|
|||||||
return this.http.get<any>(`${geturl}`, options);
|
return this.http.get<any>(`${geturl}`, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
GetMDOficialTasks(): Observable<any>
|
GetMDOficialTasks(): Observable<any> {
|
||||||
{
|
|
||||||
const geturl = environment.apiURL + 'tasks/GetMDOficialTasks';
|
const geturl = environment.apiURL + 'tasks/GetMDOficialTasks';
|
||||||
let options = {
|
let options = {
|
||||||
headers: this.headers,
|
headers: this.headers,
|
||||||
@@ -232,8 +229,7 @@ export class ProcessesService {
|
|||||||
return this.http.get<any>(`${geturl}`, options);
|
return this.http.get<any>(`${geturl}`, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
GetMDPersonalTasks(): Observable<any>
|
GetMDPersonalTasks(): Observable<any> {
|
||||||
{
|
|
||||||
const geturl = environment.apiURL + 'tasks/GetMDPersonalTasks';
|
const geturl = environment.apiURL + 'tasks/GetMDPersonalTasks';
|
||||||
let options = {
|
let options = {
|
||||||
headers: this.headers,
|
headers: this.headers,
|
||||||
@@ -241,8 +237,7 @@ export class ProcessesService {
|
|||||||
return this.http.get<any>(`${geturl}`, options);
|
return this.http.get<any>(`${geturl}`, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
GetToApprovedEvents(categoryname:string, count:string): Observable<any>
|
GetToApprovedEvents(categoryname: string, count: string): Observable<any> {
|
||||||
{
|
|
||||||
const geturl = environment.apiURL + 'Tasks/ListByCategory';
|
const geturl = environment.apiURL + 'Tasks/ListByCategory';
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
|
|
||||||
@@ -256,7 +251,7 @@ export class ProcessesService {
|
|||||||
return this.http.get<any>(`${geturl}`, options);
|
return this.http.get<any>(`${geturl}`, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
PostTaskAction(body:any){
|
PostTaskAction(body: any) {
|
||||||
const geturl = environment.apiURL + 'Tasks/Complete';
|
const geturl = environment.apiURL + 'Tasks/Complete';
|
||||||
|
|
||||||
let options = {
|
let options = {
|
||||||
@@ -274,7 +269,7 @@ export class ProcessesService {
|
|||||||
return this.http.post<any>(`${geturl}`, body, options)
|
return this.http.post<any>(`${geturl}`, body, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
CompleteTask(body:Excludetask) {
|
CompleteTask(body: Excludetask) {
|
||||||
|
|
||||||
// double check
|
// double check
|
||||||
const geturl = environment.apiURL + 'Tasks/CompleteTask';
|
const geturl = environment.apiURL + 'Tasks/CompleteTask';
|
||||||
@@ -285,7 +280,7 @@ export class ProcessesService {
|
|||||||
return this.http.post<any>(`${geturl}`, body, options)
|
return this.http.post<any>(`${geturl}`, body, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
CompleteParecerPrTask(body:any) {
|
CompleteParecerPrTask(body: any) {
|
||||||
const geturl = environment.apiURL + 'Tasks/CompleteTaskParecerPr';
|
const geturl = environment.apiURL + 'Tasks/CompleteTaskParecerPr';
|
||||||
|
|
||||||
let options = {
|
let options = {
|
||||||
@@ -294,7 +289,7 @@ export class ProcessesService {
|
|||||||
return this.http.post<any>(`${geturl}`, body, options)
|
return this.http.post<any>(`${geturl}`, body, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
UpdateTaskStatus(FolderId:any): Observable<any>{
|
UpdateTaskStatus(FolderId: any): Observable<any> {
|
||||||
const geturl = environment.apiURL + 'Tasks/UpdateTaskStatus';
|
const geturl = environment.apiURL + 'Tasks/UpdateTaskStatus';
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
|
|
||||||
@@ -304,10 +299,10 @@ export class ProcessesService {
|
|||||||
headers: this.headers,
|
headers: this.headers,
|
||||||
params: params
|
params: params
|
||||||
};
|
};
|
||||||
return this.http.post<any>(`${geturl}`,'', options);
|
return this.http.post<any>(`${geturl}`, '', options);
|
||||||
}
|
}
|
||||||
|
|
||||||
GetDocumentUrl(DocId:string, FsId:string): Observable<any>{
|
GetDocumentUrl(DocId: string, FsId: string): Observable<any> {
|
||||||
const geturl = environment.apiURL + 'ecm/document/viewrequestshort';
|
const geturl = environment.apiURL + 'ecm/document/viewrequestshort';
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
|
|
||||||
@@ -321,7 +316,7 @@ export class ProcessesService {
|
|||||||
return this.http.get<any>(`${geturl}`, options);
|
return this.http.get<any>(`${geturl}`, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
postDespatcho(body:any) {
|
postDespatcho(body: any) {
|
||||||
const geturl = environment.apiURL + 'Processes/CreateDispatch';
|
const geturl = environment.apiURL + 'Processes/CreateDispatch';
|
||||||
let options = {
|
let options = {
|
||||||
headers: this.headers,
|
headers: this.headers,
|
||||||
@@ -329,7 +324,7 @@ export class ProcessesService {
|
|||||||
return this.http.post<any>(`${geturl}`, body, options)
|
return this.http.post<any>(`${geturl}`, body, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
postDespatchoPr(body:any) {
|
postDespatchoPr(body: any) {
|
||||||
const geturl = environment.apiURL + 'Processes/CreateDispatchPR';
|
const geturl = environment.apiURL + 'Processes/CreateDispatchPR';
|
||||||
let options = {
|
let options = {
|
||||||
headers: this.headers,
|
headers: this.headers,
|
||||||
@@ -337,24 +332,24 @@ export class ProcessesService {
|
|||||||
return this.http.post<any>(`${geturl}`, body, options)
|
return this.http.post<any>(`${geturl}`, body, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
postParecer(body:any) {
|
postParecer(body: any) {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
if(!body.AttachmentList) {
|
if (!body.AttachmentList) {
|
||||||
body.AttachmentList = {}
|
body.AttachmentList = {}
|
||||||
}
|
}
|
||||||
if(!body?.dataFields) {
|
if (!body?.dataFields) {
|
||||||
body.dataFields = {}
|
body.dataFields = {}
|
||||||
}
|
}
|
||||||
if(!body.dataFields?.DraftIds) {
|
if (!body.dataFields?.DraftIds) {
|
||||||
body.dataFields.DraftIds = ""
|
body.dataFields.DraftIds = ""
|
||||||
}
|
}
|
||||||
if(!body.AttachmentList?.DraftIds) {
|
if (!body.AttachmentList?.DraftIds) {
|
||||||
body.AttachmentList.DraftIds = ""
|
body.AttachmentList.DraftIds = ""
|
||||||
}
|
}
|
||||||
} catch (error) {}
|
} catch (error) { }
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const geturl = environment.apiURL + 'Processes/CreateParecer';
|
const geturl = environment.apiURL + 'Processes/CreateParecer';
|
||||||
let options = {
|
let options = {
|
||||||
headers: this.headers,
|
headers: this.headers,
|
||||||
@@ -362,22 +357,22 @@ export class ProcessesService {
|
|||||||
return this.http.post<any>(`${geturl}`, body, options)
|
return this.http.post<any>(`${geturl}`, body, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
postParecerPr(body:any) {
|
postParecerPr(body: any) {
|
||||||
try {
|
try {
|
||||||
if(!body.AttachmentList) {
|
if (!body.AttachmentList) {
|
||||||
body.AttachmentList = {}
|
body.AttachmentList = {}
|
||||||
}
|
}
|
||||||
if(!body?.dataFields) {
|
if (!body?.dataFields) {
|
||||||
body.dataFields = {}
|
body.dataFields = {}
|
||||||
}
|
}
|
||||||
if(!body.dataFields?.DraftIds) {
|
if (!body.dataFields?.DraftIds) {
|
||||||
body.dataFields.DraftIds = ""
|
body.dataFields.DraftIds = ""
|
||||||
}
|
}
|
||||||
if(!body.AttachmentList?.DraftIds) {
|
if (!body.AttachmentList?.DraftIds) {
|
||||||
body.AttachmentList.DraftIds = ""
|
body.AttachmentList.DraftIds = ""
|
||||||
}
|
}
|
||||||
} catch(error) {}
|
} catch (error) { }
|
||||||
|
|
||||||
|
|
||||||
const geturl = environment.apiURL + 'Processes/CreateParecerPR';
|
const geturl = environment.apiURL + 'Processes/CreateParecerPR';
|
||||||
let options = {
|
let options = {
|
||||||
@@ -386,7 +381,7 @@ export class ProcessesService {
|
|||||||
return this.http.post<any>(`${geturl}`, body, options)
|
return this.http.post<any>(`${geturl}`, body, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
postDeferimento(body:any){
|
postDeferimento(body: any) {
|
||||||
const geturl = environment.apiURL + 'Processes/CreateDeferimento';
|
const geturl = environment.apiURL + 'Processes/CreateDeferimento';
|
||||||
let options = {
|
let options = {
|
||||||
headers: this.headers,
|
headers: this.headers,
|
||||||
@@ -394,12 +389,12 @@ export class ProcessesService {
|
|||||||
return this.http.post<any>(`${geturl}`, body, options)
|
return this.http.post<any>(`${geturl}`, body, options)
|
||||||
}
|
}
|
||||||
|
|
||||||
GetActionsList(){
|
GetActionsList() {
|
||||||
const geturl = environment.apiURL + 'presidentialActions';
|
const geturl = environment.apiURL + 'presidentialActions';
|
||||||
let options = {
|
let options = {
|
||||||
headers: this.headers,
|
headers: this.headers,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
return this.http.get<any>(`${geturl}`, options);
|
return this.http.get<any>(`${geturl}`, options);
|
||||||
}
|
}
|
||||||
@@ -412,7 +407,7 @@ export class ProcessesService {
|
|||||||
return this.http.get<any>(`${geturl}`, options);
|
return this.http.get<any>(`${geturl}`, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
GetDocumentDetails(DocId:string, FsId:string){
|
GetDocumentDetails(DocId: string, FsId: string) {
|
||||||
|
|
||||||
const geturl = environment.apiURL + 'search/documents';
|
const geturl = environment.apiURL + 'search/documents';
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
@@ -430,15 +425,15 @@ export class ProcessesService {
|
|||||||
documentSetUpMeeting(body: DocumentSetUpMeeting) {
|
documentSetUpMeeting(body: DocumentSetUpMeeting) {
|
||||||
|
|
||||||
let url = environment.apiURL + 'Processes/CallMeeting';
|
let url = environment.apiURL + 'Processes/CallMeeting';
|
||||||
url = url.replace('/V4/','/V5/')
|
url = url.replace('/V4/', '/V5/')
|
||||||
|
|
||||||
let options: any = {
|
let options: any = {
|
||||||
headers: this.headers,
|
headers: this.headers,
|
||||||
}
|
}
|
||||||
return this.http.post<any>(`${url}`,body, options);
|
return this.http.post<any>(`${url}`, body, options);
|
||||||
}
|
}
|
||||||
|
|
||||||
DocumentDetail(DocId:string, FsId:string){
|
DocumentDetail(DocId: string, FsId: string) {
|
||||||
|
|
||||||
const geturl = environment.apiURL + 'ecm/GetDocument';
|
const geturl = environment.apiURL + 'ecm/GetDocument';
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
@@ -472,7 +467,7 @@ export class ProcessesService {
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
GetViewer(DocId:string, FsId:string){
|
GetViewer(DocId: string, FsId: string) {
|
||||||
|
|
||||||
const geturl = environment.apiURL + 'ecm/document/viewfile';
|
const geturl = environment.apiURL + 'ecm/document/viewfile';
|
||||||
let params = new HttpParams();
|
let params = new HttpParams();
|
||||||
@@ -493,7 +488,36 @@ export class ProcessesService {
|
|||||||
let options = {
|
let options = {
|
||||||
headers: this.headers,
|
headers: this.headers,
|
||||||
};
|
};
|
||||||
return this.http.post<any>(`${geturl}`,file, options);
|
return this.http.post<any>(`${geturl}`, file, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
createEventToAprove(calendarType, agenda, body) {
|
||||||
|
|
||||||
|
const geturl = environment.apiURL + 'Processes/CreateEvent/' + agenda;
|
||||||
|
let params = new HttpParams();
|
||||||
|
params = params.set('calendarName', calendarType);
|
||||||
|
let options = {
|
||||||
|
headers: this.headers,
|
||||||
|
params: params
|
||||||
|
};
|
||||||
|
return this.http.post<any>(`${geturl}`, body, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
generateInstaceFormatDate(): string {
|
||||||
|
const data = new Date();
|
||||||
|
|
||||||
|
const ano = data.getFullYear().toString().padStart(4, '0');
|
||||||
|
const mes = (data.getMonth() + 1).toString().padStart(2, '0');
|
||||||
|
const dia = data.getDate().toString().padStart(2, '0');
|
||||||
|
|
||||||
|
const horas = data.getHours().toString().padStart(2, '0');
|
||||||
|
const minutos = data.getMinutes().toString().padStart(2, '0');
|
||||||
|
const segundos = data.getSeconds().toString().padStart(2, '0');
|
||||||
|
const milissegundos = data.getMilliseconds().toString().padStart(3, '0');
|
||||||
|
|
||||||
|
const dataFormatada = `${ano}-${mes}-${dia}_${horas}:${minutos}:${segundos}.${milissegundos}`;
|
||||||
|
|
||||||
|
return dataFormatada;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ export class ApproveEventPage implements OnInit {
|
|||||||
|
|
||||||
async rejectTask(serialNumber:string) {
|
async rejectTask(serialNumber:string) {
|
||||||
|
|
||||||
let body = { "serialNumber": serialNumber, "action": "Descartar" }
|
let body = { "serialNumber": serialNumber, "action": "Rejeitar" }
|
||||||
|
|
||||||
|
|
||||||
const loader = this.toastService.loading()
|
const loader = this.toastService.loading()
|
||||||
|
|||||||
@@ -397,7 +397,7 @@ export class EditEventPage implements OnInit {
|
|||||||
this.clearPostEvent.emit();
|
this.clearPostEvent.emit();
|
||||||
this.deleteTemporaryData();
|
this.deleteTemporaryData();
|
||||||
|
|
||||||
await this.saveDocument()
|
/* await this.saveDocument() */
|
||||||
|
|
||||||
this.close();
|
this.close();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,12 +8,12 @@ import { ModalController } from '@ionic/angular';
|
|||||||
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
|
import { removeDuplicate } from 'src/plugin/removeDuplicate.js'
|
||||||
import { SearchPage } from 'src/app/pages/search/search.page';
|
import { SearchPage } from 'src/app/pages/search/search.page';
|
||||||
import { SearchList } from "src/app/models/search-document";
|
import { SearchList } from "src/app/models/search-document";
|
||||||
import { EventAttachment } from 'src/app/models/attachment.model';
|
import { EventAttachment } from 'src/app/models/attachment.model';
|
||||||
|
|
||||||
import { ToastService } from 'src/app/services/toast.service';
|
import { ToastService } from 'src/app/services/toast.service';
|
||||||
import { LoginUserRespose } from 'src/app/models/user.model';
|
import { LoginUserRespose } from 'src/app/models/user.model';
|
||||||
|
|
||||||
import {DateAdapter} from '@angular/material/core';
|
import { DateAdapter } from '@angular/material/core';
|
||||||
import * as _moment from 'moment';
|
import * as _moment from 'moment';
|
||||||
import * as _rollupMoment from 'moment';
|
import * as _rollupMoment from 'moment';
|
||||||
import { FormControl } from '@angular/forms';
|
import { FormControl } from '@angular/forms';
|
||||||
@@ -21,7 +21,7 @@ import { NgxMatDateFormats } from '@angular-material-components/datetime-picker'
|
|||||||
import { ThemePalette } from '@angular/material/core';
|
import { ThemePalette } from '@angular/material/core';
|
||||||
|
|
||||||
import { ViewChild } from '@angular/core';
|
import { ViewChild } from '@angular/core';
|
||||||
import { FormGroup, Validators } from '@angular/forms';
|
import { FormGroup, Validators } from '@angular/forms';
|
||||||
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
import { NGX_MAT_DATE_FORMATS } from '@angular-material-components/datetime-picker';
|
||||||
import { ThemeService } from 'src/app/services/theme.service'
|
import { ThemeService } from 'src/app/services/theme.service'
|
||||||
import { ChatMethodsService } from 'src/app/services/chat/chat-methods.service';
|
import { ChatMethodsService } from 'src/app/services/chat/chat-methods.service';
|
||||||
@@ -29,6 +29,9 @@ import { ServerConnectionService } from 'src/app/services/server-connection.serv
|
|||||||
import { SessionStore } from 'src/app/store/session.service';
|
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 { EventToAprove } from 'src/app/models/eventToAprove.model';
|
||||||
|
import { ProcessesService } from 'src/app/services/processes.service';
|
||||||
|
import { Subject } from 'rxjs';
|
||||||
|
|
||||||
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
||||||
parse: {
|
parse: {
|
||||||
@@ -55,7 +58,7 @@ const CUSTOM_DATE_FORMATS: NgxMatDateFormats = {
|
|||||||
export class NewEventPage implements OnInit {
|
export class NewEventPage implements OnInit {
|
||||||
|
|
||||||
eventBody: EventBody;
|
eventBody: EventBody;
|
||||||
segment:string = "true";
|
segment: string = "true";
|
||||||
|
|
||||||
public date: any;
|
public date: any;
|
||||||
public disabled = false;
|
public disabled = false;
|
||||||
@@ -74,8 +77,8 @@ export class NewEventPage implements OnInit {
|
|||||||
mostrarModal = false;
|
mostrarModal = false;
|
||||||
|
|
||||||
@Input() attendees: []
|
@Input() attendees: []
|
||||||
@Input() profile:string;
|
@Input() profile: string;
|
||||||
@Input() roomId:string;
|
@Input() roomId: string;
|
||||||
@Input() selectedSegment: string;
|
@Input() selectedSegment: string;
|
||||||
@Input() selectedDate: Date;
|
@Input() selectedDate: Date;
|
||||||
@Input() CalendarDate: Date;
|
@Input() CalendarDate: Date;
|
||||||
@@ -86,14 +89,15 @@ export class NewEventPage implements OnInit {
|
|||||||
@Output() setIntervenientCC = new EventEmitter<any>();
|
@Output() setIntervenientCC = new EventEmitter<any>();
|
||||||
|
|
||||||
postEvent: Event;
|
postEvent: Event;
|
||||||
|
postEventToAprove: EventToAprove;
|
||||||
@Output() onAddEvent = new EventEmitter<any>();
|
@Output() onAddEvent = new EventEmitter<any>();
|
||||||
@Output() openAttendeesComponent = new EventEmitter<any>();
|
@Output() openAttendeesComponent = new EventEmitter<any>();
|
||||||
@Output() clearContact = new EventEmitter<any>();
|
@Output() clearContact = new EventEmitter<any>();
|
||||||
@Output() GoBackEditOrAdd = new EventEmitter<any>();
|
@Output() GoBackEditOrAdd = new EventEmitter<any>();
|
||||||
@Output() cloneAllmobileComponent = new EventEmitter<any>();
|
@Output() cloneAllmobileComponent = new EventEmitter<any>();
|
||||||
@Output() backToChat = new EventEmitter<any>();
|
@Output() backToChat = new EventEmitter<any>();
|
||||||
|
|
||||||
documents:SearchList[] = [];
|
documents: SearchList[] = [];
|
||||||
|
|
||||||
// minDate: string;
|
// minDate: string;
|
||||||
|
|
||||||
@@ -107,7 +111,7 @@ export class NewEventPage implements OnInit {
|
|||||||
Form: FormGroup;
|
Form: FormGroup;
|
||||||
validateFrom = false;
|
validateFrom = false;
|
||||||
autoStartTime;
|
autoStartTime;
|
||||||
autoEndTime;
|
autoEndTime;
|
||||||
|
|
||||||
public options = [
|
public options = [
|
||||||
{ value: true, label: 'True' },
|
{ value: true, label: 'True' },
|
||||||
@@ -135,7 +139,8 @@ export class NewEventPage implements OnInit {
|
|||||||
private dateAdapter: DateAdapter<any>,
|
private dateAdapter: DateAdapter<any>,
|
||||||
public ThemeService: ThemeService,
|
public ThemeService: ThemeService,
|
||||||
private chatMethodService: ChatMethodsService,
|
private chatMethodService: ChatMethodsService,
|
||||||
private hhtpErrorHandle: HttpErrorHandle
|
private hhtpErrorHandle: HttpErrorHandle,
|
||||||
|
private processeService: ProcessesService,
|
||||||
) {
|
) {
|
||||||
this.dateAdapter.setLocale('pt');
|
this.dateAdapter.setLocale('pt');
|
||||||
this.loggeduser = SessionStore.user;
|
this.loggeduser = SessionStore.user;
|
||||||
@@ -145,8 +150,8 @@ export class NewEventPage implements OnInit {
|
|||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
|
||||||
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]
|
||||||
@@ -154,12 +159,12 @@ export class NewEventPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.getRecurrenceTypes();
|
this.getRecurrenceTypes();
|
||||||
if(!this.restoreTemporaryData()) {
|
if (!this.restoreTemporaryData()) {
|
||||||
// clear
|
// clear
|
||||||
this.eventBody = { BodyType : "1", Text : ""};
|
this.eventBody = { BodyType: "1", Text: "" };
|
||||||
this.postEvent.Body = this.eventBody;
|
this.postEvent.Body = this.eventBody;
|
||||||
|
|
||||||
if(this.selectedSegment != "Combinada") {
|
if (this.selectedSegment != "Combinada") {
|
||||||
this.postEvent = {
|
this.postEvent = {
|
||||||
EventId: '',
|
EventId: '',
|
||||||
Subject: '',
|
Subject: '',
|
||||||
@@ -178,10 +183,10 @@ export class NewEventPage implements OnInit {
|
|||||||
Organizer: '',
|
Organizer: '',
|
||||||
Category: 'Reunião',
|
Category: 'Reunião',
|
||||||
HasAttachments: false,
|
HasAttachments: false,
|
||||||
EventRecurrence: { Type:'-1', LastOccurrence: this.autoEndTime },
|
EventRecurrence: { Type: '-1', LastOccurrence: this.autoEndTime },
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else{
|
else {
|
||||||
this.postEvent = {
|
this.postEvent = {
|
||||||
EventId: '',
|
EventId: '',
|
||||||
Subject: '',
|
Subject: '',
|
||||||
@@ -200,13 +205,13 @@ export class NewEventPage implements OnInit {
|
|||||||
Organizer: '',
|
Organizer: '',
|
||||||
Category: 'Reunião',
|
Category: 'Reunião',
|
||||||
HasAttachments: false,
|
HasAttachments: false,
|
||||||
EventRecurrence: {Type:'-1',LastOccurrence:this.autoEndTime},
|
EventRecurrence: { Type: '-1', LastOccurrence: this.autoEndTime },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.postEvent.Attendees != null) {
|
if (this.postEvent.Attendees != null) {
|
||||||
this.postEvent.Attendees.forEach(e => {
|
this.postEvent.Attendees.forEach(e => {
|
||||||
if(e.IsRequired) {
|
if (e.IsRequired) {
|
||||||
this.taskParticipants.push(e);
|
this.taskParticipants.push(e);
|
||||||
} else {
|
} else {
|
||||||
this.taskParticipantsCc.push(e);
|
this.taskParticipantsCc.push(e);
|
||||||
@@ -222,8 +227,8 @@ export class NewEventPage implements OnInit {
|
|||||||
this.setDefaultTime();
|
this.setDefaultTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this.date = new Date(2021,9,4,5,6,7);
|
this.date = new Date(2021, 9, 4, 5, 6, 7);
|
||||||
|
|
||||||
this.injectValidation();
|
this.injectValidation();
|
||||||
this.changeAgenda()
|
this.changeAgenda()
|
||||||
@@ -236,14 +241,14 @@ export class NewEventPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
roundTimeQuarterHour(timeToReturn = new Date()): Date {
|
roundTimeQuarterHour(timeToReturn = new Date()): Date {
|
||||||
|
|
||||||
let date = new Date(timeToReturn) || new Date();
|
let date = new Date(timeToReturn) || new Date();
|
||||||
|
|
||||||
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)
|
||||||
} else if (minutes > 30) {
|
} else if (minutes > 30) {
|
||||||
@@ -253,26 +258,26 @@ export class NewEventPage implements OnInit {
|
|||||||
} else if (minutes > 0) {
|
} else if (minutes > 0) {
|
||||||
date.setMinutes(15)
|
date.setMinutes(15)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
roundTimeQuarterHour1 (timeToReturn) {
|
roundTimeQuarterHour1(timeToReturn) {
|
||||||
let date: any = new Date(timeToReturn) || new Date();
|
let date: any = new Date(timeToReturn) || new Date();
|
||||||
const minutes = date.getMinutes();
|
const minutes = date.getMinutes();
|
||||||
date.setSeconds(0);
|
date.setSeconds(0);
|
||||||
|
|
||||||
if((minutes % 15) != 0 ) {
|
if ((minutes % 15) != 0) {
|
||||||
let a = (Math.floor(minutes / 15) + 1) * 15
|
let a = (Math.floor(minutes / 15) + 1) * 15
|
||||||
date.setMinutes(a)
|
date.setMinutes(a)
|
||||||
}
|
}
|
||||||
@@ -280,24 +285,24 @@ export class NewEventPage implements OnInit {
|
|||||||
return date
|
return date
|
||||||
}
|
}
|
||||||
|
|
||||||
setStartDate(){
|
setStartDate() {
|
||||||
// this.postEvent.StartDate = this.roundTimeQuarterHour();
|
// this.postEvent.StartDate = this.roundTimeQuarterHour();
|
||||||
}
|
}
|
||||||
|
|
||||||
setEndDate(){
|
setEndDate() {
|
||||||
// this.postEvent.EndDate = this.postEvent.StartDate;
|
// this.postEvent.EndDate = this.postEvent.StartDate;
|
||||||
}
|
}
|
||||||
|
|
||||||
runValidation() {
|
runValidation() {
|
||||||
this.validateFrom = true;
|
this.validateFrom = true;
|
||||||
if(new Date(this.postEvent.StartDate).getTime() > new Date(this.postEvent.EndDate).getTime()){
|
if (new Date(this.postEvent.StartDate).getTime() > new Date(this.postEvent.EndDate).getTime()) {
|
||||||
this.toastService._badRequest("A data de fim não pode ser inferior a data de início do evento")
|
this.toastService._badRequest("A data de fim não pode ser inferior a data de início do evento")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
injectValidation() {
|
injectValidation() {
|
||||||
|
|
||||||
if (typeof(this.postEvent.EventRecurrence.Type) == 'number') {
|
if (typeof (this.postEvent.EventRecurrence.Type) == 'number') {
|
||||||
const str: any = this.postEvent.EventRecurrence.Type.toString()
|
const str: any = this.postEvent.EventRecurrence.Type.toString()
|
||||||
this.postEvent.EventRecurrence.Type = str
|
this.postEvent.EventRecurrence.Type = str
|
||||||
}
|
}
|
||||||
@@ -320,13 +325,13 @@ export class NewEventPage implements OnInit {
|
|||||||
dateEnd: new FormControl(this.postEvent.EndDate, [
|
dateEnd: new FormControl(this.postEvent.EndDate, [
|
||||||
Validators.required
|
Validators.required
|
||||||
]),
|
]),
|
||||||
dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok']: this.postEvent.EventRecurrence.LastOccurrence && new Date(this.postEvent.EventRecurrence.LastOccurrence).getTime() > new Date(this.postEvent.EndDate).getTime() ? 'ok': null, [
|
dateOccurrence: new FormControl(this.postEvent.EventRecurrence.Type.toString() == '-1' ? ['ok'] : this.postEvent.EventRecurrence.LastOccurrence && new Date(this.postEvent.EventRecurrence.LastOccurrence).getTime() > new Date(this.postEvent.EndDate).getTime() ? 'ok' : null, [
|
||||||
Validators.required
|
Validators.required
|
||||||
]),
|
]),
|
||||||
participantes: new FormControl(this.taskParticipants, [
|
participantes: new FormControl(this.taskParticipants, [
|
||||||
// Validators.required
|
// Validators.required
|
||||||
]),
|
]),
|
||||||
Date: new FormControl( new Date(this.postEvent.StartDate).getTime() < new Date(this.postEvent.EndDate).getTime() ? 'ok': null,[
|
Date: new FormControl(new Date(this.postEvent.StartDate).getTime() < new Date(this.postEvent.EndDate).getTime() ? 'ok' : null, [
|
||||||
Validators.required
|
Validators.required
|
||||||
]),
|
]),
|
||||||
})
|
})
|
||||||
@@ -336,15 +341,15 @@ export class NewEventPage implements OnInit {
|
|||||||
|
|
||||||
openInicio() {
|
openInicio() {
|
||||||
let input: any = document.querySelector('#new-inicio')
|
let input: any = document.querySelector('#new-inicio')
|
||||||
if(input) {
|
if (input) {
|
||||||
|
|
||||||
input.click()
|
input.click()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
openFim() {
|
openFim() {
|
||||||
let input: any = document.querySelector('#new-fim')
|
let input: any = document.querySelector('#new-fim')
|
||||||
if(input) {
|
if (input) {
|
||||||
input.click()
|
input.click()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -353,32 +358,36 @@ export class NewEventPage implements OnInit {
|
|||||||
|
|
||||||
this.CalendarNameShow = false
|
this.CalendarNameShow = false
|
||||||
|
|
||||||
setTimeout(()=>{
|
setTimeout(() => {
|
||||||
|
|
||||||
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']
|
||||||
|
console.log(this.postEvent.CalendarName)
|
||||||
|
|
||||||
} else if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial']) {
|
} else if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial']) {
|
||||||
this.CalendarNamesOptions = ['Oficial']
|
this.CalendarNamesOptions = ['Oficial']
|
||||||
this.postEvent.CalendarName = 'Oficial'
|
this.postEvent.CalendarName = 'Oficial'
|
||||||
|
console.log(this.postEvent.CalendarName)
|
||||||
|
|
||||||
} else if (this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) {
|
} else if (this.eventService.calendarNamesType[this.CalendarName]?.['Pessoal']) {
|
||||||
this.CalendarNamesOptions = ['Pessoal']
|
this.CalendarNamesOptions = ['Pessoal']
|
||||||
this.postEvent.CalendarName = 'Pessoal'
|
this.postEvent.CalendarName = 'Pessoal'
|
||||||
|
console.log(this.postEvent.CalendarName)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
this.CalendarNamesOptions = ['Oficial', 'Pessoal']
|
this.CalendarNamesOptions = ['Oficial', 'Pessoal']
|
||||||
|
console.log(this.postEvent.CalendarName)
|
||||||
}
|
}
|
||||||
}, 50)
|
}, 50)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
openLastOccurrence() {
|
openLastOccurrence() {
|
||||||
let input: any = document.querySelector('#last-occurrence')
|
let input: any = document.querySelector('#last-occurrence')
|
||||||
if(input) {
|
if (input) {
|
||||||
input.click()
|
input.click()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -395,7 +404,7 @@ export class NewEventPage implements OnInit {
|
|||||||
});
|
});
|
||||||
|
|
||||||
modal.onDidDismiss().then((res) => {
|
modal.onDidDismiss().then((res) => {
|
||||||
if(res){
|
if (res) {
|
||||||
const data = res.data;
|
const data = res.data;
|
||||||
this.documents.push(data.selected);
|
this.documents.push(data.selected);
|
||||||
}
|
}
|
||||||
@@ -411,45 +420,45 @@ export class NewEventPage implements OnInit {
|
|||||||
this.setIntervenient.emit([]);
|
this.setIntervenient.emit([]);
|
||||||
this.setIntervenientCC.emit([]);
|
this.setIntervenientCC.emit([]);
|
||||||
// chat exit
|
// chat exit
|
||||||
this.backToChat.emit({roomId:this.roomId})
|
this.backToChat.emit({ roomId: this.roomId })
|
||||||
// agenda exit
|
// agenda exit
|
||||||
this.cloneAllmobileComponent.emit({})
|
this.cloneAllmobileComponent.emit({})
|
||||||
}
|
}
|
||||||
|
|
||||||
getRecurrenceTypes() {
|
getRecurrenceTypes() {
|
||||||
this.eventService.getRecurrenceTypes().subscribe(res=>{
|
this.eventService.getRecurrenceTypes().subscribe(res => {
|
||||||
|
|
||||||
this.recurringTypes = res;
|
this.recurringTypes = res;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
onSelectedRecurringChanged(ev:any){
|
onSelectedRecurringChanged(ev: any) {
|
||||||
|
|
||||||
this.calculetedLastOccurrence(ev);
|
this.calculetedLastOccurrence(ev);
|
||||||
|
|
||||||
if(ev.length > 1){
|
if (ev.length > 1) {
|
||||||
|
|
||||||
this.postEvent.EventRecurrence.Type = ev.filter(data => data != '-1');
|
this.postEvent.EventRecurrence.Type = ev.filter(data => data != '-1');
|
||||||
}
|
}
|
||||||
if(ev.length == 0){
|
if (ev.length == 0) {
|
||||||
this.postEvent.EventRecurrence.Type = "-1";
|
this.postEvent.EventRecurrence.Type = "-1";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
calculetedLastOccurrence(type:number){
|
calculetedLastOccurrence(type: number) {
|
||||||
|
|
||||||
var valor;
|
var valor;
|
||||||
var opcao: boolean;
|
var opcao: boolean;
|
||||||
if (type == 0) {
|
if (type == 0) {
|
||||||
valor = 7;
|
valor = 7;
|
||||||
opcao = true;
|
opcao = true;
|
||||||
} else if(type == 1){
|
} else if (type == 1) {
|
||||||
valor = 30;
|
valor = 30;
|
||||||
opcao = true;
|
opcao = true;
|
||||||
} else if(type == 2){
|
} else if (type == 2) {
|
||||||
valor = 1;
|
valor = 1;
|
||||||
opcao = false;
|
opcao = false;
|
||||||
}else if(type == 3){
|
} else if (type == 3) {
|
||||||
valor = 5;
|
valor = 5;
|
||||||
opcao = false;
|
opcao = false;
|
||||||
}
|
}
|
||||||
@@ -457,22 +466,22 @@ export class NewEventPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
defineLastOccurrence(valor:number, opcao:boolean){
|
defineLastOccurrence(valor: number, opcao: boolean) {
|
||||||
var time = new Date(this.postEvent.EndDate);
|
var time = new Date(this.postEvent.EndDate);
|
||||||
if (opcao == true) {
|
if (opcao == true) {
|
||||||
time.setDate(time.getDate() + valor);
|
time.setDate(time.getDate() + valor);
|
||||||
this.postEvent.EventRecurrence.LastOccurrence = time;
|
this.postEvent.EventRecurrence.LastOccurrence = time;
|
||||||
} else {
|
} else {
|
||||||
time = new Date(
|
time = new Date(
|
||||||
time.getFullYear() + valor,
|
time.getFullYear() + valor,
|
||||||
time.getMonth(),
|
time.getMonth(),
|
||||||
time.getDate(),
|
time.getDate(),
|
||||||
time.getHours(),
|
time.getHours(),
|
||||||
time.getMinutes()
|
time.getMinutes()
|
||||||
);
|
);
|
||||||
this.postEvent.EventRecurrence.LastOccurrence = time;
|
this.postEvent.EventRecurrence.LastOccurrence = time;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async save() {
|
async save() {
|
||||||
@@ -480,30 +489,30 @@ export class NewEventPage implements OnInit {
|
|||||||
this.injectValidation()
|
this.injectValidation()
|
||||||
this.runValidation()
|
this.runValidation()
|
||||||
|
|
||||||
if(this.Form.invalid) {
|
if (this.Form.invalid) {
|
||||||
|
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
this.postEvent.Attendees = this.taskParticipants.concat(this.taskParticipantsCc);
|
||||||
|
|
||||||
|
|
||||||
if(this.documents.length >= 0) {
|
if (this.documents.length > 0) {
|
||||||
this.postEvent.HasAttachments = true;
|
this.postEvent.HasAttachments = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.postEvent.EventRecurrence.Type == undefined) {
|
if (this.postEvent.EventRecurrence.Type == undefined) {
|
||||||
this.postEvent.EventRecurrence.Type = '-1'
|
this.postEvent.EventRecurrence.Type = '-1'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(this.loggeduser.Profile == 'MDGPR') {
|
if (this.loggeduser.Profile == 'MDGPR') {
|
||||||
const CalendarId = this.selectedCalendarId()
|
const CalendarId = this.selectedCalendarId()
|
||||||
this.showLoader = true;
|
this.showLoader = true;
|
||||||
this.postEvent.CalendarId = CalendarId
|
this.postEvent.CalendarId = CalendarId
|
||||||
|
|
||||||
let loader = this.toastService.loading();
|
let loader = this.toastService.loading();
|
||||||
|
|
||||||
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
|
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
|
||||||
async (id) => {
|
async (id) => {
|
||||||
loader.remove()
|
loader.remove()
|
||||||
@@ -522,13 +531,13 @@ export class NewEventPage implements OnInit {
|
|||||||
};
|
};
|
||||||
});
|
});
|
||||||
await DocumentToSave.forEach((attachments, i) => {
|
await DocumentToSave.forEach((attachments, i) => {
|
||||||
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) =>{
|
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => {
|
||||||
if(DocumentToSave.length == (i+1)) {
|
if (DocumentToSave.length == (i + 1)) {
|
||||||
this.afterSave();
|
this.afterSave();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
if(DocumentToSave.length == 0) {
|
if (DocumentToSave.length == 0) {
|
||||||
this.afterSave();
|
this.afterSave();
|
||||||
}
|
}
|
||||||
this.hhtpErrorHandle.httpsSucessMessagge('new event')
|
this.hhtpErrorHandle.httpsSucessMessagge('new event')
|
||||||
@@ -541,30 +550,30 @@ export class NewEventPage implements OnInit {
|
|||||||
"calendarId": CalendarId
|
"calendarId": CalendarId
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.roomId) {
|
if (this.roomId) {
|
||||||
this.chatMethodService.sendMessage(this.roomId,data);
|
this.chatMethodService.sendMessage(this.roomId, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
error => {
|
error => {
|
||||||
loader.remove()
|
loader.remove()
|
||||||
this.showLoader = false
|
this.showLoader = false
|
||||||
this.hhtpErrorHandle.httpStatusHandle(error)
|
this.hhtpErrorHandle.httpStatusHandle(error)
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
else if(this.loggeduser.Profile == 'PR') {
|
else if (this.loggeduser.Profile == 'PR') {
|
||||||
|
|
||||||
const CalendarId = this.selectedCalendarId()
|
const CalendarId = this.selectedCalendarId()
|
||||||
let loader = this.toastService.loading();
|
let loader = this.toastService.loading();
|
||||||
this.postEvent.CalendarId = CalendarId
|
this.postEvent.CalendarId = CalendarId
|
||||||
|
|
||||||
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
|
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
|
||||||
(id) => {
|
(id) => {
|
||||||
|
|
||||||
loader.remove()
|
loader.remove()
|
||||||
|
|
||||||
const eventId: any = id;
|
const eventId: any = id;
|
||||||
|
|
||||||
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
||||||
return {
|
return {
|
||||||
@@ -580,14 +589,14 @@ export class NewEventPage implements OnInit {
|
|||||||
});
|
});
|
||||||
|
|
||||||
DocumentToSave.forEach((attachments, i) => {
|
DocumentToSave.forEach((attachments, i) => {
|
||||||
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) =>{
|
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => {
|
||||||
if(DocumentToSave.length == (i+1)){
|
if (DocumentToSave.length == (i + 1)) {
|
||||||
this.afterSave();
|
this.afterSave();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
if(DocumentToSave.length == 0){
|
if (DocumentToSave.length == 0) {
|
||||||
this.afterSave();
|
this.afterSave();
|
||||||
}
|
}
|
||||||
this.hhtpErrorHandle.httpsSucessMessagge('new event')
|
this.hhtpErrorHandle.httpsSucessMessagge('new event')
|
||||||
@@ -599,10 +608,10 @@ export class NewEventPage implements OnInit {
|
|||||||
"id": id,
|
"id": id,
|
||||||
"calendarId": CalendarId
|
"calendarId": CalendarId
|
||||||
}
|
}
|
||||||
if(this.roomId) {
|
if (this.roomId) {
|
||||||
this.chatMethodService.sendMessage(this.roomId,data);
|
this.chatMethodService.sendMessage(this.roomId, data);
|
||||||
}
|
}
|
||||||
},(error) => {
|
}, (error) => {
|
||||||
|
|
||||||
//const connectionToServer = this.ServerConnectionService.BaseAPI()
|
//const connectionToServer = this.ServerConnectionService.BaseAPI()
|
||||||
|
|
||||||
@@ -610,22 +619,201 @@ export class NewEventPage implements OnInit {
|
|||||||
|
|
||||||
loader.remove()
|
loader.remove()
|
||||||
this.showLoader = false
|
this.showLoader = false
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
} else if (this.loggeduser.Profile == 'SGGPR') {
|
||||||
|
|
||||||
|
console.log(this.postEventToAprove)
|
||||||
|
console.log(this.postEvent)
|
||||||
|
console.log(this.postEvent.CalendarName)
|
||||||
|
console.log(this.CalendarName)
|
||||||
|
console.log(this.eventService.calendarNamesAry)
|
||||||
|
const CalendarId = this.selectedCalendarId()
|
||||||
|
|
||||||
|
let selectedCalendar
|
||||||
|
try {
|
||||||
|
selectedCalendar = this.eventService.calendarNamesAry.find(calendar => calendar.Fullname === this.CalendarName)
|
||||||
|
} catch (error) {
|
||||||
|
|
||||||
|
}
|
||||||
|
console.log('selectedCalendar', selectedCalendar)
|
||||||
|
|
||||||
|
if (selectedCalendar) {
|
||||||
|
if (selectedCalendar.Role = 'Presidente da República') {
|
||||||
|
let loader = this.toastService.loading();
|
||||||
|
|
||||||
|
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
||||||
|
return {
|
||||||
|
SourceTitle: e.Assunto,
|
||||||
|
ParentId: "AGD_" + this.loggeduser.UserName + "_" + this.processeService.generateInstaceFormatDate(),
|
||||||
|
Source: '1',
|
||||||
|
SourceId: e.Id,
|
||||||
|
ApplicationId: e.ApplicationType.toString(),
|
||||||
|
Id: '',
|
||||||
|
Link: '',
|
||||||
|
SerialNumber: ''
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
let body = this.eventToaproveBody(this.postEvent, CalendarId, this.loggeduser.RoleID, this.loggeduser.UserId, DocumentToSave);
|
||||||
|
await this.processeService.createEventToAprove(this.postEvent.CalendarName, 'pr', body).subscribe((id) => {
|
||||||
|
loader.remove()
|
||||||
|
this.afterSave();
|
||||||
|
this.hhtpErrorHandle.httpsSucessMessagge('new event to aprove')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* DocumentToSave.forEach((attachments, i) => {
|
||||||
|
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => {
|
||||||
|
if (DocumentToSave.length == (i + 1)) {
|
||||||
|
this.afterSave();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
if (DocumentToSave.length == 0) {
|
||||||
|
this.afterSave();
|
||||||
|
} */
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
loader.remove()
|
||||||
|
this.showLoader = false
|
||||||
|
this.hhtpErrorHandle.httpStatusHandle(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
} else if (selectedCalendar.Role = 'Ministro e Director do Gabinete do PR') {
|
||||||
|
let loader = this.toastService.loading();
|
||||||
|
|
||||||
|
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
||||||
|
return {
|
||||||
|
SourceTitle: e.Assunto,
|
||||||
|
ParentId: "AGD_" + this.loggeduser.UserName + "_" + this.processeService.generateInstaceFormatDate(),
|
||||||
|
Source: '1',
|
||||||
|
SourceId: e.Id,
|
||||||
|
ApplicationId: e.ApplicationType.toString(),
|
||||||
|
Id: '',
|
||||||
|
Link: '',
|
||||||
|
SerialNumber: ''
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
|
let body = this.eventToaproveBody(this.postEvent, CalendarId, this.loggeduser.RoleID, this.loggeduser.UserId, DocumentToSave);
|
||||||
|
await this.processeService.createEventToAprove(this.postEvent.CalendarName, 'md', body).subscribe((id) => {
|
||||||
|
loader.remove()
|
||||||
|
this.afterSave();
|
||||||
|
this.hhtpErrorHandle.httpsSucessMessagge('new event to aprove')
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/* DocumentToSave.forEach((attachments, i) => {
|
||||||
|
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => {
|
||||||
|
if (DocumentToSave.length == (i + 1)) {
|
||||||
|
this.afterSave();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
if (DocumentToSave.length == 0) {
|
||||||
|
this.afterSave();
|
||||||
|
} */
|
||||||
|
|
||||||
|
}, (error) => {
|
||||||
|
loader.remove()
|
||||||
|
this.showLoader = false
|
||||||
|
this.hhtpErrorHandle.httpStatusHandle(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!selectedCalendar && this.CalendarName == "Meu calendario") {
|
||||||
|
console.log('SG generic')
|
||||||
|
this.postEvent.CalendarName
|
||||||
|
|
||||||
|
const CalendarId = this.selectedCalendarId()
|
||||||
|
let loader = this.toastService.loading();
|
||||||
|
|
||||||
|
this.postEvent.CalendarId = CalendarId
|
||||||
|
|
||||||
|
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
|
||||||
|
(id) => {
|
||||||
|
loader.remove();
|
||||||
|
|
||||||
|
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.hhtpErrorHandle.httpsSucessMessagge('new event')
|
||||||
|
let data = {
|
||||||
|
"subject": this.postEvent.Subject,
|
||||||
|
"start": this.postEvent.StartDate,
|
||||||
|
"end": this.postEvent.EndDate,
|
||||||
|
"venue": this.postEvent.Location,
|
||||||
|
"id": id,
|
||||||
|
"calendarId": CalendarId
|
||||||
|
}
|
||||||
|
if (this.roomId) {
|
||||||
|
this.chatMethodService.sendMessage(this.roomId, data);
|
||||||
|
}
|
||||||
|
}, (error) => {
|
||||||
|
|
||||||
|
loader.remove()
|
||||||
|
this.showLoader = false
|
||||||
|
this.hhtpErrorHandle.httpStatusHandle(error)
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
this.postEvent.CalendarName
|
this.postEvent.CalendarName
|
||||||
|
|
||||||
const CalendarId = this.selectedCalendarId()
|
const CalendarId = this.selectedCalendarId()
|
||||||
let loader = this.toastService.loading();
|
let loader = this.toastService.loading();
|
||||||
|
|
||||||
this.postEvent.CalendarId = CalendarId
|
this.postEvent.CalendarId = CalendarId
|
||||||
|
|
||||||
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
|
this.eventService.postEventGeneric(this.postEvent, this.postEvent.CalendarName, CalendarId).subscribe(
|
||||||
(id) => {
|
(id) => {
|
||||||
loader.remove();
|
loader.remove();
|
||||||
|
|
||||||
const eventId: any = id;
|
const eventId: any = id;
|
||||||
|
|
||||||
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
const DocumentToSave: EventAttachment[] = this.documents.map((e) => {
|
||||||
return {
|
return {
|
||||||
@@ -641,14 +829,14 @@ export class NewEventPage implements OnInit {
|
|||||||
});
|
});
|
||||||
|
|
||||||
DocumentToSave.forEach((attachments, i) => {
|
DocumentToSave.forEach((attachments, i) => {
|
||||||
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) =>{
|
this.attachmentsService.setEventAttachmentById(attachments).subscribe((res) => {
|
||||||
if(DocumentToSave.length == (i+1)){
|
if (DocumentToSave.length == (i + 1)) {
|
||||||
this.afterSave();
|
this.afterSave();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
if(DocumentToSave.length == 0){
|
if (DocumentToSave.length == 0) {
|
||||||
this.afterSave();
|
this.afterSave();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -661,20 +849,20 @@ export class NewEventPage implements OnInit {
|
|||||||
"id": id,
|
"id": id,
|
||||||
"calendarId": CalendarId
|
"calendarId": CalendarId
|
||||||
}
|
}
|
||||||
if(this.roomId) {
|
if (this.roomId) {
|
||||||
this.chatMethodService.sendMessage(this.roomId,data);
|
this.chatMethodService.sendMessage(this.roomId, data);
|
||||||
}
|
}
|
||||||
},(error)=>{
|
}, (error) => {
|
||||||
|
|
||||||
loader.remove()
|
loader.remove()
|
||||||
this.showLoader = false
|
this.showLoader = false
|
||||||
this.hhtpErrorHandle.httpStatusHandle(error)
|
this.hhtpErrorHandle.httpStatusHandle(error)
|
||||||
});
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
selectedCalendarId () {
|
selectedCalendarId() {
|
||||||
|
|
||||||
if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postEvent.CalendarName == 'Oficial') {
|
if (this.eventService.calendarNamesType[this.CalendarName]?.['Oficial'] && this.postEvent.CalendarName == 'Oficial') {
|
||||||
|
|
||||||
@@ -704,12 +892,12 @@ export class NewEventPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
removeAttachment(index: number) {
|
removeAttachment(index: number) {
|
||||||
this.documents = this.documents.filter( (e, i) => index != i);
|
this.documents = this.documents.filter((e, i) => index != i);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async addParticipants() {
|
async addParticipants() {
|
||||||
|
|
||||||
|
|
||||||
this.saveTemporaryData();
|
this.saveTemporaryData();
|
||||||
|
|
||||||
@@ -749,9 +937,9 @@ export class NewEventPage implements OnInit {
|
|||||||
*/
|
*/
|
||||||
restoreTemporaryData(): boolean {
|
restoreTemporaryData(): boolean {
|
||||||
|
|
||||||
const restoredData = window['temp.path:/home/agenda/new-event.component.ts']
|
const restoredData = window['temp.path:/home/agenda/new-event.component.ts']
|
||||||
|
|
||||||
if(JSON.stringify(restoredData) != "{}" && undefined != restoredData) {
|
if (JSON.stringify(restoredData) != "{}" && undefined != restoredData) {
|
||||||
this.postEvent = restoredData.postEvent
|
this.postEvent = restoredData.postEvent
|
||||||
this.eventBody = restoredData.eventBody
|
this.eventBody = restoredData.eventBody
|
||||||
this.segment = restoredData.segment
|
this.segment = restoredData.segment
|
||||||
@@ -763,7 +951,7 @@ export class NewEventPage implements OnInit {
|
|||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -771,5 +959,31 @@ export class NewEventPage implements OnInit {
|
|||||||
window['temp.path:/home/agenda/new-event.component.ts'] = {}
|
window['temp.path:/home/agenda/new-event.component.ts'] = {}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
eventToaproveBody(event, calendarId, role, userId, attachments) {
|
||||||
|
let toAproveObject = {
|
||||||
|
"EventProcess": {
|
||||||
|
"Body": event.Body,
|
||||||
|
"Location": event.Location,
|
||||||
|
"Subject": event.Subject,
|
||||||
|
"StartDate": event.StartDate,
|
||||||
|
"EndDate": event.EndDate,
|
||||||
|
"Status": "Active",
|
||||||
|
"IsAllDayEvent": event.IsRecurring,
|
||||||
|
"EventType": event.EventType,
|
||||||
|
"ParticipantsList": event.Attendees,
|
||||||
|
"EventRecurrence": event.EventRecurrence,
|
||||||
|
"HasAttachments": event.HasAttachments,
|
||||||
|
"CalendarId": calendarId,
|
||||||
|
"Role": role,
|
||||||
|
"wxUserID": userId,
|
||||||
|
"TimeZone": "W. Central Africa Standard Time"
|
||||||
|
},
|
||||||
|
"Attachments": attachments,
|
||||||
|
"InstanceID": "AGD_" + this.loggeduser.UserName + "_" + this.processeService.generateInstaceFormatDate()
|
||||||
|
}
|
||||||
|
|
||||||
|
return toAproveObject;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -907,13 +907,26 @@ export class GroupMessagesPage implements OnInit, OnChanges, AfterViewInit, OnDe
|
|||||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => {
|
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
})));
|
})));
|
||||||
const blob = this.fileService.base64toBlob(encodedData, file.type)
|
let blob;
|
||||||
|
let formData
|
||||||
|
let fileBase64
|
||||||
|
if (this.platform.is("tablet")) {
|
||||||
|
|
||||||
const fileBase64 = await this._getBase64(file)
|
blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||||
|
console.log('BLOB BLOB', blob)
|
||||||
|
|
||||||
const formData = new FormData();
|
formData = new FormData();
|
||||||
formData.append('blobFile', blob);
|
formData.append('blobFile', blob);
|
||||||
|
/* console.log('add file', fileBase64) */
|
||||||
|
|
||||||
|
} else {
|
||||||
|
blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||||
|
|
||||||
|
fileBase64 = await this._getBase64(file)
|
||||||
|
|
||||||
|
formData = new FormData();
|
||||||
|
formData.append('blobFile', blob);
|
||||||
|
}
|
||||||
|
|
||||||
this.ChatSystemService.getGroupRoom(roomId).send({
|
this.ChatSystemService.getGroupRoom(roomId).send({
|
||||||
file: {
|
file: {
|
||||||
|
|||||||
@@ -150,7 +150,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
}
|
}
|
||||||
|
|
||||||
async ChatMessageDebuggingPage() {
|
async ChatMessageDebuggingPage() {
|
||||||
|
|
||||||
const modal = await this.modalController.create({
|
const modal = await this.modalController.create({
|
||||||
component: ChatMessageDebuggingPage,
|
component: ChatMessageDebuggingPage,
|
||||||
cssClass: 'model profile-modal search-submodal',
|
cssClass: 'model profile-modal search-submodal',
|
||||||
@@ -612,25 +612,25 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
// convert base64 to raw binary data held in a string
|
// convert base64 to raw binary data held in a string
|
||||||
// doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
|
// doesn't handle URLEncoded DataURIs - see SO answer #6850276 for code that does this
|
||||||
var byteString = atob(dataURI.split(',')[1]);
|
var byteString = atob(dataURI.split(',')[1]);
|
||||||
|
|
||||||
// separate out the mime component
|
// separate out the mime component
|
||||||
var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]
|
var mimeString = dataURI.split(',')[0].split(':')[1].split(';')[0]
|
||||||
|
|
||||||
// write the bytes of the string to an ArrayBuffer
|
// write the bytes of the string to an ArrayBuffer
|
||||||
var ab = new ArrayBuffer(byteString.length);
|
var ab = new ArrayBuffer(byteString.length);
|
||||||
|
|
||||||
// create a view into the buffer
|
// create a view into the buffer
|
||||||
var ia = new Uint8Array(ab);
|
var ia = new Uint8Array(ab);
|
||||||
|
|
||||||
// set the bytes of the buffer to the correct values
|
// set the bytes of the buffer to the correct values
|
||||||
for (var i = 0; i < byteString.length; i++) {
|
for (var i = 0; i < byteString.length; i++) {
|
||||||
ia[i] = byteString.charCodeAt(i);
|
ia[i] = byteString.charCodeAt(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
// write the ArrayBuffer to a blob, and you're done
|
// write the ArrayBuffer to a blob, and you're done
|
||||||
var blob = new Blob([ab], {type: mimeString});
|
var blob = new Blob([ab], { type: mimeString });
|
||||||
return blob;
|
return blob;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async takePictureMobile() {
|
async takePictureMobile() {
|
||||||
@@ -645,7 +645,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
source: CameraSource.Camera
|
source: CameraSource.Camera
|
||||||
});
|
});
|
||||||
|
|
||||||
var base64 = 'data:image/jpeg;base64,' + file.base64String
|
var base64 = 'data:image/jpeg;base64,' + file.base64String
|
||||||
const compressedImage = await this.compressImageBase64(
|
const compressedImage = await this.compressImageBase64(
|
||||||
base64,
|
base64,
|
||||||
800, // maxWidth
|
800, // maxWidth
|
||||||
@@ -785,7 +785,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
//const imageData = await this.fileToBase64Service.convert(file)
|
//const imageData = await this.fileToBase64Service.convert(file)
|
||||||
//
|
//
|
||||||
|
|
||||||
var base64 = 'data:image/jpeg;base64,' + file.base64String
|
var base64 = 'data:image/jpeg;base64,' + file.base64String
|
||||||
const compressedImage = await this.compressImageBase64(
|
const compressedImage = await this.compressImageBase64(
|
||||||
base64,
|
base64,
|
||||||
800, // maxWidth
|
800, // maxWidth
|
||||||
@@ -795,7 +795,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
console.log('Selected: ', picture)
|
console.log('Selected: ', picture)
|
||||||
base64 = picture
|
base64 = picture
|
||||||
});
|
});
|
||||||
|
|
||||||
const response = await fetch(base64);
|
const response = await fetch(base64);
|
||||||
const blob = await response.blob();
|
const blob = await response.blob();
|
||||||
|
|
||||||
@@ -827,23 +827,42 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
|
|
||||||
async addFileToChat(types: typeof FileType[]) {
|
async addFileToChat(types: typeof FileType[]) {
|
||||||
|
|
||||||
|
|
||||||
const roomId = this.roomId
|
const roomId = this.roomId
|
||||||
|
|
||||||
const file: any = await this.fileService.getFileFromDevice(types);
|
const file: any = await this.fileService.getFileFromDevice(types);
|
||||||
|
console.log(file.type)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
|
if (file.type != "application/img" && file.type != "image/png" && file.type != "image/jpeg" && file.type != "image/gif") {
|
||||||
|
|
||||||
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch ((error) => {
|
const encodedData = btoa(JSON.stringify(await this.getBase64(file).catch((error) => {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
})));
|
})));
|
||||||
const blob = this.fileService.base64toBlob(encodedData, file.type)
|
|
||||||
|
|
||||||
const fileBase64 = await this._getBase64(file)
|
let blob;
|
||||||
|
let formData
|
||||||
|
let fileBase64
|
||||||
|
if (this.platform.is("tablet")) {
|
||||||
|
|
||||||
|
blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||||
|
console.log('BLOB BLOB', blob)
|
||||||
|
|
||||||
|
formData = new FormData();
|
||||||
|
formData.append('blobFile', blob);
|
||||||
|
/* console.log('add file', fileBase64) */
|
||||||
|
|
||||||
|
} else {
|
||||||
|
blob = this.fileService.base64toBlob(encodedData, file.type)
|
||||||
|
|
||||||
|
fileBase64 = await this._getBase64(file)
|
||||||
|
|
||||||
|
formData = new FormData();
|
||||||
|
formData.append('blobFile', blob);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const formData = new FormData();
|
|
||||||
formData.append('blobFile', blob);
|
|
||||||
|
|
||||||
|
|
||||||
this.ChatSystemService.getDmRoom(roomId).send({
|
this.ChatSystemService.getDmRoom(roomId).send({
|
||||||
@@ -872,7 +891,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
}
|
}
|
||||||
|
|
||||||
_getBase64(file) {
|
_getBase64(file) {
|
||||||
return new Promise((resolve, reject)=>{
|
return new Promise((resolve, reject) => {
|
||||||
var reader = new FileReader();
|
var reader = new FileReader();
|
||||||
reader.readAsDataURL(file);
|
reader.readAsDataURL(file);
|
||||||
reader.onload = function () {
|
reader.onload = function () {
|
||||||
@@ -882,7 +901,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
console.log('Error: ', error);
|
console.log('Error: ', error);
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
getFileReader(): FileReader {
|
getFileReader(): FileReader {
|
||||||
const fileReader = new FileReader();
|
const fileReader = new FileReader();
|
||||||
const zoneOriginalInstance = (fileReader as any)["__zone_symbol__originalInstance"];
|
const zoneOriginalInstance = (fileReader as any)["__zone_symbol__originalInstance"];
|
||||||
@@ -991,7 +1010,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
|
|
||||||
});
|
});
|
||||||
await modal.present();
|
await modal.present();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -1094,7 +1113,7 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
this.downloadFileMsg(msg)
|
this.downloadFileMsg(msg)
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
var str = msg.attachments[0].image_url
|
var str = msg.attachments[0].image_url
|
||||||
str = str.substring(1, ((str.length) - 1));
|
str = str.substring(1, ((str.length) - 1));
|
||||||
|
|
||||||
@@ -1176,14 +1195,14 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
if (this.room.name) {
|
if (this.room.name) {
|
||||||
try {
|
try {
|
||||||
this.roomName = this.room.name.split('-').join(' ');
|
this.roomName = this.room.name.split('-').join(' ');
|
||||||
} catch(error) {
|
} catch (error) {
|
||||||
this.roomName = this.room.name;
|
this.roomName = this.room.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
if(SessionStore.user.ChatData.data.userId == this.room.u._id){
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (SessionStore.user.ChatData.data.userId == this.room.u._id) {
|
||||||
this.isAdmin = true
|
this.isAdmin = true
|
||||||
} else {
|
} else {
|
||||||
this.isAdmin = false
|
this.isAdmin = false
|
||||||
@@ -1199,32 +1218,32 @@ export class MessagesPage implements OnInit, OnChanges, AfterViewInit, OnDestroy
|
|||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const image = new (window as any).Image();
|
const image = new (window as any).Image();
|
||||||
image.src = base64String;
|
image.src = base64String;
|
||||||
|
|
||||||
image.onload = async () => {
|
image.onload = async () => {
|
||||||
const canvas = document.createElement('canvas');
|
const canvas = document.createElement('canvas');
|
||||||
let newWidth = image.width;
|
let newWidth = image.width;
|
||||||
let newHeight = image.height;
|
let newHeight = image.height;
|
||||||
|
|
||||||
if (newWidth > maxWidth) {
|
if (newWidth > maxWidth) {
|
||||||
newHeight *= maxWidth / newWidth;
|
newHeight *= maxWidth / newWidth;
|
||||||
newWidth = maxWidth;
|
newWidth = maxWidth;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (newHeight > maxHeight) {
|
if (newHeight > maxHeight) {
|
||||||
newWidth *= maxHeight / newHeight;
|
newWidth *= maxHeight / newHeight;
|
||||||
newHeight = maxHeight;
|
newHeight = maxHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
canvas.width = newWidth;
|
canvas.width = newWidth;
|
||||||
canvas.height = newHeight;
|
canvas.height = newHeight;
|
||||||
|
|
||||||
const context = canvas.getContext('2d');
|
const context = canvas.getContext('2d');
|
||||||
context?.drawImage(image, 0, 0, newWidth, newHeight);
|
context?.drawImage(image, 0, 0, newWidth, newHeight);
|
||||||
|
|
||||||
const compressedBase64 = canvas.toDataURL('image/jpeg', quality);
|
const compressedBase64 = canvas.toDataURL('image/jpeg', quality);
|
||||||
resolve(compressedBase64);
|
resolve(compressedBase64);
|
||||||
};
|
};
|
||||||
|
|
||||||
image.onerror = (error) => {
|
image.onerror = (error) => {
|
||||||
reject(error);
|
reject(error);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -226,7 +226,7 @@
|
|||||||
|
|
||||||
|
|
||||||
<div *ngIf="profilePicture != ''" class="profile-image">
|
<div *ngIf="profilePicture != ''" class="profile-image">
|
||||||
<img class="profile-image" src={{profilePicture}}>
|
<img class="profile-image font-45-em" src={{profilePicture}}>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="profile-text">
|
<div class="profile-text">
|
||||||
|
|||||||
@@ -1,22 +1,22 @@
|
|||||||
@import '~src/function.scss';
|
@import "~src/function.scss";
|
||||||
|
|
||||||
.div-top-header{
|
.div-top-header {
|
||||||
margin: 0 em(20);
|
margin: 0 em(20);
|
||||||
// background-color: #0782c9;
|
// background-color: #0782c9;
|
||||||
//padding-top: em(15px);
|
//padding-top: em(15px);
|
||||||
border: 0!important;
|
border: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.profile-image {
|
||||||
|
vertical-align: middle;
|
||||||
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
border-radius: 50%;
|
||||||
|
display: block; /* Torna a imagem um elemento de bloco */
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.div-logo {
|
||||||
.profile-image {
|
|
||||||
border-radius: 80%; /* Tornar a imagem circular */
|
|
||||||
width: 100%;
|
|
||||||
height: 25.33%;
|
|
||||||
overflow: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.div-logo{
|
|
||||||
background: transparent;
|
background: transparent;
|
||||||
width: em(140);
|
width: em(140);
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
@@ -34,17 +34,17 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.logo-description{
|
.logo-description {
|
||||||
width: 74.67%;
|
width: 74.67%;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
font-size: 8.5px;
|
font-size: 8.5px;
|
||||||
font-family: Bahnschrift;
|
font-family: Bahnschrift;
|
||||||
|
|
||||||
.logo-description-content{
|
.logo-description-content {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
.logo-description-text{
|
.logo-description-text {
|
||||||
font-weight: 700;
|
font-weight: 700;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
@@ -52,32 +52,31 @@
|
|||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.add-line{
|
.add-line {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-bottom: 1px solid #000;
|
border-bottom: 1px solid #000;
|
||||||
margin-bottom: 2.5px !important;
|
margin-bottom: 2.5px !important;
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.add-line-white{
|
.add-line-white {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-bottom: 1px solid #fff;
|
border-bottom: 1px solid #fff;
|
||||||
margin-bottom: 2.5px !important;
|
margin-bottom: 2.5px !important;
|
||||||
padding: 0 !important;
|
padding: 0 !important;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.color-white{
|
.color-white {
|
||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
.add-botton-border{
|
.add-botton-border {
|
||||||
border-bottom: 1px solid #000;
|
border-bottom: 1px solid #000;
|
||||||
}
|
}
|
||||||
|
|
||||||
.add-botton-border-white{
|
.add-botton-border-white {
|
||||||
border-bottom: 1px solid #fff;
|
border-bottom: 1px solid #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -87,15 +86,15 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.div-profile {
|
.div-profile {
|
||||||
height: fit-content;
|
width: 40px;
|
||||||
|
height: 40px;
|
||||||
|
text-align: center;
|
||||||
background-color: transparent;
|
background-color: transparent;
|
||||||
overflow: auto;
|
|
||||||
display: flex !important;
|
display: flex !important;
|
||||||
justify-content: end;
|
justify-content:space-around;
|
||||||
max-width: 45px;
|
|
||||||
border-radius: 50px;
|
border-radius: 50px;
|
||||||
|
|
||||||
.icon{
|
.icon {
|
||||||
position: relative;
|
position: relative;
|
||||||
border: none !important;
|
border: none !important;
|
||||||
}
|
}
|
||||||
@@ -105,15 +104,15 @@
|
|||||||
font-size: rem(12);
|
font-size: rem(12);
|
||||||
color: white;
|
color: white;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
width:20px;
|
width: 20px;
|
||||||
height:20px;
|
height: 20px;
|
||||||
border-radius: 35%;
|
border-radius: 35%;
|
||||||
position: absolute; /* changed */
|
position: absolute; /* changed */
|
||||||
top: 5px; /* changed */
|
top: 5px; /* changed */
|
||||||
right: 27px; /* changed */
|
right: 27px; /* changed */
|
||||||
}
|
}
|
||||||
|
|
||||||
.profile-text{
|
.profile-text {
|
||||||
font-size: rem(20);
|
font-size: rem(20);
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
@@ -125,43 +124,40 @@
|
|||||||
//border: 1px solid red;
|
//border: 1px solid red;
|
||||||
}
|
}
|
||||||
|
|
||||||
.desktop {
|
.desktop {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media only screen and (min-width: 1366px) {
|
@media only screen and (min-width: 1366px) {
|
||||||
|
.mobile {
|
||||||
.mobile{
|
|
||||||
display: none !important;
|
display: none !important;
|
||||||
}
|
}
|
||||||
.desktop{
|
.desktop {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab{
|
.tab {
|
||||||
height: 65px;
|
height: 65px;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
user-select: none;
|
user-select: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.tab:hover{
|
.tab:hover {
|
||||||
border-top: 7px solid var(--header-tab-text-white);
|
border-top: 7px solid var(--header-tab-text-white);
|
||||||
}
|
}
|
||||||
.active{
|
.active {
|
||||||
border-top: 7px solid var(--header-tab-text-white);
|
border-top: 7px solid var(--header-tab-text-white);
|
||||||
span{
|
span {
|
||||||
font-weight: 650;
|
font-weight: 650;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.search-input-container {
|
||||||
.search-input-container{
|
|
||||||
background-color: white;
|
background-color: white;
|
||||||
border-radius: 27.5px;
|
border-radius: 27.5px;
|
||||||
border: solid 1px #ebebeb;
|
border: solid 1px #ebebeb;
|
||||||
.icon{
|
.icon {
|
||||||
color: #797979;
|
color: #797979;
|
||||||
width: rem(45);
|
width: rem(45);
|
||||||
height: rem(45);
|
height: rem(45);
|
||||||
@@ -170,15 +166,14 @@
|
|||||||
font-size: rem(25);
|
font-size: rem(25);
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
.input-text{
|
.input-text {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
.icon-z{
|
.icon-z {
|
||||||
width: 20px;
|
width: 20px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
.tab {
|
.tab {
|
||||||
color: var(--header-tab-text-white);
|
color: var(--header-tab-text-white);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
<div class="buttons width-100">
|
<div class="buttons width-100">
|
||||||
<button (click)="openAddNoteModal('Arquivo')" class="btn-cancel" shape="round" >Arquivar</button>
|
<button (click)="openAddNoteModal('Arquivo')" class="btn-cancel" shape="round" >Arquivar</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="buttons width-100" *ngIf="task.activityInstanceName != 'Revisar Diploma'">
|
<div class="buttons width-100" *ngIf="task.activityInstanceName != 'Assinar Diploma'">
|
||||||
<button (click)="openExpedientActionsModal('0',task)" class="btn-cancel" shape="round" >Efetuar despacho</button>
|
<button (click)="openExpedientActionsModal('0',task)" class="btn-cancel" shape="round" >Efetuar despacho</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ export class DiplomaOptionsPage implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
|
console.log(this.task.activityInstanceName)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
export let versionData = {
|
export let versionData = {
|
||||||
"shortSHA": "90e01839b",
|
"shortSHA": "9de301944",
|
||||||
"SHA": "90e01839b7f38ed5a568a0e24fa0970836a1ce2b",
|
"SHA": "9de30194464b9511a9aa14a85b5b60894aeb860b",
|
||||||
"branch": "developer-prod",
|
"branch": "developer-prod",
|
||||||
"lastCommitAuthor": "'Eudes Inácio'",
|
"lastCommitAuthor": "'Eudes Inácio'",
|
||||||
"lastCommitTime": "'Thu Aug 31 16:39:13 2023 +0100'",
|
"lastCommitTime": "'Thu Aug 31 17:35:39 2023 +0100'",
|
||||||
"lastCommitMessage": "time picker of create secret grupo remove 0 minutes",
|
"lastCommitMessage": "new erro hendle",
|
||||||
"lastCommitNumber": "5255",
|
"lastCommitNumber": "5256",
|
||||||
"change": "",
|
"change": "",
|
||||||
"changeStatus": "On branch developer-prod\nYour branch is ahead of 'origin/developer-prod' by 1 commit.\n (use \"git push\" to publish your local commits)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/services/http-error-handle.service.ts",
|
"changeStatus": "On branch developer-prod\nYour branch is ahead of 'origin/developer-prod' by 2 commits.\n (use \"git push\" to publish your local commits)\n\nChanges to be committed:\n (use \"git restore --staged <file>...\" to unstage)\n\tmodified: src/app/Rules/despacho.service.ts\n\tmodified: src/app/modals/create-process/create-process.page.html\n\tmodified: src/app/modals/create-process/create-process.page.ts\n\tnew file: src/app/models/eventToAprove.model.ts\n\tmodified: src/app/models/user.model.ts\n\tmodified: src/app/pages/agenda/edit-event/edit-event.page.ts\n\tmodified: src/app/pages/agenda/new-event/new-event.page.ts\n\tmodified: src/app/pages/events/events.page.html\n\tmodified: src/app/pages/gabinete-digital/diplomas-assinar/diploma-assinar/diploma-assinar.page.html\n\tmodified: src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.html\n\tmodified: src/app/pages/gabinete-digital/event-list/approve-event-modal/approve-event-modal.page.ts\n\tmodified: src/app/pages/gabinete-digital/expediente/expediente-detail/expediente-detail.page.ts\n\tmodified: src/app/services/auth.service.ts\n\tmodified: src/app/services/http-error-handle.service.ts\n\tmodified: src/app/services/processes.service.ts\n\tmodified: src/app/shared/agenda/approve-event/approve-event.page.ts\n\tmodified: src/app/shared/agenda/edit-event/edit-event.page.ts\n\tmodified: src/app/shared/agenda/new-event/new-event.page.ts\n\tmodified: src/app/shared/chat/group-messages/group-messages.page.ts\n\tmodified: src/app/shared/chat/messages/messages.page.ts\n\tmodified: src/app/shared/header/header.page.html\n\tmodified: src/app/shared/header/header.page.scss\n\tmodified: src/app/shared/popover/deploma-options/deploma-options.page.html\n\tmodified: src/app/shared/popover/deploma-options/deploma-options.page.ts",
|
||||||
"changeAuthor": "eudes.inacio"
|
"changeAuthor": "eudes.inacio"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user