Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
2749 vikas 1
var orderTable;
2
var cartTable;
3096 mandeep.dh 3
 
3090 mandeep.dh 4
function loadUserPane(domId, userId) {
3228 mandeep.dh 5
    $.ajax({
6
        type : "GET",
7
        url : "/crm/user-info?userId=" + userId,
8
        success : function(response) {
9
            $('#' + domId).html(response);
10
        }
11
    });
2674 vikas 12
}
13
 
3228 mandeep.dh 14
function loadOrderPane(domId, userId, orderId) {
15
    $.ajax({
16
        type : "GET",
17
        url : "/crm/user-orders?userId=" + userId,
18
        success : function(response) {
19
            $('#' + domId).html(response);
3499 mandeep.dh 20
            loadOrderInfo("bottom-infopane", orderId);
3228 mandeep.dh 21
            orderTable = $('#user-orders').dataTable({
22
                "aaSorting" : [ [ 1, 'desc' ] ],
4241 anupam.sin 23
              "bAutoWidth": false,
24
              "aoColumns" : [{ "sWidth": "16%" },//order id
25
                             { "sWidth": "30%" },//item desc
26
                             { "sWidth": "16%" },//created
27
                             { "sWidth": "8%" },//amount
28
                             { "sWidth": "17%" },//status
29
                             { "sWidth": "9%" }],//mobile no.
3996 mandeep.dh 30
                "fnDrawCallback": function() { truncateText(125); },
4605 anupam.sin 31
                "iDisplayLength" : 10,
3339 mandeep.dh 32
                "sDom" : 'T<"clear">lfrtip',
33
                "oTableTools" : {
34
                    "sSwfPath" : "swf/copy_cvs_xls_pdf.swf"
35
                },
3228 mandeep.dh 36
                "aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]
37
            });
38
        }
39
    });
2674 vikas 40
}
41
 
3228 mandeep.dh 42
function loadCartPane(domId, userId, cartId) {
43
    $.ajax({
44
        type : "GET",
45
        url : "/crm/user-cart?userId=" + userId + "&cartId=" + cartId,
46
        success : function(response) {
47
            $('#' + domId).html(response);
48
            cartTable = $('#user-cart').dataTable({
49
                "aaSorting" : [ [ 1, 'desc' ] ],
4241 anupam.sin 50
              "bAutoWidth": false,
51
              "aoColumns" : [{ "sWidth": "32%" },//name
52
                             { "sWidth": "9%" },//quantity
53
                             { "sWidth": "16%" },//actual price
54
                             { "sWidth": "16%" },//discounted price
55
                             { "sWidth": "9%" },//estimate
56
                             { "sWidth": "18%" }],//created on
3228 mandeep.dh 57
                "iDisplayLength" : 10,
3339 mandeep.dh 58
                "sDom" : 'T<"clear">lfrtip',
59
                "oTableTools" : {
60
                    "sSwfPath" : "swf/copy_cvs_xls_pdf.swf"
61
                },
3228 mandeep.dh 62
                "aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]
63
            });
64
        }
65
    });
2714 vikas 66
}
67
 
3499 mandeep.dh 68
function loadOrderInfo(domId, orderId) {
3228 mandeep.dh 69
    $.ajax({
70
        type : "GET",
3499 mandeep.dh 71
        url : "/crm/user-order-info?orderId=" + orderId,
3228 mandeep.dh 72
        success : function(response) {
73
            $('#' + domId).html(response);
3220 mandeep.dh 74
 
3228 mandeep.dh 75
            var trId = 'order-row-' + orderId;
76
            if (orderTable != null) {
77
                for ( var index in orderTable.fnGetNodes()) {
78
                    var item = orderTable.fnGetNodes()[index];
79
                    if ($(item).attr('id') == trId) {
80
                        orderTable.fnDisplayRow(item);
81
                        break;
82
                    }
83
                }
84
            }
3220 mandeep.dh 85
 
3228 mandeep.dh 86
            $('#user-orders tr').removeClass('selected');
87
            $('#order-row-' + orderId).addClass('selected');
88
        }
89
    });
2714 vikas 90
}
91
 
3228 mandeep.dh 92
function loadLineInfo(domId, userId, itemId) {
93
    $.ajax({
94
        type : "GET",
95
        url : "/crm/user-line-info?userId=" + userId + "&itemId=" + itemId,
96
        success : function(response) {
97
            $('#' + domId).html(response);
98
            $('#user-cart tr').removeClass('selected');
99
            $('#cart-row-' + itemId).addClass('selected');
100
        }
101
    });
2830 vikas 102
}
103
 
3228 mandeep.dh 104
function loadTicketInfo(domId, ticketId, ticketTable, activityId) {
105
    $.ajax({
106
        type : "GET",
3405 mandeep.dh 107
        url : "/crm/tickets/" + ticketId + "/edit",
3228 mandeep.dh 108
        success : function(response) {
109
            $('#' + domId).html(response);
3206 mandeep.dh 110
 
3228 mandeep.dh 111
            var trId = 'ticket-row-' + ticketId;
112
            if (ticketTable != null) {
113
                for ( var index in ticketTable.fnGetNodes()) {
114
                    var item = ticketTable.fnGetNodes()[index];
115
                    if ($(item).attr('id') == trId) {
116
                        ticketTable.fnDisplayRow(item);
117
                        break;
118
                    }
119
                }
120
            }
3206 mandeep.dh 121
 
3228 mandeep.dh 122
            $('#tickets tr').removeClass('selected');
123
            $('#' + trId).addClass('selected');
124
 
125
            // For tickets accessed from activity page
126
            if (activityId != null) {
3339 mandeep.dh 127
                $('#activity tr').removeClass('selected');
3228 mandeep.dh 128
                $('#activity-row-' + activityId).addClass('selected');
129
            }
3546 mandeep.dh 130
 
131
            $('#order-table').dataTable({
132
                "aaSorting" : [ [ 2, 'desc' ] ],
4241 anupam.sin 133
//            "bAutoWidth": false,
134
//            "aoColumns" : [{ "sWidth": "5%" },
135
//                           { "sWidth": "20%" },
136
//                           { "sWidth": "20%" },
137
//                           { "sWidth": "12.5%" },
138
//                           { "sWidth": "12.5%" },
139
//                           { "sWidth": "10%" },
140
//                           { "sWidth": "10%" },
141
//                           { "sWidth": "10%" }],
4605 anupam.sin 142
                "iDisplayLength" : 10,
3546 mandeep.dh 143
                "fnDrawCallback": function() {truncateText(100);},
144
                "aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]
145
            });
3228 mandeep.dh 146
        }
147
    });
3090 mandeep.dh 148
}
149
 
3405 mandeep.dh 150
function createTicketDataTable(domId) {
3499 mandeep.dh 151
    var ticketsTable = $('#' + domId).dataTable({
4142 mandeep.dh 152
         "aaSorting" : [ [ 3, 'asc' ] ],
4241 anupam.sin 153
         "bAutoWidth": false,
154
         "aoColumns" : [{ "sWidth": "9%" },//ticket id
155
                        { "sWidth": "16%" },//customer id or Description when orderId is set
156
                        { "sWidth": "21%" },//category id
157
                        { "sWidth": "13%" },//date created
158
                        { "sWidth": "13%" },//date closed
159
                        { "sWidth": "12%" },//assignee
160
                        { "sWidth": "8%" },//status
161
                        { "sWidth": "8%" }],//priority
3546 mandeep.dh 162
        "fnDrawCallback": function() {truncateText(85);},
4605 anupam.sin 163
        "iDisplayLength" : 10,
3339 mandeep.dh 164
        "sDom" : 'T<"clear">lfrtip',
165
        "oTableTools" : {
166
            "sSwfPath" : "swf/copy_cvs_xls_pdf.swf"
167
        },
168
        "aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]
169
    });
3499 mandeep.dh 170
 
171
    return ticketsTable;
3339 mandeep.dh 172
}
173
 
4241 anupam.sin 174
function loadActivityDescription(domId, aActivityId) {
175
	$('#' + domId).html("<h4>Activity Description :</h4><pre>" + $(aActivityId).parent().siblings('td[id="activity-description"]').attr('title') + '</pre>');
176
    $('#activity-table tr').removeClass('selected');
177
    $(aActivityId).parent().parent().addClass('selected');
178
}
179
 
3422 mandeep.dh 180
function loadActivityInfo(domId, activityId) {
3228 mandeep.dh 181
    $.ajax({
182
        type : "GET",
3422 mandeep.dh 183
        url : "/crm/activity-info?activityId=" + activityId,
3228 mandeep.dh 184
        success : function(response) {
185
            $('#' + domId).html(response);
3339 mandeep.dh 186
            $('#activity tr').removeClass('selected');
3228 mandeep.dh 187
            $('#activity-row-' + activityId).addClass('selected');
3390 mandeep.dh 188
            $('#activity').css('table-layout', 'fixed');
3228 mandeep.dh 189
        }
190
    });
3090 mandeep.dh 191
}
192
 
3405 mandeep.dh 193
function createActivityDataTable(domId) {
3499 mandeep.dh 194
    var activityTable = $('#' + domId).dataTable({
3339 mandeep.dh 195
        "aaSorting" : [ [ 4, 'desc' ] ],
4241 anupam.sin 196
     "bAutoWidth": false,
197
      "aoColumns" : [{ "sWidth": "10%" },//id
198
                     { "sWidth": "22%" },//activity type
199
                     { "sWidth": "15%" },//description
200
                     { "sWidth": "12%" },//timestamp
201
                     { "sWidth": "12%" },//creator
202
                     { "sWidth": "12%" },//customer id
203
                     { "sWidth": "9%" },//ticket id
204
                     { "sWidth": "8%" }],//category
4605 anupam.sin 205
        "iDisplayLength" : 10,
3339 mandeep.dh 206
        "sDom" : 'T<"clear">lfrtip',
3546 mandeep.dh 207
        "fnDrawCallback": function() {truncateText(95);},
3339 mandeep.dh 208
        "oTableTools" : {
209
            "sSwfPath" : "swf/copy_cvs_xls_pdf.swf"
210
        },
211
        "aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]
212
    });
3499 mandeep.dh 213
 
214
    return activityTable;
3339 mandeep.dh 215
}
216
 
3405 mandeep.dh 217
function loadTicketCreationForm(domId, params) {
3228 mandeep.dh 218
    $.ajax({
219
        type : "GET",
3339 mandeep.dh 220
        url : "/crm/tickets/new",
3405 mandeep.dh 221
        data : params,
3339 mandeep.dh 222
        success : function(response) {
223
            $('#' + domId).html(response);
224
        }
225
    });
226
}
227
 
3405 mandeep.dh 228
function loadActivityCreationForm(domId, params) {
3339 mandeep.dh 229
    $.ajax({
230
        type : "GET",
231
        url : "/crm/activity/new",
3405 mandeep.dh 232
        data : params,
3339 mandeep.dh 233
        success : function(response) {
234
            $('#' + domId).html(response);
235
        }
236
    });
237
}
238
 
3090 mandeep.dh 239
function updateTicket(domId, ticketId, params) {
3228 mandeep.dh 240
    $.ajax({
4782 mandeep.dh 241
        type : "POST",
242
        url : "/crm/tickets!update?id=" + ticketId,
243
        data : params,
3228 mandeep.dh 244
        success : function(response) {
3339 mandeep.dh 245
            var ticketTable = $('table[id$="tickets"]');
246
            if (ticketTable.length == 1) {
247
                var rowIndex = ticketTable.dataTable().fnGetPosition($('tr#ticket-row-' + ticketId)[0]);
248
                var responseObj = jQuery(response);
3546 mandeep.dh 249
                var actionMessages = responseObj.find('#action-messages').html();
3339 mandeep.dh 250
                responseObj.find('#ticket-row-' + ticketId).children().each(
251
                        function(i, item) {
252
                            var th = responseObj.find('th').eq(i);
253
                            if (th.text() == "Ticket Id") {
254
                                return;
255
                            }
256
 
257
                            var thOld = ticketTable.find('th').filter(
258
                                    function(index) {
259
                                        if ($(this).text() == th.text()) {
260
                                            return true;
261
                                        }
262
 
263
                                        return false;
264
                                    });
265
 
4249 anupam.sin 266
                            if ($(thOld).length != 0) {
3339 mandeep.dh 267
                                ticketTable.dataTable().fnUpdate($(item).text(), rowIndex, $(thOld).index(), true, false);
268
                            }
269
                        });
270
 
3546 mandeep.dh 271
                loadTicketInfo("bottom-infopane", ticketId, ticketTable.dataTable(), null);
3339 mandeep.dh 272
                ticketTable.css('table-layout', 'fixed');
3546 mandeep.dh 273
 
274
                var alertString = jQuery.trim(actionMessages);
275
                if (alertString != '') {
276
                    alert(alertString);
277
                }
3339 mandeep.dh 278
            }
279
            else {
280
                loadTicketInfo("bottom-infopane", ticketId, null, null);
281
            }
282
 
3499 mandeep.dh 283
            truncateText(85);
3339 mandeep.dh 284
        }
285
    });
286
}
287
 
3090 mandeep.dh 288
function createTicket(domId, params) {
3228 mandeep.dh 289
    $.ajax({
290
        type : "POST",
3339 mandeep.dh 291
        url : "/crm/tickets",
3228 mandeep.dh 292
        data : params,
293
        success : function(response) {
294
            $('#' + domId).html(response);
3405 mandeep.dh 295
            var ticketTable = createTicketDataTable('tickets');
3228 mandeep.dh 296
        }
297
    });
3090 mandeep.dh 298
}
299
 
300
function createActivity(domId, params) {
3228 mandeep.dh 301
    $.ajax({
302
        type : "POST",
3339 mandeep.dh 303
        url : "/crm/activity",
3228 mandeep.dh 304
        data : params,
305
        success : function(response) {
306
            $('#' + domId).html(response);
3405 mandeep.dh 307
            var activityTable = createActivityDataTable('activity');
3228 mandeep.dh 308
        }
309
    });
3106 mandeep.dh 310
}
311
 
312
function goToHomePage() {
3228 mandeep.dh 313
    document.location.href = "/crm";
3106 mandeep.dh 314
}
315
 
3422 mandeep.dh 316
function loadTickets(domId, getURL, ticketId) {
3228 mandeep.dh 317
    $.ajax({
318
        type : "GET",
3234 mandeep.dh 319
        url : getURL,
3228 mandeep.dh 320
        success : function(response) {
321
            $('#' + domId).html(response);
3405 mandeep.dh 322
            var ticketTable = createTicketDataTable('tickets');
3422 mandeep.dh 323
            if (ticketId != null) {
324
                loadTicketInfo("bottom-infopane", ticketId, ticketTable.dataTable(), null);
325
                ticketTable.css('table-layout', 'fixed');
326
            }
3228 mandeep.dh 327
        }
328
    });
3106 mandeep.dh 329
}
3137 mandeep.dh 330
 
3422 mandeep.dh 331
function processActivityTypeChange(activityType) {
3269 mandeep.dh 332
    if (activityType == "SEND_EMAIL_TO_CUSTOMER") {
3228 mandeep.dh 333
        $.colorbox({
334
            inline : true,
3519 mandeep.dh 335
            width : "775px",
336
            height : "445px",
3228 mandeep.dh 337
            href : "div#mail-div",
338
            onClosed : function() {
3519 mandeep.dh 339
				CKEDITOR.instances['mail-body'].destroy(false);
3228 mandeep.dh 340
                $("div#mail-div").hide();
341
                $('select#activity-type').val('OTHER');
342
            }
343
        });
3206 mandeep.dh 344
 
3228 mandeep.dh 345
        $("div#mail-div").show();
3701 mandeep.dh 346
        $('#mail-body').ckeditor({toolbar : 'Basic', scayt_autoStartup : true});
3228 mandeep.dh 347
    }
4020 mandeep.dh 348
    else if (activityType == "ESCALATE_TICKET") {
349
        $.colorbox({
350
            inline : true,
351
            width : "675px",
4027 mandeep.dh 352
            height : "560px",
4020 mandeep.dh 353
            href : "div#escalation-div",
354
            onClosed : function() {
355
                CKEDITOR.instances['escalation-mail-body'].destroy(false);
356
                $("div#escalation-div").hide();
357
                $('select#activity-type').val('OTHER');
358
            }
359
        });
360
 
361
        $("div#escalation-div").show();
362
        $('#escalation-mail-body').ckeditor({toolbar : 'Basic', scayt_autoStartup : true});
363
    }
3206 mandeep.dh 364
}
365
 
366
function processInputFormSubmit() {
3228 mandeep.dh 367
    $.ajax({
368
        type : "POST",
369
        url : "/crm/",
370
        success : function(response) {
371
            $.html(response);
3405 mandeep.dh 372
            var ticketTable = createTicketDataTable('tickets');
3228 mandeep.dh 373
        }
374
    });
3339 mandeep.dh 375
}
376
 
377
function listActivities(domId, params) {
378
    $.ajax({
379
        type : "GET",
380
        url : "/crm/activity",
381
        data : params,
382
        success : function(response) {
383
            $('#' + domId).html(response);
3405 mandeep.dh 384
            var activityTable = createActivityDataTable('activity');
3339 mandeep.dh 385
        }
386
    });
387
}
388
 
389
function truncateText(widthSize) {
4241 anupam.sin 390
    $(".truncated-text").each(function() {
391
    	$(this).truncate({
392
            width : $(this).attr('truncatedTextWidth'),
393
            addtitle : true
394
        });
395
	})
3339 mandeep.dh 396
}
3390 mandeep.dh 397
 
398
function markAsRead(activityId) {
399
    $.ajax({
400
        type : "POST",
401
        url : "/crm/activity!markAsRead?activityId=" + activityId,
402
        success: function(response) {
403
            listActivities('infopane', "creatorId=1");
404
        }
405
    });
406
}
3397 mandeep.dh 407
 
408
function loadAdvancedSearchBox() {
409
    $.colorbox({
410
        inline : true,
411
        width : "535px",
412
        height : "465px",
413
        href : "form#search",
414
        onClosed : function() {
415
            $("form#search").hide();
416
        }
417
    });
418
 
419
    $("form#search").show();
420
}
421
 
422
function processSearchEntityChange(searchEntity) {
423
    if (searchEntity == "Tickets") {
424
        $("#assignee").show();
425
        $("#creator").hide();
4142 mandeep.dh 426
        $("tr#activityTypes").hide();
3397 mandeep.dh 427
    }
428
    else if (searchEntity == "Activities") {
429
        $("#assignee").hide();
430
        $("#creator").show();
4142 mandeep.dh 431
        $("tr#activityTypes").show();
3397 mandeep.dh 432
    }
433
}
3499 mandeep.dh 434
 
435
function increaseTrustLevel(domId, userId, trustLevelDelta) {
436
    $.ajax({
437
        type : "PUT",
438
        url : "/crm/user-info/" + userId + "?trustLevelDelta=" + trustLevelDelta,
439
        success : function(response) {
440
            $('#' + domId).html(response);
441
        }
442
    });
443
}
444
 
4241 anupam.sin 445
function displayCancelOrderPopUp() {
446
    	$.colorbox({
447
            inline : true,
448
            width : "650px",
4314 anupam.sin 449
            height : "550px",
4689 anupam.sin 450
            href : "div#cancel-div",
4241 anupam.sin 451
            onClosed : function() {
4689 anupam.sin 452
                CKEDITOR.instances['cancel-body'].destroy(false);
453
                $("div#cancel-div").hide();
4241 anupam.sin 454
            }
455
        });
456
 
4689 anupam.sin 457
        $("div#cancel-div").show();
458
        $('#cancel-body').ckeditor({toolbar : 'Basic', scayt_autoStartup : true});
4241 anupam.sin 459
}
460
 
461
function cancelOrder(domId, ticketId, orderId, orderStatus, formData) {
4704 anupam.sin 462
	if ($('#cancellationInitiator').val()) {
4689 anupam.sin 463
		var cancellationInitiator = $('#cancellationInitiator').val();
464
		var uri = "/crm/user-order-info!markOrderForCancellation?orderId=" + orderId
465
						+ "&cancellationInitiator=" + cancellationInitiator + "&" + formData;
466
		var cancellationResult = function() {
467
			document.location.href = "/crm?email=&orderId=" + orderId;
468
		}
469
	} else {
470
		var uri = "/crm/tickets!updateOrderStatus?id=" + ticketId + "&orderId=" + orderId
471
						+ "&orderStatus=" + orderStatus + "&" + formData;
472
		var cancellationResult = function(response) {
473
            $('#' + domId).html(response);
474
        }
475
	}
4241 anupam.sin 476
    $.ajax({
477
        type : "POST",
4689 anupam.sin 478
        url : uri,
479
        success : cancellationResult
4241 anupam.sin 480
    });
4681 amar.kumar 481
 
482
    if(formData.indexOf("LOWER_PRICE_AVAILABLE_ELSEWHERE")!=-1){
483
    	var desc = formData.split("&");
484
    	var description = "Order cancelled because of Lower Price Available elsewhere";
485
    	$.ajax({
486
    		type : "POST",
487
    		url : "/crm/tickets?orderId="+orderId+"&priority=MEDIUM&category=PRODUCT_PROCUREMENT"
488
    				+ "&assigneeEmailId=chaitnaya.vats@shop2020.in&description="+description+"&"+desc[1],
489
    		success : function(response){
490
    			alert("Ticket created for Lower Price Available elsewhere");
491
    		}
492
    	});
493
 
494
    }
4241 anupam.sin 495
}
4065 mandeep.dh 496
 
4241 anupam.sin 497
function updateOrderStatus(domId, ticketId, orderId, orderStatus) {
3499 mandeep.dh 498
    $.ajax({
3546 mandeep.dh 499
        type : "POST",
4241 anupam.sin 500
        url : "/crm/tickets!updateOrderStatus?id=" + ticketId + "&orderId=" + orderId
501
        					+ "&orderStatus=" + orderStatus,
3499 mandeep.dh 502
        success : function(response) {
3546 mandeep.dh 503
            $('#' + domId).html(response);
3499 mandeep.dh 504
        }
505
    });
3711 mandeep.dh 506
}
507
 
508
function loadUnreadActivities(domId) {
509
    $.ajax({
510
        type : "GET",
511
        url : "/crm/activity!getUnreadActivities",
512
        success : function(response) {
513
            $('#' + domId).html(response);
514
            var activityTable = createActivityDataTable('activity');
515
        }
516
    });
517
}
4065 mandeep.dh 518
 
519
function refreshSidebar() {
520
    $.ajax({
4142 mandeep.dh 521
        type : "PUT",
522
        url : "/crm",
523
        success : function(response) {
524
            $('#sidebar').html($(response).find('#sidebar').html());
525
        }
526
    });
527
}
528
 
529
function changeAddress(urlParams) {
530
    $.ajax({
4065 mandeep.dh 531
        type : "GET",
532
        url : "/crm",
533
        success : function(response) {
534
            $('#sidebar').html($(response).find('#sidebar').html());
535
        }
536
    });
4267 anupam.sin 537
}
538
 
4681 amar.kumar 539
function showHidecancelReasonDiv(cancelReason){
540
	if(cancelReason=="LOWER_PRICE_AVAILABLE_ELSEWHERE"||cancelReason=="OTHER"){
541
		$('#cancelReasonBox').show();
542
	} else {
543
		$('#cancelReasonBox').hide();
544
	}
545
 
546
}
547
 
4438 anupam.sin 548
function blockPayment(transactionId, ticketId, paymentId) {
4267 anupam.sin 549
	$.ajax({
550
		type : "GET",
4451 anupam.sin 551
		url : "/crm/tickets!blockPayment?transactionId=" + transactionId + "&id=" + ticketId + "&paymentId=" + paymentId,
4267 anupam.sin 552
		success : function(response) {
553
            $('#bottom-infopane').html(response);
554
        }
555
	});
556
}
557
 
4438 anupam.sin 558
function allowPayment(transactionId, ticketId, paymentId) {
4267 anupam.sin 559
	$.ajax({
560
		type : "GET",
4451 anupam.sin 561
		url : "/crm/tickets!allowPayment?transactionId=" + transactionId + "&id=" + ticketId + "&paymentId=" + paymentId,
4267 anupam.sin 562
		success : function(response) {
563
            $('#bottom-infopane').html(response);
564
        }
565
	});
4490 anupam.sin 566
}
567
 
568
function denyDOA(orderId, ticketId) {
569
	$.ajax({
570
		type : "GET",
571
		url : "/crm/tickets!denyDOA?orderId=" + orderId + "&id=" + ticketId,
572
		success : function(response) {
573
            $('#bottom-infopane').html(response);
574
        }
575
	});
576
}
577
 
578
 
579
function authorizeDOA(orderId, ticketId) {
580
	$.ajax({
581
		type : "GET",
582
		url : "/crm/tickets!authorizeDOA?orderId=" + orderId + "&id=" + ticketId,
583
		success : function(response) {
584
            $('#bottom-infopane').html(response);
585
        }
586
	});
587
}
588
 
589
function denyReturn(orderId, ticketId) {
590
	$.ajax({
591
		type : "GET",
592
		url : "/crm/tickets!denyReturn?orderId=" + orderId + "&id=" + ticketId,
593
		success : function(response) {
594
            $('#bottom-infopane').html(response);
595
        }
596
	});
597
}
598
 
599
 
600
function authorizeReturn(orderId, ticketId) {
601
	$.ajax({
602
		type : "GET",
603
		url : "/crm/tickets!authorizeReturn?orderId=" + orderId + "&id=" + ticketId,
604
		success : function(response) {
605
            $('#bottom-infopane').html(response);
606
        }
607
	});
4689 anupam.sin 608
}
609
 
610
function markOrderForCancellation(orderId, formData) {
611
	console.log(typeof(orderId), typeof(formData), orderId, formData);
612
 
613
	$.ajax({
614
		type : "GET",
615
		url : "/crm/user-order-info!markOrderForCancellation?orderId=" + orderId + "&cancellationInitiator=" + formData,
616
		success : function(response) {
617
			document.location.href = "/crm?email=&orderId=" + orderId;
618
        }
619
	});
4241 anupam.sin 620
}