Subversion Repositories SmartDukaan

Rev

Rev 3711 | Rev 4020 | 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');
3499 mandeep.dh 4
        loadOrderInfo("bottom-infopane", orderId);
3228 mandeep.dh 5
    });
3206 mandeep.dh 6
 
3228 mandeep.dh 7
    $("a.show-user-details").live('click', function() {
8
        var userId = $(this).attr('userId');
9
        loadUserPane("infopane", userId);
10
    });
3090 mandeep.dh 11
 
3228 mandeep.dh 12
    $("a.show-orders").live('click', function() {
13
        var userId = $(this).attr('userId');
14
        loadOrderPane("infopane", userId, 0);
15
    });
3090 mandeep.dh 16
 
3228 mandeep.dh 17
    $("a.show-cart").live('click', function() {
18
        var userId = $(this).attr('userId');
19
        var cartId = $(this).attr('cartId');
20
        loadCartPane("infopane", userId, cartId);
21
    });
3090 mandeep.dh 22
 
3228 mandeep.dh 23
    $("a.show-user-communication").live('click', function() {
24
        var userId = $(this).attr('userId');
25
        loadUserCommunicationPane("infopane", userId);
26
    });
3090 mandeep.dh 27
 
3228 mandeep.dh 28
    $("a.show-line-details").live('click', function() {
29
        var userId = $(this).attr('userId');
30
        var itemId = $(this).attr('itemId');
31
        loadLineInfo("bottom-infopane", userId, itemId);
32
    });
3090 mandeep.dh 33
 
3228 mandeep.dh 34
    $("a.show-comm-details").live('click', function() {
35
        var userId = $(this).attr('userId');
36
        var commId = $(this).attr('commId');
37
        loadCommunicationInfo("bottom-infopane", userId, commId);
38
    });
3090 mandeep.dh 39
 
3228 mandeep.dh 40
    $("a.show-tickets").live('click', function() {
41
        var userId = $(this).attr('userId');
3405 mandeep.dh 42
        loadTickets('infopane', "/crm/tickets!searchTickets?userId=" + userId);
3228 mandeep.dh 43
    });
3090 mandeep.dh 44
 
3228 mandeep.dh 45
    $("a.show-activity").live('click', function() {
46
        var userId = $(this).attr('userId');
3405 mandeep.dh 47
        listActivities('infopane', "userId=" + userId);
3228 mandeep.dh 48
    });
3090 mandeep.dh 49
 
3228 mandeep.dh 50
    $("a.show-ticket-details").live('click', function() {
51
        var ticketId = $(this).attr('ticketId');
3405 mandeep.dh 52
 
3228 mandeep.dh 53
        // will be set when ticket Id link is clicked from activity page
54
        var activityId = $(this).attr('activityId');
55
        loadTicketInfo("bottom-infopane", ticketId, null, activityId);
56
    });
3090 mandeep.dh 57
 
3228 mandeep.dh 58
    $("a.show-activity-details").live('click', function() {
59
        var activityId = $(this).attr('activityId');
3422 mandeep.dh 60
        loadActivityInfo("bottom-infopane", activityId);
3228 mandeep.dh 61
    });
3090 mandeep.dh 62
 
3228 mandeep.dh 63
    $("a.create-ticket").live('click', function() {
3405 mandeep.dh 64
        var userId = $(this).attr('userId');
65
 
66
        var params = null;
67
        if (userId != null && userId != "") {
68
            params = "userId=" + userId;
69
        }
70
 
71
        loadTicketCreationForm("infopane", params);
3228 mandeep.dh 72
    });
3206 mandeep.dh 73
 
3228 mandeep.dh 74
    $("a.create-activity").live('click', function() {
75
        var userId = $(this).attr('userId');
3090 mandeep.dh 76
 
3405 mandeep.dh 77
        var params = null;
78
        if (userId != null && userId != "") {
79
            params = "userId=" + userId;
80
        }
81
 
82
        loadActivityCreationForm("infopane", params);
3339 mandeep.dh 83
    });
84
 
3228 mandeep.dh 85
    $('#update-ticket-form').live('submit', function() {
86
        var ticketId = $(this).attr('ticketId');
87
        updateTicket("infopane", ticketId, $(this).serialize());
88
        return false;
89
    });
3206 mandeep.dh 90
 
3228 mandeep.dh 91
    $('form#mail-form').live(
92
            'submit',
93
            function() {
94
                var ticketId = $('#update-ticket-form').attr('ticketId');
95
                updateTicket("infopane", ticketId, $(this).serialize() + '&'
96
                        + $('#update-ticket-form').serialize());
97
                $.colorbox.close();
98
                return false;
99
            });
3106 mandeep.dh 100
 
3228 mandeep.dh 101
    $('form#activity-mail-form').live(
102
            'submit',
103
            function() {
104
                createActivity("infopane", $(this).serialize() + '&' + $("#create-activity-form").serialize());
105
                $.colorbox.close();
106
                return false;
107
            });
3106 mandeep.dh 108
 
3405 mandeep.dh 109
    $('#create-activity-form').live('submit', function() {
110
        createActivity("infopane", $(this).serialize());
3339 mandeep.dh 111
        return false;
112
    });
113
 
3228 mandeep.dh 114
    $('#create-ticket-form').live('submit', function() {
115
        createTicket("infopane", $(this).serialize());
116
        return false;
117
    });
3106 mandeep.dh 118
 
3228 mandeep.dh 119
    $(".home-page").click(function() {
120
        goToHomePage();
121
    });
3106 mandeep.dh 122
 
3228 mandeep.dh 123
    $(".my-open-tickets").live('click', function() {
4008 mandeep.dh 124
        loadTickets('infopane', "/crm/tickets!searchTickets?agentIds=" + $(this).attr('agentIds') +"&status=OPEN");
3228 mandeep.dh 125
    });
3151 mandeep.dh 126
 
3228 mandeep.dh 127
    $(".unassigned-tickets").live('click', function() {
3234 mandeep.dh 128
        loadTickets('infopane', "/crm/tickets!getUnassignedTickets");
3151 mandeep.dh 129
    });
130
 
3228 mandeep.dh 131
    $("form").ajaxSend(function(evt, request, settings) {
132
        $("#spinner-div").show();
133
    });
134
 
135
    $("form").ajaxComplete(function(evt, request, settings) {
136
        $("#spinner-div").hide();
137
    });
138
 
139
    $("a").ajaxSend(function(evt, request, settings) {
140
        $("#spinner-div").show();
141
    });
142
 
143
    $("a").ajaxComplete(function(evt, request, settings) {
144
        $("#spinner-div").hide();
145
    });
146
 
147
    $("select#activity-type").live('change', function() {
3422 mandeep.dh 148
        processActivityTypeChange($(this).val());
3228 mandeep.dh 149
    });
3397 mandeep.dh 150
 
3339 mandeep.dh 151
    $(".list-my-activity").live('click', function() {
152
        listActivities('infopane', "");
153
    });
154
 
155
    $(".list-customer-activity").live('click', function() {
156
        listActivities('infopane', "creatorId=1");
157
    });
3390 mandeep.dh 158
 
159
    $("#mark-as-read").live('click', function() {
160
        var activityId = $(this).attr('activityId');
161
        markAsRead(activityId);
162
    });
3397 mandeep.dh 163
 
164
    $("form#search").live('submit', function() {
165
        if ($('#searchEntity').val() == 'Tickets') {
166
            loadTickets('infopane', "/crm/tickets!searchTickets?" + $(this).serialize());
167
        }
168
        else {
169
            listActivities('infopane', $(this).serialize());
170
        }
171
 
172
        $.colorbox.close();
173
        return false;
174
    });
175
 
176
    $(".advanced-search").live('click', function() {
177
        loadAdvancedSearchBox();
178
        return false;
179
    });
180
 
181
    $("select#searchEntity").live('change', function() {
182
        var searchEntity = $(this).val();
183
        processSearchEntityChange(searchEntity);
184
    });
3499 mandeep.dh 185
 
186
    $('.pending-cod-verification-tickets').live('click', function() {
3546 mandeep.dh 187
        loadTickets('infopane', "/crm/tickets!searchTickets?category=COD_VERIFICATION&status=OPEN");        
188
        return false;
3499 mandeep.dh 189
    });
3546 mandeep.dh 190
 
3578 mandeep.dh 191
    $('.open-failed-payments-tickets').live('click', function() {
192
        loadTickets('infopane', "/crm/tickets!searchTickets?category=FAILED_PAYMENTS&status=OPEN");        
193
        return false;
194
    });
195
 
4008 mandeep.dh 196
    $('.open-delayed-delivery-tickets').live('click', function() {
197
        loadTickets('infopane', "/crm/tickets!searchTickets?category=DELAYED_DELIVERY&status=OPEN");        
198
        return false;
199
    });
200
 
3499 mandeep.dh 201
    $('.trust-level-increase').live('click', function() {
202
        increaseTrustLevel('infopane', $('input#trust-level-increase').attr('userId'), $('input#trust-level-increase').val());
203
    });
204
 
3546 mandeep.dh 205
    $('.update-order-status').live('click', function() {
206
        updateOrderStatus('bottom-infopane', $(this).attr('ticketId'), $(this).attr('orderId'), $(this).attr('orderStatus'));
3499 mandeep.dh 207
    });
3711 mandeep.dh 208
 
209
    $('.list-my-unread-activity').live('click', function() {
210
        loadUnreadActivities('infopane');
211
    });
2674 vikas 212
});