Subversion Repositories SmartDukaan

Rev

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

Rev 29209 Rev 32463
Line 49... Line 49...
49
								bootbox
49
								bootbox
50
									.alert("Gmail id is required");
50
									.alert("Gmail id is required");
51
							}
51
							}
52
						});
52
						});
53
			});
53
			});
-
 
54
			$(document).on('click', ".img_edit",
-
 
55
            			function() {
-
 
56
            				var $that = $(this);
-
 
57
            				bootbox
-
 
58
            					.prompt(
-
 
59
            						"New Image Url",
-
 
60
            						function(result) {
-
 
61
            							if (result) {
-
 
62
            								doGetAjaxRequestHandler(
-
 
63
            									context
-
 
64
            									+ "/authuser/editImageUrl?emailId="
-
 
65
            									+ $that
-
 
66
            										.data("id")
-
 
67
            									+ "&imageUrl="
-
 
68
            									+ result,
-
 
69
            									function(response) {
-
 
70
            										if (response == "true") {
-
 
71
            											bootbox
-
 
72
            												.alert("Image Url updated successfully");
-
 
73
            											$that
-
 
74
            												.closest(
-
 
75
            													'td')
-
 
76
            												.find(
-
 
77
            													'span')
-
 
78
            												.html(
-
 
79
            													result);
-
 
80
            											$that
-
 
81
            												.closest(
-
 
82
            													'td')
-
 
83
            												.find(
-
 
84
            													'button')
-
 
85
            												.html(
-
 
86
            													'Edit');
-
 
87
            											return;
-
 
88
            										}
-
 
89
            									});
-
 
90
            							} else {
-
 
91
            								bootbox
-
 
92
            									.alert("Image url is required");
-
 
93
            							}
-
 
94
            						});
-
 
95
            			});
-
 
96
 
54
 
97
 
55
	$(document).on('click', ".reset-password",
98
	$(document).on('click', ".reset-password",
56
			function() {
99
			function() {
57
				console.log("reset-password clicked......");
100
				console.log("reset-password clicked......");
58
				var emailId = $(this).data('id');
101
				var emailId = $(this).data('id');
Line 115... Line 158...
115
				var firstName = $("#authUserFirstName").val();
158
				var firstName = $("#authUserFirstName").val();
116
				var lastName = $("#authUserLastName").val();
159
				var lastName = $("#authUserLastName").val();
117
				var mobileNumber = $("#authUserMobileNumber").val();
160
				var mobileNumber = $("#authUserMobileNumber").val();
118
				var gmailId = $("#authUserGmailId").val();
161
				var gmailId = $("#authUserGmailId").val();
119
				var employeeCode = $("#authUserEmployeeCode").val();
162
				var employeeCode = $("#authUserEmployeeCode").val();
-
 
163
				var imageUrl=$("#authUserImage").val();
120
 
164
 
121
				if (emailId == "" || emailId == null
165
				if (emailId == "" || emailId == null
122
					|| emailId == undefined) {
166
					|| emailId == undefined) {
123
					alert("emailId cann't be blank");
167
					alert("emailId cann't be blank");
124
					return;
168
					return;
Line 154... Line 198...
154
				if (mobileNumber.length != 10) {
198
				if (mobileNumber.length != 10) {
155
 
199
 
156
					alert("required 10 digits, match requested format!");
200
					alert("required 10 digits, match requested format!");
157
					return;
201
					return;
158
				}
202
				}
-
 
203
 
159
				if (confirm("Are you sure you want to create Auth user!") == true) {
204
				if (confirm("Are you sure you want to create Auth user!") == true) {
160
					addAuthUser(emailId, firstName, lastName,
205
					addAuthUser(emailId, firstName, lastName,
161
						mobileNumber, gmailId, employeeCode);
206
						mobileNumber, gmailId, employeeCode,imageUrl);
162
				}
207
				}
163
			});
208
			});
164
	$(document).on('click', "#authUsers-paginated .next",
209
	$(document).on('click', "#authUsers-paginated .next",
165
		function() {
210
		function() {
166
 
211
 
Line 218... Line 263...
218
		function(response) {
263
		function(response) {
219
			alert("Password changed successfully");
264
			alert("Password changed successfully");
220
			loadChangeAuthUserPassword("main-content");
265
			loadChangeAuthUserPassword("main-content");
221
		});
266
		});
222
}
267
}
223
function addAuthUser(emailId, firstName, lastName, mobileNumber, gmailId, employeeCode) {
268
function addAuthUser(emailId, firstName, lastName, mobileNumber, gmailId, employeeCode, imageUrl) {
224
	var params = {
269
	var params = {
225
		"emailId": emailId,
270
		"emailId": emailId,
226
		"firstName": firstName,
271
		"firstName": firstName,
227
		"lastName": lastName,
272
		"lastName": lastName,
228
		"mobileNumber": mobileNumber,
273
		"mobileNumber": mobileNumber,
229
		"gmailId": gmailId,
274
		"gmailId": gmailId,
230
		"employeeCode": employeeCode
275
		"employeeCode": employeeCode,
-
 
276
		"imageUrl":imageUrl
231
	}
277
	}
232
	doPostAjaxRequestWithParamsHandler(
278
	doPostAjaxRequestWithParamsHandler(
233
		context + "/createAuthUser",
279
		context + "/createAuthUser",
234
		params,
280
		params,
235
		function(response) {
281
		function(response) {