Rev 3168 | Rev 3207 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
var orderTable;var cartTable;var userCommunicationTable;function loadUserPane(domId, userId) {$.ajax({type: "GET",url: "/crm/user-info?userId=" + userId,success: function(response){$('#' + domId).html(response);}});}function loadOrderPane(domId, userId, orderId) {$.ajax({type: "GET",url: "/crm/user-orders?userId=" + userId,success: function(response){$('#' + domId).html(response);loadOrderInfo("bottom-infopane", userId, orderId);orderTable = $('#user-orders').dataTable({"aaSorting": [[1,'desc']],"iDisplayLength" : 5,"aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]});}});}function loadCartPane(domId, userId, cartId) {$.ajax({type: "GET",url: "/crm/user-cart?userId=" + userId + "&cartId=" + cartId,success: function(response){$('#' + domId).html(response);cartTable = $('#user-cart').dataTable({"aaSorting": [[1,'desc']],"iDisplayLength" : 10,"aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]});}});}function loadUserCommunicationPane(domId, userId) {$.ajax({type: "GET",url: "/crm/user-communications?userId=" + userId,success: function(response){$('#' + domId).html(response);userCommunicationTable = $('#user-communications').dataTable({"aaSorting": [[0,'desc']],"iDisplayLength" : 5,"aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]});}});}function loadOrderInfo(domId, userId, orderId) {$.ajax({type: "GET",url: "/crm/user-order-info?userId=" + userId + "&orderId=" + orderId,success: function(response){$('#' + domId).html(response);$('#user-orders tr').removeClass('selected');$('#order-row-' + orderId).addClass('selected');}});}function loadLineInfo(domId, userId, itemId) {$.ajax({type: "GET",url: "/crm/user-line-info?userId=" + userId + "&itemId=" + itemId,success: function(response){$('#' + domId).html(response);$('#user-cart tr').removeClass('selected');$('#cart-row-' + itemId).addClass('selected');}});}function loadCommunicationInfo(domId, userId, commId) {$.ajax({type: "GET",url: "/crm/user-communication-info?userId=" + userId + "&commId=" + commId,success: function(response){$('#' + domId).html(response);$('#user-cart tr').removeClass('selected');$('#cart-row-' + commId).addClass('selected');}});}function loadTicketInfo(domId, ticketId, ticketTable) {$.ajax({type: "GET",url: "/crm/user-tickets/" + ticketId + "/edit",success: function(response) {$('#' + domId).html(response);if (ticketTable != null) {// alert(ticketTable.fnGetPosition(document.getElementById("ticket-row-" + ticketId)));// alert(ticketTable.fnGetPosition($('#ticket-row-' + ticketId)[0]));// ticketTable.fnDisplayRow(ticketTable.fnGetNodes()[5]);}$('#user-tickets tr').removeClass('selected');$('#ticket-row-' + ticketId).addClass('selected');}});}function loadTicketPane(domId, userId, ticketId) {$.ajax({type: "GET",url: "/crm/user-tickets?userId=" + userId,success: function(response){$('#' + domId).html(response);var ticketTable = $('#user-tickets').dataTable({"aaSorting": [[3,'desc']],"iDisplayLength" : 5,"aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]});if (ticketId) {loadTicketInfo("bottom-infopane", ticketId, ticketTable);}}});}function loadActivityInfo(domId, userId, activityId) {$.ajax({type: "GET",url: "/crm/user-activity-info?userId=" + userId + "&activityId=" + activityId,success: function(response){$('#' + domId).html(response);$('#user-activity tr').removeClass('selected');$('#activity-row-' + activityId).addClass('selected');}});}function loadActivityPane(domId, userId) {$.ajax({type: "GET",url: "/crm/user-activity?userId=" + userId,success: function(response){$('#' + domId).html(response);var activityTable = $('#user-activity').dataTable({"aaSorting": [[4,'desc']],"iDisplayLength" : 5,"aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]});}});}function loadTicketCreationForm(domId, userId) {$.ajax({type: "GET",url: "/crm/user-tickets/new?userId=" + userId,success: function(response){$('#' + domId).html(response);}});}function loadActivityCreationForm(domId, userId) {$.ajax({type: "GET",url: "/crm/user-activity/new?userId=" + userId,success: function(response){$('#' + domId).html(response);}});}function updateTicket(domId, ticketId, params) {$.ajax({type: "PUT",url: "/crm/user-tickets/" + ticketId + "?" + params,success: function(response) {$('#' + domId).html(response);var ticketTable = $('#user-tickets').dataTable({"aaSorting": [[3,'desc']],"iDisplayLength" : 5,"aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]});loadTicketInfo("bottom-infopane", ticketId, ticketTable);}});}function createTicket(domId, params) {$.ajax({type: "POST",url: "/crm/user-tickets",data: params,success: function(response){$('#' + domId).html(response);var ticketTable = $('#user-tickets').dataTable({"aaSorting": [[3,'desc']],"iDisplayLength" : 5,"aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]});}});}function createActivity(domId, params) {$.ajax({type: "POST",url: "/crm/user-activity",data: params,success: function(response){$('#' + domId).html(response);var activityTable = $('#user-activity').dataTable({"aaSorting": [[4,'desc']],"iDisplayLength" : 5,"aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]});}});}function goToHomePage() {document.location.href = "/crm";}function loadMyOpenTickets(domId) {$.ajax({type: "GET",url: "/crm/tickets!getMyOpenTickets",success: function(response){$('#' + domId).html(response);var ticketTable = $('table#tickets').dataTable({"aaSorting": [[3,'desc']],"iDisplayLength" : 5,"aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]});}});}function loadMyTickets(domId) {$.ajax({type: "GET",url: "/crm/tickets!getMyTickets",success: function(response){$('#' + domId).html(response);var ticketTable = $('table#tickets').dataTable({"aaSorting": [[3,'desc']],"iDisplayLength" : 5,"aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]});}});}function loadUnassignedTickets(domId) {$.ajax({type: "GET",url: "/crm/tickets!getUnassignedTickets",success: function(response){$('#' + domId).html(response);var ticketTable = $('table#tickets').dataTable({"aaSorting": [[3,'desc']],"iDisplayLength" : 5,"aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]});}});}function loadAllOpenTickets(domId) {$.ajax({type: "GET",url: "/crm/tickets!getAllOpenTickets",success: function(response){$('#' + domId).html(response);var ticketTable = $('table#tickets').dataTable({"aaSorting": [[3,'desc']],"iDisplayLength" : 5,"aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]});}});}function loadAllTickets(domId) {$.ajax({type: "GET",url: "/crm/tickets!getAllTickets",success: function(response){$('#' + domId).html(response);var ticketTable = $('table#tickets').dataTable({"aaSorting": [[3,'desc']],"iDisplayLength" : 5,"aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]});}});}function processActivityTypeChange(userId, activityType) {if (activityType == "EMAIL_CUSTOMER") {$.colorbox({inline: true,width: "735px",height: "365px",href: "div#mail-div",onClosed: function() {$("div#mail-div").hide();$('select#activity-type').val('OTHER');}});$("div#mail-div").show();}}function processInputFormSubmit() {$.ajax({type: "POST",url: "/crm/",success: function(response){$.html(response);var ticketTable = $('table#tickets').dataTable({"aaSorting": [[3,'desc']],"iDisplayLength" : 5,"aLengthMenu" : [ [ 5, 10, 20, -1 ], [ 5, 10, 20, "All" ] ]});}});}