Subversion Repositories SmartDukaan

Rev

Rev 24500 | Rev 24557 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 24500 Rev 24534
Line 13... Line 13...
13
					'click',
13
					'click',
14
					function() {
14
					function() {
15
						var ticketId = $("#ticketId").val();
15
						var ticketId = $("#ticketId").val();
16
						var subCategory = $("#subCategory").val();
16
						var subCategory = $("#subCategory").val();
17
						var authUserId = $("#authUser").val();
17
						var authUserId = $("#authUser").val();
18
						var categoryId= $("#category").val();
18
						var categoryId = $("#category").val();
19
						console.log(ticketId);
19
						console.log(ticketId);
20
						if (subCategory == null || subCategory == ""
20
						if (subCategory == null || subCategory == ""
21
								|| subCategory == undefined) {
21
								|| subCategory == undefined) {
22
							alert("Choose appropriate subCategory");
22
							alert("Choose appropriate subCategory");
23
							return false;
23
							return false;
24
						}
24
						}
25
						console.log(authUserId);
25
						console.log(authUserId);
26
						if (confirm("Are you sure you want to change ticket!") == true) {
26
						if (confirm("Are you sure you want to change ticket!") == true) {
27
							changeTicket(ticketId, subCategory, authUserId,categoryId);
27
							changeTicket(ticketId, subCategory, authUserId,
-
 
28
									categoryId);
28
						}
29
						}
29
					});
30
					});
30
	$("#edit-ticket").live('click', function() {
31
	$("#edit-ticket").live('click', function() {
31
 
32
 
32
		var ticketId = $(this).data('ticketid1');
33
		var ticketId = $(this).data('ticketid1');
Line 35... Line 36...
35
	});
36
	});
36
	$(".manager-ticket").live('click', function() {
37
	$(".manager-ticket").live('click', function() {
37
		loadManagerTicket("main-content");
38
		loadManagerTicket("main-content");
38
	});
39
	});
39
	$(".ticketType").live('click', function() {
40
	$(".ticketType").live('click', function() {
-
 
41
		console.log("create Region");
40
		loadCreateRegion("main-content");
42
		loadCreateRegion("main-content");
41
	});
43
	});
42
	$("#activities").live('click', function() {
44
	$("#activities").live('click', function() {
43
		var ticketId = $(this).data('ticketid');
45
		var ticketId = $(this).data('ticketid');
44
		var assignee = $(this).data('assignee');
46
		var assignee = $(this).data('assignee');
45
		console.log(assignee);
47
		console.log(assignee);
46
		loadActivities(ticketId, assignee);
48
		loadActivities(ticketId, assignee);
47
	});
49
	});
48
	$(".my-ticket").live('click', function() {
50
	$(".my-ticket").live('click', function() {
49
		loadMyTicket("main-content");
51
		loadMyTicket("main-content", null, null);
50
	});
52
	});
51
	$("#close-ticket").live('click', function() {
53
	$("#close-ticket").live('click', function() {
52
		var ticketId = $(this).data('ticketid');
54
		var ticketId = $(this).data('ticketid');
53
		closeTicket(ticketId);
55
		closeTicket(ticketId);
54
	});
56
	});
Line 189... Line 191...
189
					});
191
					});
190
	$(".create-position").live('click', function() {
192
	$(".create-position").live('click', function() {
191
		loadCreatePosition("main-content");
193
		loadCreatePosition("main-content");
192
	});
194
	});
193
 
195
 
-
 
196
	$("#ticketStatus").live('change', function() {
-
 
197
		var status = $("#ticketStatus").val();
-
 
198
		var sortOrder = $("#sortOrder").val();
-
 
199
		console.log(status);
-
 
200
		console.log(sortOrder);
-
 
201
		loadMyTicket("main-content", status, sortOrder);
-
 
202
	});
-
 
203
	$("#sortOrder").live('change', function() {
-
 
204
		var status = $("#ticketStatus").val();
-
 
205
		var sortOrder = $("#sortOrder").val();
-
 
206
		console.log(status);
-
 
207
		console.log(sortOrder);
-
 
208
		loadMyTicket("main-content", status, sortOrder);
-
 
209
	});
194
	$("#category").live('change', function() {
210
	$("#category").live('change', function() {
195
		var categoryId = $("#category").val();
211
		var categoryId = $("#category").val();
196
		$("#auth-user-for-category").hide();
212
		$("#auth-user-for-category").hide();
197
		loadSubCategories(categoryId);
213
		loadSubCategories(categoryId);
198
	});
214
	});
Line 342... Line 358...
342
						}
358
						}
343
					});
359
					});
344
	$(".remove-position").live('click', function() {
360
	$(".remove-position").live('click', function() {
345
		var positionId = $(this).data('positionid');
361
		var positionId = $(this).data('positionid');
346
		if (confirm("Are you sure you want to remove position!") == true) {
362
		if (confirm("Are you sure you want to remove position!") == true) {
347
		removePosition(positionId);
363
			removePosition(positionId);
348
		}
364
		}
349
	});
365
	});
350
 
366
 
351
});
367
});
352
 
368
 
353
function loadCreateCategory(domId) {
369
function loadCreateCategory(domId) {
354
	doGetAjaxRequestHandler(context + "/cs/createCategory", function(response) {
370
	doGetAjaxRequestHandler(context + "/cs/createCategory", function(response) {
355
		$('#' + domId).html(response);
371
		$('#' + domId).html(response);
356
	});
372
	});
357
}
373
}
358
function removePosition(positionId)
374
function removePosition(positionId) {
359
{
-
 
360
	doDeleteAjaxRequestHandler(context + "/cs/removePosition?positionId="+positionId, function(response) {
375
	doDeleteAjaxRequestHandler(context + "/cs/removePosition?positionId="
-
 
376
			+ positionId, function(response) {
361
		if (response == "true") {
377
		if (response == "true") {
362
			alert("Position removed successfully");
378
			alert("Position removed successfully");
363
			loadCreatePosition("main-content");
379
			loadCreatePosition("main-content");
364
		}
380
		}
365
	});
381
	});
Line 368... Line 384...
368
function loadCreateRegion(domId) {
384
function loadCreateRegion(domId) {
369
	doGetAjaxRequestHandler(context + "/cs/createRegion", function(response) {
385
	doGetAjaxRequestHandler(context + "/cs/createRegion", function(response) {
370
		$('#' + domId).html(response);
386
		$('#' + domId).html(response);
371
	});
387
	});
372
}
388
}
373
function loadMyTicket(domId) {
389
function loadMyTicket(domId, status, orderBy) {
-
 
390
	if (status == null && orderBy == null) {
374
	doGetAjaxRequestHandler(context + "/cs/myticket", function(response) {
391
		doGetAjaxRequestHandler(context + "/cs/myticket", function(response) {
-
 
392
			$('#' + domId).html(response);
-
 
393
		});
-
 
394
	} else {
-
 
395
		doGetAjaxRequestHandler(context + "/cs/myticket?status=" + status
-
 
396
				+ "&orderBy=" + orderBy, function(response) {
375
		$('#' + domId).html(response);
397
			$('#' + domId).html(response);
376
	});
398
		});
-
 
399
	}
377
}
400
}
378
 
401
 
379
function loadCreatePartnerRegion(domId) {
402
function loadCreatePartnerRegion(domId) {
380
	doGetAjaxRequestHandler(context + "/cs/createPartnerRegion", function(
403
	doGetAjaxRequestHandler(context + "/cs/createPartnerRegion", function(
381
			response) {
404
			response) {
Line 403... Line 426...
403
			function(response) {
426
			function(response) {
404
				alert("Category created successfully");
427
				alert("Category created successfully");
405
				loadCreateCategory(domId);
428
				loadCreateCategory(domId);
406
			});
429
			});
407
}
430
}
408
function changeTicket(ticketId, subCategoryId, authUserId,categoryId) {
431
function changeTicket(ticketId, subCategoryId, authUserId, categoryId) {
409
	var params = {
432
	var params = {
410
		"ticketId" : ticketId,
433
		"ticketId" : ticketId,
411
		"subCategoryId" : subCategoryId,
434
		"subCategoryId" : subCategoryId,
412
		"authUserId" : authUserId,
435
		"authUserId" : authUserId,
413
		"categoryId":categoryId
436
		"categoryId" : categoryId
414
	}
437
	}
415
	doPostAjaxRequestWithParamsHandler(context + "/cs/edit-ticket", params,
438
	doPostAjaxRequestWithParamsHandler(context + "/cs/edit-ticket", params,
416
			function(response) {
439
			function(response) {
417
				if (response == "true") {
440
				if (response == "true") {
418
					alert("Ticket changed successfully");
441
					alert("Ticket changed successfully");
Line 537... Line 560...
537
}
560
}
538
function createActivity(message, ticketId, assigneeId) {
561
function createActivity(message, ticketId, assigneeId) {
539
	var params = {
562
	var params = {
540
		"message" : message,
563
		"message" : message,
541
		"ticketId" : ticketId,
564
		"ticketId" : ticketId,
542
		"assigneeId":assigneeId,
565
		"assigneeId" : assigneeId,
543
	}
566
	}
544
	doPostAjaxRequestWithParamsHandler(context + "/cs/createActivity", params,
567
	doPostAjaxRequestWithParamsHandler(context + "/cs/createActivity", params,
545
			function(response) {
568
			function(response) {
546
				response = JSON.parse(response);
569
				response = JSON.parse(response);
547
				var assigneeName = response.firstName;
570
				var assigneeName = response.firstName;
Line 557... Line 580...
557
function loadActivities(ticketId, assignee) {
580
function loadActivities(ticketId, assignee) {
558
 
581
 
559
	$(".activity-container .modal-body").empty();
582
	$(".activity-container .modal-body").empty();
560
	$("#activityMessage").val("");
583
	$("#activityMessage").val("");
561
	$("#ticketIdforactivity").val(ticketId);
584
	$("#ticketIdforactivity").val(ticketId);
562
	var assigned = "<div class=\"white_box\"><span>AssignedTo:-" + assignee
-
 
563
			+ "</span></div>";
-
 
564
	$(".activity-container .modal-body").append(assigned);
-
 
565
	console.log(ticketId);
585
	console.log(ticketId);
566
	doGetAjaxRequestHandler(
586
	doGetAjaxRequestHandler(
567
			context + "/cs/getActivities?ticketId=" + ticketId,
587
			context + "/cs/getActivities?ticketId=" + ticketId,
568
			function(response) {
588
			function(response) {
569
				response = JSON.parse(response);
589
				response = JSON.parse(response);