Subversion Repositories SmartDukaan

Rev

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

Rev 24840 Rev 25570
Line 97... Line 97...
97
	$("#region").live('change', function() {
97
	$("#region").live('change', function() {
98
		var regionId = $("#region").val();
98
		var regionId = $("#region").val();
99
		console.log(regionId);
99
		console.log(regionId);
100
		loadPartnerForRegion(regionId);
100
		loadPartnerForRegion(regionId);
101
	});
101
	});
-
 
102
 
-
 
103
	$("#regionPosition").live('change', function() {
-
 
104
		var regionId = $("#regionPosition").val();
-
 
105
		console.log(regionId);
-
 
106
		loadPartnerForRegionId(regionId);
-
 
107
	});
-
 
108
 
102
	$("#managersearchType").live('change', function() {
109
	$("#managersearchType").live('change', function() {
103
		var searchType = $("#managersearchType").val();
110
		var searchType = $("#managersearchType").val();
104
		console.log(searchType);
111
		console.log(searchType);
105
		var html;
112
		var html;
106
		if (searchType == "PARTNER_NAME") {
113
		if (searchType == "PARTNER_NAME") {
Line 585... Line 592...
585
						var authUser = $("#authUser").val();
592
						var authUser = $("#authUser").val();
586
						var ticketCategoryPosition = $(
593
						var ticketCategoryPosition = $(
587
								"#ticketCategoryPosition").val();
594
								"#ticketCategoryPosition").val();
588
						var escalationType = $("#escalationType").val();
595
						var escalationType = $("#escalationType").val();
589
						var regionPosition = $("#regionPosition").val();
596
						var regionPosition = $("#regionPosition").val();
-
 
597
						var fofoIds = $("#partner").val();
-
 
598
						if (fofoIds.includes("0")) {
-
 
599
							fofoIds = [ 0 ];
-
 
600
							console.log(fofoIds);
-
 
601
						} else {
-
 
602
							console.log(fofoIds);
-
 
603
						}
590
						console.log(authUser, ticketCategoryPosition,
604
						console.log(authUser, ticketCategoryPosition,
591
								escalationType, regionPosition);
605
								escalationType, regionPosition);
592
						if (authUser == "" || authUser == null
606
						if (authUser == "" || authUser == null
593
								|| authUser == undefined) {
607
								|| authUser == undefined) {
594
							alert("select appropriate authUser");
608
							alert("select appropriate authUser");
Line 608... Line 622...
608
						if (regionPosition == "" || regionPosition == null
622
						if (regionPosition == "" || regionPosition == null
609
								|| regionPosition == undefined) {
623
								|| regionPosition == undefined) {
610
							alert("select appropriate Region");
624
							alert("select appropriate Region");
611
							return false;
625
							return false;
612
						}
626
						}
-
 
627
 
613
						if (confirm("Are you sure you want to create Position!") == true) {
628
						if (confirm("Are you sure you want to create Position!") == true) {
614
							createPosition("main-content", authUser,
629
							createPosition("main-content", authUser,
615
									ticketCategoryPosition, escalationType,
630
									ticketCategoryPosition, escalationType,
616
									regionPosition);
631
									regionPosition, fofoIds);
617
						}
632
						}
-
 
633
 
618
					});
634
					});
619
 
635
 
620
	$("#ticketCategory").live('change', function() {
636
	$("#ticketCategory").live('change', function() {
621
		console.log("change ticket category clicked......");
637
		console.log("change ticket category clicked......");
622
		var ticketCategoryId = $(this).val();
638
		var ticketCategoryId = $(this).val();
Line 662... Line 678...
662
		if (confirm("Are you sure you want to remove position!") == true) {
678
		if (confirm("Are you sure you want to remove position!") == true) {
663
			removePosition(positionId);
679
			removePosition(positionId);
664
		}
680
		}
665
	});
681
	});
666
 
682
 
-
 
683
	$(".update-position").live(
-
 
684
			'click',
-
 
685
			function() {
-
 
686
				var positionId = $(this).data('positionid');
-
 
687
				var regionId = $(this).data('regionid');
-
 
688
 
-
 
689
				var row = $(this);
-
 
690
				var selectedFofoIds = $(this).closest("tr").find('#partners ')
-
 
691
						.val();
-
 
692
				if (selectedFofoIds.includes("0")) {
-
 
693
					selectedFofoIds = [ 0 ];
-
 
694
					console.log(selectedFofoIds);
-
 
695
				} else {
-
 
696
					console.log(selectedFofoIds);
-
 
697
				}
-
 
698
				if (confirm("Are you sure you want to update the partners!") == true) {
-
 
699
				doPostAjaxRequestWithJsonHandler(context
-
 
700
						+ "/cs/updatePartnerPosition?regionId=" + regionId
-
 
701
						+ "&positionId=" + positionId, JSON
-
 
702
						.stringify(selectedFofoIds), function(response) {
-
 
703
					if (response == "true") {
-
 
704
						alert("Update successfully");
-
 
705
						loadCreatePosition("main-content");
-
 
706
					}
-
 
707
				});
-
 
708
				}
-
 
709
 
-
 
710
			});
-
 
711
 
667
});
712
});
668
 
713
 
669
function loadCreateCategory(domId) {
714
function loadCreateCategory(domId) {
670
	doGetAjaxRequestHandler(context + "/cs/createCategory", function(response) {
715
	doGetAjaxRequestHandler(context + "/cs/createCategory", function(response) {
671
		$('#' + domId).html(response);
716
		$('#' + domId).html(response);
Line 859... Line 904...
859
					loadMyTicket("main-content", null, null);
904
					loadMyTicket("main-content", null, null);
860
				}
905
				}
861
			});
906
			});
862
}
907
}
863
 
908
 
864
function createPosition(domId, authUserId, categoryId, escalationType, regionId) {
909
function createPosition(domId, authUserId, categoryId, escalationType,
-
 
910
		regionId, fofoIds) {
-
 
911
 
865
	var params = {
912
	var createPositionModel = {};
866
		"authUserId" : authUserId,
913
	createPositionModel['authUserId'] = authUserId;
867
		"categoryId" : categoryId,
914
	createPositionModel['categoryId'] = categoryId
868
		"escalationType" : escalationType,
915
	createPositionModel['escalationType'] = escalationType;
869
		"regionId" : regionId
916
	createPositionModel['regionId'] = regionId,
-
 
917
			createPositionModel['fofoIds'] = fofoIds
870
	}
918
 
-
 
919
	console.log(createPositionModel);
871
	doPostAjaxRequestWithParamsHandler(context + "/cs/createPosition", params,
920
	doPostAjaxRequestWithJsonHandler(context + "/cs/createPosition", JSON
872
			function(response) {
921
			.stringify(createPositionModel), function(response) {
873
				if (response == "true") {
922
		if (response == "true") {
874
					alert("Position created successfully");
923
			alert("Position created successfully");
875
					loadCreatePosition(domId);
924
			loadCreatePosition(domId);
876
				}
925
		}
877
			});
926
	});
878
}
927
}
879
function createActivity(message, ticketId, assigneeId, internal, roleType) {
928
function createActivity(message, ticketId, assigneeId, internal, roleType) {
880
	var params = {
929
	var params = {
881
		"message" : message,
930
		"message" : message,
882
		"ticketId" : ticketId,
931
		"ticketId" : ticketId,
Line 900... Line 949...
900
	doGetAjaxRequestHandler(context + "/cs/getPartners?regionId=" + regionId,
949
	doGetAjaxRequestHandler(context + "/cs/getPartners?regionId=" + regionId,
901
			function(response) {
950
			function(response) {
902
				$("#partner-region-container").html(response);
951
				$("#partner-region-container").html(response);
903
			});
952
			});
904
}
953
}
-
 
954
 
-
 
955
function loadPartnerForRegionId(regionId) {
-
 
956
	doGetAjaxRequestHandler(context + "/cs/getPartnersByRegion?regionId="
-
 
957
			+ regionId, function(response) {
-
 
958
		$("#partner-subregion-container").html(response);
-
 
959
	});
-
 
960
}
-
 
961
 
905
function loadActivities(ticketId, assignee, internal, roleType) {
962
function loadActivities(ticketId, assignee, internal, roleType) {
906
 
963
 
907
	$(".activity-container .modal-body").empty();
964
	$(".activity-container .modal-body").empty();
908
	$("#activityMessage").val("");
965
	$("#activityMessage").val("");
909
	$("#ticketIdforactivity").val(ticketId);
966
	$("#ticketIdforactivity").val(ticketId);