Commit 46c1d3fa3d3ae96cc34c2c1e450f29dfe0e3aeac

Authored by trainee
1 parent c117222c
Exists in master

style button

src/app/dashboard/dashboard.component.html
@@ -54,7 +54,7 @@ @@ -54,7 +54,7 @@
54 </div> 54 </div>
55 <br> 55 <br>
56 <br> 56 <br>
57 - <button type="button" class ="btn btn-default" *ngFor="let name of ButtonValue" (click)="getButton1(name.valueN)" style="margin-left: 5px; margin-top: 2px;">{{ name.name }}</button> 57 + <button type="button" class ="btn btn-circle button " *ngFor="let name of ButtonValue" (click)="getButton1(name.valueN)" style="margin-left: 5px; margin-top: 3px;">{{ name.name }}</button>
58 <hr> 58 <hr>
59 <br> 59 <br>
60 </div> 60 </div>
src/app/dashboard/dashboard.component.scss
@@ -60,4 +60,17 @@ btn.active { @@ -60,4 +60,17 @@ btn.active {
60 position: absolute; 60 position: absolute;
61 top: 4px; 61 top: 4px;
62 right: 0px; 62 right: 0px;
63 -}  
64 \ No newline at end of file 63 \ No newline at end of file
  64 +}
  65 +.btn:focus {
  66 + color: white;
  67 + background: #32c5d2;
  68 + border-color: #32c5d2;
  69 +}
  70 +
  71 +.button {
  72 + background-color: white;
  73 + border-color: #32c5d2;
  74 + color: #32c5d2;
  75 + display: inline-block;
  76 + cursor: pointer;
  77 +}
src/app/dashboard/dashboard.component.ts
@@ -11,30 +11,30 @@ import { async } from &#39;rxjs/internal/scheduler/async&#39;; @@ -11,30 +11,30 @@ import { async } from &#39;rxjs/internal/scheduler/async&#39;;
11 }) 11 })
12 export class DashboardComponent implements OnInit { 12 export class DashboardComponent implements OnInit {
13 13
14 - FilterSearch = '';  
15 - FilterSearchOnHold = '';  
16 - FilterSearchButton = ''; 14 + FilterSearch = '';
  15 + FilterSearchOnHold = '';
  16 + FilterSearchButton = '';
17 17
18 -  
19 18
20 19
21 -  
22 - getColorDay(days){ 20 +
  21 +
  22 + getColorDay(days) {
23 console.log(days) 23 console.log(days)
24 24
25 - if(days >= 0 && days <= 7){  
26 - return '#32c5d2';  
27 - }  
28 -  
29 - if (days >= 8 && days <= 15){  
30 - return '#f0c332';  
31 - } 25 + if (days >= 0 && days <= 7) {
  26 + return '#32c5d2';
  27 + }
32 28
33 - if (days >= 16){  
34 - return '#e7505a';  
35 - } 29 + if (days >= 8 && days <= 15) {
  30 + return '#f0c332';
36 } 31 }
37 - 32 +
  33 + if (days >= 16) {
  34 + return '#e7505a';
  35 + }
  36 + }
  37 +
38 constructor( 38 constructor(
39 private _apiService: ApiService, 39 private _apiService: ApiService,
40 private _common: CommonService, 40 private _common: CommonService,
@@ -43,31 +43,31 @@ export class DashboardComponent implements OnInit { @@ -43,31 +43,31 @@ export class DashboardComponent implements OnInit {
43 ) { } 43 ) { }
44 44
45 resultData: any; 45 resultData: any;
46 - resultNum:number = 0; 46 + resultNum: number = 0;
47 resultDataOnHold: any; 47 resultDataOnHold: any;
48 48
49 resultData2: any; 49 resultData2: any;
50 - resultNum2:number = 0; 50 + resultNum2: number = 0;
51 resultDataOnHold2: any; 51 resultDataOnHold2: any;
52 52
53 resultData3: any; 53 resultData3: any;
54 - resultNum3:number = 0; 54 + resultNum3: number = 0;
55 resultDataOnHold3: any; 55 resultDataOnHold3: any;
56 56
57 resultData4: any; 57 resultData4: any;
58 - resultNum4:number = 0; 58 + resultNum4: number = 0;
59 resultDataOnHold4: any; 59 resultDataOnHold4: any;
60 60
61 resultData5: any; 61 resultData5: any;
62 - resultNum5:number = 0; 62 + resultNum5: number = 0;
63 resultDataOnHold5: any; 63 resultDataOnHold5: any;
64 64
65 resultData6: any; 65 resultData6: any;
66 - resultNum6:number = 0; 66 + resultNum6: number = 0;
67 resultDataOnHold6: any; 67 resultDataOnHold6: any;
68 68
69 resultData7: any; 69 resultData7: any;
70 - resultNum7:number = 0; 70 + resultNum7: number = 0;
71 resultDataOnHold7: any; 71 resultDataOnHold7: any;
72 72
73 Show1: any = []; 73 Show1: any = [];
@@ -87,136 +87,136 @@ export class DashboardComponent implements OnInit { @@ -87,136 +87,136 @@ export class DashboardComponent implements OnInit {
87 87
88 ButtonValue = [ 88 ButtonValue = [
89 { 89 {
90 - name : 'acc',  
91 - valueN : 'acc' 90 + name: 'ACC',
  91 + valueN: 'acc'
92 }, 92 },
93 { 93 {
94 - name : 'ade',  
95 - valueN : 'ade' 94 + name: 'ADE',
  95 + valueN: 'ade'
96 }, 96 },
97 { 97 {
98 - name : 'adm',  
99 - valueN : 'adm' 98 + name: 'ADM',
  99 + valueN: 'adm'
100 }, 100 },
101 { 101 {
102 - name : 'apd',  
103 - valueN : 'apd' 102 + name: 'APD',
  103 + valueN: 'apd'
104 }, 104 },
105 { 105 {
106 - name : 'bnw',  
107 - valueN : 'bnw' 106 + name: 'BNW',
  107 + valueN: 'bnw'
108 }, 108 },
109 { 109 {
110 - name : 'crs',  
111 - valueN : 'crs' 110 + name: 'CRS',
  111 + valueN: 'crs'
112 }, 112 },
113 { 113 {
114 - name : 'cus',  
115 - valueN : 'cus' 114 + name: 'CUS',
  115 + valueN: 'cus'
116 }, 116 },
117 { 117 {
118 - name : 'dvr',  
119 - valueN : 'dvr' 118 + name: 'DVR',
  119 + valueN: 'dvr'
120 }, 120 },
121 { 121 {
122 - name : 'etc',  
123 - valueN : 'etc' 122 + name: 'ETC',
  123 + valueN: 'etc'
124 }, 124 },
125 { 125 {
126 - name : 'hwe',  
127 - valueN : 'hwe' 126 + name: 'HWE',
  127 + valueN: 'hwe'
128 }, 128 },
129 { 129 {
130 - name : 'its',  
131 - valueN : 'its' 130 + name: 'ITS',
  131 + valueN: 'its'
132 }, 132 },
133 { 133 {
134 - name : 'lws',  
135 - valueN : 'lws' 134 + name: 'LWS',
  135 + valueN: 'lws'
136 }, 136 },
137 { 137 {
138 - name : 'nds',  
139 - valueN : 'nds' 138 + name: 'NDS',
  139 + valueN: 'nds'
140 }, 140 },
141 { 141 {
142 - name : 'ned',  
143 - valueN : 'ned' 142 + name: 'NED',
  143 + valueN: 'ned'
144 }, 144 },
145 { 145 {
146 - name : 'nes',  
147 - valueN : 'nes' 146 + name: 'NES',
  147 + valueN: 'nes'
148 }, 148 },
149 { 149 {
150 - name : 'net',  
151 - valueN : 'net' 150 + name: 'NET',
  151 + valueN: 'net'
152 }, 152 },
153 { 153 {
154 - name : 'new',  
155 - valueN : 'new' 154 + name: 'NEW',
  155 + valueN: 'new'
156 }, 156 },
157 { 157 {
158 - name : 'osc',  
159 - valueN : 'osc' 158 + name: 'OSC',
  159 + valueN: 'osc'
160 }, 160 },
161 { 161 {
162 - name : 'pm',  
163 - valueN : 'pm' 162 + name: 'PM',
  163 + valueN: 'pm'
164 }, 164 },
165 { 165 {
166 - name : 'prs',  
167 - valueN : 'prs' 166 + name: 'PRS',
  167 + valueN: 'prs'
168 }, 168 },
169 { 169 {
170 - name : 'rnd',  
171 - valueN : 'rnd' 170 + name: 'RND',
  171 + valueN: 'rnd'
172 }, 172 },
173 { 173 {
174 - name : 'sde',  
175 - valueN : 'sde' 174 + name: 'SDE',
  175 + valueN: 'sde'
176 }, 176 },
177 { 177 {
178 - name : 'sdn',  
179 - valueN : 'sdn' 178 + name: 'SDN',
  179 + valueN: 'sdn'
180 }, 180 },
181 { 181 {
182 - name : 'set',  
183 - valueN : 'set' 182 + name: 'SET',
  183 + valueN: 'set'
184 }, 184 },
185 { 185 {
186 - name : 'sev',  
187 - valueN : 'sev' 186 + name: 'SEV',
  187 + valueN: 'sev'
188 }, 188 },
189 { 189 {
190 - name : 'sid',  
191 - valueN : 'sid' 190 + name: 'SID',
  191 + valueN: 'sid'
192 }, 192 },
193 { 193 {
194 - name : 'ssh',  
195 - valueN : 'ssh' 194 + name: 'SSH',
  195 + valueN: 'ssh'
196 }, 196 },
197 { 197 {
198 - name : 'suv',  
199 - valueN : 'suv' 198 + name: 'SUV',
  199 + valueN: 'suv'
200 }, 200 },
201 { 201 {
202 - name : 'sys',  
203 - valueN : 'sys' 202 + name: 'SYS',
  203 + valueN: 'sys'
204 }, 204 },
205 { 205 {
206 - name : 'tst',  
207 - valueN : 'tst' 206 + name: 'TST',
  207 + valueN: 'tst'
208 }, 208 },
209 { 209 {
210 - name : 'udi',  
211 - valueN : 'udi' 210 + name: 'UDI',
  211 + valueN: 'udi'
212 }, 212 },
213 { 213 {
214 - name : 'web',  
215 - valueN : 'web' 214 + name: 'WEB',
  215 + valueN: 'web'
216 }, 216 },
217 { 217 {
218 - name : 'Refresh',  
219 - valueN : '' 218 + name: 'All',
  219 + valueN: ''
220 }, 220 },
221 ]; 221 ];
222 222
@@ -242,7 +242,7 @@ export class DashboardComponent implements OnInit { @@ -242,7 +242,7 @@ export class DashboardComponent implements OnInit {
242 this.resultNum = this.resultData.length; 242 this.resultNum = this.resultData.length;
243 this.Show1.push(this.resultData[i]); 243 this.Show1.push(this.resultData[i]);
244 } 244 }
245 - 245 +
246 } else { 246 } else {
247 this.resultData = []; 247 this.resultData = [];
248 } 248 }
@@ -250,7 +250,7 @@ export class DashboardComponent implements OnInit { @@ -250,7 +250,7 @@ export class DashboardComponent implements OnInit {
250 console.log(error); 250 console.log(error);
251 } 251 }
252 252
253 - setInterval(async() => { 253 + setInterval(async () => {
254 await this.getData(); 254 await this.getData();
255 }, 600000); 255 }, 600000);
256 256
@@ -280,14 +280,14 @@ export class DashboardComponent implements OnInit { @@ -280,14 +280,14 @@ export class DashboardComponent implements OnInit {
280 console.log(error); 280 console.log(error);
281 } 281 }
282 282
283 - setInterval(async() => { 283 + setInterval(async () => {
284 await this.getDataOnHold(); 284 await this.getDataOnHold();
285 }, 600000); 285 }, 600000);
286 286
287 - 287 +
288 288
289 //----------------------------2------------------------ 289 //----------------------------2------------------------
290 - // Active 290 + // Active
291 try { 291 try {
292 const data2 = { 292 const data2 = {
293 // tslint:disable-next-line:max-line-length 293 // tslint:disable-next-line:max-line-length
@@ -313,7 +313,7 @@ export class DashboardComponent implements OnInit { @@ -313,7 +313,7 @@ export class DashboardComponent implements OnInit {
313 console.log(error); 313 console.log(error);
314 } 314 }
315 315
316 - setInterval(async() => { 316 + setInterval(async () => {
317 await this.getData2(); 317 await this.getData2();
318 }, 600000); 318 }, 600000);
319 319
@@ -343,71 +343,71 @@ export class DashboardComponent implements OnInit { @@ -343,71 +343,71 @@ export class DashboardComponent implements OnInit {
343 console.log(error); 343 console.log(error);
344 } 344 }
345 345
346 - setInterval(async() => { 346 + setInterval(async () => {
347 await this.getDataOnHold2(); 347 await this.getDataOnHold2();
348 348
349 }, 600000); 349 }, 600000);
350 //----------------------------3------------------------ 350 //----------------------------3------------------------
351 - // Active  
352 - try {  
353 - const data3 = {  
354 - // tslint:disable-next-line:max-line-length  
355 - "query": "SELECT vtiger_account.accountname AS custgroupName , vtiger_troubletickets.ticketid AS id , IF( vtiger_groups.groupname IS NOT NULL , vtiger_groups.groupname , vu.user_name) AS team , vtiger_troubletickets.title , vtiger_troubletickets. STATUS , vtiger_troubletickets.priority , CONCAT( 'http%3A%2F%2Fvtiger.sourcecode.co.th%2Findex.php%3Faction%3DDetailView%26module%3DHelpDesk%26parenttab%3DSupport%26record%3D' , vtiger_troubletickets.ticketid) AS link ,( SELECT CONCAT( xx.createdtime , ' : ' , xx.comments) FROM vtiger_ticketcomments xx WHERE xx.ticketid = vtiger_troubletickets.ticketid ORDER BY xx.createdtime DESC LIMIT 1) AS COMMENT , CASE vtiger_troubletickets. STATUS WHEN 'Closed' THEN( unix_timestamp(vtiger_crmentity.modifiedtime) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 ELSE( unix_timestamp(now()) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 END AS days , concat( vtiger_ticketcf.cf_568 , ' (' , vtiger_cf_568.day_amount , ')') AS type , IFNULL(( SELECT 'Wait for response by' FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , 'Created by') userType , IFNULL(( SELECT concat('' , assigned_by , '') FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , vtiger_users.user_name) username , vtiger_crmentity.description , vtiger_crmentity.createdtime , vtiger_crmentity.modifiedtime , vtiger_cf_568.cf_568id FROM vtiger_crmentity JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smcreatorid JOIN vtiger_troubletickets ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid JOIN vtiger_account ON vtiger_account.accountid = vtiger_troubletickets.parent_id JOIN vtiger_ticketcf ON vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid JOIN vtiger_cf_568 ON vtiger_cf_568.cf_568 = vtiger_ticketcf.cf_568 LEFT OUTER JOIN vtiger_groups ON vtiger_crmentity.smownerid = vtiger_groups.groupid LEFT OUTER JOIN vtiger_users vu ON vtiger_crmentity.smownerid = vu.id WHERE 1 AND vtiger_crmentity.setype = 'HelpDesk' AND vtiger_crmentity.deleted = 0 AND vtiger_ticketcf.cf_568 != '' AND vtiger_cf_568.cf_568id NOT IN(8 , 9 , 10) AND( LCASE(vtiger_cf_568.cf_568) IN ('SDE (Site Down บ่อย)','SDN (Site Down Reset แล้วใช้งานไม่ได้)') AND LCASE(vtiger_troubletickets. STATUS) not in('closed' , 'Wait For Customer')) GROUP BY vtiger_troubletickets.ticketid ORDER BY vtiger_crmentity.createdtime ASC LIMIT 0 , 100", 351 + // Active
  352 + try {
  353 + const data3 = {
  354 + // tslint:disable-next-line:max-line-length
  355 + "query": "SELECT vtiger_account.accountname AS custgroupName , vtiger_troubletickets.ticketid AS id , IF( vtiger_groups.groupname IS NOT NULL , vtiger_groups.groupname , vu.user_name) AS team , vtiger_troubletickets.title , vtiger_troubletickets. STATUS , vtiger_troubletickets.priority , CONCAT( 'http%3A%2F%2Fvtiger.sourcecode.co.th%2Findex.php%3Faction%3DDetailView%26module%3DHelpDesk%26parenttab%3DSupport%26record%3D' , vtiger_troubletickets.ticketid) AS link ,( SELECT CONCAT( xx.createdtime , ' : ' , xx.comments) FROM vtiger_ticketcomments xx WHERE xx.ticketid = vtiger_troubletickets.ticketid ORDER BY xx.createdtime DESC LIMIT 1) AS COMMENT , CASE vtiger_troubletickets. STATUS WHEN 'Closed' THEN( unix_timestamp(vtiger_crmentity.modifiedtime) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 ELSE( unix_timestamp(now()) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 END AS days , concat( vtiger_ticketcf.cf_568 , ' (' , vtiger_cf_568.day_amount , ')') AS type , IFNULL(( SELECT 'Wait for response by' FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , 'Created by') userType , IFNULL(( SELECT concat('' , assigned_by , '') FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , vtiger_users.user_name) username , vtiger_crmentity.description , vtiger_crmentity.createdtime , vtiger_crmentity.modifiedtime , vtiger_cf_568.cf_568id FROM vtiger_crmentity JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smcreatorid JOIN vtiger_troubletickets ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid JOIN vtiger_account ON vtiger_account.accountid = vtiger_troubletickets.parent_id JOIN vtiger_ticketcf ON vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid JOIN vtiger_cf_568 ON vtiger_cf_568.cf_568 = vtiger_ticketcf.cf_568 LEFT OUTER JOIN vtiger_groups ON vtiger_crmentity.smownerid = vtiger_groups.groupid LEFT OUTER JOIN vtiger_users vu ON vtiger_crmentity.smownerid = vu.id WHERE 1 AND vtiger_crmentity.setype = 'HelpDesk' AND vtiger_crmentity.deleted = 0 AND vtiger_ticketcf.cf_568 != '' AND vtiger_cf_568.cf_568id NOT IN(8 , 9 , 10) AND( LCASE(vtiger_cf_568.cf_568) IN ('SDE (Site Down บ่อย)','SDN (Site Down Reset แล้วใช้งานไม่ได้)') AND LCASE(vtiger_troubletickets. STATUS) not in('closed' , 'Wait For Customer')) GROUP BY vtiger_troubletickets.ticketid ORDER BY vtiger_crmentity.createdtime ASC LIMIT 0 , 100",
356 "params": ["vtiger_crmentity"] 356 "params": ["vtiger_crmentity"]
357 - };  
358 - let response = await this._apiService.post('dynamic', data3);  
359 - if (response !== null) {  
360 - this.resultData3 = response;  
361 - console.log(this.resultData3);  
362 - this.resultData3.link = decodeURIComponent(decodeURIComponent(this.resultData3.link));  
363 - console.log('link: ', this.resultData3.link);  
364 - // tslint:disable-next-line:forin  
365 - for (const i in this.resultData3) {  
366 - this.resultData3[i].link = this._common.decodeURI(this.resultData3[i].link);  
367 - this.resultData3[i].birth_date = this._common.convertDate(this.resultData3[i].birth_date);  
368 - this.resultNum3 = this.resultData3.length;  
369 - this.Show3.push(this.resultData3[i]);  
370 - }  
371 - } else {  
372 - this.resultData3 = []; 357 + };
  358 + let response = await this._apiService.post('dynamic', data3);
  359 + if (response !== null) {
  360 + this.resultData3 = response;
  361 + console.log(this.resultData3);
  362 + this.resultData3.link = decodeURIComponent(decodeURIComponent(this.resultData3.link));
  363 + console.log('link: ', this.resultData3.link);
  364 + // tslint:disable-next-line:forin
  365 + for (const i in this.resultData3) {
  366 + this.resultData3[i].link = this._common.decodeURI(this.resultData3[i].link);
  367 + this.resultData3[i].birth_date = this._common.convertDate(this.resultData3[i].birth_date);
  368 + this.resultNum3 = this.resultData3.length;
  369 + this.Show3.push(this.resultData3[i]);
373 } 370 }
374 - } catch (error) {  
375 - console.log(error); 371 + } else {
  372 + this.resultData3 = [];
376 } 373 }
377 -  
378 - setInterval(async() => {  
379 - await this.getData3();  
380 - }, 600000);  
381 -  
382 -  
383 - //OnHold  
384 - try {  
385 - const dataOnHold3 = {  
386 - // tslint:disable-next-line:max-line-length  
387 - "query": "SELECT vtiger_account.accountname AS custgroupName , vtiger_troubletickets.ticketid AS id , IF( vtiger_groups.groupname IS NOT NULL , vtiger_groups.groupname , vu.user_name) AS team , vtiger_troubletickets.title , vtiger_troubletickets. STATUS , vtiger_troubletickets.priority , CONCAT( 'http%3A%2F%2Fvtiger.sourcecode.co.th%2Findex.php%3Faction%3DDetailView%26module%3DHelpDesk%26parenttab%3DSupport%26record%3D' , vtiger_troubletickets.ticketid) AS link ,( SELECT CONCAT( xx.createdtime , ' : ' , xx.comments) FROM vtiger_ticketcomments xx WHERE xx.ticketid = vtiger_troubletickets.ticketid ORDER BY xx.createdtime DESC LIMIT 1) AS COMMENT , CASE vtiger_troubletickets. STATUS WHEN 'Closed' THEN( unix_timestamp(vtiger_crmentity.modifiedtime) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 ELSE( unix_timestamp(now()) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 END AS days , concat( vtiger_ticketcf.cf_568 , ' (' , vtiger_cf_568.day_amount , ')') AS type , IFNULL(( SELECT 'Wait for response by' FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , 'Created by') userType , IFNULL(( SELECT concat('' , assigned_by , '') FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , vtiger_users.user_name) username , vtiger_crmentity.description , vtiger_crmentity.createdtime , vtiger_crmentity.modifiedtime , vtiger_cf_568.cf_568id FROM vtiger_crmentity JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smcreatorid JOIN vtiger_troubletickets ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid JOIN vtiger_account ON vtiger_account.accountid = vtiger_troubletickets.parent_id JOIN vtiger_ticketcf ON vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid JOIN vtiger_cf_568 ON vtiger_cf_568.cf_568 = vtiger_ticketcf.cf_568 LEFT OUTER JOIN vtiger_groups ON vtiger_crmentity.smownerid = vtiger_groups.groupid LEFT OUTER JOIN vtiger_users vu ON vtiger_crmentity.smownerid = vu.id WHERE 1 AND vtiger_crmentity.setype = 'HelpDesk' AND vtiger_crmentity.deleted = 0 AND vtiger_ticketcf.cf_568 != '' AND vtiger_cf_568.cf_568id NOT IN(8 , 9 , 10) AND( LCASE(vtiger_cf_568.cf_568) IN ('SDE (Site Down บ่อย)','SDN (Site Down Reset แล้วใช้งานไม่ได้)') AND LCASE(vtiger_troubletickets. STATUS) IN('Wait For Customer')) GROUP BY vtiger_troubletickets.ticketid ORDER BY vtiger_crmentity.createdtime ASC LIMIT 0 , 100", 374 + } catch (error) {
  375 + console.log(error);
  376 + }
  377 +
  378 + setInterval(async () => {
  379 + await this.getData3();
  380 + }, 600000);
  381 +
  382 +
  383 + //OnHold
  384 + try {
  385 + const dataOnHold3 = {
  386 + // tslint:disable-next-line:max-line-length
  387 + "query": "SELECT vtiger_account.accountname AS custgroupName , vtiger_troubletickets.ticketid AS id , IF( vtiger_groups.groupname IS NOT NULL , vtiger_groups.groupname , vu.user_name) AS team , vtiger_troubletickets.title , vtiger_troubletickets. STATUS , vtiger_troubletickets.priority , CONCAT( 'http%3A%2F%2Fvtiger.sourcecode.co.th%2Findex.php%3Faction%3DDetailView%26module%3DHelpDesk%26parenttab%3DSupport%26record%3D' , vtiger_troubletickets.ticketid) AS link ,( SELECT CONCAT( xx.createdtime , ' : ' , xx.comments) FROM vtiger_ticketcomments xx WHERE xx.ticketid = vtiger_troubletickets.ticketid ORDER BY xx.createdtime DESC LIMIT 1) AS COMMENT , CASE vtiger_troubletickets. STATUS WHEN 'Closed' THEN( unix_timestamp(vtiger_crmentity.modifiedtime) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 ELSE( unix_timestamp(now()) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 END AS days , concat( vtiger_ticketcf.cf_568 , ' (' , vtiger_cf_568.day_amount , ')') AS type , IFNULL(( SELECT 'Wait for response by' FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , 'Created by') userType , IFNULL(( SELECT concat('' , assigned_by , '') FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , vtiger_users.user_name) username , vtiger_crmentity.description , vtiger_crmentity.createdtime , vtiger_crmentity.modifiedtime , vtiger_cf_568.cf_568id FROM vtiger_crmentity JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smcreatorid JOIN vtiger_troubletickets ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid JOIN vtiger_account ON vtiger_account.accountid = vtiger_troubletickets.parent_id JOIN vtiger_ticketcf ON vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid JOIN vtiger_cf_568 ON vtiger_cf_568.cf_568 = vtiger_ticketcf.cf_568 LEFT OUTER JOIN vtiger_groups ON vtiger_crmentity.smownerid = vtiger_groups.groupid LEFT OUTER JOIN vtiger_users vu ON vtiger_crmentity.smownerid = vu.id WHERE 1 AND vtiger_crmentity.setype = 'HelpDesk' AND vtiger_crmentity.deleted = 0 AND vtiger_ticketcf.cf_568 != '' AND vtiger_cf_568.cf_568id NOT IN(8 , 9 , 10) AND( LCASE(vtiger_cf_568.cf_568) IN ('SDE (Site Down บ่อย)','SDN (Site Down Reset แล้วใช้งานไม่ได้)') AND LCASE(vtiger_troubletickets. STATUS) IN('Wait For Customer')) GROUP BY vtiger_troubletickets.ticketid ORDER BY vtiger_crmentity.createdtime ASC LIMIT 0 , 100",
388 "params": ["vtiger_crmentity"] 388 "params": ["vtiger_crmentity"]
389 - };  
390 - let response = await this._apiService.post('dynamic', dataOnHold3);  
391 - if (response !== null) {  
392 - this.resultDataOnHold3 = response;  
393 - this.resultDataOnHold3.link = decodeURIComponent(decodeURIComponent(this.resultDataOnHold3.link));  
394 - console.log('link: ', this.resultDataOnHold3.link);  
395 - // tslint:disable-next-line:forin  
396 - for (const i in this.resultDataOnHold3) {  
397 - this.resultDataOnHold3[i].link = this._common.decodeURI(this.resultDataOnHold3[i].link);  
398 - this.resultDataOnHold3[i].birth_date = this._common.convertDate(this.resultDataOnHold3[i].birth_date);  
399 - this.Show3Onhold.push(this.resultDataOnHold3[i]);  
400 - }  
401 - } else {  
402 - this.resultDataOnHold3 = []; 389 + };
  390 + let response = await this._apiService.post('dynamic', dataOnHold3);
  391 + if (response !== null) {
  392 + this.resultDataOnHold3 = response;
  393 + this.resultDataOnHold3.link = decodeURIComponent(decodeURIComponent(this.resultDataOnHold3.link));
  394 + console.log('link: ', this.resultDataOnHold3.link);
  395 + // tslint:disable-next-line:forin
  396 + for (const i in this.resultDataOnHold3) {
  397 + this.resultDataOnHold3[i].link = this._common.decodeURI(this.resultDataOnHold3[i].link);
  398 + this.resultDataOnHold3[i].birth_date = this._common.convertDate(this.resultDataOnHold3[i].birth_date);
  399 + this.Show3Onhold.push(this.resultDataOnHold3[i]);
403 } 400 }
404 - } catch (error) {  
405 - console.log(error); 401 + } else {
  402 + this.resultDataOnHold3 = [];
406 } 403 }
407 -  
408 - setInterval(async() => {  
409 - await this.getDataOnHold3();  
410 - }, 600000); 404 + } catch (error) {
  405 + console.log(error);
  406 + }
  407 +
  408 + setInterval(async () => {
  409 + await this.getDataOnHold3();
  410 + }, 600000);
411 411
412 //----------------------------4------------------------ 412 //----------------------------4------------------------
413 try { 413 try {
@@ -435,7 +435,7 @@ export class DashboardComponent implements OnInit { @@ -435,7 +435,7 @@ export class DashboardComponent implements OnInit {
435 console.log(error); 435 console.log(error);
436 } 436 }
437 437
438 - setInterval(async() => { 438 + setInterval(async () => {
439 await this.getData4(); 439 await this.getData4();
440 }, 600000); 440 }, 600000);
441 441
@@ -465,7 +465,7 @@ export class DashboardComponent implements OnInit { @@ -465,7 +465,7 @@ export class DashboardComponent implements OnInit {
465 console.log(error); 465 console.log(error);
466 } 466 }
467 467
468 - setInterval(async() => { 468 + setInterval(async () => {
469 await this.getDataOnHold4(); 469 await this.getDataOnHold4();
470 470
471 }, 600000); 471 }, 600000);
@@ -495,7 +495,7 @@ export class DashboardComponent implements OnInit { @@ -495,7 +495,7 @@ export class DashboardComponent implements OnInit {
495 console.log(error); 495 console.log(error);
496 } 496 }
497 497
498 - setInterval(async() => { 498 + setInterval(async () => {
499 await this.getData5(); 499 await this.getData5();
500 }, 600000); 500 }, 600000);
501 501
@@ -525,7 +525,7 @@ export class DashboardComponent implements OnInit { @@ -525,7 +525,7 @@ export class DashboardComponent implements OnInit {
525 console.log(error); 525 console.log(error);
526 } 526 }
527 527
528 - setInterval(async() => { 528 + setInterval(async () => {
529 await this.getDataOnHold5(); 529 await this.getDataOnHold5();
530 }, 600000); 530 }, 600000);
531 //----------------------------6------------------------ 531 //----------------------------6------------------------
@@ -554,7 +554,7 @@ export class DashboardComponent implements OnInit { @@ -554,7 +554,7 @@ export class DashboardComponent implements OnInit {
554 console.log(error); 554 console.log(error);
555 } 555 }
556 556
557 - setInterval(async() => { 557 + setInterval(async () => {
558 await this.getData6(); 558 await this.getData6();
559 }, 600000); 559 }, 600000);
560 560
@@ -584,7 +584,7 @@ export class DashboardComponent implements OnInit { @@ -584,7 +584,7 @@ export class DashboardComponent implements OnInit {
584 console.log(error); 584 console.log(error);
585 } 585 }
586 586
587 - setInterval(async() => { 587 + setInterval(async () => {
588 await this.getDataOnHold6(); 588 await this.getDataOnHold6();
589 }, 600000); 589 }, 600000);
590 590
@@ -607,10 +607,10 @@ export class DashboardComponent implements OnInit { @@ -607,10 +607,10 @@ export class DashboardComponent implements OnInit {
607 this.resultNum7 = this.resultData7.length; 607 this.resultNum7 = this.resultData7.length;
608 this.Show7.push(this.resultData7[i]); 608 this.Show7.push(this.resultData7[i]);
609 } 609 }
610 - 610 +
611 // this.Show = Object.assign(this.resultData7); 611 // this.Show = Object.assign(this.resultData7);
612 - console.log('hi',this.Show7)  
613 - 612 + console.log('hi', this.Show7)
  613 +
614 } else { 614 } else {
615 this.resultData7 = []; 615 this.resultData7 = [];
616 } 616 }
@@ -618,7 +618,7 @@ export class DashboardComponent implements OnInit { @@ -618,7 +618,7 @@ export class DashboardComponent implements OnInit {
618 console.log(error); 618 console.log(error);
619 } 619 }
620 620
621 - setInterval(async() => { 621 + setInterval(async () => {
622 await this.getData7(); 622 await this.getData7();
623 }, 600000); 623 }, 600000);
624 624
@@ -648,12 +648,12 @@ export class DashboardComponent implements OnInit { @@ -648,12 +648,12 @@ export class DashboardComponent implements OnInit {
648 console.log(error); 648 console.log(error);
649 } 649 }
650 650
651 - setInterval(async() => { 651 + setInterval(async () => {
652 await this.getDataOnHold7(); 652 await this.getDataOnHold7();
653 }, 600000); 653 }, 600000);
654 } 654 }
655 655
656 - getButton1(valueN){ 656 + getButton1(valueN) {
657 console.log(valueN); 657 console.log(valueN);
658 658
659 if (this.Show1.length === 0) { 659 if (this.Show1.length === 0) {
@@ -662,11 +662,11 @@ export class DashboardComponent implements OnInit { @@ -662,11 +662,11 @@ export class DashboardComponent implements OnInit {
662 662
663 const resultArray = []; 663 const resultArray = [];
664 for (const item of this.Show1) { 664 for (const item of this.Show1) {
665 - console.log('item: ', item); 665 + console.log('item: ', item);
666 666
667 - var st = ''; 667 + var st = '';
668 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; 668 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ;
669 - if(item['type']){ 669 + if (item['type']) {
670 st = item['type'].toLowerCase(); 670 st = item['type'].toLowerCase();
671 } 671 }
672 672
@@ -675,13 +675,13 @@ export class DashboardComponent implements OnInit { @@ -675,13 +675,13 @@ export class DashboardComponent implements OnInit {
675 console.log(st); 675 console.log(st);
676 resultArray.push(item); 676 resultArray.push(item);
677 } 677 }
678 - 678 +
679 } 679 }
680 680
681 this.resultData = resultArray; 681 this.resultData = resultArray;
682 } 682 }
683 -/* buttondataOnhold1 */  
684 - getButton1Onhold(valueN){ 683 + /* buttondataOnhold1 */
  684 + getButton1Onhold(valueN) {
685 console.log(valueN); 685 console.log(valueN);
686 686
687 if (this.Show1Onhold.length === 0) { 687 if (this.Show1Onhold.length === 0) {
@@ -690,11 +690,11 @@ export class DashboardComponent implements OnInit { @@ -690,11 +690,11 @@ export class DashboardComponent implements OnInit {
690 690
691 const resultArray = []; 691 const resultArray = [];
692 for (const item of this.Show1Onhold) { 692 for (const item of this.Show1Onhold) {
693 - console.log('item: ', item); 693 + console.log('item: ', item);
694 694
695 - var st = ''; 695 + var st = '';
696 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; 696 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ;
697 - if(item['type']){ 697 + if (item['type']) {
698 st = item['type'].toLowerCase(); 698 st = item['type'].toLowerCase();
699 } 699 }
700 700
@@ -703,13 +703,13 @@ export class DashboardComponent implements OnInit { @@ -703,13 +703,13 @@ export class DashboardComponent implements OnInit {
703 console.log(st); 703 console.log(st);
704 resultArray.push(item); 704 resultArray.push(item);
705 } 705 }
706 - 706 +
707 } 707 }
708 708
709 this.resultDataOnHold = resultArray; 709 this.resultDataOnHold = resultArray;
710 } 710 }
711 711
712 - getButton2(valueN){ 712 + getButton2(valueN) {
713 console.log(valueN); 713 console.log(valueN);
714 714
715 if (this.Show2.length === 0) { 715 if (this.Show2.length === 0) {
@@ -718,11 +718,11 @@ export class DashboardComponent implements OnInit { @@ -718,11 +718,11 @@ export class DashboardComponent implements OnInit {
718 718
719 const resultArray = []; 719 const resultArray = [];
720 for (const item of this.Show2) { 720 for (const item of this.Show2) {
721 - console.log('item: ', item); 721 + console.log('item: ', item);
722 722
723 - var st = ''; 723 + var st = '';
724 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; 724 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ;
725 - if(item['type']){ 725 + if (item['type']) {
726 st = item['type'].toLowerCase(); 726 st = item['type'].toLowerCase();
727 } 727 }
728 728
@@ -731,14 +731,14 @@ export class DashboardComponent implements OnInit { @@ -731,14 +731,14 @@ export class DashboardComponent implements OnInit {
731 console.log(st); 731 console.log(st);
732 resultArray.push(item); 732 resultArray.push(item);
733 } 733 }
734 - 734 +
735 } 735 }
736 736
737 this.resultData2 = resultArray; 737 this.resultData2 = resultArray;
738 } 738 }
739 739
740 /* buttondataOnhold2 */ 740 /* buttondataOnhold2 */
741 - getButton2Onhold(valueN){ 741 + getButton2Onhold(valueN) {
742 console.log(valueN); 742 console.log(valueN);
743 743
744 if (this.Show2Onhold.length === 0) { 744 if (this.Show2Onhold.length === 0) {
@@ -747,11 +747,11 @@ export class DashboardComponent implements OnInit { @@ -747,11 +747,11 @@ export class DashboardComponent implements OnInit {
747 747
748 const resultArray = []; 748 const resultArray = [];
749 for (const item of this.Show2Onhold) { 749 for (const item of this.Show2Onhold) {
750 - console.log('item: ', item); 750 + console.log('item: ', item);
751 751
752 - var st = ''; 752 + var st = '';
753 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; 753 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ;
754 - if(item['type']){ 754 + if (item['type']) {
755 st = item['type'].toLowerCase(); 755 st = item['type'].toLowerCase();
756 } 756 }
757 757
@@ -760,13 +760,13 @@ export class DashboardComponent implements OnInit { @@ -760,13 +760,13 @@ export class DashboardComponent implements OnInit {
760 console.log(st); 760 console.log(st);
761 resultArray.push(item); 761 resultArray.push(item);
762 } 762 }
763 - 763 +
764 } 764 }
765 765
766 this.resultDataOnHold2 = resultArray; 766 this.resultDataOnHold2 = resultArray;
767 } 767 }
768 768
769 - getButton3(valueN){ 769 + getButton3(valueN) {
770 console.log(valueN); 770 console.log(valueN);
771 771
772 if (this.Show3.length === 0) { 772 if (this.Show3.length === 0) {
@@ -775,11 +775,11 @@ export class DashboardComponent implements OnInit { @@ -775,11 +775,11 @@ export class DashboardComponent implements OnInit {
775 775
776 const resultArray = []; 776 const resultArray = [];
777 for (const item of this.Show3) { 777 for (const item of this.Show3) {
778 - console.log('item: ', item); 778 + console.log('item: ', item);
779 779
780 - var st = ''; 780 + var st = '';
781 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; 781 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ;
782 - if(item['type']){ 782 + if (item['type']) {
783 st = item['type'].toLowerCase(); 783 st = item['type'].toLowerCase();
784 } 784 }
785 785
@@ -788,14 +788,14 @@ export class DashboardComponent implements OnInit { @@ -788,14 +788,14 @@ export class DashboardComponent implements OnInit {
788 console.log(st); 788 console.log(st);
789 resultArray.push(item); 789 resultArray.push(item);
790 } 790 }
791 - 791 +
792 } 792 }
793 793
794 this.resultData3 = resultArray; 794 this.resultData3 = resultArray;
795 } 795 }
796 796
797 /* buttondataOnhold3 */ 797 /* buttondataOnhold3 */
798 - getButton3Onhold(valueN){ 798 + getButton3Onhold(valueN) {
799 console.log(valueN); 799 console.log(valueN);
800 800
801 if (this.Show3Onhold.length === 0) { 801 if (this.Show3Onhold.length === 0) {
@@ -804,11 +804,11 @@ export class DashboardComponent implements OnInit { @@ -804,11 +804,11 @@ export class DashboardComponent implements OnInit {
804 804
805 const resultArray = []; 805 const resultArray = [];
806 for (const item of this.Show3Onhold) { 806 for (const item of this.Show3Onhold) {
807 - console.log('item: ', item); 807 + console.log('item: ', item);
808 808
809 - var st = ''; 809 + var st = '';
810 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; 810 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ;
811 - if(item['type']){ 811 + if (item['type']) {
812 st = item['type'].toLowerCase(); 812 st = item['type'].toLowerCase();
813 } 813 }
814 814
@@ -817,13 +817,13 @@ export class DashboardComponent implements OnInit { @@ -817,13 +817,13 @@ export class DashboardComponent implements OnInit {
817 console.log(st); 817 console.log(st);
818 resultArray.push(item); 818 resultArray.push(item);
819 } 819 }
820 - 820 +
821 } 821 }
822 822
823 this.resultDataOnHold3 = resultArray; 823 this.resultDataOnHold3 = resultArray;
824 } 824 }
825 825
826 - getButton4(valueN){ 826 + getButton4(valueN) {
827 console.log(valueN); 827 console.log(valueN);
828 828
829 if (this.Show4.length === 0) { 829 if (this.Show4.length === 0) {
@@ -832,11 +832,11 @@ export class DashboardComponent implements OnInit { @@ -832,11 +832,11 @@ export class DashboardComponent implements OnInit {
832 832
833 const resultArray = []; 833 const resultArray = [];
834 for (const item of this.Show4) { 834 for (const item of this.Show4) {
835 - console.log('item: ', item); 835 + console.log('item: ', item);
836 836
837 - var st = ''; 837 + var st = '';
838 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; 838 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ;
839 - if(item['type']){ 839 + if (item['type']) {
840 st = item['type'].toLowerCase(); 840 st = item['type'].toLowerCase();
841 } 841 }
842 842
@@ -845,14 +845,14 @@ export class DashboardComponent implements OnInit { @@ -845,14 +845,14 @@ export class DashboardComponent implements OnInit {
845 console.log(st); 845 console.log(st);
846 resultArray.push(item); 846 resultArray.push(item);
847 } 847 }
848 - 848 +
849 } 849 }
850 850
851 this.resultData4 = resultArray; 851 this.resultData4 = resultArray;
852 } 852 }
853 853
854 /* buttondataOnhold4 */ 854 /* buttondataOnhold4 */
855 - getButton4Onhold(valueN){ 855 + getButton4Onhold(valueN) {
856 console.log(valueN); 856 console.log(valueN);
857 857
858 if (this.Show4Onhold.length === 0) { 858 if (this.Show4Onhold.length === 0) {
@@ -861,11 +861,11 @@ export class DashboardComponent implements OnInit { @@ -861,11 +861,11 @@ export class DashboardComponent implements OnInit {
861 861
862 const resultArray = []; 862 const resultArray = [];
863 for (const item of this.Show4Onhold) { 863 for (const item of this.Show4Onhold) {
864 - console.log('item: ', item); 864 + console.log('item: ', item);
865 865
866 - var st = ''; 866 + var st = '';
867 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; 867 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ;
868 - if(item['type']){ 868 + if (item['type']) {
869 st = item['type'].toLowerCase(); 869 st = item['type'].toLowerCase();
870 } 870 }
871 871
@@ -874,13 +874,13 @@ export class DashboardComponent implements OnInit { @@ -874,13 +874,13 @@ export class DashboardComponent implements OnInit {
874 console.log(st); 874 console.log(st);
875 resultArray.push(item); 875 resultArray.push(item);
876 } 876 }
877 - 877 +
878 } 878 }
879 879
880 this.resultDataOnHold4 = resultArray; 880 this.resultDataOnHold4 = resultArray;
881 } 881 }
882 882
883 - getButton5(valueN){ 883 + getButton5(valueN) {
884 console.log(valueN); 884 console.log(valueN);
885 885
886 if (this.Show5.length === 0) { 886 if (this.Show5.length === 0) {
@@ -889,11 +889,11 @@ export class DashboardComponent implements OnInit { @@ -889,11 +889,11 @@ export class DashboardComponent implements OnInit {
889 889
890 const resultArray = []; 890 const resultArray = [];
891 for (const item of this.Show5) { 891 for (const item of this.Show5) {
892 - console.log('item: ', item); 892 + console.log('item: ', item);
893 893
894 - var st = ''; 894 + var st = '';
895 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; 895 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ;
896 - if(item['type']){ 896 + if (item['type']) {
897 st = item['type'].toLowerCase(); 897 st = item['type'].toLowerCase();
898 } 898 }
899 899
@@ -902,14 +902,14 @@ export class DashboardComponent implements OnInit { @@ -902,14 +902,14 @@ export class DashboardComponent implements OnInit {
902 console.log(st); 902 console.log(st);
903 resultArray.push(item); 903 resultArray.push(item);
904 } 904 }
905 - 905 +
906 } 906 }
907 907
908 this.resultData5 = resultArray; 908 this.resultData5 = resultArray;
909 } 909 }
910 910
911 /* buttondataOnhold1 */ 911 /* buttondataOnhold1 */
912 - getButton5Onhold(valueN){ 912 + getButton5Onhold(valueN) {
913 console.log(valueN); 913 console.log(valueN);
914 914
915 if (this.Show5Onhold.length === 0) { 915 if (this.Show5Onhold.length === 0) {
@@ -918,11 +918,11 @@ export class DashboardComponent implements OnInit { @@ -918,11 +918,11 @@ export class DashboardComponent implements OnInit {
918 918
919 const resultArray = []; 919 const resultArray = [];
920 for (const item of this.Show5Onhold) { 920 for (const item of this.Show5Onhold) {
921 - console.log('item: ', item); 921 + console.log('item: ', item);
922 922
923 - var st = ''; 923 + var st = '';
924 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; 924 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ;
925 - if(item['type']){ 925 + if (item['type']) {
926 st = item['type'].toLowerCase(); 926 st = item['type'].toLowerCase();
927 } 927 }
928 928
@@ -931,13 +931,13 @@ export class DashboardComponent implements OnInit { @@ -931,13 +931,13 @@ export class DashboardComponent implements OnInit {
931 console.log(st); 931 console.log(st);
932 resultArray.push(item); 932 resultArray.push(item);
933 } 933 }
934 - 934 +
935 } 935 }
936 936
937 this.resultDataOnHold5 = resultArray; 937 this.resultDataOnHold5 = resultArray;
938 } 938 }
939 939
940 - getButton6(valueN){ 940 + getButton6(valueN) {
941 console.log(valueN); 941 console.log(valueN);
942 942
943 if (this.Show6.length === 0) { 943 if (this.Show6.length === 0) {
@@ -946,11 +946,11 @@ export class DashboardComponent implements OnInit { @@ -946,11 +946,11 @@ export class DashboardComponent implements OnInit {
946 946
947 const resultArray = []; 947 const resultArray = [];
948 for (const item of this.Show6) { 948 for (const item of this.Show6) {
949 - console.log('item: ', item); 949 + console.log('item: ', item);
950 950
951 - var st = ''; 951 + var st = '';
952 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; 952 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ;
953 - if(item['type']){ 953 + if (item['type']) {
954 st = item['type'].toLowerCase(); 954 st = item['type'].toLowerCase();
955 } 955 }
956 956
@@ -959,14 +959,14 @@ export class DashboardComponent implements OnInit { @@ -959,14 +959,14 @@ export class DashboardComponent implements OnInit {
959 console.log(st); 959 console.log(st);
960 resultArray.push(item); 960 resultArray.push(item);
961 } 961 }
962 - 962 +
963 } 963 }
964 964
965 this.resultData6 = resultArray; 965 this.resultData6 = resultArray;
966 } 966 }
967 967
968 /* buttondataOnhold6 */ 968 /* buttondataOnhold6 */
969 - getButton6Onhold(valueN){ 969 + getButton6Onhold(valueN) {
970 console.log(valueN); 970 console.log(valueN);
971 971
972 if (this.Show6Onhold.length === 0) { 972 if (this.Show6Onhold.length === 0) {
@@ -975,11 +975,11 @@ export class DashboardComponent implements OnInit { @@ -975,11 +975,11 @@ export class DashboardComponent implements OnInit {
975 975
976 const resultArray = []; 976 const resultArray = [];
977 for (const item of this.Show6Onhold) { 977 for (const item of this.Show6Onhold) {
978 - console.log('item: ', item); 978 + console.log('item: ', item);
979 979
980 - var st = ''; 980 + var st = '';
981 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; 981 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ;
982 - if(item['type']){ 982 + if (item['type']) {
983 st = item['type'].toLowerCase(); 983 st = item['type'].toLowerCase();
984 } 984 }
985 985
@@ -988,13 +988,13 @@ export class DashboardComponent implements OnInit { @@ -988,13 +988,13 @@ export class DashboardComponent implements OnInit {
988 console.log(st); 988 console.log(st);
989 resultArray.push(item); 989 resultArray.push(item);
990 } 990 }
991 - 991 +
992 } 992 }
993 993
994 this.resultDataOnHold6 = resultArray; 994 this.resultDataOnHold6 = resultArray;
995 } 995 }
996 996
997 - getButton7(valueN){ 997 + getButton7(valueN) {
998 console.log(valueN); 998 console.log(valueN);
999 999
1000 if (this.Show7.length === 0) { 1000 if (this.Show7.length === 0) {
@@ -1003,11 +1003,11 @@ export class DashboardComponent implements OnInit { @@ -1003,11 +1003,11 @@ export class DashboardComponent implements OnInit {
1003 1003
1004 const resultArray = []; 1004 const resultArray = [];
1005 for (const item of this.Show7) { 1005 for (const item of this.Show7) {
1006 - console.log('item: ', item); 1006 + console.log('item: ', item);
1007 1007
1008 - var st = ''; 1008 + var st = '';
1009 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; 1009 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ;
1010 - if(item['type']){ 1010 + if (item['type']) {
1011 st = item['type'].toLowerCase(); 1011 st = item['type'].toLowerCase();
1012 } 1012 }
1013 1013
@@ -1016,14 +1016,14 @@ export class DashboardComponent implements OnInit { @@ -1016,14 +1016,14 @@ export class DashboardComponent implements OnInit {
1016 console.log(st); 1016 console.log(st);
1017 resultArray.push(item); 1017 resultArray.push(item);
1018 } 1018 }
1019 - 1019 +
1020 } 1020 }
1021 1021
1022 this.resultData7 = resultArray; 1022 this.resultData7 = resultArray;
1023 } 1023 }
1024 1024
1025 /* buttondataOnhold7 */ 1025 /* buttondataOnhold7 */
1026 - getButton7Onhold(valueN){ 1026 + getButton7Onhold(valueN) {
1027 console.log(valueN); 1027 console.log(valueN);
1028 1028
1029 if (this.Show7Onhold.length === 0) { 1029 if (this.Show7Onhold.length === 0) {
@@ -1032,11 +1032,11 @@ export class DashboardComponent implements OnInit { @@ -1032,11 +1032,11 @@ export class DashboardComponent implements OnInit {
1032 1032
1033 const resultArray = []; 1033 const resultArray = [];
1034 for (const item of this.Show7Onhold) { 1034 for (const item of this.Show7Onhold) {
1035 - console.log('item: ', item); 1035 + console.log('item: ', item);
1036 1036
1037 - var st = ''; 1037 + var st = '';
1038 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ; 1038 // st = item['team'].toLowerCase() + item['COMMENT'].toLowerCase() + item['custgroupName'].toLowerCase() + item['STATUS'].toLowerCase() ;
1039 - if(item['type']){ 1039 + if (item['type']) {
1040 st = item['type'].toLowerCase(); 1040 st = item['type'].toLowerCase();
1041 } 1041 }
1042 1042
@@ -1045,7 +1045,7 @@ export class DashboardComponent implements OnInit { @@ -1045,7 +1045,7 @@ export class DashboardComponent implements OnInit {
1045 console.log(st); 1045 console.log(st);
1046 resultArray.push(item); 1046 resultArray.push(item);
1047 } 1047 }
1048 - 1048 +
1049 } 1049 }
1050 1050
1051 this.resultDataOnHold7 = resultArray; 1051 this.resultDataOnHold7 = resultArray;
@@ -1054,7 +1054,7 @@ export class DashboardComponent implements OnInit { @@ -1054,7 +1054,7 @@ export class DashboardComponent implements OnInit {
1054 /////////////Get data come to use////////////////////// 1054 /////////////Get data come to use//////////////////////
1055 1055
1056 1056
1057 - //----------------------------1------------------------ 1057 + //----------------------------1------------------------
1058 // Active 1058 // Active
1059 async getData() { 1059 async getData() {
1060 try { 1060 try {
@@ -1081,7 +1081,7 @@ export class DashboardComponent implements OnInit { @@ -1081,7 +1081,7 @@ export class DashboardComponent implements OnInit {
1081 } 1081 }
1082 } 1082 }
1083 //On Hold 1083 //On Hold
1084 - async getDataOnHold() { 1084 + async getDataOnHold() {
1085 try { 1085 try {
1086 const dataOnHold = { 1086 const dataOnHold = {
1087 // tslint:disable-next-line:max-line-length 1087 // tslint:disable-next-line:max-line-length
@@ -1105,10 +1105,10 @@ export class DashboardComponent implements OnInit { @@ -1105,10 +1105,10 @@ export class DashboardComponent implements OnInit {
1105 console.log(error); 1105 console.log(error);
1106 } 1106 }
1107 } 1107 }
1108 - 1108 +
1109 //----------------------------2------------------------ 1109 //----------------------------2------------------------
1110 - // Active  
1111 - async getData2() { 1110 + // Active
  1111 + async getData2() {
1112 try { 1112 try {
1113 const data2 = { 1113 const data2 = {
1114 // tslint:disable-next-line:max-line-length 1114 // tslint:disable-next-line:max-line-length
@@ -1158,61 +1158,61 @@ export class DashboardComponent implements OnInit { @@ -1158,61 +1158,61 @@ export class DashboardComponent implements OnInit {
1158 } 1158 }
1159 } 1159 }
1160 //----------------------------3------------------------ 1160 //----------------------------3------------------------
1161 - // Active  
1162 - async getData3() {  
1163 - try {  
1164 - const data3 = {  
1165 - // tslint:disable-next-line:max-line-length  
1166 - "query": "SELECT vtiger_account.accountname AS custgroupName , vtiger_troubletickets.ticketid AS id , IF( vtiger_groups.groupname IS NOT NULL , vtiger_groups.groupname , vu.user_name) AS team , vtiger_troubletickets.title , vtiger_troubletickets. STATUS , vtiger_troubletickets.priority , CONCAT( 'http%3A%2F%2Fvtiger.sourcecode.co.th%2Findex.php%3Faction%3DDetailView%26module%3DHelpDesk%26parenttab%3DSupport%26record%3D' , vtiger_troubletickets.ticketid) AS link ,( SELECT CONCAT( xx.createdtime , ' : ' , xx.comments) FROM vtiger_ticketcomments xx WHERE xx.ticketid = vtiger_troubletickets.ticketid ORDER BY xx.createdtime DESC LIMIT 1) AS COMMENT , CASE vtiger_troubletickets. STATUS WHEN 'Closed' THEN( unix_timestamp(vtiger_crmentity.modifiedtime) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 ELSE( unix_timestamp(now()) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 END AS days , concat( vtiger_ticketcf.cf_568 , ' (' , vtiger_cf_568.day_amount , ')') AS type , IFNULL(( SELECT 'Wait for response by' FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , 'Created by') userType , IFNULL(( SELECT concat('' , assigned_by , '') FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , vtiger_users.user_name) username , vtiger_crmentity.description , vtiger_crmentity.createdtime , vtiger_crmentity.modifiedtime , vtiger_cf_568.cf_568id FROM vtiger_crmentity JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smcreatorid JOIN vtiger_troubletickets ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid JOIN vtiger_account ON vtiger_account.accountid = vtiger_troubletickets.parent_id JOIN vtiger_ticketcf ON vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid JOIN vtiger_cf_568 ON vtiger_cf_568.cf_568 = vtiger_ticketcf.cf_568 LEFT OUTER JOIN vtiger_groups ON vtiger_crmentity.smownerid = vtiger_groups.groupid LEFT OUTER JOIN vtiger_users vu ON vtiger_crmentity.smownerid = vu.id WHERE 1 AND vtiger_crmentity.setype = 'HelpDesk' AND vtiger_crmentity.deleted = 0 AND vtiger_ticketcf.cf_568 != '' AND vtiger_cf_568.cf_568id NOT IN(8 , 9 , 10) AND( LCASE(vtiger_cf_568.cf_568) IN ('SDE (Site Down บ่อย)','SDN (Site Down Reset แล้วใช้งานไม่ได้)') AND LCASE(vtiger_troubletickets. STATUS) not in('closed' , 'Wait For Customer')) GROUP BY vtiger_troubletickets.ticketid ORDER BY vtiger_crmentity.createdtime ASC LIMIT 0 , 100", 1161 + // Active
  1162 + async getData3() {
  1163 + try {
  1164 + const data3 = {
  1165 + // tslint:disable-next-line:max-line-length
  1166 + "query": "SELECT vtiger_account.accountname AS custgroupName , vtiger_troubletickets.ticketid AS id , IF( vtiger_groups.groupname IS NOT NULL , vtiger_groups.groupname , vu.user_name) AS team , vtiger_troubletickets.title , vtiger_troubletickets. STATUS , vtiger_troubletickets.priority , CONCAT( 'http%3A%2F%2Fvtiger.sourcecode.co.th%2Findex.php%3Faction%3DDetailView%26module%3DHelpDesk%26parenttab%3DSupport%26record%3D' , vtiger_troubletickets.ticketid) AS link ,( SELECT CONCAT( xx.createdtime , ' : ' , xx.comments) FROM vtiger_ticketcomments xx WHERE xx.ticketid = vtiger_troubletickets.ticketid ORDER BY xx.createdtime DESC LIMIT 1) AS COMMENT , CASE vtiger_troubletickets. STATUS WHEN 'Closed' THEN( unix_timestamp(vtiger_crmentity.modifiedtime) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 ELSE( unix_timestamp(now()) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 END AS days , concat( vtiger_ticketcf.cf_568 , ' (' , vtiger_cf_568.day_amount , ')') AS type , IFNULL(( SELECT 'Wait for response by' FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , 'Created by') userType , IFNULL(( SELECT concat('' , assigned_by , '') FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , vtiger_users.user_name) username , vtiger_crmentity.description , vtiger_crmentity.createdtime , vtiger_crmentity.modifiedtime , vtiger_cf_568.cf_568id FROM vtiger_crmentity JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smcreatorid JOIN vtiger_troubletickets ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid JOIN vtiger_account ON vtiger_account.accountid = vtiger_troubletickets.parent_id JOIN vtiger_ticketcf ON vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid JOIN vtiger_cf_568 ON vtiger_cf_568.cf_568 = vtiger_ticketcf.cf_568 LEFT OUTER JOIN vtiger_groups ON vtiger_crmentity.smownerid = vtiger_groups.groupid LEFT OUTER JOIN vtiger_users vu ON vtiger_crmentity.smownerid = vu.id WHERE 1 AND vtiger_crmentity.setype = 'HelpDesk' AND vtiger_crmentity.deleted = 0 AND vtiger_ticketcf.cf_568 != '' AND vtiger_cf_568.cf_568id NOT IN(8 , 9 , 10) AND( LCASE(vtiger_cf_568.cf_568) IN ('SDE (Site Down บ่อย)','SDN (Site Down Reset แล้วใช้งานไม่ได้)') AND LCASE(vtiger_troubletickets. STATUS) not in('closed' , 'Wait For Customer')) GROUP BY vtiger_troubletickets.ticketid ORDER BY vtiger_crmentity.createdtime ASC LIMIT 0 , 100",
1167 "params": ["vtiger_crmentity"] 1167 "params": ["vtiger_crmentity"]
1168 - };  
1169 - let response = await this._apiService.post('dynamic', data3);  
1170 - if (response !== null) {  
1171 - this.resultData3 = response;  
1172 - this.resultData3.link = decodeURIComponent(decodeURIComponent(this.resultData3.link));  
1173 - console.log('link: ', this.resultData3.link);  
1174 - // tslint:disable-next-line:forin  
1175 - for (const i in this.resultData3) {  
1176 - this.resultData3[i].link = this._common.decodeURI(this.resultData3[i].link);  
1177 - this.resultData3[i].birth_date = this._common.convertDate(this.resultData3[i].birth_date);  
1178 - }  
1179 - } else {  
1180 - this.resultData3 = []; 1168 + };
  1169 + let response = await this._apiService.post('dynamic', data3);
  1170 + if (response !== null) {
  1171 + this.resultData3 = response;
  1172 + this.resultData3.link = decodeURIComponent(decodeURIComponent(this.resultData3.link));
  1173 + console.log('link: ', this.resultData3.link);
  1174 + // tslint:disable-next-line:forin
  1175 + for (const i in this.resultData3) {
  1176 + this.resultData3[i].link = this._common.decodeURI(this.resultData3[i].link);
  1177 + this.resultData3[i].birth_date = this._common.convertDate(this.resultData3[i].birth_date);
1181 } 1178 }
1182 - } catch (error) {  
1183 - console.log(error); 1179 + } else {
  1180 + this.resultData3 = [];
1184 } 1181 }
  1182 + } catch (error) {
  1183 + console.log(error);
1185 } 1184 }
  1185 + }
1186 1186
1187 - //On Hold  
1188 - async getDataOnHold3() {  
1189 - try {  
1190 - const dataOnHold3 = {  
1191 - // tslint:disable-next-line:max-line-length  
1192 - "query": "SELECT vtiger_account.accountname AS custgroupName , vtiger_troubletickets.ticketid AS id , IF( vtiger_groups.groupname IS NOT NULL , vtiger_groups.groupname , vu.user_name) AS team , vtiger_troubletickets.title , vtiger_troubletickets. STATUS , vtiger_troubletickets.priority , CONCAT( 'http%3A%2F%2Fvtiger.sourcecode.co.th%2Findex.php%3Faction%3DDetailView%26module%3DHelpDesk%26parenttab%3DSupport%26record%3D' , vtiger_troubletickets.ticketid) AS link ,( SELECT CONCAT( xx.createdtime , ' : ' , xx.comments) FROM vtiger_ticketcomments xx WHERE xx.ticketid = vtiger_troubletickets.ticketid ORDER BY xx.createdtime DESC LIMIT 1) AS COMMENT , CASE vtiger_troubletickets. STATUS WHEN 'Closed' THEN( unix_timestamp(vtiger_crmentity.modifiedtime) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 ELSE( unix_timestamp(now()) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 END AS days , concat( vtiger_ticketcf.cf_568 , ' (' , vtiger_cf_568.day_amount , ')') AS type , IFNULL(( SELECT 'Wait for response by' FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , 'Created by') userType , IFNULL(( SELECT concat('' , assigned_by , '') FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , vtiger_users.user_name) username , vtiger_crmentity.description , vtiger_crmentity.createdtime , vtiger_crmentity.modifiedtime , vtiger_cf_568.cf_568id FROM vtiger_crmentity JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smcreatorid JOIN vtiger_troubletickets ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid JOIN vtiger_account ON vtiger_account.accountid = vtiger_troubletickets.parent_id JOIN vtiger_ticketcf ON vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid JOIN vtiger_cf_568 ON vtiger_cf_568.cf_568 = vtiger_ticketcf.cf_568 LEFT OUTER JOIN vtiger_groups ON vtiger_crmentity.smownerid = vtiger_groups.groupid LEFT OUTER JOIN vtiger_users vu ON vtiger_crmentity.smownerid = vu.id WHERE 1 AND vtiger_crmentity.setype = 'HelpDesk' AND vtiger_crmentity.deleted = 0 AND vtiger_ticketcf.cf_568 != '' AND vtiger_cf_568.cf_568id NOT IN(8 , 9 , 10) AND( LCASE(vtiger_cf_568.cf_568) IN ('SDE (Site Down บ่อย)','SDN (Site Down Reset แล้วใช้งานไม่ได้)') AND LCASE(vtiger_troubletickets. STATUS) IN('Wait For Customer')) GROUP BY vtiger_troubletickets.ticketid ORDER BY vtiger_crmentity.createdtime ASC LIMIT 0 , 100", 1187 + //On Hold
  1188 + async getDataOnHold3() {
  1189 + try {
  1190 + const dataOnHold3 = {
  1191 + // tslint:disable-next-line:max-line-length
  1192 + "query": "SELECT vtiger_account.accountname AS custgroupName , vtiger_troubletickets.ticketid AS id , IF( vtiger_groups.groupname IS NOT NULL , vtiger_groups.groupname , vu.user_name) AS team , vtiger_troubletickets.title , vtiger_troubletickets. STATUS , vtiger_troubletickets.priority , CONCAT( 'http%3A%2F%2Fvtiger.sourcecode.co.th%2Findex.php%3Faction%3DDetailView%26module%3DHelpDesk%26parenttab%3DSupport%26record%3D' , vtiger_troubletickets.ticketid) AS link ,( SELECT CONCAT( xx.createdtime , ' : ' , xx.comments) FROM vtiger_ticketcomments xx WHERE xx.ticketid = vtiger_troubletickets.ticketid ORDER BY xx.createdtime DESC LIMIT 1) AS COMMENT , CASE vtiger_troubletickets. STATUS WHEN 'Closed' THEN( unix_timestamp(vtiger_crmentity.modifiedtime) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 ELSE( unix_timestamp(now()) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 END AS days , concat( vtiger_ticketcf.cf_568 , ' (' , vtiger_cf_568.day_amount , ')') AS type , IFNULL(( SELECT 'Wait for response by' FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , 'Created by') userType , IFNULL(( SELECT concat('' , assigned_by , '') FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , vtiger_users.user_name) username , vtiger_crmentity.description , vtiger_crmentity.createdtime , vtiger_crmentity.modifiedtime , vtiger_cf_568.cf_568id FROM vtiger_crmentity JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smcreatorid JOIN vtiger_troubletickets ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid JOIN vtiger_account ON vtiger_account.accountid = vtiger_troubletickets.parent_id JOIN vtiger_ticketcf ON vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid JOIN vtiger_cf_568 ON vtiger_cf_568.cf_568 = vtiger_ticketcf.cf_568 LEFT OUTER JOIN vtiger_groups ON vtiger_crmentity.smownerid = vtiger_groups.groupid LEFT OUTER JOIN vtiger_users vu ON vtiger_crmentity.smownerid = vu.id WHERE 1 AND vtiger_crmentity.setype = 'HelpDesk' AND vtiger_crmentity.deleted = 0 AND vtiger_ticketcf.cf_568 != '' AND vtiger_cf_568.cf_568id NOT IN(8 , 9 , 10) AND( LCASE(vtiger_cf_568.cf_568) IN ('SDE (Site Down บ่อย)','SDN (Site Down Reset แล้วใช้งานไม่ได้)') AND LCASE(vtiger_troubletickets. STATUS) IN('Wait For Customer')) GROUP BY vtiger_troubletickets.ticketid ORDER BY vtiger_crmentity.createdtime ASC LIMIT 0 , 100",
1193 "params": ["vtiger_crmentity"] 1193 "params": ["vtiger_crmentity"]
1194 - };  
1195 - let response = await this._apiService.post('dynamic', dataOnHold3);  
1196 - if (response !== null) {  
1197 - this.resultDataOnHold3 = response;  
1198 - this.resultDataOnHold3.link = decodeURIComponent(decodeURIComponent(this.resultDataOnHold3.link));  
1199 - console.log('link: ', this.resultDataOnHold3.link);  
1200 - // tslint:disable-next-line:forin  
1201 - for (const i in this.resultDataOnHold) {  
1202 - this.resultDataOnHold3[i].link = this._common.decodeURI(this.resultDataOnHold3[i].link);  
1203 - this.resultDataOnHold3[i].birth_date = this._common.convertDate(this.resultDataOnHold3[i].birth_date);  
1204 - }  
1205 - } else {  
1206 - this.resultDataOnHold3 = []; 1194 + };
  1195 + let response = await this._apiService.post('dynamic', dataOnHold3);
  1196 + if (response !== null) {
  1197 + this.resultDataOnHold3 = response;
  1198 + this.resultDataOnHold3.link = decodeURIComponent(decodeURIComponent(this.resultDataOnHold3.link));
  1199 + console.log('link: ', this.resultDataOnHold3.link);
  1200 + // tslint:disable-next-line:forin
  1201 + for (const i in this.resultDataOnHold) {
  1202 + this.resultDataOnHold3[i].link = this._common.decodeURI(this.resultDataOnHold3[i].link);
  1203 + this.resultDataOnHold3[i].birth_date = this._common.convertDate(this.resultDataOnHold3[i].birth_date);
1207 } 1204 }
1208 - } catch (error) {  
1209 - console.log(error); 1205 + } else {
  1206 + this.resultDataOnHold3 = [];
1210 } 1207 }
  1208 + } catch (error) {
  1209 + console.log(error);
1211 } 1210 }
  1211 + }
1212 1212
1213 //----------------------------4------------------------ 1213 //----------------------------4------------------------
1214 - // Active  
1215 - async getData4() { 1214 + // Active
  1215 + async getData4() {
1216 try { 1216 try {
1217 const data4 = { 1217 const data4 = {
1218 // tslint:disable-next-line:max-line-length 1218 // tslint:disable-next-line:max-line-length
@@ -1262,8 +1262,8 @@ export class DashboardComponent implements OnInit { @@ -1262,8 +1262,8 @@ export class DashboardComponent implements OnInit {
1262 } 1262 }
1263 } 1263 }
1264 //----------------------------5------------------------ 1264 //----------------------------5------------------------
1265 - // Active  
1266 - async getData5() { 1265 + // Active
  1266 + async getData5() {
1267 try { 1267 try {
1268 const data5 = { 1268 const data5 = {
1269 // tslint:disable-next-line:max-line-length 1269 // tslint:disable-next-line:max-line-length
@@ -1312,110 +1312,110 @@ export class DashboardComponent implements OnInit { @@ -1312,110 +1312,110 @@ export class DashboardComponent implements OnInit {
1312 console.log(error); 1312 console.log(error);
1313 } 1313 }
1314 } 1314 }
1315 - 1315 +
1316 //----------------------------6------------------------ 1316 //----------------------------6------------------------
1317 - // Active  
1318 - async getData6() {  
1319 - try {  
1320 - const data6 = {  
1321 - // tslint:disable-next-line:max-line-length  
1322 - "query": "SELECT vtiger_account.accountname AS custgroupName , vtiger_troubletickets.ticketid AS id , IF( vtiger_groups.groupname IS NOT NULL , vtiger_groups.groupname , vu.user_name) AS team , vtiger_troubletickets.title , vtiger_troubletickets. STATUS , vtiger_troubletickets.priority , CONCAT( 'http%3A%2F%2Fvtiger.sourcecode.co.th%2Findex.php%3Faction%3DDetailView%26module%3DHelpDesk%26parenttab%3DSupport%26record%3D' , vtiger_troubletickets.ticketid) AS link ,( SELECT CONCAT( xx.createdtime , ' : ' , xx.comments) FROM vtiger_ticketcomments xx WHERE xx.ticketid = vtiger_troubletickets.ticketid ORDER BY xx.createdtime DESC LIMIT 1) AS COMMENT , CASE vtiger_troubletickets. STATUS WHEN 'Closed' THEN( unix_timestamp(vtiger_crmentity.modifiedtime) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 ELSE( unix_timestamp(now()) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 END AS days , concat( vtiger_ticketcf.cf_568 , ' (' , vtiger_cf_568.day_amount , ')') AS type , IFNULL(( SELECT 'Wait for response by' FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , 'Created by') userType , IFNULL(( SELECT concat('' , assigned_by , '') FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , vtiger_users.user_name) username , vtiger_crmentity.description , vtiger_crmentity.createdtime , vtiger_crmentity.modifiedtime , vtiger_cf_568.cf_568id FROM vtiger_crmentity JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smcreatorid JOIN vtiger_troubletickets ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid JOIN vtiger_account ON vtiger_account.accountid = vtiger_troubletickets.parent_id JOIN vtiger_ticketcf ON vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid JOIN vtiger_cf_568 ON vtiger_cf_568.cf_568 = vtiger_ticketcf.cf_568 LEFT OUTER JOIN vtiger_groups ON vtiger_crmentity.smownerid = vtiger_groups.groupid LEFT OUTER JOIN vtiger_users vu ON vtiger_crmentity.smownerid = vu.id WHERE 1 AND vtiger_crmentity.setype = 'HelpDesk' AND vtiger_crmentity.deleted = 0 AND vtiger_ticketcf.cf_568 != '' AND vtiger_cf_568.cf_568id NOT IN(8 , 9 , 10) AND( LCASE(vtiger_cf_568.cf_568) = 'CUS (ตรวจสอบเครื่องลูกค้า)' AND LCASE(vtiger_troubletickets. STATUS) not in('closed' , 'Wait For Customer')) GROUP BY vtiger_troubletickets.ticketid ORDER BY vtiger_crmentity.createdtime ASC LIMIT 0 , 100",  
1323 - "params": ["vtiger_crmentity"]  
1324 - };  
1325 - let response = await this._apiService.post('dynamic', data6);  
1326 - if (response !== null) {  
1327 - this.resultData6 = response;  
1328 - this.resultData6.link = decodeURIComponent(decodeURIComponent(this.resultData6.link));  
1329 - console.log('link: ', this.resultData6.link);  
1330 - // tslint:disable-next-line:forin  
1331 - for (const i in this.resultData6) {  
1332 - this.resultData6[i].link = this._common.decodeURI(this.resultData6[i].link);  
1333 - this.resultData6[i].birth_date = this._common.convertDate(this.resultData6[i].birth_date); 1317 + // Active
  1318 + async getData6() {
  1319 + try {
  1320 + const data6 = {
  1321 + // tslint:disable-next-line:max-line-length
  1322 + "query": "SELECT vtiger_account.accountname AS custgroupName , vtiger_troubletickets.ticketid AS id , IF( vtiger_groups.groupname IS NOT NULL , vtiger_groups.groupname , vu.user_name) AS team , vtiger_troubletickets.title , vtiger_troubletickets. STATUS , vtiger_troubletickets.priority , CONCAT( 'http%3A%2F%2Fvtiger.sourcecode.co.th%2Findex.php%3Faction%3DDetailView%26module%3DHelpDesk%26parenttab%3DSupport%26record%3D' , vtiger_troubletickets.ticketid) AS link ,( SELECT CONCAT( xx.createdtime , ' : ' , xx.comments) FROM vtiger_ticketcomments xx WHERE xx.ticketid = vtiger_troubletickets.ticketid ORDER BY xx.createdtime DESC LIMIT 1) AS COMMENT , CASE vtiger_troubletickets. STATUS WHEN 'Closed' THEN( unix_timestamp(vtiger_crmentity.modifiedtime) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 ELSE( unix_timestamp(now()) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 END AS days , concat( vtiger_ticketcf.cf_568 , ' (' , vtiger_cf_568.day_amount , ')') AS type , IFNULL(( SELECT 'Wait for response by' FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , 'Created by') userType , IFNULL(( SELECT concat('' , assigned_by , '') FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , vtiger_users.user_name) username , vtiger_crmentity.description , vtiger_crmentity.createdtime , vtiger_crmentity.modifiedtime , vtiger_cf_568.cf_568id FROM vtiger_crmentity JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smcreatorid JOIN vtiger_troubletickets ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid JOIN vtiger_account ON vtiger_account.accountid = vtiger_troubletickets.parent_id JOIN vtiger_ticketcf ON vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid JOIN vtiger_cf_568 ON vtiger_cf_568.cf_568 = vtiger_ticketcf.cf_568 LEFT OUTER JOIN vtiger_groups ON vtiger_crmentity.smownerid = vtiger_groups.groupid LEFT OUTER JOIN vtiger_users vu ON vtiger_crmentity.smownerid = vu.id WHERE 1 AND vtiger_crmentity.setype = 'HelpDesk' AND vtiger_crmentity.deleted = 0 AND vtiger_ticketcf.cf_568 != '' AND vtiger_cf_568.cf_568id NOT IN(8 , 9 , 10) AND( LCASE(vtiger_cf_568.cf_568) = 'CUS (ตรวจสอบเครื่องลูกค้า)' AND LCASE(vtiger_troubletickets. STATUS) not in('closed' , 'Wait For Customer')) GROUP BY vtiger_troubletickets.ticketid ORDER BY vtiger_crmentity.createdtime ASC LIMIT 0 , 100",
  1323 + "params": ["vtiger_crmentity"]
  1324 + };
  1325 + let response = await this._apiService.post('dynamic', data6);
  1326 + if (response !== null) {
  1327 + this.resultData6 = response;
  1328 + this.resultData6.link = decodeURIComponent(decodeURIComponent(this.resultData6.link));
  1329 + console.log('link: ', this.resultData6.link);
  1330 + // tslint:disable-next-line:forin
  1331 + for (const i in this.resultData6) {
  1332 + this.resultData6[i].link = this._common.decodeURI(this.resultData6[i].link);
  1333 + this.resultData6[i].birth_date = this._common.convertDate(this.resultData6[i].birth_date);
  1334 + }
  1335 + } else {
  1336 + this.resultData6 = [];
1334 } 1337 }
1335 - } else {  
1336 - this.resultData6 = []; 1338 + } catch (error) {
  1339 + console.log(error);
1337 } 1340 }
1338 - } catch (error) {  
1339 - console.log(error);  
1340 } 1341 }
1341 -}  
1342 -//On Hold  
1343 -async getDataOnHold6() {  
1344 - try {  
1345 - const dataOnHold6 = {  
1346 - // tslint:disable-next-line:max-line-length  
1347 - "query": "SELECT vtiger_account.accountname AS custgroupName , vtiger_troubletickets.ticketid AS id , IF( vtiger_groups.groupname IS NOT NULL , vtiger_groups.groupname , vu.user_name) AS team , vtiger_troubletickets.title , vtiger_troubletickets. STATUS , vtiger_troubletickets.priority , CONCAT( 'http%3A%2F%2Fvtiger.sourcecode.co.th%2Findex.php%3Faction%3DDetailView%26module%3DHelpDesk%26parenttab%3DSupport%26record%3D' , vtiger_troubletickets.ticketid) AS link ,( SELECT CONCAT( xx.createdtime , ' : ' , xx.comments) FROM vtiger_ticketcomments xx WHERE xx.ticketid = vtiger_troubletickets.ticketid ORDER BY xx.createdtime DESC LIMIT 1) AS COMMENT , CASE vtiger_troubletickets. STATUS WHEN 'Closed' THEN( unix_timestamp(vtiger_crmentity.modifiedtime) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 ELSE( unix_timestamp(now()) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 END AS days , concat( vtiger_ticketcf.cf_568 , ' (' , vtiger_cf_568.day_amount , ')') AS type , IFNULL(( SELECT 'Wait for response by' FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , 'Created by') userType , IFNULL(( SELECT concat('' , assigned_by , '') FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , vtiger_users.user_name) username , vtiger_crmentity.description , vtiger_crmentity.createdtime , vtiger_crmentity.modifiedtime , vtiger_cf_568.cf_568id FROM vtiger_crmentity JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smcreatorid JOIN vtiger_troubletickets ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid JOIN vtiger_account ON vtiger_account.accountid = vtiger_troubletickets.parent_id JOIN vtiger_ticketcf ON vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid JOIN vtiger_cf_568 ON vtiger_cf_568.cf_568 = vtiger_ticketcf.cf_568 LEFT OUTER JOIN vtiger_groups ON vtiger_crmentity.smownerid = vtiger_groups.groupid LEFT OUTER JOIN vtiger_users vu ON vtiger_crmentity.smownerid = vu.id WHERE 1 AND vtiger_crmentity.setype = 'HelpDesk' AND vtiger_crmentity.deleted = 0 AND vtiger_ticketcf.cf_568 != '' AND vtiger_cf_568.cf_568id NOT IN(8 , 9 , 10) AND( LCASE(vtiger_cf_568.cf_568) = 'CUS (ตรวจสอบเครื่องลูกค้า)' AND LCASE(vtiger_troubletickets. STATUS) IN('Wait For Customer')) GROUP BY vtiger_troubletickets.ticketid ORDER BY vtiger_crmentity.createdtime ASC LIMIT 0 , 100", 1342 + //On Hold
  1343 + async getDataOnHold6() {
  1344 + try {
  1345 + const dataOnHold6 = {
  1346 + // tslint:disable-next-line:max-line-length
  1347 + "query": "SELECT vtiger_account.accountname AS custgroupName , vtiger_troubletickets.ticketid AS id , IF( vtiger_groups.groupname IS NOT NULL , vtiger_groups.groupname , vu.user_name) AS team , vtiger_troubletickets.title , vtiger_troubletickets. STATUS , vtiger_troubletickets.priority , CONCAT( 'http%3A%2F%2Fvtiger.sourcecode.co.th%2Findex.php%3Faction%3DDetailView%26module%3DHelpDesk%26parenttab%3DSupport%26record%3D' , vtiger_troubletickets.ticketid) AS link ,( SELECT CONCAT( xx.createdtime , ' : ' , xx.comments) FROM vtiger_ticketcomments xx WHERE xx.ticketid = vtiger_troubletickets.ticketid ORDER BY xx.createdtime DESC LIMIT 1) AS COMMENT , CASE vtiger_troubletickets. STATUS WHEN 'Closed' THEN( unix_timestamp(vtiger_crmentity.modifiedtime) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 ELSE( unix_timestamp(now()) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 END AS days , concat( vtiger_ticketcf.cf_568 , ' (' , vtiger_cf_568.day_amount , ')') AS type , IFNULL(( SELECT 'Wait for response by' FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , 'Created by') userType , IFNULL(( SELECT concat('' , assigned_by , '') FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , vtiger_users.user_name) username , vtiger_crmentity.description , vtiger_crmentity.createdtime , vtiger_crmentity.modifiedtime , vtiger_cf_568.cf_568id FROM vtiger_crmentity JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smcreatorid JOIN vtiger_troubletickets ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid JOIN vtiger_account ON vtiger_account.accountid = vtiger_troubletickets.parent_id JOIN vtiger_ticketcf ON vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid JOIN vtiger_cf_568 ON vtiger_cf_568.cf_568 = vtiger_ticketcf.cf_568 LEFT OUTER JOIN vtiger_groups ON vtiger_crmentity.smownerid = vtiger_groups.groupid LEFT OUTER JOIN vtiger_users vu ON vtiger_crmentity.smownerid = vu.id WHERE 1 AND vtiger_crmentity.setype = 'HelpDesk' AND vtiger_crmentity.deleted = 0 AND vtiger_ticketcf.cf_568 != '' AND vtiger_cf_568.cf_568id NOT IN(8 , 9 , 10) AND( LCASE(vtiger_cf_568.cf_568) = 'CUS (ตรวจสอบเครื่องลูกค้า)' AND LCASE(vtiger_troubletickets. STATUS) IN('Wait For Customer')) GROUP BY vtiger_troubletickets.ticketid ORDER BY vtiger_crmentity.createdtime ASC LIMIT 0 , 100",
1348 "params": ["vtiger_crmentity"] 1348 "params": ["vtiger_crmentity"]
1349 - };  
1350 - let response = await this._apiService.post('dynamic', dataOnHold6);  
1351 - if (response !== null) {  
1352 - this.resultDataOnHold6 = response;  
1353 - this.resultDataOnHold6.link = decodeURIComponent(decodeURIComponent(this.resultDataOnHold6.link));  
1354 - console.log('link: ', this.resultDataOnHold6.link);  
1355 - // tslint:disable-next-line:forin  
1356 - for (const i in this.resultDataOnHold6) {  
1357 - this.resultDataOnHold6[i].link = this._common.decodeURI(this.resultDataOnHold6[i].link);  
1358 - this.resultDataOnHold6[i].birth_date = this._common.convertDate(this.resultDataOnHold6[i].birth_date); 1349 + };
  1350 + let response = await this._apiService.post('dynamic', dataOnHold6);
  1351 + if (response !== null) {
  1352 + this.resultDataOnHold6 = response;
  1353 + this.resultDataOnHold6.link = decodeURIComponent(decodeURIComponent(this.resultDataOnHold6.link));
  1354 + console.log('link: ', this.resultDataOnHold6.link);
  1355 + // tslint:disable-next-line:forin
  1356 + for (const i in this.resultDataOnHold6) {
  1357 + this.resultDataOnHold6[i].link = this._common.decodeURI(this.resultDataOnHold6[i].link);
  1358 + this.resultDataOnHold6[i].birth_date = this._common.convertDate(this.resultDataOnHold6[i].birth_date);
  1359 + }
  1360 + } else {
  1361 + this.resultDataOnHold6 = [];
1359 } 1362 }
1360 - } else {  
1361 - this.resultDataOnHold6 = []; 1363 + } catch (error) {
  1364 + console.log(error);
1362 } 1365 }
1363 - } catch (error) {  
1364 - console.log(error);  
1365 } 1366 }
1366 -}  
1367 -  
1368 -// ----------------------------7------------------------  
1369 - // Active  
1370 - async getData7() {  
1371 - try {  
1372 - const data7 = {  
1373 - // tslint:disable-next-line:max-line-length  
1374 - "query": "SELECT vtiger_account.accountname AS custgroupName , vtiger_troubletickets.ticketid AS id , IF( vtiger_groups.groupname IS NOT NULL , vtiger_groups.groupname , vu.user_name) AS team , vtiger_troubletickets.title , vtiger_troubletickets. STATUS , vtiger_troubletickets.priority , CONCAT( 'http%3A%2F%2Fvtiger.sourcecode.co.th%2Findex.php%3Faction%3DDetailView%26module%3DHelpDesk%26parenttab%3DSupport%26record%3D' , vtiger_troubletickets.ticketid) AS link ,( SELECT CONCAT( xx.createdtime , ' : ' , xx.comments) FROM vtiger_ticketcomments xx WHERE xx.ticketid = vtiger_troubletickets.ticketid ORDER BY xx.createdtime DESC LIMIT 1) AS COMMENT , CASE vtiger_troubletickets. STATUS WHEN 'Closed' THEN( unix_timestamp(vtiger_crmentity.modifiedtime) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 ELSE( unix_timestamp(now()) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 END AS days , vtiger_ticketcf.cf_568 AS type , IFNULL(( SELECT 'Wait for response by' FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , 'Created by') userType , IFNULL(( SELECT concat('' , assigned_by , '') FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , vtiger_users.user_name) username , vtiger_crmentity.description , vtiger_crmentity.createdtime , vtiger_crmentity.modifiedtime , vtiger_cf_568.cf_568id FROM vtiger_crmentity JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smcreatorid JOIN vtiger_troubletickets ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid JOIN vtiger_account ON vtiger_account.accountid = vtiger_troubletickets.parent_id JOIN vtiger_ticketcf ON vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid JOIN vtiger_cf_568 ON vtiger_cf_568.cf_568 = vtiger_ticketcf.cf_568 LEFT OUTER JOIN vtiger_groups ON vtiger_crmentity.smownerid = vtiger_groups.groupid LEFT OUTER JOIN vtiger_users vu ON vtiger_crmentity.smownerid = vu.id WHERE 1 AND vtiger_crmentity.setype = 'HelpDesk' AND vtiger_crmentity.deleted = 0 AND vtiger_ticketcf.cf_568 != '' AND vtiger_cf_568.cf_568id NOT IN(8 , 9 , 10) AND( LCASE(vtiger_cf_568.cf_568) != 'set (ติดตั้ง)' AND LCASE(vtiger_troubletickets. STATUS) NOT IN('closed' , 'Wait For Customer')) GROUP BY vtiger_troubletickets.ticketid ORDER BY vtiger_crmentity.createdtime ASC ",  
1375 - "params": ["vtiger_crmentity"]  
1376 - };  
1377 - const response = await this._apiService.post('dynamic', data7);  
1378 - if (response !== null) {  
1379 - this.resultData7 = response;  
1380 - this.resultData7.link = decodeURIComponent(decodeURIComponent(this.resultData7.link));  
1381 - console.log('link: ', this.resultData7.link);  
1382 - // tslint:disable-next-line:forin  
1383 - for (const i in this.resultData7) {  
1384 - this.resultData7[i].link = this._common.decodeURI(this.resultData7[i].link);  
1385 - this.resultData7[i].birth_date = this._common.convertDate(this.resultData7[i].birth_date);  
1386 - this.Show7.push(this.resultData7[i]); 1367 +
  1368 + // ----------------------------7------------------------
  1369 + // Active
  1370 + async getData7() {
  1371 + try {
  1372 + const data7 = {
  1373 + // tslint:disable-next-line:max-line-length
  1374 + "query": "SELECT vtiger_account.accountname AS custgroupName , vtiger_troubletickets.ticketid AS id , IF( vtiger_groups.groupname IS NOT NULL , vtiger_groups.groupname , vu.user_name) AS team , vtiger_troubletickets.title , vtiger_troubletickets. STATUS , vtiger_troubletickets.priority , CONCAT( 'http%3A%2F%2Fvtiger.sourcecode.co.th%2Findex.php%3Faction%3DDetailView%26module%3DHelpDesk%26parenttab%3DSupport%26record%3D' , vtiger_troubletickets.ticketid) AS link ,( SELECT CONCAT( xx.createdtime , ' : ' , xx.comments) FROM vtiger_ticketcomments xx WHERE xx.ticketid = vtiger_troubletickets.ticketid ORDER BY xx.createdtime DESC LIMIT 1) AS COMMENT , CASE vtiger_troubletickets. STATUS WHEN 'Closed' THEN( unix_timestamp(vtiger_crmentity.modifiedtime) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 ELSE( unix_timestamp(now()) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 END AS days , vtiger_ticketcf.cf_568 AS type , IFNULL(( SELECT 'Wait for response by' FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , 'Created by') userType , IFNULL(( SELECT concat('' , assigned_by , '') FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = 'Wait for response' ORDER BY updatetime DESC LIMIT 0 , 1) , vtiger_users.user_name) username , vtiger_crmentity.description , vtiger_crmentity.createdtime , vtiger_crmentity.modifiedtime , vtiger_cf_568.cf_568id FROM vtiger_crmentity JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smcreatorid JOIN vtiger_troubletickets ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid JOIN vtiger_account ON vtiger_account.accountid = vtiger_troubletickets.parent_id JOIN vtiger_ticketcf ON vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid JOIN vtiger_cf_568 ON vtiger_cf_568.cf_568 = vtiger_ticketcf.cf_568 LEFT OUTER JOIN vtiger_groups ON vtiger_crmentity.smownerid = vtiger_groups.groupid LEFT OUTER JOIN vtiger_users vu ON vtiger_crmentity.smownerid = vu.id WHERE 1 AND vtiger_crmentity.setype = 'HelpDesk' AND vtiger_crmentity.deleted = 0 AND vtiger_ticketcf.cf_568 != '' AND vtiger_cf_568.cf_568id NOT IN(8 , 9 , 10) AND( LCASE(vtiger_cf_568.cf_568) != 'set (ติดตั้ง)' AND LCASE(vtiger_troubletickets. STATUS) NOT IN('closed' , 'Wait For Customer')) GROUP BY vtiger_troubletickets.ticketid ORDER BY vtiger_crmentity.createdtime ASC ",
  1375 + "params": ["vtiger_crmentity"]
  1376 + };
  1377 + const response = await this._apiService.post('dynamic', data7);
  1378 + if (response !== null) {
  1379 + this.resultData7 = response;
  1380 + this.resultData7.link = decodeURIComponent(decodeURIComponent(this.resultData7.link));
  1381 + console.log('link: ', this.resultData7.link);
  1382 + // tslint:disable-next-line:forin
  1383 + for (const i in this.resultData7) {
  1384 + this.resultData7[i].link = this._common.decodeURI(this.resultData7[i].link);
  1385 + this.resultData7[i].birth_date = this._common.convertDate(this.resultData7[i].birth_date);
  1386 + this.Show7.push(this.resultData7[i]);
  1387 + }
  1388 + } else {
  1389 + this.resultData7 = [];
1387 } 1390 }
1388 - } else {  
1389 - this.resultData7 = []; 1391 + } catch (error) {
  1392 + console.log(error);
1390 } 1393 }
1391 - } catch (error) {  
1392 - console.log(error);  
1393 } 1394 }
1394 -}  
1395 -// On Hold  
1396 -async getDataOnHold7() {  
1397 - try {  
1398 - const dataOnHold7 = {  
1399 - // tslint:disable-next-line:max-line-length  
1400 - 'query': 'SELECT vtiger_account.accountname AS custgroupName , vtiger_troubletickets.ticketid AS id , IF( vtiger_groups.groupname IS NOT NULL , vtiger_groups.groupname , vu.user_name) AS team , vtiger_troubletickets.title , vtiger_troubletickets. STATUS , vtiger_troubletickets.priority , CONCAT( \'http%3A%2F%2Fvtiger.sourcecode.co.th%2Findex.php%3Faction%3DDetailView%26module%3DHelpDesk%26parenttab%3DSupport%26record%3D\' , vtiger_troubletickets.ticketid) AS link ,( SELECT CONCAT( xx.createdtime , \' : \' , xx.comments) FROM vtiger_ticketcomments xx WHERE xx.ticketid = vtiger_troubletickets.ticketid ORDER BY xx.createdtime DESC LIMIT 1) AS COMMENT , CASE vtiger_troubletickets. STATUS WHEN \'Closed\' THEN( unix_timestamp(vtiger_crmentity.modifiedtime) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 ELSE( unix_timestamp(now()) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 END AS days , vtiger_ticketcf.cf_568 AS type , IFNULL(( SELECT \'Wait for response by\' FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = \'Wait for response\' ORDER BY updatetime DESC LIMIT 0 , 1) , \'Created by\') userType , IFNULL(( SELECT concat(\'\' , assigned_by , \'\') FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = \'Wait for response\' ORDER BY updatetime DESC LIMIT 0 , 1) , vtiger_users.user_name) username , vtiger_crmentity.description , vtiger_crmentity.createdtime , vtiger_crmentity.modifiedtime , vtiger_cf_568.cf_568id FROM vtiger_crmentity JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smcreatorid JOIN vtiger_troubletickets ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid JOIN vtiger_account ON vtiger_account.accountid = vtiger_troubletickets.parent_id JOIN vtiger_ticketcf ON vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid JOIN vtiger_cf_568 ON vtiger_cf_568.cf_568 = vtiger_ticketcf.cf_568 LEFT OUTER JOIN vtiger_groups ON vtiger_crmentity.smownerid = vtiger_groups.groupid LEFT OUTER JOIN vtiger_users vu ON vtiger_crmentity.smownerid = vu.id WHERE 1 AND vtiger_crmentity.setype = \'HelpDesk\' AND vtiger_crmentity.deleted = 0 AND vtiger_ticketcf.cf_568 != \'\' AND vtiger_cf_568.cf_568id NOT IN(8 , 9 , 10) AND( LCASE(vtiger_cf_568.cf_568) != \'set (ติดตั้ง)\' AND LCASE(vtiger_troubletickets. STATUS) IN(\'Wait For Customer\')) GROUP BY vtiger_troubletickets.ticketid ORDER BY vtiger_crmentity.createdtime ASC LIMIT 0 , 100',  
1401 - 'params': ['vtiger_crmentity']  
1402 - };  
1403 - const response = await this._apiService.post('dynamic', dataOnHold7);  
1404 - if (response !== null) {  
1405 - this.resultDataOnHold7 = response;  
1406 - this.resultDataOnHold7.link = decodeURIComponent(decodeURIComponent(this.resultDataOnHold7.link));  
1407 - console.log('link: ', this.resultDataOnHold7.link);  
1408 - // tslint:disable-next-line:forin  
1409 - for (const i in this.resultDataOnHold7) {  
1410 - this.resultDataOnHold7[i].link = this._common.decodeURI(this.resultDataOnHold7[i].link);  
1411 - this.resultDataOnHold7[i].birth_date = this._common.convertDate(this.resultDataOnHold7[i].birth_date); 1395 + // On Hold
  1396 + async getDataOnHold7() {
  1397 + try {
  1398 + const dataOnHold7 = {
  1399 + // tslint:disable-next-line:max-line-length
  1400 + 'query': 'SELECT vtiger_account.accountname AS custgroupName , vtiger_troubletickets.ticketid AS id , IF( vtiger_groups.groupname IS NOT NULL , vtiger_groups.groupname , vu.user_name) AS team , vtiger_troubletickets.title , vtiger_troubletickets. STATUS , vtiger_troubletickets.priority , CONCAT( \'http%3A%2F%2Fvtiger.sourcecode.co.th%2Findex.php%3Faction%3DDetailView%26module%3DHelpDesk%26parenttab%3DSupport%26record%3D\' , vtiger_troubletickets.ticketid) AS link ,( SELECT CONCAT( xx.createdtime , \' : \' , xx.comments) FROM vtiger_ticketcomments xx WHERE xx.ticketid = vtiger_troubletickets.ticketid ORDER BY xx.createdtime DESC LIMIT 1) AS COMMENT , CASE vtiger_troubletickets. STATUS WHEN \'Closed\' THEN( unix_timestamp(vtiger_crmentity.modifiedtime) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 ELSE( unix_timestamp(now()) - unix_timestamp(vtiger_crmentity.createdtime)) / 86400 END AS days , vtiger_ticketcf.cf_568 AS type , IFNULL(( SELECT \'Wait for response by\' FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = \'Wait for response\' ORDER BY updatetime DESC LIMIT 0 , 1) , \'Created by\') userType , IFNULL(( SELECT concat(\'\' , assigned_by , \'\') FROM vtiger_ticket_history WHERE vtiger_troubletickets.ticketid = vtiger_ticket_history.ticketid AND assigned_type = \'Wait for response\' ORDER BY updatetime DESC LIMIT 0 , 1) , vtiger_users.user_name) username , vtiger_crmentity.description , vtiger_crmentity.createdtime , vtiger_crmentity.modifiedtime , vtiger_cf_568.cf_568id FROM vtiger_crmentity JOIN vtiger_users ON vtiger_users.id = vtiger_crmentity.smcreatorid JOIN vtiger_troubletickets ON vtiger_crmentity.crmid = vtiger_troubletickets.ticketid JOIN vtiger_account ON vtiger_account.accountid = vtiger_troubletickets.parent_id JOIN vtiger_ticketcf ON vtiger_ticketcf.ticketid = vtiger_troubletickets.ticketid JOIN vtiger_cf_568 ON vtiger_cf_568.cf_568 = vtiger_ticketcf.cf_568 LEFT OUTER JOIN vtiger_groups ON vtiger_crmentity.smownerid = vtiger_groups.groupid LEFT OUTER JOIN vtiger_users vu ON vtiger_crmentity.smownerid = vu.id WHERE 1 AND vtiger_crmentity.setype = \'HelpDesk\' AND vtiger_crmentity.deleted = 0 AND vtiger_ticketcf.cf_568 != \'\' AND vtiger_cf_568.cf_568id NOT IN(8 , 9 , 10) AND( LCASE(vtiger_cf_568.cf_568) != \'set (ติดตั้ง)\' AND LCASE(vtiger_troubletickets. STATUS) IN(\'Wait For Customer\')) GROUP BY vtiger_troubletickets.ticketid ORDER BY vtiger_crmentity.createdtime ASC LIMIT 0 , 100',
  1401 + 'params': ['vtiger_crmentity']
  1402 + };
  1403 + const response = await this._apiService.post('dynamic', dataOnHold7);
  1404 + if (response !== null) {
  1405 + this.resultDataOnHold7 = response;
  1406 + this.resultDataOnHold7.link = decodeURIComponent(decodeURIComponent(this.resultDataOnHold7.link));
  1407 + console.log('link: ', this.resultDataOnHold7.link);
  1408 + // tslint:disable-next-line:forin
  1409 + for (const i in this.resultDataOnHold7) {
  1410 + this.resultDataOnHold7[i].link = this._common.decodeURI(this.resultDataOnHold7[i].link);
  1411 + this.resultDataOnHold7[i].birth_date = this._common.convertDate(this.resultDataOnHold7[i].birth_date);
  1412 + }
  1413 + } else {
  1414 + this.resultDataOnHold7 = [];
1412 } 1415 }
1413 - } else {  
1414 - this.resultDataOnHold7 = []; 1416 + } catch (error) {
  1417 + console.log(error);
1415 } 1418 }
1416 - } catch (error) {  
1417 - console.log(error);  
1418 } 1419 }
1419 -}  
1420 1420
1421 } 1421 }
1422 \ No newline at end of file 1422 \ No newline at end of file