Subversion Repositories SmartDukaan

Rev

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

Rev 24417 Rev 24439
Line 5... Line 5...
5
		loadCreateCategory("main-content");
5
		loadCreateCategory("main-content");
6
	});
6
	});
7
	$(".create-region").live('click', function() {
7
	$(".create-region").live('click', function() {
8
		loadCreateRegion("main-content");
8
		loadCreateRegion("main-content");
9
	});
9
	});
-
 
10
	$("#edit-ticket").live('click', function() {
-
 
11
		loadTicketByTicketId("main-content");
-
 
12
	});
-
 
13
	$(".manager-ticket").live('click', function() {
-
 
14
		loadManagerTicket("main-content");
-
 
15
	});
10
	$(".ticketType").live('click', function() {
16
	$(".ticketType").live('click', function() {
11
		loadCreateRegion("main-content");
17
		loadCreateRegion("main-content");
12
	});
18
	});
13
	$(".activities").live('click', function() {
19
	$(".activities").live('click', function() {
14
		var ticketId = $(this).data('ticketid');
20
		var ticketId = $(this).data('ticketid');
Line 19... Line 25...
19
	$(".my-ticket").live('click', function() {
25
	$(".my-ticket").live('click', function() {
20
		loadMyTicket("main-content");
26
		loadMyTicket("main-content");
21
	});
27
	});
22
	$("#close-ticket").live('click', function() {
28
	$("#close-ticket").live('click', function() {
23
		var ticketId = $(this).data('ticketid');
29
		var ticketId = $(this).data('ticketid');
24
		if (confirm("Are you sure you want to close ticket!") == true) {
-
 
25
			closeTicket(ticketId);
30
		closeTicket(ticketId);
26
		}
-
 
27
	});
31
	});
28
	$(".submit-message-button").live('click', function() {
32
	$(".submit-message-button").live('click', function() {
29
		var message = $("#activityMessage").val();
33
		var message = $("#activityMessage").val();
30
		if (message == "" || message == null || message == undefined) {
34
		if (message == "" || message == null || message == undefined) {
31
			alert("message field can't be empty");
35
			alert("message field can't be empty");
Line 343... Line 347...
343
	doGetAjaxRequestHandler(context + "/cs/createSubCategory", function(
347
	doGetAjaxRequestHandler(context + "/cs/createSubCategory", function(
344
			response) {
348
			response) {
345
		$('#' + domId).html(response);
349
		$('#' + domId).html(response);
346
	});
350
	});
347
}
351
}
-
 
352
function loadManagerTicket(domId){
-
 
353
	doGetAjaxRequestHandler(context + "/cs/managerTicket", function(
-
 
354
			response) {
-
 
355
		$('#' + domId).html(response);
-
 
356
	});
-
 
357
}
348
function loadCreateTicket(domId) {
358
function loadCreateTicket(domId) {
349
	doGetAjaxRequestHandler(context + "/cs/createTicket", function(response) {
359
	doGetAjaxRequestHandler(context + "/cs/createTicket", function(response) {
350
		$('#' + domId).html(response);
360
		$('#' + domId).html(response);
351
	});
361
	});
352
}
362
}
Line 378... Line 388...
378
				alert("Sub Category created successfully");
388
				alert("Sub Category created successfully");
379
				loadCreateSubCategory(domId);
389
				loadCreateSubCategory(domId);
380
			});
390
			});
381
}
391
}
382
function closeTicket(ticketId) {
392
function closeTicket(ticketId) {
-
 
393
	var dialog = bootbox
-
 
394
			.dialog({
-
 
395
				title : "Are you sure want to close ticket!",
-
 
396
				message : "<div class=\"col-lg-6 form-group\">"
-
 
397
						+ "<input placeholder=\"Happy Code\" id=\"happyCode\" name=\"happyCode\" type=\"text\"  class=\"form-control input-sm\">"
-
 
398
						+ "</div>",
-
 
399
				buttons : {
-
 
400
					cancel : {
-
 
401
						label : "cancel",
-
 
402
						className : 'btn-danger',
-
 
403
						callback : function() {
-
 
404
							loadMyTicket("main-content");
-
 
405
						}
-
 
406
					},
-
 
407
					ok : {
-
 
408
						label : "ok",
-
 
409
						className : 'btn-info',
-
 
410
						callback : function() {
-
 
411
							happyCode = $('#happyCode').val();
-
 
412
							console.log(happyCode);
-
 
413
							if (happyCode == "" || happyCode == null
-
 
414
									|| happyCode == undefined) {
-
 
415
								alert("happyCode field can't be empty");
-
 
416
								return false;
-
 
417
							}
383
	var params = {
418
							var params = {
384
		"ticketId" : ticketId
419
								"ticketId" : ticketId,
-
 
420
								"happyCode" : happyCode
385
	}
421
							}
386
	doPostAjaxRequestWithParamsHandler(context + "/cs/closeTicket", params,
422
							doPostAjaxRequestWithParamsHandler(context
-
 
423
									+ "/cs/closeTicket", params, function(
387
			function(response) {
424
									response) {
388
				alert("Ticket close successfully");
425
								alert("Ticket close successfully");
389
				loadMyTicket("main-content");
426
								loadMyTicket("main-content");
-
 
427
							});
-
 
428
						}
-
 
429
					}
-
 
430
				}
390
			});
431
			});
-
 
432
 
391
}
433
}
392
function createPosition(domId, authUserId, categoryId, escalationType, regionId) {
434
function createPosition(domId, authUserId, categoryId, escalationType, regionId) {
393
	var params = {
435
	var params = {
394
		"authUserId" : authUserId,
436
		"authUserId" : authUserId,
395
		"categoryId" : categoryId,
437
		"categoryId" : categoryId,