Subversion Repositories SmartDukaan

Rev

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