Subversion Repositories SmartDukaan

Rev

Rev 3397 | Rev 3422 | 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');
3405 mandeep.dh 43
        loadTickets('infopane', "/crm/tickets!searchTickets?userId=" + userId);
3228 mandeep.dh 44
    });
3090 mandeep.dh 45
 
3228 mandeep.dh 46
    $("a.show-activity").live('click', function() {
47
        var userId = $(this).attr('userId');
3405 mandeep.dh 48
        listActivities('infopane', "userId=" + userId);
3228 mandeep.dh 49
    });
3090 mandeep.dh 50
 
3228 mandeep.dh 51
    $("a.show-ticket-details").live('click', function() {
52
        var ticketId = $(this).attr('ticketId');
3405 mandeep.dh 53
 
3228 mandeep.dh 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() {
3405 mandeep.dh 66
        var userId = $(this).attr('userId');
67
 
68
        var params = null;
69
        if (userId != null && userId != "") {
70
            params = "userId=" + userId;
71
        }
72
 
73
        loadTicketCreationForm("infopane", params);
3228 mandeep.dh 74
    });
3206 mandeep.dh 75
 
3228 mandeep.dh 76
    $("a.create-activity").live('click', function() {
77
        var userId = $(this).attr('userId');
3090 mandeep.dh 78
 
3405 mandeep.dh 79
        var params = null;
80
        if (userId != null && userId != "") {
81
            params = "userId=" + userId;
82
        }
83
 
84
        loadActivityCreationForm("infopane", params);
3339 mandeep.dh 85
    });
86
 
3228 mandeep.dh 87
    $('#update-ticket-form').live('submit', function() {
88
        var ticketId = $(this).attr('ticketId');
89
        updateTicket("infopane", ticketId, $(this).serialize());
90
        return false;
91
    });
3206 mandeep.dh 92
 
3228 mandeep.dh 93
    $('form#mail-form').live(
94
            'submit',
95
            function() {
96
                var ticketId = $('#update-ticket-form').attr('ticketId');
97
                updateTicket("infopane", ticketId, $(this).serialize() + '&'
98
                        + $('#update-ticket-form').serialize());
99
                $.colorbox.close();
100
                return false;
101
            });
3106 mandeep.dh 102
 
3228 mandeep.dh 103
    $('form#activity-mail-form').live(
104
            'submit',
105
            function() {
106
                createActivity("infopane", $(this).serialize() + '&' + $("#create-activity-form").serialize());
107
                $.colorbox.close();
108
                return false;
109
            });
3106 mandeep.dh 110
 
3405 mandeep.dh 111
    $('#create-activity-form').live('submit', function() {
112
        createActivity("infopane", $(this).serialize());
3339 mandeep.dh 113
        return false;
114
    });
115
 
3228 mandeep.dh 116
    $('#create-ticket-form').live('submit', function() {
117
        createTicket("infopane", $(this).serialize());
118
        return false;
119
    });
3106 mandeep.dh 120
 
3228 mandeep.dh 121
    $(".home-page").click(function() {
122
        goToHomePage();
123
    });
3106 mandeep.dh 124
 
3228 mandeep.dh 125
    $(".my-open-tickets").live('click', function() {
3234 mandeep.dh 126
        loadTickets('infopane', "/crm/tickets!getMyOpenTickets");
3228 mandeep.dh 127
    });
3151 mandeep.dh 128
 
3228 mandeep.dh 129
    $(".unassigned-tickets").live('click', function() {
3234 mandeep.dh 130
        loadTickets('infopane', "/crm/tickets!getUnassignedTickets");
3151 mandeep.dh 131
    });
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
    });
3397 mandeep.dh 153
 
3339 mandeep.dh 154
    $(".list-my-activity").live('click', function() {
155
        listActivities('infopane', "");
156
    });
157
 
158
    $(".list-customer-activity").live('click', function() {
159
        listActivities('infopane', "creatorId=1");
160
    });
3390 mandeep.dh 161
 
162
    $("#mark-as-read").live('click', function() {
163
        var activityId = $(this).attr('activityId');
164
        markAsRead(activityId);
165
    });
3397 mandeep.dh 166
 
167
    $("form#search").live('submit', function() {
168
        if ($('#searchEntity').val() == 'Tickets') {
169
            loadTickets('infopane', "/crm/tickets!searchTickets?" + $(this).serialize());
170
        }
171
        else {
172
            listActivities('infopane', $(this).serialize());
173
        }
174
 
175
        $.colorbox.close();
176
        return false;
177
    });
178
 
179
    $(".advanced-search").live('click', function() {
180
        loadAdvancedSearchBox();
181
        return false;
182
    });
183
 
184
    $("select#searchEntity").live('change', function() {
185
        var searchEntity = $(this).val();
186
        processSearchEntityChange(searchEntity);
187
    });
2674 vikas 188
});