Subversion Repositories SmartDukaan

Rev

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

Rev 27755 Rev 29200
Line 8... Line 8...
8
					function() {
8
					function() {
9
						console.log(localStorage.getItem("notifyDocument"));
9
						console.log(localStorage.getItem("notifyDocument"));
10
						var userIds = $('#fofo-users').val().concat(
10
						var userIds = $('#fofo-users').val().concat(
11
								$('#internal-users').val());
11
								$('#internal-users').val());
12
						console.log("multipleUsers", userIds);
12
						console.log("multipleUsers", userIds);
-
 
13
						
-
 
14
						var stateIds = $('#state-users').val();
-
 
15
						
-
 
16
						console.log("stateIds"+stateIds);
13
 
17
 
14
						var campaignName = $('input[name="campaignName"]')
18
						var campaignName = $('input[name="campaignName"]')
15
								.val();
19
								.val();
16
						var title = $('input[name="title"]').val();
20
						var title = $('input[name="title"]').val();
17
						var message = $('input[name="message"]').val();
21
						var message = $('input[name="message"]').val();
Line 31... Line 35...
31
 
35
 
32
						$('#showImage').on('change', function() {
36
						$('#showImage').on('change', function() {
33
							this.value = this.checked ? true : false;
37
							this.value = this.checked ? true : false;
34
						}).change();
38
						}).change();
35
 
39
 
36
						if (userIds.length === 0 && campaignName === ""
40
						if (campaignName === ""
37
								&& title === "" && message === ""
41
								&& title === "" && message === ""
38
								&& expiryTime === "" && type === ""
42
								&& expiryTime === "" && type === ""
39
								&& messageType === "") {
43
								&& messageType === "") {
40
							alert("Field can't be empty");
44
							alert("Field can't be empty");
41
							return;
45
							return;
42
						}
46
						}
43
						if (userIds.length === 0) {
47
						if (stateIds.length === 0 && stateIds.length === 0 ) {
44
							alert("please select the user");
48
							alert("please select the user or State");
45
							return;
49
							return;
46
						}
50
						}
47
						if (campaignName === "") {
51
						if (campaignName === "") {
48
							alert("Campaign name is required");
52
							alert("Campaign name is required");
49
							return;
53
							return;
Line 76... Line 80...
76
							}
80
							}
77
 
81
 
78
						}
82
						}
79
 
83
 
80
						var notificationData = {};
84
						var notificationData = {};
-
 
85
						
-
 
86
						notificationData['stateIds'] = $('#state-users').val();
-
 
87
						
81
						notificationData['userIds'] = $('#fofo-users').val()
88
						notificationData['userIds'] = $('#fofo-users').val()
82
								.concat($('#internal-users').val());
89
								.concat($('#internal-users').val());
83
						notificationData['campaignName'] = $(
90
						notificationData['campaignName'] = $(
84
								'input[name="campaignName"]').val();
91
								'input[name="campaignName"]').val();
85
						notificationData['title'] = $('input[name="title"]')
92
						notificationData['title'] = $('input[name="title"]')