Subversion Repositories SmartDukaan

Rev

Rev 4020 | Rev 4142 | 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
 
4020 mandeep.dh 101
    $('form#escalation-form').live(
102
            'submit',
103
            function() {
104
                var ticketId = $('#update-ticket-form').attr('ticketId');
105
                updateTicket("infopane", ticketId, $(this).serialize() + '&'
106
                        + $('#update-ticket-form').serialize());
107
                $.colorbox.close();
108
                return false;
109
            });
110
 
3228 mandeep.dh 111
    $('form#activity-mail-form').live(
112
            'submit',
113
            function() {
114
                createActivity("infopane", $(this).serialize() + '&' + $("#create-activity-form").serialize());
115
                $.colorbox.close();
116
                return false;
117
            });
3106 mandeep.dh 118
 
3405 mandeep.dh 119
    $('#create-activity-form').live('submit', function() {
120
        createActivity("infopane", $(this).serialize());
3339 mandeep.dh 121
        return false;
122
    });
123
 
3228 mandeep.dh 124
    $('#create-ticket-form').live('submit', function() {
125
        createTicket("infopane", $(this).serialize());
126
        return false;
127
    });
3106 mandeep.dh 128
 
3228 mandeep.dh 129
    $(".home-page").click(function() {
130
        goToHomePage();
131
    });
3106 mandeep.dh 132
 
3228 mandeep.dh 133
    $(".my-open-tickets").live('click', function() {
4008 mandeep.dh 134
        loadTickets('infopane', "/crm/tickets!searchTickets?agentIds=" + $(this).attr('agentIds') +"&status=OPEN");
3228 mandeep.dh 135
    });
3151 mandeep.dh 136
 
3228 mandeep.dh 137
    $(".unassigned-tickets").live('click', function() {
3234 mandeep.dh 138
        loadTickets('infopane', "/crm/tickets!getUnassignedTickets");
3151 mandeep.dh 139
    });
140
 
4065 mandeep.dh 141
    $("#spinner-div").ajaxSend(function(evt, request, settings) {
142
        if (settings.url != '/crm') {
143
            $(this).show();
144
        }
3228 mandeep.dh 145
    });
146
 
4065 mandeep.dh 147
    $("#spinner-div").ajaxComplete(function(evt, request, settings) {
148
        if (settings.url != '/crm') {
149
            $(this).hide();
150
        }
3228 mandeep.dh 151
    });
152
 
153
    $("select#activity-type").live('change', function() {
3422 mandeep.dh 154
        processActivityTypeChange($(this).val());
3228 mandeep.dh 155
    });
3397 mandeep.dh 156
 
3339 mandeep.dh 157
    $(".list-my-activity").live('click', function() {
158
        listActivities('infopane', "");
159
    });
160
 
161
    $(".list-customer-activity").live('click', function() {
162
        listActivities('infopane', "creatorId=1");
163
    });
3390 mandeep.dh 164
 
165
    $("#mark-as-read").live('click', function() {
166
        var activityId = $(this).attr('activityId');
167
        markAsRead(activityId);
168
    });
3397 mandeep.dh 169
 
170
    $("form#search").live('submit', function() {
171
        if ($('#searchEntity').val() == 'Tickets') {
172
            loadTickets('infopane', "/crm/tickets!searchTickets?" + $(this).serialize());
173
        }
174
        else {
175
            listActivities('infopane', $(this).serialize());
176
        }
177
 
178
        $.colorbox.close();
179
        return false;
180
    });
181
 
182
    $(".advanced-search").live('click', function() {
183
        loadAdvancedSearchBox();
184
        return false;
185
    });
186
 
187
    $("select#searchEntity").live('change', function() {
188
        var searchEntity = $(this).val();
189
        processSearchEntityChange(searchEntity);
190
    });
3499 mandeep.dh 191
 
192
    $('.pending-cod-verification-tickets').live('click', function() {
3546 mandeep.dh 193
        loadTickets('infopane', "/crm/tickets!searchTickets?category=COD_VERIFICATION&status=OPEN");        
194
        return false;
3499 mandeep.dh 195
    });
3546 mandeep.dh 196
 
3578 mandeep.dh 197
    $('.open-failed-payments-tickets').live('click', function() {
198
        loadTickets('infopane', "/crm/tickets!searchTickets?category=FAILED_PAYMENTS&status=OPEN");        
199
        return false;
200
    });
201
 
4008 mandeep.dh 202
    $('.open-delayed-delivery-tickets').live('click', function() {
203
        loadTickets('infopane', "/crm/tickets!searchTickets?category=DELAYED_DELIVERY&status=OPEN");        
204
        return false;
205
    });
206
 
3499 mandeep.dh 207
    $('.trust-level-increase').live('click', function() {
208
        increaseTrustLevel('infopane', $('input#trust-level-increase').attr('userId'), $('input#trust-level-increase').val());
209
    });
210
 
3546 mandeep.dh 211
    $('.update-order-status').live('click', function() {
212
        updateOrderStatus('bottom-infopane', $(this).attr('ticketId'), $(this).attr('orderId'), $(this).attr('orderStatus'));
3499 mandeep.dh 213
    });
3711 mandeep.dh 214
 
215
    $('.list-my-unread-activity').live('click', function() {
216
        loadUnreadActivities('infopane');
217
    });
2674 vikas 218
});