Subversion Repositories SmartDukaan

Rev

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