Commit 5fff1548 authored by ari_darmawan's avatar ari_darmawan

add email logs

parent c5e730fc
...@@ -271,7 +271,8 @@ ...@@ -271,7 +271,8 @@
Resolved By : Resolved By :
<b>{{ResolveByName}}</b> <b>{{ResolveByName}}</b>
</span><br> </span><br>
<span class="mt-2" *ngIf="TransactionDate != ''">Transaction Date <b>{{TransactionDate}}</b></span> <span class="mt-2" *ngIf="TransactionDate != ''">Transaction Date <b>{{TransactionDate | date: 'dd MMMM yyyy'}}, </b></span>
<span class="mt-2" *ngIf="ttrDeadline != ''">Deadline <b>{{ttrDeadline | date: 'dd MMMM yyyy HH:mm'}}</b></span>
</p> </p>
<div class="row"> <div class="row">
...@@ -486,20 +487,22 @@ ...@@ -486,20 +487,22 @@
<div class="card-body" style="max-height: 610px;overflow-y: scroll;"> <div class="card-body" style="max-height: 610px;overflow-y: scroll;">
<p *ngIf="EmailLogsData.length == 0" class="text-center"><b>No E-mail Log</b></p> <p *ngIf="EmailLogsData.length == 0" class="text-center"><b>No E-mail Log</b></p>
<ng-container *ngFor="let data of EmailLogsData; let i = index"> <ng-container *ngFor="let data of EmailLogsData; let i = index">
<div class="divider-custom" (click)="EmailLogDetailClick(data.id)"> <div class="divider-custom">
<div class="row"> <div class="row">
<div class="col-12 col-sm-6 col-md-2 col-lg-2"> <div class="col-12 col-sm-6 col-md-2 col-lg-2">
<p class="text-muted"> <p class="text-muted">
<span><small>{{data.datetime | date: 'dd MMMM yyyy HH:mm'}} </small></span> <span><small>{{data.date | date: 'dd MMMM yyyy HH:mm'}} </small></span>
</p><br> </p><br>
</div> </div>
<div class="col-12 col-sm-6 col-md-8 col-lg-8"> <div class="col-12 col-sm-6 col-md-10 col-lg-10">
<p>{{data.subject}}</p>
<p class="m-1" style="font-size: 11px;"><b>To :</b>&nbsp; <span class="text-muted">{{data.to}}</span></p> <p class="m-1" style="font-size: 11px;"><b>To :</b>&nbsp; <span class="text-muted">{{data.to}}</span></p>
<p class="m-1" style="font-size: 11px;" *ngIf="data.cc != null"><b>CC :</b>&nbsp; <span class="text-muted">{{data.cc}}</span></p> <p class="m-1" style="font-size: 11px;"><b>CC :</b>&nbsp; <span class="text-muted">{{data.cc}}</span></p>
<p class="m-1" style="font-size: 11px;" *ngIf="data.bcc != null"><b>BCC :</b>&nbsp; <span class="text-muted">{{data.bcc}}</span></p> <p class="m-1" style="font-size: 11px;"><b>Subject :</b>&nbsp; <span class="text-muted" [innerHTML]="data.subject | safeHtml"></span></p>
<p class="m-1" style="font-size: 11px;"><b>Body :</b>&nbsp;
<a class='badge badge-pill' style="background-color: orange;" data-toggle="modal" data-target="#detail-body" (click)="detailBodyEmail = data">Detail Body</a>
</p>
<!-- <p>{{data.attachments}}</p> --> <!-- <p>{{data.attachments}}</p> -->
<ng-container *ngFor="let dataJ of data.attachments; let j = index"> <!-- <ng-container *ngFor="let dataJ of data.attachments; let j = index">
<span class="fileEmailLogs"> <span class="fileEmailLogs">
<ng-container *ngIf="dataJ.extension == 'pdf'"><i class="far fa-file-pdf"></i>&nbsp;</ng-container> <ng-container *ngIf="dataJ.extension == 'pdf'"><i class="far fa-file-pdf"></i>&nbsp;</ng-container>
<ng-container *ngIf="dataJ.extension == 'doc' || dataJ.extension == 'docx'"><i class="far fa-file-word"></i>&nbsp;</ng-container> <ng-container *ngIf="dataJ.extension == 'doc' || dataJ.extension == 'docx'"><i class="far fa-file-word"></i>&nbsp;</ng-container>
...@@ -507,12 +510,12 @@ ...@@ -507,12 +510,12 @@
<ng-container *ngIf="dataJ.extension == 'jpg' || dataJ.extension == 'png' || dataJ.extension == 'jpeg'"><i class="far fa-images"></i>&nbsp;</ng-container> <ng-container *ngIf="dataJ.extension == 'jpg' || dataJ.extension == 'png' || dataJ.extension == 'jpeg'"><i class="far fa-images"></i>&nbsp;</ng-container>
{{dataJ.fileFullName}} {{dataJ.fileFullName}}
</span> </span>
</ng-container> </ng-container> -->
</div> </div>
<div class="col-12 col-sm-12 col-md-2 col-lg-2"> <!-- <div class="col-12 col-sm-12 col-md-2 col-lg-2">
<span style="font-size: 10px;text-align: center;" class="badge badge-pill badge-success" *ngIf="data.status == 1">Sent Success</span> <span style="font-size: 10px;text-align: center;" class="badge badge-pill badge-success" *ngIf="data.status == 1">Sent Success</span>
<span style="font-size: 10px;text-align: center;" class="badge badge-pill badge-danger" *ngIf="data.status == 0">Sent Failed</span> <span style="font-size: 10px;text-align: center;" class="badge badge-pill badge-danger" *ngIf="data.status == 0">Sent Failed</span>
</div> </div> -->
</div> </div>
</div> </div>
<hr> <hr>
...@@ -686,6 +689,38 @@ ...@@ -686,6 +689,38 @@
</div> </div>
</div> </div>
<div class="modal fade" id="EmailLOgsDetail-MD" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-header">
<p class="modal-title">
<b>Body Detail</b>
</p>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
</div>
</div>
</div>
</div>
<div class="modal fade" id="detail-body" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document">
<div class="modal-content">
<div class="modal-body">
<div [innerHTML]="detailBodyEmail.body | safeHtml"></div>
<div class="form-group" style="float: right;">
<button type="button" data-dismiss="modal" aria-label="Close" class="btn btn-danger" style="width: 150px;">
Close
</button>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="EmailLOgsDetail-MD" tabindex="-1" role="dialog" aria-hidden="true"> <div class="modal fade" id="EmailLOgsDetail-MD" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-lg" role="document"> <div class="modal-dialog modal-lg" role="document">
<div class="modal-content"> <div class="modal-content">
......
...@@ -124,6 +124,7 @@ export class AdminTicketDetailComponent implements OnInit { ...@@ -124,6 +124,7 @@ export class AdminTicketDetailComponent implements OnInit {
public TransactionDate : string = "" public TransactionDate : string = ""
public ResolutionDate : string = "" public ResolutionDate : string = ""
public LastUpdate : string = "" public LastUpdate : string = ""
public ttrDeadline: string = ""
public PublicReplyEditor : string = "" public PublicReplyEditor : string = ""
...@@ -222,6 +223,8 @@ export class AdminTicketDetailComponent implements OnInit { ...@@ -222,6 +223,8 @@ export class AdminTicketDetailComponent implements OnInit {
public ServiceDeskLogsID = null public ServiceDeskLogsID = null
detailBodyEmail: any = {};
constructor(injector: Injector, constructor(injector: Injector,
private router: Router, private router: Router,
private route: ActivatedRoute, private route: ActivatedRoute,
...@@ -834,6 +837,7 @@ export class AdminTicketDetailComponent implements OnInit { ...@@ -834,6 +837,7 @@ export class AdminTicketDetailComponent implements OnInit {
this.ResolutionDate = data.fields.resolution_date this.ResolutionDate = data.fields.resolution_date
this.LastUpdate = data.fields.last_update this.LastUpdate = data.fields.last_update
this.ttrDeadline = data.fields.ttr_escalation_deadline
//if on PIC //if on PIC
//ServiceDeskLogsID must be null first at get detail ticket //ServiceDeskLogsID must be null first at get detail ticket
...@@ -1756,6 +1760,7 @@ export class AdminTicketDetailComponent implements OnInit { ...@@ -1756,6 +1760,7 @@ export class AdminTicketDetailComponent implements OnInit {
this.EmailLogsData = [] this.EmailLogsData = []
this._TicketService.EmailLogs(_Request) this._TicketService.EmailLogs(_Request)
.subscribe((result: any) => { .subscribe((result: any) => {
console.log(result)
if(result != null){ if(result != null){
//console.log("Email Logs", JSON.stringify(result)) //console.log("Email Logs", JSON.stringify(result))
this.EmailLogsData = [] this.EmailLogsData = []
...@@ -1778,7 +1783,7 @@ export class AdminTicketDetailComponent implements OnInit { ...@@ -1778,7 +1783,7 @@ export class AdminTicketDetailComponent implements OnInit {
this.EmailLogsData.push({ this.EmailLogsData.push({
id : result.values[i].id, id : result.values[i].id,
ticket_id : result.values[i].ticket_id, ticket_id : result.values[i].ticket_id,
datetime : result.values[i].datetime, date : result.values[i].date,
from : result.values[i].from, from : result.values[i].from,
to : result.values[i].to, to : result.values[i].to,
cc : result.values[i].cc, cc : result.values[i].cc,
...@@ -1786,6 +1791,7 @@ export class AdminTicketDetailComponent implements OnInit { ...@@ -1786,6 +1791,7 @@ export class AdminTicketDetailComponent implements OnInit {
subject : result.values[i].subject, subject : result.values[i].subject,
attachments : objAttachment, attachments : objAttachment,
status : result.values[i].status, status : result.values[i].status,
body : result.values[i].body
}) })
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment