Subversion Repositories SmartDukaan

Rev

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