Subversion Repositories SmartDukaan

Rev

Rev 5909 | Rev 6111 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2674 vikas 1
$(function() {
3228 mandeep.dh 2
    $("a.show-order-details").live('click', function() {
3
        var orderId = $(this).attr('orderId');
3499 mandeep.dh 4
        loadOrderInfo("bottom-infopane", orderId);
3228 mandeep.dh 5
    });
3206 mandeep.dh 6
 
3228 mandeep.dh 7
    $("a.show-user-details").live('click', function() {
8
        var userId = $(this).attr('userId');
9
        loadUserPane("infopane", userId);
10
    });
5168 amar.kumar 11
 
12
    $("a.agent-ticket-count").live('click', function() {
13
        loadTickets('infopane', "/crm/tickets!searchTickets?agentIds=" + $(this).attr('agentId') +"&status=OPEN");
14
    });
3090 mandeep.dh 15
 
3228 mandeep.dh 16
    $("a.show-orders").live('click', function() {
17
        var userId = $(this).attr('userId');
18
        loadOrderPane("infopane", userId, 0);
19
    });
3090 mandeep.dh 20
 
3228 mandeep.dh 21
    $("a.show-cart").live('click', function() {
22
        var userId = $(this).attr('userId');
23
        var cartId = $(this).attr('cartId');
24
        loadCartPane("infopane", userId, cartId);
25
    });
3090 mandeep.dh 26
 
3228 mandeep.dh 27
    $("a.show-line-details").live('click', function() {
28
        var userId = $(this).attr('userId');
29
        var itemId = $(this).attr('itemId');
30
        loadLineInfo("bottom-infopane", userId, itemId);
31
    });
3090 mandeep.dh 32
 
3228 mandeep.dh 33
    $("a.show-tickets").live('click', function() {
34
        var userId = $(this).attr('userId');
3405 mandeep.dh 35
        loadTickets('infopane', "/crm/tickets!searchTickets?userId=" + userId);
3228 mandeep.dh 36
    });
3090 mandeep.dh 37
 
3228 mandeep.dh 38
    $("a.show-activity").live('click', function() {
39
        var userId = $(this).attr('userId');
3405 mandeep.dh 40
        listActivities('infopane', "userId=" + userId);
3228 mandeep.dh 41
    });
3090 mandeep.dh 42
 
3228 mandeep.dh 43
    $("a.show-ticket-details").live('click', function() {
44
        var ticketId = $(this).attr('ticketId');
3405 mandeep.dh 45
 
3228 mandeep.dh 46
        // will be set when ticket Id link is clicked from activity page
47
        var activityId = $(this).attr('activityId');
48
        loadTicketInfo("bottom-infopane", ticketId, null, activityId);
49
    });
4241 anupam.sin 50
 
51
    $("a.show-activity-description").live('click', function() {
52
    	loadActivityDescription("activity-description-pane", this);
53
    });
3090 mandeep.dh 54
 
3228 mandeep.dh 55
    $("a.show-activity-details").live('click', function() {
56
        var activityId = $(this).attr('activityId');
3422 mandeep.dh 57
        loadActivityInfo("bottom-infopane", activityId);
3228 mandeep.dh 58
    });
4241 anupam.sin 59
 
3228 mandeep.dh 60
    $("a.create-ticket").live('click', function() {
3405 mandeep.dh 61
        var userId = $(this).attr('userId');
62
 
63
        var params = null;
64
        if (userId != null && userId != "") {
65
            params = "userId=" + userId;
66
        }
67
 
68
        loadTicketCreationForm("infopane", params);
3228 mandeep.dh 69
    });
3206 mandeep.dh 70
 
3228 mandeep.dh 71
    $("a.create-activity").live('click', function() {
72
        var userId = $(this).attr('userId');
3090 mandeep.dh 73
 
3405 mandeep.dh 74
        var params = null;
75
        if (userId != null && userId != "") {
76
            params = "userId=" + userId;
77
        }
78
 
79
        loadActivityCreationForm("infopane", params);
3339 mandeep.dh 80
    });
81
 
3228 mandeep.dh 82
    $('#update-ticket-form').live('submit', function() {
83
        var ticketId = $(this).attr('ticketId');
84
        updateTicket("infopane", ticketId, $(this).serialize());
85
        return false;
86
    });
3206 mandeep.dh 87
 
3228 mandeep.dh 88
    $('form#mail-form').live(
89
            'submit',
90
            function() {
4163 mandeep.dh 91
            	var body = $('#mail-body').val().trim();
92
                if (body == null || body == '') {
93
                	alert('Please specify body of the mail');
94
                }
95
                else {
4164 mandeep.dh 96
                    var ticketId = $('#update-ticket-form').attr('ticketId');
4163 mandeep.dh 97
                    updateTicket("infopane", ticketId, $(this).serialize() + '&'
98
                            + $('#update-ticket-form').serialize());
99
                    $.colorbox.close();
100
                }
101
 
3228 mandeep.dh 102
                return false;
103
            });
3106 mandeep.dh 104
 
4020 mandeep.dh 105
    $('form#escalation-form').live(
106
            'submit',
107
            function() {
108
                var ticketId = $('#update-ticket-form').attr('ticketId');
109
                updateTicket("infopane", ticketId, $(this).serialize() + '&'
110
                        + $('#update-ticket-form').serialize());
111
                $.colorbox.close();
112
                return false;
113
            });
4241 anupam.sin 114
 
4705 anupam.sin 115
    $('form#cancel-form').live('submit',
116
    		function() {
117
    	if( $('#cancelReasonBox').attr('style') && !($('#cancelReasonBox').attr('style').indexOf('none'))) {
118
    	var body = $('#cancel-body').val().trim();
119
    	if (body == null || body == '') {
120
    		alert('Please specify description');
121
    		return false;
122
    	}
123
    }
124
    var ticketId = $('.display-cancel-order-popup').attr('ticketId');
125
    var orderId = $('.display-cancel-order-popup').attr('orderId');
126
    var orderStatus = $('.display-cancel-order-popup').attr('orderStatus');
127
    cancelOrder("bottom-infopane", ticketId, orderId, orderStatus, $(this).serialize());
128
    $.colorbox.close();
129
    return false;
130
	});
4020 mandeep.dh 131
 
3228 mandeep.dh 132
    $('form#activity-mail-form').live(
133
            'submit',
134
            function() {
135
                createActivity("infopane", $(this).serialize() + '&' + $("#create-activity-form").serialize());
136
                $.colorbox.close();
137
                return false;
138
            });
3106 mandeep.dh 139
 
3405 mandeep.dh 140
    $('#create-activity-form').live('submit', function() {
141
        createActivity("infopane", $(this).serialize());
3339 mandeep.dh 142
        return false;
143
    });
144
 
3228 mandeep.dh 145
    $('#create-ticket-form').live('submit', function() {
146
        createTicket("infopane", $(this).serialize());
147
        return false;
148
    });
3106 mandeep.dh 149
 
3228 mandeep.dh 150
    $(".home-page").click(function() {
151
        goToHomePage();
152
    });
3106 mandeep.dh 153
 
3228 mandeep.dh 154
    $(".my-open-tickets").live('click', function() {
4008 mandeep.dh 155
        loadTickets('infopane', "/crm/tickets!searchTickets?agentIds=" + $(this).attr('agentIds') +"&status=OPEN");
3228 mandeep.dh 156
    });
3151 mandeep.dh 157
 
3228 mandeep.dh 158
    $(".unassigned-tickets").live('click', function() {
3234 mandeep.dh 159
        loadTickets('infopane', "/crm/tickets!getUnassignedTickets");
3151 mandeep.dh 160
    });
161
 
4065 mandeep.dh 162
    $("#spinner-div").ajaxSend(function(evt, request, settings) {
163
        if (settings.url != '/crm') {
164
            $(this).show();
165
        }
3228 mandeep.dh 166
    });
167
 
4065 mandeep.dh 168
    $("#spinner-div").ajaxComplete(function(evt, request, settings) {
169
        if (settings.url != '/crm') {
170
            $(this).hide();
171
        }
3228 mandeep.dh 172
    });
173
 
174
    $("select#activity-type").live('change', function() {
3422 mandeep.dh 175
        processActivityTypeChange($(this).val());
3228 mandeep.dh 176
    });
5225 amar.kumar 177
 
178
    $("select#common-activity-desc").live('change', function() {
179
        changeActivityFormValidCriteria($(this).val());
180
    });
3397 mandeep.dh 181
 
3339 mandeep.dh 182
    $(".list-my-activity").live('click', function() {
183
        listActivities('infopane', "");
184
    });
185
 
186
    $(".list-customer-activity").live('click', function() {
187
        listActivities('infopane', "creatorId=1");
188
    });
3390 mandeep.dh 189
 
190
    $("#mark-as-read").live('click', function() {
191
        var activityId = $(this).attr('activityId');
192
        markAsRead(activityId);
193
    });
3397 mandeep.dh 194
 
4490 anupam.sin 195
    $("#deny-doa").live('click', function() {
196
    	var ticketId = $(this).attr('ticketId');
197
    	var orderId = $(this).attr('orderId');
198
    	denyDOA(orderId, ticketId);
199
    });
200
 
201
    $("#authorize-doa").live('click', function() {
202
    	var ticketId = $(this).attr('ticketId');
203
    	var orderId = $(this).attr('orderId');
204
    	authorizeDOA(orderId, ticketId);
205
    });
206
 
207
    $("#deny-return").live('click', function() {
208
    	var ticketId = $(this).attr('ticketId');
209
    	var orderId = $(this).attr('orderId');
210
    	denyReturn(orderId, ticketId);
211
    });
212
 
213
    $("#authorize-return").live('click', function() {
214
    	var ticketId = $(this).attr('ticketId');
215
    	var orderId = $(this).attr('orderId');
216
    	authorizeReturn(orderId, ticketId);
217
    });
218
 
4267 anupam.sin 219
    $("#block-payment").live('click', function() {
220
    	var transactionId = $(this).attr('transactionId');
221
    	var ticketId = $(this).attr('ticketId');
4438 anupam.sin 222
    	var paymentId = $(this).attr('paymentId');
223
    	blockPayment(transactionId, ticketId, paymentId);
4267 anupam.sin 224
    });
225
 
226
    $("#allow-payment").live('click', function() {
227
    	var transactionId = $(this).attr('transactionId');
228
    	var ticketId = $(this).attr('ticketId');
4438 anupam.sin 229
    	var paymentId = $(this).attr('paymentId');
230
    	allowPayment(transactionId, ticketId, paymentId);
4267 anupam.sin 231
    });
232
 
3397 mandeep.dh 233
    $("form#search").live('submit', function() {
234
        if ($('#searchEntity').val() == 'Tickets') {
235
            loadTickets('infopane', "/crm/tickets!searchTickets?" + $(this).serialize());
236
        }
237
        else {
238
            listActivities('infopane', $(this).serialize());
239
        }
240
 
241
        $.colorbox.close();
242
        return false;
243
    });
244
 
245
    $(".advanced-search").live('click', function() {
246
        loadAdvancedSearchBox();
247
        return false;
248
    });
249
 
250
    $("select#searchEntity").live('change', function() {
251
        var searchEntity = $(this).val();
252
        processSearchEntityChange(searchEntity);
253
    });
3499 mandeep.dh 254
 
255
    $('.pending-cod-verification-tickets').live('click', function() {
3546 mandeep.dh 256
        loadTickets('infopane', "/crm/tickets!searchTickets?category=COD_VERIFICATION&status=OPEN");        
257
        return false;
3499 mandeep.dh 258
    });
3546 mandeep.dh 259
 
3578 mandeep.dh 260
    $('.open-failed-payments-tickets').live('click', function() {
261
        loadTickets('infopane', "/crm/tickets!searchTickets?category=FAILED_PAYMENTS&status=OPEN");        
262
        return false;
263
    });
4267 anupam.sin 264
 
265
    $('.open-flagged-payments-tickets').live('click', function() {
266
        loadTickets('infopane', "/crm/tickets!searchTickets?category=PAYMENT_FLAGGED&status=OPEN");        
267
        return false;
268
    });
4490 anupam.sin 269
 
270
    $('.doa-request-tickets').live('click', function() {
271
        loadTickets('infopane', "/crm/tickets!searchTickets?category=DOA_RECEIVED&status=OPEN");        
272
        return false;
273
    });
274
 
275
    $('.return-request-tickets').live('click', function() {
276
        loadTickets('infopane', "/crm/tickets!searchTickets?category=RETURN_FORM&status=OPEN");        
277
        return false;
278
    });
4751 anupam.sin 279
 
280
    $('#order-cancellation-tickets').live('click', function() {
281
        loadTickets('infopane', "/crm/tickets!searchTickets?category=ORDER_CANCELLATION&status=OPEN");        
282
        return false;
283
    });
3578 mandeep.dh 284
 
4008 mandeep.dh 285
    $('.open-delayed-delivery-tickets').live('click', function() {
286
        loadTickets('infopane', "/crm/tickets!searchTickets?category=DELAYED_DELIVERY&status=OPEN");        
287
        return false;
288
    });
5858 amar.kumar 289
 
290
    $('#store-pickup-tickets').live('click', function() {
291
        loadTickets('infopane', "/crm/tickets!searchTickets?category=STORE_PICKUP&status=OPEN");        
292
        return false;
293
    });
4008 mandeep.dh 294
 
3499 mandeep.dh 295
    $('.trust-level-increase').live('click', function() {
296
        increaseTrustLevel('infopane', $('input#trust-level-increase').attr('userId'), $('input#trust-level-increase').val());
297
    });
298
 
3546 mandeep.dh 299
    $('.update-order-status').live('click', function() {
300
        updateOrderStatus('bottom-infopane', $(this).attr('ticketId'), $(this).attr('orderId'), $(this).attr('orderStatus'));
3499 mandeep.dh 301
    });
4241 anupam.sin 302
 
303
    $('.display-cancel-order-popup').live('click', function() {
4689 anupam.sin 304
    	displayCancelOrderPopUp();
4241 anupam.sin 305
    });
3711 mandeep.dh 306
 
307
    $('.list-my-unread-activity').live('click', function() {
308
        loadUnreadActivities('infopane');
309
    });
4142 mandeep.dh 310
 
311
    $('form.change-address').live('submit', function() {
312
        changeAddress($(this).serialize());
313
    });
4681 amar.kumar 314
 
4689 anupam.sin 315
    $('#orderCancellationButton').live('click', function(){
316
        displayCancelOrderPopUp();
317
    });
318
 
4681 amar.kumar 319
    $('input.cancelReason').live('change', function(){
320
    	showHidecancelReasonDiv($(this).attr('id'));
321
    });
4793 amar.kumar 322
 
323
    $('a.manage-agents').live('click', function() {
324
        loadAgentsInfo("infopane");
325
    });
326
 
5909 amar.kumar 327
    $('a.open-tickets').live('click', function() {
328
        loadAllOpenTickets("infopane");
329
    });
330
 
331
    $('a.open-ticket-count').live('click', function() {
332
    	loadTickets('infopane', "/crm/tickets!searchTickets?category=" + $(this).attr('category') + "&status=OPEN");
333
    });
334
 
4793 amar.kumar 335
    $('a#create-agent').live('click', function() {
336
    	loadAgentCreationForm();
337
    });
338
 
339
    $('a#deactivate-agent').live('click', function() {
340
    	deactivateAgentPopup();
341
    });
342
 
343
    $('a#change-password').live('click', function() {
344
    	changeAgentPasswordPopup();
345
    });
346
 
5168 amar.kumar 347
    $('a#change-role').live('click', function() {
348
    	changeAgentRolePopup();
349
    });
350
 
4793 amar.kumar 351
    $('input#deactivate-agent').live('click', function() {
352
    	deactivateAgent($('#deactivate-agent-email').val(),$('#deactivate-agent-email').find(':selected')[0].id);
353
    });
354
 
355
    $('#create-agent-form').live('submit', function() {
356
    	if(validateAgentCreationForm()){
357
    		var managerId = $('#manager-email-id').find(':selected')[0].id;
358
    		createAgent($(this).serialize(), managerId);
359
    	}
360
    });
361
 
5168 amar.kumar 362
    $('#change-agent-role-form').live('submit', function() {
363
    	if($('#changed-role')[0].value!=""||$('#changed-role')[0].value!=undefined){
364
    		changeAgentRole($(this).serialize());
365
    	} else {
366
    		alert("Please choose roles before proceeding");
367
    	}
368
    });
369
 
4793 amar.kumar 370
    $('#change-agent-password').live('click', function() {
371
    	updateAgentPassword();
372
    });
5791 anupam.sin 373
 
374
    $('.extend-expiry').live('click', function() {
375
    	var pickupExtension = $('#pickupExtension').val();
5917 anupam.sin 376
        extendExpiryDate('bottom-infopane', $(this).attr('ticketId'), $(this).attr('orderId'), pickupExtension);
5791 anupam.sin 377
    });
2674 vikas 378
});