Subversion Repositories SmartDukaan

Rev

Rev 3228 | Rev 3339 | 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');
4
        var userId = $(this).attr('userId');
5
        loadOrderInfo("bottom-infopane", userId, orderId);
6
    });
3206 mandeep.dh 7
 
3228 mandeep.dh 8
    $("a.show-user-details").live('click', function() {
9
        var userId = $(this).attr('userId');
10
        loadUserPane("infopane", userId);
11
    });
3090 mandeep.dh 12
 
3228 mandeep.dh 13
    $("a.show-orders").live('click', function() {
14
        var userId = $(this).attr('userId');
15
        loadOrderPane("infopane", userId, 0);
16
    });
3090 mandeep.dh 17
 
3228 mandeep.dh 18
    $("a.show-cart").live('click', function() {
19
        var userId = $(this).attr('userId');
20
        var cartId = $(this).attr('cartId');
21
        loadCartPane("infopane", userId, cartId);
22
    });
3090 mandeep.dh 23
 
3228 mandeep.dh 24
    $("a.show-user-communication").live('click', function() {
25
        var userId = $(this).attr('userId');
26
        loadUserCommunicationPane("infopane", userId);
27
    });
3090 mandeep.dh 28
 
3228 mandeep.dh 29
    $("a.show-line-details").live('click', function() {
30
        var userId = $(this).attr('userId');
31
        var itemId = $(this).attr('itemId');
32
        loadLineInfo("bottom-infopane", userId, itemId);
33
    });
3090 mandeep.dh 34
 
3228 mandeep.dh 35
    $("a.show-comm-details").live('click', function() {
36
        var userId = $(this).attr('userId');
37
        var commId = $(this).attr('commId');
38
        loadCommunicationInfo("bottom-infopane", userId, commId);
39
    });
3090 mandeep.dh 40
 
3228 mandeep.dh 41
    $("a.show-tickets").live('click', function() {
42
        var userId = $(this).attr('userId');
43
        loadTicketPane("infopane", userId, 0);
44
    });
3090 mandeep.dh 45
 
3228 mandeep.dh 46
    $("a.show-activity").live('click', function() {
47
        var userId = $(this).attr('userId');
48
        loadActivityPane("infopane", userId);
49
    });
3090 mandeep.dh 50
 
3228 mandeep.dh 51
    $("a.show-ticket-details").live('click', function() {
52
        var ticketId = $(this).attr('ticketId');
53
 
54
        // will be set when ticket Id link is clicked from activity page
55
        var activityId = $(this).attr('activityId');
56
        loadTicketInfo("bottom-infopane", ticketId, null, activityId);
57
    });
3090 mandeep.dh 58
 
3228 mandeep.dh 59
    $("a.show-activity-details").live('click', function() {
60
        var activityId = $(this).attr('activityId');
61
        var userId = $(this).attr('userId');
62
        loadActivityInfo("bottom-infopane", userId, activityId);
63
    });
3090 mandeep.dh 64
 
3228 mandeep.dh 65
    $("a.create-ticket").live('click', function() {
66
        var userId = $(this).attr('userId');
67
        loadTicketCreationForm("infopane", userId);
68
    });
3206 mandeep.dh 69
 
3228 mandeep.dh 70
    $("a.create-activity").live('click', function() {
71
        var userId = $(this).attr('userId');
72
        loadActivityCreationForm("infopane", userId);
73
    });
3090 mandeep.dh 74
 
3228 mandeep.dh 75
    $('#update-ticket-form').live('submit', function() {
76
        var ticketId = $(this).attr('ticketId');
77
        updateTicket("infopane", ticketId, $(this).serialize());
78
        return false;
79
    });
3206 mandeep.dh 80
 
3228 mandeep.dh 81
    $('form#mail-form').live(
82
            'submit',
83
            function() {
84
                var ticketId = $('#update-ticket-form').attr('ticketId');
85
                updateTicket("infopane", ticketId, $(this).serialize() + '&'
86
                        + $('#update-ticket-form').serialize());
87
                $.colorbox.close();
88
                return false;
89
            });
3106 mandeep.dh 90
 
3228 mandeep.dh 91
    $('form#activity-mail-form').live(
92
            'submit',
93
            function() {
94
                createActivity("infopane", $(this).serialize() + '&' + $("#create-activity-form").serialize());
95
                $.colorbox.close();
96
                return false;
97
            });
3106 mandeep.dh 98
 
3228 mandeep.dh 99
    $('#create-ticket-form').live('submit', function() {
100
        createTicket("infopane", $(this).serialize());
101
        return false;
102
    });
3106 mandeep.dh 103
 
3228 mandeep.dh 104
    $('#create-activity-form').live('submit', function() {
105
        createActivity("infopane", $(this).serialize());
106
        return false;
107
    });
3106 mandeep.dh 108
 
3228 mandeep.dh 109
    $(".home-page").click(function() {
110
        goToHomePage();
111
    });
3106 mandeep.dh 112
 
3228 mandeep.dh 113
    $(".my-open-tickets").live('click', function() {
3234 mandeep.dh 114
        loadTickets('infopane', "/crm/tickets!getMyOpenTickets");
3228 mandeep.dh 115
    });
3151 mandeep.dh 116
 
3228 mandeep.dh 117
    $(".my-tickets").live('click', function() {
3234 mandeep.dh 118
        loadTickets('infopane', "/crm/tickets!getMyTickets");
3151 mandeep.dh 119
    });
120
 
3228 mandeep.dh 121
    $(".unassigned-tickets").live('click', function() {
3234 mandeep.dh 122
        loadTickets('infopane', "/crm/tickets!getUnassignedTickets");
3151 mandeep.dh 123
    });
124
 
3228 mandeep.dh 125
    $(".all-open-tickets").live('click', function() {
3234 mandeep.dh 126
        loadTickets('infopane', "/crm/tickets!getAllOpenTickets");
3151 mandeep.dh 127
    });
128
 
3228 mandeep.dh 129
    $(".all-tickets").live('click', function() {
3234 mandeep.dh 130
        loadTickets('infopane', "/crm/tickets!getAllTickets");
3151 mandeep.dh 131
    });
3206 mandeep.dh 132
 
3228 mandeep.dh 133
    $("form").ajaxSend(function(evt, request, settings) {
134
        $("#spinner-div").show();
135
    });
136
 
137
    $("form").ajaxComplete(function(evt, request, settings) {
138
        $("#spinner-div").hide();
139
    });
140
 
141
    $("a").ajaxSend(function(evt, request, settings) {
142
        $("#spinner-div").show();
143
    });
144
 
145
    $("a").ajaxComplete(function(evt, request, settings) {
146
        $("#spinner-div").hide();
147
    });
148
 
149
    $("select#activity-type").live('change', function() {
150
        var userId = $(this).attr('userId');
151
        processActivityTypeChange(userId, $(this).val());
152
    });
2674 vikas 153
});