Subversion Repositories SmartDukaan

Rev

Rev 3234 | Rev 3390 | 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() {
3339 mandeep.dh 66
        loadTicketCreationForm("infopane");
3228 mandeep.dh 67
    });
3206 mandeep.dh 68
 
3228 mandeep.dh 69
    $("a.create-activity").live('click', function() {
3339 mandeep.dh 70
        loadActivityCreationForm("infopane");
71
    });
72
 
73
    $("a.create-user-ticket").live('click', function() {
3228 mandeep.dh 74
        var userId = $(this).attr('userId');
3339 mandeep.dh 75
        loadUserTicketCreationForm("infopane", userId);
3228 mandeep.dh 76
    });
3090 mandeep.dh 77
 
3339 mandeep.dh 78
    $("a.create-user-activity").live('click', function() {
79
        var userId = $(this).attr('userId');
80
        loadUserActivityCreationForm("infopane", userId);
81
    });
82
 
3228 mandeep.dh 83
    $('#update-ticket-form').live('submit', function() {
84
        var ticketId = $(this).attr('ticketId');
85
        updateTicket("infopane", ticketId, $(this).serialize());
86
        return false;
87
    });
3206 mandeep.dh 88
 
3228 mandeep.dh 89
    $('form#mail-form').live(
90
            'submit',
91
            function() {
92
                var ticketId = $('#update-ticket-form').attr('ticketId');
93
                updateTicket("infopane", ticketId, $(this).serialize() + '&'
94
                        + $('#update-ticket-form').serialize());
95
                $.colorbox.close();
96
                return false;
97
            });
3106 mandeep.dh 98
 
3228 mandeep.dh 99
    $('form#activity-mail-form').live(
100
            'submit',
101
            function() {
102
                createActivity("infopane", $(this).serialize() + '&' + $("#create-activity-form").serialize());
103
                $.colorbox.close();
104
                return false;
105
            });
3106 mandeep.dh 106
 
3339 mandeep.dh 107
    $('#create-user-ticket-form').live('submit', function() {
108
        createUserTicket("infopane", $(this).serialize());
109
        return false;
110
    });
111
 
112
    $('#create-user-activity-form').live('submit', function() {
113
        createUserActivity("infopane", $(this).serialize());
114
        return false;
115
    });
116
 
3228 mandeep.dh 117
    $('#create-ticket-form').live('submit', function() {
118
        createTicket("infopane", $(this).serialize());
119
        return false;
120
    });
3106 mandeep.dh 121
 
3228 mandeep.dh 122
    $('#create-activity-form').live('submit', function() {
123
        createActivity("infopane", $(this).serialize());
124
        return false;
125
    });
3106 mandeep.dh 126
 
3228 mandeep.dh 127
    $(".home-page").click(function() {
128
        goToHomePage();
129
    });
3106 mandeep.dh 130
 
3228 mandeep.dh 131
    $(".my-open-tickets").live('click', function() {
3234 mandeep.dh 132
        loadTickets('infopane', "/crm/tickets!getMyOpenTickets");
3228 mandeep.dh 133
    });
3151 mandeep.dh 134
 
3228 mandeep.dh 135
    $(".my-tickets").live('click', function() {
3234 mandeep.dh 136
        loadTickets('infopane', "/crm/tickets!getMyTickets");
3151 mandeep.dh 137
    });
138
 
3228 mandeep.dh 139
    $(".unassigned-tickets").live('click', function() {
3234 mandeep.dh 140
        loadTickets('infopane', "/crm/tickets!getUnassignedTickets");
3151 mandeep.dh 141
    });
142
 
3228 mandeep.dh 143
    $(".all-open-tickets").live('click', function() {
3234 mandeep.dh 144
        loadTickets('infopane', "/crm/tickets!getAllOpenTickets");
3151 mandeep.dh 145
    });
146
 
3228 mandeep.dh 147
    $(".all-tickets").live('click', function() {
3234 mandeep.dh 148
        loadTickets('infopane', "/crm/tickets!getAllTickets");
3151 mandeep.dh 149
    });
3206 mandeep.dh 150
 
3228 mandeep.dh 151
    $("form").ajaxSend(function(evt, request, settings) {
152
        $("#spinner-div").show();
153
    });
154
 
155
    $("form").ajaxComplete(function(evt, request, settings) {
156
        $("#spinner-div").hide();
157
    });
158
 
159
    $("a").ajaxSend(function(evt, request, settings) {
160
        $("#spinner-div").show();
161
    });
162
 
163
    $("a").ajaxComplete(function(evt, request, settings) {
164
        $("#spinner-div").hide();
165
    });
166
 
167
    $("select#activity-type").live('change', function() {
168
        var userId = $(this).attr('userId');
169
        processActivityTypeChange(userId, $(this).val());
170
    });
3339 mandeep.dh 171
 
172
    $(".list-my-activity").live('click', function() {
173
        listActivities('infopane', "");
174
    });
175
 
176
    $(".list-customer-activity").live('click', function() {
177
        listActivities('infopane', "creatorId=1");
178
    });
2674 vikas 179
});