Subversion Repositories SmartDukaan

Rev

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

Rev 4065 Rev 4142
Line 1... Line 1...
1
var orderTable;
1
var orderTable;
2
var cartTable;
2
var cartTable;
3
var userCommunicationTable;
-
 
4
 
3
 
5
function loadUserPane(domId, userId) {
4
function loadUserPane(domId, userId) {
6
    $.ajax({
5
    $.ajax({
7
        type : "GET",
6
        type : "GET",
8
        url : "/crm/user-info?userId=" + userId,
7
        url : "/crm/user-info?userId=" + userId,
Line 50... Line 49...
50
            });
49
            });
51
        }
50
        }
52
    });
51
    });
53
}
52
}
54
 
53
 
55
function loadUserCommunicationPane(domId, userId) {
-
 
56
    $.ajax({
-
 
57
        type : "GET",
-
 
58
        url : "/crm/user-communications?userId=" + userId,
-
 
59
        success : function(response) {
-
 
60
            $('#' + domId).html(response);
-
 
61
            userCommunicationTable = $('#user-communications').dataTable({
-
 
62
                "aaSorting" : [ [ 0, 'desc' ] ],
-
 
63
                "iDisplayLength" : 5,
-
 
64
                "sDom" : 'T<"clear">lfrtip',
-
 
65
                "oTableTools" : {
-
 
66
                    "sSwfPath" : "swf/copy_cvs_xls_pdf.swf"
-
 
67
                },
-
 
68
                "aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]
-
 
69
            });
-
 
70
        }
-
 
71
    });
-
 
72
}
-
 
73
 
-
 
74
function loadOrderInfo(domId, orderId) {
54
function loadOrderInfo(domId, orderId) {
75
    $.ajax({
55
    $.ajax({
76
        type : "GET",
56
        type : "GET",
77
        url : "/crm/user-order-info?orderId=" + orderId,
57
        url : "/crm/user-order-info?orderId=" + orderId,
78
        success : function(response) {
58
        success : function(response) {
Line 105... Line 85...
105
            $('#cart-row-' + itemId).addClass('selected');
85
            $('#cart-row-' + itemId).addClass('selected');
106
        }
86
        }
107
    });
87
    });
108
}
88
}
109
 
89
 
110
function loadCommunicationInfo(domId, userId, commId) {
-
 
111
    $.ajax({
-
 
112
        type : "GET",
-
 
113
        url : "/crm/user-communication-info?userId=" + userId + "&commId="
-
 
114
                + commId,
-
 
115
        success : function(response) {
-
 
116
            $('#' + domId).html(response);
-
 
117
            $('#user-cart tr').removeClass('selected');
-
 
118
            $('#cart-row-' + commId).addClass('selected');
-
 
119
        }
-
 
120
    });
-
 
121
}
-
 
122
 
-
 
123
function loadTicketInfo(domId, ticketId, ticketTable, activityId) {
90
function loadTicketInfo(domId, ticketId, ticketTable, activityId) {
124
    $.ajax({
91
    $.ajax({
125
        type : "GET",
92
        type : "GET",
126
        url : "/crm/tickets/" + ticketId + "/edit",
93
        url : "/crm/tickets/" + ticketId + "/edit",
127
        success : function(response) {
94
        success : function(response) {
Line 157... Line 124...
157
    });
124
    });
158
}
125
}
159
 
126
 
160
function createTicketDataTable(domId) {
127
function createTicketDataTable(domId) {
161
    var ticketsTable = $('#' + domId).dataTable({
128
    var ticketsTable = $('#' + domId).dataTable({
162
         "aaSorting" : [ [ 2, 'desc' ] ],
129
         "aaSorting" : [ [ 3, 'asc' ] ],
163
//         "bAutoWidth": false,
130
//         "bAutoWidth": false,
164
//         "aoColumns" : [{ "sWidth": "5%" },
131
//         "aoColumns" : [{ "sWidth": "5%" },
165
//                        { "sWidth": "20%" },
132
//                        { "sWidth": "20%" },
166
//                        { "sWidth": "20%" },
133
//                        { "sWidth": "20%" },
167
//                        { "sWidth": "12.5%" },
134
//                        { "sWidth": "12.5%" },
Line 413... Line 380...
413
 
380
 
414
function processSearchEntityChange(searchEntity) {
381
function processSearchEntityChange(searchEntity) {
415
    if (searchEntity == "Tickets") {
382
    if (searchEntity == "Tickets") {
416
        $("#assignee").show();
383
        $("#assignee").show();
417
        $("#creator").hide();
384
        $("#creator").hide();
-
 
385
        $("tr#activityTypes").hide();
418
    }
386
    }
419
    else if (searchEntity == "Activities") {
387
    else if (searchEntity == "Activities") {
420
        $("#assignee").hide();
388
        $("#assignee").hide();
421
        $("#creator").show();
389
        $("#creator").show();
-
 
390
        $("tr#activityTypes").show();
422
    }
391
    }
423
}
392
}
424
 
393
 
425
function increaseTrustLevel(domId, userId, trustLevelDelta) {
394
function increaseTrustLevel(domId, userId, trustLevelDelta) {
426
    $.ajax({
395
    $.ajax({
Line 459... Line 428...
459
    });
428
    });
460
}
429
}
461
 
430
 
462
function refreshSidebar() {
431
function refreshSidebar() {
463
    $.ajax({
432
    $.ajax({
-
 
433
        type : "PUT",
-
 
434
        url : "/crm",
-
 
435
        success : function(response) {
-
 
436
            $('#sidebar').html($(response).find('#sidebar').html());
-
 
437
        }
-
 
438
    });
-
 
439
}
-
 
440
 
-
 
441
function changeAddress(urlParams) {
-
 
442
    $.ajax({
464
        type : "GET",
443
        type : "GET",
465
        url : "/crm",
444
        url : "/crm",
466
        success : function(response) {
445
        success : function(response) {
467
            $('#sidebar').html($(response).find('#sidebar').html());
446
            $('#sidebar').html($(response).find('#sidebar').html());
468
        }
447
        }
469
    });
448
    });
470
}
-
 
471
449
}
-
 
450