Subversion Repositories SmartDukaan

Rev

Rev 24620 | Rev 24747 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
24417 govind 1
$(function() {
2
 
3
	$(".create-ticket-category").live('click', function() {
4
		console.log("create ticket category clicked......");
5
		loadCreateCategory("main-content");
6
	});
7
	$(".create-region").live('click', function() {
8
		loadCreateRegion("main-content");
9
	});
24620 govind 10
	$("#ticket-last-activity").live('click', function() {
11
		var ticketId = $(this).data('ticketid');
12
		var activity = $(this).data('activity');
13
		console.log(ticketId);
14
		console.log(activity);
24699 govind 15
		if (confirm("Are you sure!") == true) {
24620 govind 16
			createLastActivity(ticketId, activity);
17
		}
18
	});
24471 govind 19
 
24557 govind 20
	$("#region").live('change', function() {
24620 govind 21
		var regionId = $("#region").val();
24557 govind 22
		console.log(regionId);
23
		loadPartnerForRegion(regionId);
24
	});
25
 
24471 govind 26
	$(".change-ticket-button")
27
			.live(
28
					'click',
29
					function() {
30
						var ticketId = $("#ticketId").val();
31
						var subCategory = $("#subCategory").val();
32
						var authUserId = $("#authUser").val();
24534 govind 33
						var categoryId = $("#category").val();
24471 govind 34
						console.log(ticketId);
35
						if (subCategory == null || subCategory == ""
36
								|| subCategory == undefined) {
37
							alert("Choose appropriate subCategory");
24500 govind 38
							return false;
24471 govind 39
						}
24500 govind 40
						console.log(authUserId);
24471 govind 41
						if (confirm("Are you sure you want to change ticket!") == true) {
24534 govind 42
							changeTicket(ticketId, subCategory, authUserId,
43
									categoryId);
24471 govind 44
						}
45
					});
24439 govind 46
	$("#edit-ticket").live('click', function() {
24471 govind 47
 
48
		var ticketId = $(this).data('ticketid1');
24467 govind 49
		console.log(ticketId);
50
		loadEditTicket(ticketId);
24439 govind 51
	});
52
	$(".manager-ticket").live('click', function() {
24699 govind 53
		loadManagerTicket("main-content",null,null);
24439 govind 54
	});
24417 govind 55
	$(".ticketType").live('click', function() {
24534 govind 56
		console.log("create Region");
24417 govind 57
		loadCreateRegion("main-content");
58
	});
24469 govind 59
	$("#activities").live('click', function() {
24417 govind 60
		var ticketId = $(this).data('ticketid');
61
		var assignee = $(this).data('assignee');
62
		console.log(assignee);
63
		loadActivities(ticketId, assignee);
64
	});
65
	$(".my-ticket").live('click', function() {
24699 govind 66
		loadMyTicket("main-content", null, null);
24417 govind 67
	});
68
	$("#close-ticket").live('click', function() {
69
		var ticketId = $(this).data('ticketid');
24439 govind 70
		closeTicket(ticketId);
24417 govind 71
	});
72
	$(".submit-message-button").live('click', function() {
73
		var message = $("#activityMessage").val();
74
		if (message == "" || message == null || message == undefined) {
75
			alert("message field can't be empty");
24500 govind 76
			return false;
24417 govind 77
		}
78
		var ticketId = $("#ticketIdforactivity").val();
79
		var assignee = $("#assigneeUser").val();
80
		console.log(message, ticketId, assignee);
81
		createActivity(message, ticketId, assignee);
82
	});
83
 
84
	$("#tickets-paginated .next").live(
85
			'click',
86
			function() {
24699 govind 87
				var ticketStatus = $("#ticketStatus").val();
88
				var orderBy = $("#orderBy").val();
89
				var params = {
90
						"ticketStatus":ticketStatus,
91
						"orderby":orderBy
92
						};
93
				loadPaginatedNextItems('/cs/myticketPaginated',params,
24417 govind 94
						'tickets-paginated', 'my-ticket-table',
95
						'ticket-details-container');
96
				$(this).blur();
97
			});
98
 
24467 govind 99
	$("#manager-tickets-paginated .previous").live(
100
			'click',
101
			function() {
102
				loadPaginatedPreviousItems('/cs/managerTicket-paginated', null,
103
						'manager-tickets-paginated', 'manager-ticket-table',
104
						'manager-ticket-details-container');
105
				$(this).blur();
106
			});
107
	$("#manager-tickets-paginated .next").live(
108
			'click',
109
			function() {
24699 govind 110
 
24467 govind 111
				loadPaginatedNextItems('/cs/managerTicket-paginated', null,
112
						'manager-tickets-paginated', 'manager-ticket-table',
113
						'manager-ticket-details-container');
114
				$(this).blur();
115
			});
116
 
24417 govind 117
	$("#tickets-paginated .previous").live(
118
			'click',
119
			function() {
24699 govind 120
				var ticketStatus = $("#ticketStatus").val();
121
				var orderBy = $("#orderBy").val();
122
				var params = {
123
						"ticketStatus":ticketStatus,
124
						"orderby":orderBy
125
						};
126
				loadPaginatedPreviousItems('/cs/myticketPaginated',params,
24417 govind 127
						'tickets-paginated', 'my-ticket-table',
128
						'ticket-details-container');
24467 govind 129
				$(this).blur();
24417 govind 130
			});
24471 govind 131
	$("#positions-paginated .next").live(
132
			'click',
133
			function() {
134
				loadPaginatedNextItems('/cs/position-paginated', null,
135
						'positions-paginated', 'position-table',
136
						'position-details-container');
137
				$(this).blur();
138
			});
24417 govind 139
 
24471 govind 140
	$("#positions-paginated .previous").live(
141
			'click',
142
			function() {
143
				loadPaginatedPreviousItems('/cs/position-paginated', null,
144
						'positions-paginated', 'position-table',
145
						'position-details-container');
146
				$(this).blur();
147
			});
148
 
24417 govind 149
	$(".create-partner-region").live('click', function() {
150
		loadCreatePartnerRegion("main-content");
151
	});
152
	$(".create-ticket").live('click', function() {
153
		loadCreateTicket("main-content");
154
	});
155
	$(".create-ticket-button")
156
			.live(
157
					'click',
158
					function() {
159
						var categoryId = $('#category').val();
160
						var subCategoryId = $('#subCategory').val();
161
						if (categoryId == "" || categoryId == null
162
								|| categoryId == undefined) {
163
							alert("select appropriate category");
164
							return false;
165
						}
166
						if (subCategoryId == "" || subCategoryId == null
167
								|| subCategoryId == undefined) {
168
							alert("select appropriate subCategoryId");
169
							return false;
170
						}
171
						var dialog = bootbox
172
								.dialog({
173
									title : "Are you sure want to change create ticket!",
174
									message : "<div class=form-inline'>"
175
											+ "<label for='message'>Message:</label>"
176
											+ "<textarea class='form-control' rows='2' id='message'></textarea>"
177
											+ "</div>",
178
									buttons : {
179
										cancel : {
180
											label : "cancel",
181
											className : 'btn-danger',
182
											callback : function() {
183
												loadCreateTicket("main-content");
184
											}
185
										},
186
										ok : {
187
											label : "ok",
188
											className : 'btn-info',
189
											callback : function() {
190
												message = $('#message').val();
191
												console.log(message);
192
												if (message == ""
193
														|| message == null
194
														|| message == undefined) {
195
													alert("message field can't be empty");
196
													return false;
197
												}
198
												var params = {
199
													"categoryId" : categoryId,
200
													"subCategoryId" : subCategoryId,
201
													"message" : message
202
												}
203
												doPostAjaxRequestWithParamsHandler(
204
														context
205
																+ "/cs/createTicket",
206
														params,
207
														function(response) {
208
															if (response == "true") {
209
																alert("successfully created");
210
																loadCreateTicket("main-content");
24620 govind 211
															} else {
212
																alert("You have reached maximum number of tickets , pls click on Resolved for the resolved tickets to create new.");
24417 govind 213
															}
214
														});
215
 
216
											}
217
										}
218
									}
219
								});
220
 
221
					});
222
	$(".create-position").live('click', function() {
223
		loadCreatePosition("main-content");
224
	});
225
 
24534 govind 226
	$("#ticketStatus").live('change', function() {
24699 govind 227
		var ticketStatus = $("#ticketStatus").val();
228
		var orderBy = $("#orderBy").val();
229
		console.log(ticketStatus);
230
		console.log(orderBy);
231
		loadMyTicket("main-content", ticketStatus, orderBy);
24534 govind 232
	});
24699 govind 233
	$("#orderBy").live('change', function() {
234
		var ticketStatus = $("#ticketStatus").val();
235
		var orderBy = $("#orderBy").val();
236
		console.log(ticketStatus);
237
		console.log(orderBy);
238
		loadMyTicket("main-content", ticketStatus, orderBy);
24534 govind 239
	});
24699 govind 240
	$("#managerTicketStatus").live('change', function() {
241
		var ticketStatus = $("#managerTicketStatus").val();
242
		var orderBy = $("#managerTicketorderBy").val();
243
		console.log(ticketStatus);
244
		console.log(orderBy);
245
		loadManagerTicket("main-content", ticketStatus, orderBy);
246
	});
247
	$("#managerTicketorderBy").live('change', function() {
248
		var ticketStatus = $("#managerTicketStatus").val();
249
		var orderBy = $("#managerTicketorderBy").val();
250
		console.log(ticketStatus);
251
		console.log(orderBy);
252
		loadManagerTicket("main-content", ticketStatus, orderBy);
253
	});
24417 govind 254
	$("#category").live('change', function() {
255
		var categoryId = $("#category").val();
24500 govind 256
		$("#auth-user-for-category").hide();
24417 govind 257
		loadSubCategories(categoryId);
258
	});
259
	$(".create-ticket-category-button")
260
			.live(
261
					'click',
262
					function() {
263
						console
264
								.log("create-ticket-category-button clicked......");
265
						var name = $("#categoryName").val();
266
						var description = $("#categorydescription").val();
267
						console.log(name, description);
268
						if (name == "" || name == null || name == undefined) {
269
							alert("Name field can't be empty");
270
							return false;
271
						}
272
						if (description == "" || description == null
273
								|| description == undefined) {
274
							alert("Description field can't be empty");
275
							return false;
276
						}
277
						if (confirm("Are you sure you want to create ticket category!") == true) {
278
							createCategory("main-content", name, description);
279
						}
280
					});
281
	$(".create-region-button")
282
			.live(
283
					'click',
284
					function() {
285
						var name = $("#regionName").val();
286
						var description = $("#regiondescription").val();
287
						if (name == "" || name == null || name == undefined) {
288
							alert("Name field can't be empty");
289
							return false;
290
						}
291
						if (description == "" || description == null
292
								|| description == undefined) {
293
							alert("Description field can't be empty");
294
							return false;
295
						}
296
						if (confirm("Are you sure you want to create region!") == true) {
297
							createRegion("main-content", name, description);
298
						}
299
					});
300
 
301
	$(".create-partner-region-button")
302
			.live(
303
					'click',
304
					function() {
305
 
306
						var regionId = $("#region").val();
307
						var fofoIds = $("#partner").val();
308
						console.log(regionId, fofoIds);
309
						if (regionId == "" || regionId == null
310
								|| regionId == undefined) {
311
							alert("regionId field can't be empty");
312
							return false;
313
						}
314
						if (fofoIds == "" || fofoIds == null
315
								|| fofoIds == undefined) {
316
							alert("select appropriate partner");
317
							return false;
318
						}
319
						if (confirm("Are you sure you want to create partner region!") == true) {
320
							createPartnerRegion("main-content", regionId,
321
									fofoIds);
322
						}
323
					});
324
	$(".create-position-button")
325
			.live(
326
					'click',
327
					function() {
328
 
329
						var authUser = $("#authUser").val();
330
						var ticketCategoryPosition = $(
331
								"#ticketCategoryPosition").val();
332
						var escalationType = $("#escalationType").val();
333
						var regionPosition = $("#regionPosition").val();
334
						console.log(authUser, ticketCategoryPosition,
335
								escalationType, regionPosition);
336
						if (authUser == "" || authUser == null
337
								|| authUser == undefined) {
338
							alert("select appropriate authUser");
339
							return false;
340
						}
341
						if (ticketCategoryPosition == ""
342
								|| ticketCategoryPosition == null
343
								|| ticketCategoryPosition == undefined) {
344
							alert("select appropriate category");
345
							return false;
346
						}
347
						if (escalationType == "" || escalationType == null
348
								|| escalationType == undefined) {
349
							alert("select appropriate escalationType");
350
							return false;
351
						}
352
						if (regionPosition == "" || regionPosition == null
353
								|| regionPosition == undefined) {
354
							alert("select appropriate Region");
355
							return false;
356
						}
357
						if (confirm("Are you sure you want to create Position!") == true) {
358
							createPosition("main-content", authUser,
359
									ticketCategoryPosition, escalationType,
360
									regionPosition);
361
						}
362
					});
363
 
364
	$("#ticketCategory").live('change', function() {
365
		console.log("change ticket category clicked......");
366
		var ticketCategoryId = $(this).val();
367
		console.log(ticketCategoryId);
368
		loadticketSubCategoryById(ticketCategoryId);
369
	});
370
	$(".create-ticket-sub-category").live('click', function() {
371
		console.log("create ticket category clicked......");
372
		loadCreateSubCategory("main-content");
373
	});
374
 
375
	$(".create-ticket-sub-category-button")
376
			.live(
377
					'click',
378
					function() {
379
						console
380
								.log("create-ticket-category-button clicked......");
381
						var name = $("#subcategoryName").val();
382
						var description = $("#subcategorydescription").val();
383
						var ticketCategoryId = $("#ticketCategory").val();
384
						console.log(name, description);
385
						if (name == "" || name == null || name == undefined) {
386
							alert("Name field can't be empty");
387
							return false;
388
						}
389
						if (description == "" || description == null
390
								|| description == undefined) {
391
							alert("Description field can't be empty");
392
							return false;
393
						}
394
						if (ticketCategoryId == "" || ticketCategoryId == null
395
								|| ticketCategoryId == undefined) {
396
							alert("select appropriate category name");
397
							return false;
398
						}
399
						if (confirm("Are you sure you want to create ticket category!") == true) {
400
							createSubCategory("main-content", name,
401
									description, ticketCategoryId);
402
						}
403
					});
24471 govind 404
	$(".remove-position").live('click', function() {
405
		var positionId = $(this).data('positionid');
406
		if (confirm("Are you sure you want to remove position!") == true) {
24534 govind 407
			removePosition(positionId);
24471 govind 408
		}
409
	});
24417 govind 410
 
411
});
412
 
413
function loadCreateCategory(domId) {
414
	doGetAjaxRequestHandler(context + "/cs/createCategory", function(response) {
415
		$('#' + domId).html(response);
416
	});
417
}
24534 govind 418
function removePosition(positionId) {
419
	doDeleteAjaxRequestHandler(context + "/cs/removePosition?positionId="
420
			+ positionId, function(response) {
24471 govind 421
		if (response == "true") {
422
			alert("Position removed successfully");
423
			loadCreatePosition("main-content");
424
		}
425
	});
426
}
24417 govind 427
 
428
function loadCreateRegion(domId) {
429
	doGetAjaxRequestHandler(context + "/cs/createRegion", function(response) {
430
		$('#' + domId).html(response);
431
	});
432
}
24699 govind 433
function loadMyTicket(domId, ticketStatus, sortOrder) {
24620 govind 434
 
24699 govind 435
	if (ticketStatus == null && sortOrder == null) {
436
		doGetAjaxRequestHandler(context + "/cs/myticket", function(response) {
437
			$('#' + domId).html(response);
438
		});
439
	} else {
440
		doGetAjaxRequestHandler(context + "/cs/myticket?ticketStatus="
441
				+ ticketStatus + "&orderby=" + sortOrder, function(response) {
442
			$('#' + domId).html(response);
443
		});
444
	}
24417 govind 445
}
446
 
447
function loadCreatePartnerRegion(domId) {
448
	doGetAjaxRequestHandler(context + "/cs/createPartnerRegion", function(
449
			response) {
450
		$('#' + domId).html(response);
451
	});
452
}
453
function loadCreatePosition(domId) {
454
	doGetAjaxRequestHandler(context + "/cs/createPosition", function(response) {
455
		$('#' + domId).html(response);
456
	});
457
}
458
function loadSubCategories(categoryId) {
459
	doGetAjaxRequestHandler(context
460
			+ "/cs/getSubCategoriesByCategoryId?categoryId=" + categoryId,
461
			function(response) {
462
				$('#' + "create-ticket-sub-categories").html(response);
463
			});
464
}
465
function createCategory(domId, name, description) {
466
	var params = {
467
		"name" : name,
468
		"description" : description
469
	}
470
	doPostAjaxRequestWithParamsHandler(context + "/cs/createCategory", params,
471
			function(response) {
472
				alert("Category created successfully");
473
				loadCreateCategory(domId);
474
			});
475
}
24534 govind 476
function changeTicket(ticketId, subCategoryId, authUserId, categoryId) {
24467 govind 477
	var params = {
24471 govind 478
		"ticketId" : ticketId,
479
		"subCategoryId" : subCategoryId,
24500 govind 480
		"authUserId" : authUserId,
24534 govind 481
		"categoryId" : categoryId
24471 govind 482
	}
483
	doPostAjaxRequestWithParamsHandler(context + "/cs/edit-ticket", params,
484
			function(response) {
485
				if (response == "true") {
486
					alert("Ticket changed successfully");
24699 govind 487
					loadManagerTicket("main-content",null,null);
24471 govind 488
				}
489
			});
24467 govind 490
}
24417 govind 491
function createRegion(domId, name, description) {
492
	var params = {
493
		"name" : name,
494
		"description" : description
495
	}
496
	doPostAjaxRequestWithParamsHandler(context + "/cs/createRegion", params,
497
			function(response) {
498
				if (response == "true") {
499
					alert("Region created successfully");
500
					loadCreateRegion(domId);
501
				}
502
			});
503
}
504
function loadCreateSubCategory(domId) {
505
	doGetAjaxRequestHandler(context + "/cs/createSubCategory", function(
506
			response) {
507
		$('#' + domId).html(response);
508
	});
509
}
24699 govind 510
function loadManagerTicket(domId,ticketStatus,sortOrder) {
511
	if (ticketStatus == null && sortOrder == null) {
24471 govind 512
	doGetAjaxRequestHandler(context + "/cs/managerTicket", function(response) {
24439 govind 513
		$('#' + domId).html(response);
514
	});
24699 govind 515
	}
516
	else
517
		{
518
		doGetAjaxRequestHandler(context + "/cs/managerTicket?ticketStatus="+ticketStatus+"&orderby="+sortOrder, function(response) {
519
			$('#' + domId).html(response);
520
		});
521
		}
24439 govind 522
}
24417 govind 523
function loadCreateTicket(domId) {
524
	doGetAjaxRequestHandler(context + "/cs/createTicket", function(response) {
525
		$('#' + domId).html(response);
526
	});
527
}
528
function loadticketSubCategoryById(ticketCategoryId) {
529
	doGetAjaxRequestHandler(context
530
			+ "/cs/getSubCategoryByCategoryId?ticketCategoryId="
531
			+ ticketCategoryId, function(response) {
532
		$(".ticket-sub-category-container").html(response);
533
	});
534
}
535
function createPartnerRegion(domId, regionId, fofoIds) {
536
	doPostAjaxRequestWithJsonHandler(context
537
			+ "/cs/createPartnerRegion?regionId=" + regionId, JSON
538
			.stringify(fofoIds), function(response) {
539
		if (response == "true") {
540
			alert("added region to partner successfully");
541
			loadCreatePartnerRegion(domId);
542
		}
543
	});
544
}
545
function createSubCategory(domId, name, description, categoryId) {
546
	var params = {
547
		"categoryId" : categoryId,
548
		"name" : name,
549
		"description" : description
550
	}
551
	doPostAjaxRequestWithParamsHandler(context + "/cs/createSubCategory",
552
			params, function(response) {
553
				alert("Sub Category created successfully");
554
				loadCreateSubCategory(domId);
555
			});
556
}
24620 govind 557
function createLastActivity(ticketId, activity) {
558
	var params = {
559
		"ticketId" : ticketId,
560
		"lastactivity" : activity
561
	}
562
	doPostAjaxRequestWithParamsHandler(context + "/cs/create-last-activity",
563
			params, function(response) {
564
				if (response == "true") {
565
					alert("successfully mark last activity");
24699 govind 566
					loadMyTicket("main-content", null, null);
24620 govind 567
				}
568
			});
569
}
24417 govind 570
function closeTicket(ticketId) {
24439 govind 571
	var dialog = bootbox
572
			.dialog({
573
				title : "Are you sure want to close ticket!",
574
				message : "<div class=\"col-lg-6 form-group\">"
575
						+ "<input placeholder=\"Happy Code\" id=\"happyCode\" name=\"happyCode\" type=\"text\"  class=\"form-control input-sm\">"
576
						+ "</div>",
577
				buttons : {
578
					cancel : {
579
						label : "cancel",
580
						className : 'btn-danger',
581
						callback : function() {
24699 govind 582
							loadMyTicket("main-content",null,null);
24439 govind 583
						}
584
					},
585
					ok : {
586
						label : "ok",
587
						className : 'btn-info',
588
						callback : function() {
589
							happyCode = $('#happyCode').val();
590
							console.log(happyCode);
591
							if (happyCode == "" || happyCode == null
592
									|| happyCode == undefined) {
593
								alert("happyCode field can't be empty");
594
								return false;
595
							}
596
							var params = {
597
								"ticketId" : ticketId,
598
								"happyCode" : happyCode
599
							}
600
							doPostAjaxRequestWithParamsHandler(context
601
									+ "/cs/closeTicket", params, function(
602
									response) {
603
								alert("Ticket close successfully");
24699 govind 604
								loadMyTicket("main-content", null, null);
24439 govind 605
							});
606
						}
607
					}
608
				}
24417 govind 609
			});
24439 govind 610
 
24417 govind 611
}
612
function createPosition(domId, authUserId, categoryId, escalationType, regionId) {
613
	var params = {
614
		"authUserId" : authUserId,
615
		"categoryId" : categoryId,
616
		"escalationType" : escalationType,
617
		"regionId" : regionId
618
	}
619
	doPostAjaxRequestWithParamsHandler(context + "/cs/createPosition", params,
620
			function(response) {
621
				if (response == "true") {
622
					alert("Position created successfully");
623
					loadCreatePosition(domId);
624
				}
625
			});
626
}
627
function createActivity(message, ticketId, assigneeId) {
628
	var params = {
629
		"message" : message,
630
		"ticketId" : ticketId,
24534 govind 631
		"assigneeId" : assigneeId,
24417 govind 632
	}
633
	doPostAjaxRequestWithParamsHandler(context + "/cs/createActivity", params,
634
			function(response) {
635
				response = JSON.parse(response);
636
				var assigneeName = response.firstName;
637
				loadActivities(ticketId, assigneeName)
638
			});
639
}
24471 govind 640
function loadEditTicket(ticketId) {
641
	doGetAjaxRequestHandler(context + "/cs/edit-ticket?ticketId=" + ticketId,
642
			function(response) {
643
				$(".modal-content").html(response);
644
			});
24467 govind 645
}
24557 govind 646
function loadPartnerForRegion(regionId) {
647
	doGetAjaxRequestHandler(context + "/cs/getPartners?regionId=" + regionId,
648
			function(response) {
649
				$("#partner-region-container").html(response);
650
			});
651
}
24417 govind 652
function loadActivities(ticketId, assignee) {
653
 
24469 govind 654
	$(".activity-container .modal-body").empty();
24417 govind 655
	$("#activityMessage").val("");
656
	$("#ticketIdforactivity").val(ticketId);
657
	console.log(ticketId);
658
	doGetAjaxRequestHandler(
659
			context + "/cs/getActivities?ticketId=" + ticketId,
660
			function(response) {
661
				response = JSON.parse(response);
662
				console.log(response);
663
				for (var i = 0; i < response.length; i++) {
664
					if ((response[i].type == "OPENED" || response[i].type == "COMMUNICATION_IN")
665
							&& response[i].createdBy == 0) {
666
 
667
						var partnerMessage = "<div class=\"incoming_msg\">"
668
								+ "<div class=\"received_msg\">"
669
								+ "<div class=\"received_withd_msg\">" + "<p>"
670
								+ response[i].message + "</p>"
671
								+ "<span class=\"time_date\"> "
672
								+ response[i].createTimestamp.hour + ":"
673
								+ response[i].createTimestamp.minute + "|"
674
								+ response[i].createTimestamp.dayOfMonth + "/"
675
								+ response[i].createTimestamp.monthValue + "/"
676
								+ response[i].createTimestamp.year
677
								+ "</span></div>" + "</div>" + "</div>";
24471 govind 678
						$(".activity-container .modal-body").append(
679
								partnerMessage);
24417 govind 680
					}
681
					if (response[i].type = "COMMUNICATION_OUT"
682
							&& response[i].createdBy > 0) {
24620 govind 683
						if (response[i].name) {
24574 govind 684
							var assigneeMessage = "<div class=\"outgoing_msg\">"
24620 govind 685
									+ "<div class=\"sent_msg\">"
686
									+ "<span style=color:green>"
687
									+ "~"
688
									+ response[i].name
689
									+ "<p>"
690
									+ response[i].message
691
									+ "</span></p>"
692
									+ "<span class=\"time_date\">"
693
									+ response[i].createTimestamp.hour
694
									+ ":"
695
									+ response[i].createTimestamp.minute
696
									+ "|"
697
									+ response[i].createTimestamp.dayOfMonth
698
									+ "/"
699
									+ response[i].createTimestamp.monthValue
700
									+ "/"
701
									+ response[i].createTimestamp.year
702
									+ "</span> </div>" + "</div>";
703
						} else {
704
							var assigneeMessage = "<div class=\"outgoing_msg\">"
705
									+ "<div class=\"sent_msg\">"
706
									+ "<p>"
707
									+ response[i].message
708
									+ "</span></p>"
709
									+ "<span class=\"time_date\">"
710
									+ response[i].createTimestamp.hour
711
									+ ":"
712
									+ response[i].createTimestamp.minute
713
									+ "|"
714
									+ response[i].createTimestamp.dayOfMonth
715
									+ "/"
716
									+ response[i].createTimestamp.monthValue
717
									+ "/"
718
									+ response[i].createTimestamp.year
719
									+ "</span> </div>" + "</div>";
720
						}
24471 govind 721
						$(".activity-container .modal-body").append(
722
								assigneeMessage);
24417 govind 723
					}
724
				}
725
			});
726
}