2021-10-08 19:29:21 +01:00
|
|
|
import { Component, OnInit } from '@angular/core';
|
2023-07-10 12:38:41 +01:00
|
|
|
import { ModalController, NavParams } from '@ionic/angular';
|
2022-03-28 15:46:07 +01:00
|
|
|
import { PermissionService } from 'src/app/services/permission.service';
|
2023-07-10 12:38:41 +01:00
|
|
|
import { ProcessesService} from 'src/app/services/processes.service';
|
|
|
|
|
import { HttpErrorHandle } from 'src/app/services/http-error-handle.service';
|
2021-10-08 19:29:21 +01:00
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
|
selector: 'app-event-details-documents-options',
|
|
|
|
|
templateUrl: './event-details-documents-options.page.html',
|
|
|
|
|
styleUrls: ['./event-details-documents-options.page.scss'],
|
|
|
|
|
})
|
|
|
|
|
export class EventDetailsDocumentsOptionsPage implements OnInit {
|
|
|
|
|
|
2023-07-10 12:38:41 +01:00
|
|
|
Document: any
|
|
|
|
|
content: any = "";
|
|
|
|
|
|
2021-10-08 19:29:21 +01:00
|
|
|
constructor(
|
|
|
|
|
public p: PermissionService,
|
|
|
|
|
private modalController: ModalController,
|
2023-07-10 12:38:41 +01:00
|
|
|
private navParams: NavParams,
|
|
|
|
|
private processService: ProcessesService,
|
|
|
|
|
private erroHandler: HttpErrorHandle
|
|
|
|
|
) {
|
|
|
|
|
this.Document = this.navParams.get('Document')
|
|
|
|
|
this.content = this.navParams.get('content')
|
|
|
|
|
}
|
2021-10-08 19:29:21 +01:00
|
|
|
|
2023-07-10 12:38:41 +01:00
|
|
|
ngOnInit() {
|
|
|
|
|
console.log(this.content)
|
|
|
|
|
}
|
2021-10-08 19:29:21 +01:00
|
|
|
|
|
|
|
|
close() {
|
|
|
|
|
this.modalController.dismiss();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
goBack() {
|
|
|
|
|
this.modalController.dismiss();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
async openBookMeetingModal() {
|
2023-07-10 12:38:41 +01:00
|
|
|
this.modalController.dismiss({ component: 'openBookMeetingModal', taskAction: '' });
|
2021-10-08 19:29:21 +01:00
|
|
|
}
|
|
|
|
|
|
2023-07-10 12:38:41 +01:00
|
|
|
async openExpedientActionsModal(taskAction: any) {
|
|
|
|
|
this.modalController.dismiss({ component: 'openExpedientActionsModal', taskAction });
|
2021-10-08 19:29:21 +01:00
|
|
|
}
|
|
|
|
|
|
2023-07-10 12:38:41 +01:00
|
|
|
async distartExpedientModal(body: any) { }
|
2021-10-08 19:29:21 +01:00
|
|
|
|
2023-07-10 12:38:41 +01:00
|
|
|
save(document,content) {
|
|
|
|
|
console.log(document)
|
|
|
|
|
let objectDraft = {
|
|
|
|
|
"status": true,
|
|
|
|
|
"description": document.Assunto,
|
|
|
|
|
"content": content,
|
|
|
|
|
"path": document.path,
|
|
|
|
|
"ownerId": document.ownerId
|
|
|
|
|
}
|
|
|
|
|
this.processService.SaveDraftByID(document.DocId, objectDraft).subscribe((res) => [
|
|
|
|
|
this.erroHandler.httpsSucessMessagge('Draft Save'),
|
|
|
|
|
this.modalController.dismiss()
|
|
|
|
|
],(error) => {
|
|
|
|
|
this.erroHandler.httpStatusHandle(error)
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
this.modalController.dismiss();
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
saveDraft(document, content) {
|
|
|
|
|
console.log(document)
|
|
|
|
|
let objectDraft = {
|
|
|
|
|
"status": false,
|
|
|
|
|
"description": document.Assunto,
|
|
|
|
|
"content": content,
|
|
|
|
|
"path": document.path,
|
|
|
|
|
"ownerId": document.ownerId
|
|
|
|
|
}
|
2023-07-21 12:58:40 +01:00
|
|
|
this.processService.SaveDraftByID(document.DocId, objectDraft).subscribe((res) => {
|
|
|
|
|
this.erroHandler.httpsSucessMessagge('Draft Save');
|
|
|
|
|
this.modalController.dismiss();
|
|
|
|
|
window['tinyupdate']()
|
|
|
|
|
},(error) => {
|
2023-07-10 12:38:41 +01:00
|
|
|
this.erroHandler.httpStatusHandle(error)
|
|
|
|
|
})
|
|
|
|
|
|
2021-10-08 19:29:21 +01:00
|
|
|
}
|
2023-07-10 12:38:41 +01:00
|
|
|
|
|
|
|
|
}
|