Subversion Repositories SmartDukaan

Rev

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

Rev 3422 Rev 3499
Line 16... Line 16...
16
    $.ajax({
16
    $.ajax({
17
        type : "GET",
17
        type : "GET",
18
        url : "/crm/user-orders?userId=" + userId,
18
        url : "/crm/user-orders?userId=" + userId,
19
        success : function(response) {
19
        success : function(response) {
20
            $('#' + domId).html(response);
20
            $('#' + domId).html(response);
21
            loadOrderInfo("bottom-infopane", userId, orderId);
21
            loadOrderInfo("bottom-infopane", orderId);
22
            orderTable = $('#user-orders').dataTable({
22
            orderTable = $('#user-orders').dataTable({
23
                "aaSorting" : [ [ 1, 'desc' ] ],
23
                "aaSorting" : [ [ 1, 'desc' ] ],
24
                "iDisplayLength" : 5,
24
                "iDisplayLength" : 5,
25
                "sDom" : 'T<"clear">lfrtip',
25
                "sDom" : 'T<"clear">lfrtip',
26
                "oTableTools" : {
26
                "oTableTools" : {
Line 68... Line 68...
68
            });
68
            });
69
        }
69
        }
70
    });
70
    });
71
}
71
}
72
 
72
 
73
function loadOrderInfo(domId, userId, orderId) {
73
function loadOrderInfo(domId, orderId) {
74
    $.ajax({
74
    $.ajax({
75
        type : "GET",
75
        type : "GET",
76
        url : "/crm/user-order-info?userId=" + userId + "&orderId=" + orderId,
76
        url : "/crm/user-order-info?orderId=" + orderId,
77
        success : function(response) {
77
        success : function(response) {
78
            $('#' + domId).html(response);
78
            $('#' + domId).html(response);
79
 
79
 
80
            var trId = 'order-row-' + orderId;
80
            var trId = 'order-row-' + orderId;
81
            if (orderTable != null) {
81
            if (orderTable != null) {
Line 148... Line 148...
148
        }
148
        }
149
    });
149
    });
150
}
150
}
151
 
151
 
152
function createTicketDataTable(domId) {
152
function createTicketDataTable(domId) {
153
    return $('#' + domId).dataTable({
153
    var ticketsTable = $('#' + domId).dataTable({
154
         "aaSorting" : [ [ 2, 'desc' ] ],
154
         "aaSorting" : [ [ 2, 'desc' ] ],
155
//         "bAutoWidth": false,
155
//         "bAutoWidth": false,
156
//         "aoColumns" : [{ "sWidth": "5%" },
156
//         "aoColumns" : [{ "sWidth": "5%" },
157
//                        { "sWidth": "25%" },
157
//                        { "sWidth": "25%" },
158
//                        { "sWidth": "5%" },
158
//                        { "sWidth": "5%" },
Line 166... Line 166...
166
        "oTableTools" : {
166
        "oTableTools" : {
167
            "sSwfPath" : "swf/copy_cvs_xls_pdf.swf"
167
            "sSwfPath" : "swf/copy_cvs_xls_pdf.swf"
168
        },
168
        },
169
        "aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]
169
        "aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]
170
    });
170
    });
-
 
171
 
-
 
172
    truncateText(85);
-
 
173
 
-
 
174
    return ticketsTable;
171
}
175
}
172
 
176
 
173
function loadActivityInfo(domId, activityId) {
177
function loadActivityInfo(domId, activityId) {
174
    $.ajax({
178
    $.ajax({
175
        type : "GET",
179
        type : "GET",
Line 182... Line 186...
182
        }
186
        }
183
    });
187
    });
184
}
188
}
185
 
189
 
186
function createActivityDataTable(domId) {
190
function createActivityDataTable(domId) {
187
    return $('#' + domId).dataTable({
191
    var activityTable = $('#' + domId).dataTable({
188
        "aaSorting" : [ [ 4, 'desc' ] ],
192
        "aaSorting" : [ [ 4, 'desc' ] ],
189
        "iDisplayLength" : 5,
193
        "iDisplayLength" : 5,
190
        "sDom" : 'T<"clear">lfrtip',
194
        "sDom" : 'T<"clear">lfrtip',
191
        "oTableTools" : {
195
        "oTableTools" : {
192
            "sSwfPath" : "swf/copy_cvs_xls_pdf.swf"
196
            "sSwfPath" : "swf/copy_cvs_xls_pdf.swf"
193
        },
197
        },
194
        "aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]
198
        "aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]
195
    });
199
    });
-
 
200
 
-
 
201
    truncateText(95);
-
 
202
    return activityTable;
196
}
203
}
197
 
204
 
198
function loadTicketCreationForm(domId, params) {
205
function loadTicketCreationForm(domId, params) {
199
    $.ajax({
206
    $.ajax({
200
        type : "GET",
207
        type : "GET",
Line 253... Line 260...
253
            }
260
            }
254
            else {
261
            else {
255
                loadTicketInfo("bottom-infopane", ticketId, null, null);
262
                loadTicketInfo("bottom-infopane", ticketId, null, null);
256
            }
263
            }
257
 
264
 
258
            truncateText(70);
265
            truncateText(85);
259
        }
266
        }
260
    });
267
    });
261
}
268
}
262
 
269
 
263
function createTicket(domId, params) {
270
function createTicket(domId, params) {
Line 382... Line 389...
382
    else if (searchEntity == "Activities") {
389
    else if (searchEntity == "Activities") {
383
        $("#assignee").hide();
390
        $("#assignee").hide();
384
        $("#creator").show();
391
        $("#creator").show();
385
    }
392
    }
386
}
393
}
-
 
394
 
-
 
395
function increaseTrustLevel(domId, userId, trustLevelDelta) {
-
 
396
    $.ajax({
-
 
397
        type : "PUT",
-
 
398
        url : "/crm/user-info/" + userId + "?trustLevelDelta=" + trustLevelDelta,
-
 
399
        success : function(response) {
-
 
400
            $('#' + domId).html(response);
-
 
401
        }
-
 
402
    });
-
 
403
}
-
 
404
 
-
 
405
function updateOrderStatus(domId, orderId) {
-
 
406
    $.ajax({
-
 
407
        type : "PUT",
-
 
408
        url : "/crm/user-orders/" + orderId + "?status=SUBMITTED_FOR_PROCESSING",
-
 
409
        success : function(response) {
-
 
410
            loadOrderInfo(domId, orderId);
-
 
411
        }
-
 
412
    });
-
 
413
}
387
414