Parent: [1bfc17] (diff)

Child: [265cb3] (diff)

Download this file

mass-edit.js    32 lines (27 with data), 922 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
function update_tickets(){
var $checked=$('input:checked'), count=$checked.length;
if ( !count ) {
$('#result').text('No tickets selected for update.');
return;
}
var data={};
data.selected = $checked.map(function(){ return this.name; }).get().join(',');
$('#update-values').find('input, select').each(function(){
this.value && (data[this.name]=this.value);
});
$.post('../update_tickets', data, function(){
flash('<p>Updated '+count+' ticket'+(count!=1 ? 's' : '')+'</p>')
location.reload();
});
}
$(function(){
$('#assigned_to').val('');
$('#select_all').click(function(){
$('tbody.ticket-list input[type=checkbox]').attr('checked', 'checked');
return false;
});
$('#select_none').click(function(){
$('tbody.ticket-list input[type=checkbox]').removeAttr('checked');
return false;
});
});