Subversion Repositories SmartDukaan

Rev

Rev 3206 | Rev 3234 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3206 Rev 3228
Line 1... Line 1...
1
$(function() {
1
$(function() {
2
	$("a.show-order-details").live('click', function() {
2
    $("a.show-order-details").live('click', function() {
3
		var orderId = $(this).attr('orderId');
3
        var orderId = $(this).attr('orderId');
4
		var userId = $(this).attr('userId');
4
        var userId = $(this).attr('userId');
5
		loadOrderInfo("bottom-infopane", userId, orderId);
5
        loadOrderInfo("bottom-infopane", userId, orderId);
6
	});
6
    });
7
 
7
 
8
	$("a.show-user-details").live('click', function() {
8
    $("a.show-user-details").live('click', function() {
9
		var userId = $(this).attr('userId');
9
        var userId = $(this).attr('userId');
10
		loadUserPane("infopane", userId);
10
        loadUserPane("infopane", userId);
11
	});
11
    });
12
	
12
 
13
	$("a.show-orders").live('click', function() {
13
    $("a.show-orders").live('click', function() {
14
		var userId = $(this).attr('userId');
14
        var userId = $(this).attr('userId');
15
		loadOrderPane("infopane", userId, 0);
15
        loadOrderPane("infopane", userId, 0);
16
	});
16
    });
17
	
17
 
18
	$("a.show-cart").live('click', function() {
18
    $("a.show-cart").live('click', function() {
19
		var userId = $(this).attr('userId');
19
        var userId = $(this).attr('userId');
20
		var cartId = $(this).attr('cartId');
20
        var cartId = $(this).attr('cartId');
21
		loadCartPane("infopane", userId, cartId);
21
        loadCartPane("infopane", userId, cartId);
22
	});
22
    });
23
	
23
 
24
	$("a.show-user-communication").live('click', function() {
24
    $("a.show-user-communication").live('click', function() {
25
		var userId = $(this).attr('userId');
25
        var userId = $(this).attr('userId');
26
		loadUserCommunicationPane("infopane", userId);
26
        loadUserCommunicationPane("infopane", userId);
27
	});
27
    });
28
 
28
 
29
	$("a.show-line-details").live('click', function() {
29
    $("a.show-line-details").live('click', function() {
30
		var userId = $(this).attr('userId');
30
        var userId = $(this).attr('userId');
31
		var itemId = $(this).attr('itemId');
31
        var itemId = $(this).attr('itemId');
32
		loadLineInfo("bottom-infopane", userId, itemId);
32
        loadLineInfo("bottom-infopane", userId, itemId);
33
	});
33
    });
34
 
34
 
35
	$("a.show-comm-details").live('click', function() {
35
    $("a.show-comm-details").live('click', function() {
36
		var userId = $(this).attr('userId');
36
        var userId = $(this).attr('userId');
37
		var commId = $(this).attr('commId');
37
        var commId = $(this).attr('commId');
38
		loadCommunicationInfo("bottom-infopane", userId, commId);
38
        loadCommunicationInfo("bottom-infopane", userId, commId);
39
	});
39
    });
40
 
40
 
41
	$("a.show-tickets").live('click', function() {
41
    $("a.show-tickets").live('click', function() {
42
		var userId = $(this).attr('userId');
42
        var userId = $(this).attr('userId');
43
		loadTicketPane("infopane", userId, 0);
43
        loadTicketPane("infopane", userId, 0);
44
	});
44
    });
45
 
45
 
46
	$("a.show-activity").live('click', function() {
46
    $("a.show-activity").live('click', function() {
47
		var userId = $(this).attr('userId');
47
        var userId = $(this).attr('userId');
48
		loadActivityPane("infopane", userId);
48
        loadActivityPane("infopane", userId);
49
	});
49
    });
50
 
50
 
51
	$("a.show-ticket-details").live('click', function() {		
51
    $("a.show-ticket-details").live('click', function() {
52
		var ticketId = $(this).attr('ticketId');
52
        var ticketId = $(this).attr('ticketId');
53
		loadTicketInfo("bottom-infopane", ticketId, null);
53
        
54
	});
54
        // will be set when ticket Id link is clicked from activity page
55
 
55
        var activityId = $(this).attr('activityId');
56
	$("a.show-activity-details").live('click', function() {
56
        loadTicketInfo("bottom-infopane", ticketId, null, activityId);
57
		var activityId = $(this).attr('activityId');
57
    });
58
		var userId = $(this).attr('userId');
58
 
59
		loadActivityInfo("bottom-infopane", userId, activityId);
59
    $("a.show-activity-details").live('click', function() {
60
	});
60
        var activityId = $(this).attr('activityId');
61
 
61
        var userId = $(this).attr('userId');
62
	$("a.create-ticket").live('click', function() {
62
        loadActivityInfo("bottom-infopane", userId, activityId);
63
		var userId = $(this).attr('userId');
63
    });
64
		loadTicketCreationForm("infopane", userId);
64
 
65
	});
65
    $("a.create-ticket").live('click', function() {
66
 
66
        var userId = $(this).attr('userId');
67
	$("a.create-activity").live('click', function() {
67
        loadTicketCreationForm("infopane", userId);
68
		var userId   = $(this).attr('userId');
68
    });
69
		loadActivityCreationForm("infopane", userId);
69
 
70
	});
70
    $("a.create-activity").live('click', function() {
71
 
71
        var userId = $(this).attr('userId');
72
	$('#update-ticket-form').live('submit', function() {
72
        loadActivityCreationForm("infopane", userId);
73
		var ticketId = $(this).attr('ticketId');
73
    });
74
		updateTicket("infopane", ticketId, $(this).serialize());
74
 
75
		return false;
75
    $('#update-ticket-form').live('submit', function() {
76
	});
76
        var ticketId = $(this).attr('ticketId');
77
 
77
        updateTicket("infopane", ticketId, $(this).serialize());
78
	$('form#mail-form').live('submit', function() {
78
        return false;
79
		var ticketId = $('#update-ticket-form').attr('ticketId');
79
    });
80
		updateTicket("infopane", ticketId, $(this).serialize() + '&' + $('#update-ticket-form').serialize());
80
 
81
		$.colorbox.close();
81
    $('form#mail-form').live(
82
		return false;
82
            'submit',
83
	});
83
            function() {
84
 
84
                var ticketId = $('#update-ticket-form').attr('ticketId');
85
	$('#create-ticket-form').live('submit', function() {
85
                updateTicket("infopane", ticketId, $(this).serialize() + '&'
86
		createTicket("infopane", $(this).serialize());
86
                        + $('#update-ticket-form').serialize());
87
		return false;
87
                $.colorbox.close();
88
	});
88
                return false;
89
 
89
            });
90
	$('#create-activity-form').live('submit', function() {
90
 
91
		createActivity("infopane", $(this).serialize());
91
    $('form#activity-mail-form').live(
92
		return false;
92
            'submit',
93
	});
93
            function() {
94
 
94
                createActivity("infopane", $(this).serialize() + '&' + $("#create-activity-form").serialize());
95
	$(".home-page").click(function() {
95
                $.colorbox.close();
96
		goToHomePage();
96
                return false;
97
	});
97
            });
98
 
98
 
99
	$(".my-open-tickets").live('click', function() {
99
    $('#create-ticket-form').live('submit', function() {
100
		loadMyOpenTickets('infopane');
100
        createTicket("infopane", $(this).serialize());
101
	});
101
        return false;
102
 
102
    });
103
	$(".my-tickets").live('click', function() {
103
 
104
		loadMyTickets('infopane');
104
    $('#create-activity-form').live('submit', function() {
105
	});
105
        createActivity("infopane", $(this).serialize());
106
 
106
        return false;
107
	$(".unassigned-tickets").live('click', function() {
107
    });
108
		loadUnassignedTickets('infopane');
108
 
109
	});
109
    $(".home-page").click(function() {
110
 
110
        goToHomePage();
111
	$(".all-open-tickets").live('click', function() {
111
    });
112
		loadAllOpenTickets('infopane');
112
 
113
	});
113
    $(".my-open-tickets").live('click', function() {
114
 
114
        loadMyOpenTickets('infopane');
115
	$(".all-tickets").live('click', function() {
115
    });
116
		loadAllTickets('infopane');
116
 
117
	});
117
    $(".my-tickets").live('click', function() {
118
 
118
        loadMyTickets('infopane');
119
	$("form").ajaxSend( function(evt, request, settings) {
119
    });
120
		$("#spinner-div").show();
120
 
121
    });
121
    $(".unassigned-tickets").live('click', function() {
122
 
122
        loadUnassignedTickets('infopane');
123
	$("form").ajaxComplete( function(evt, request, settings) {
123
    });
124
		$("#spinner-div").hide();
124
 
125
    });
125
    $(".all-open-tickets").live('click', function() {
126
 
126
        loadAllOpenTickets('infopane');
127
	$("a").ajaxSend( function(evt, request, settings) {
127
    });
128
		$("#spinner-div").show();
128
 
129
    });
129
    $(".all-tickets").live('click', function() {
130
 
130
        loadAllTickets('infopane');
131
	$("a").ajaxComplete( function(evt, request, settings) {
131
    });
132
		$("#spinner-div").hide();
132
 
133
    });
133
    $("form").ajaxSend(function(evt, request, settings) {
134
 
134
        $("#spinner-div").show();
135
	$("select#activity-type").live('change', function() {
135
    });
136
		var userId = $(this).attr('userId');
136
 
137
		processActivityTypeChange(userId, $(this).val());
137
    $("form").ajaxComplete(function(evt, request, settings) {
138
	});
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
    });
139
});
153
});
140
154