Petr Skoda 3afce1a574 MDL-29030 convert participation report to new report type
AMOS BEGIN
 MOV [participation:view,coursereport_participation],[participation:view,report_participation]
 MOV [pluginpagetype,coursereport_participation],[pluginpagetype,report_participation]
 MOV [pluginname,coursereport_participation],[pluginname,report_participation]
AMOS END
2011-11-06 12:22:48 +01:00

44 lines
1.2 KiB
JavaScript

M.report_participation = {};
M.report_participation.init = function(Y) {
Y.on('submit', function(e) {
Y.one('#formactionselect').get('options').each(function() {
if (this.get('selected') && this.get('value') == '') {
// no action selected
e.preventDefault();
}
});
var ok = false;
Y.all('input.usercheckbox').each(function() {
if (this.get('checked')) {
ok = true;
}
});
if (!ok) {
// no checkbox selected
e.preventDefault();
}
}, '#studentsform');
Y.on('click', function(e) {
Y.all('input.usercheckbox').each(function() {
this.set('checked', 'checked');
});
}, '#checkall');
Y.on('click', function(e) {
Y.all('input.usercheckbox').each(function() {
this.set('checked', '');
});
}, '#checknone');
Y.on('click', function(e) {
Y.all('input.usercheckbox').each(function() {
if (this.get('value') == 0) {
this.set('checked', 'checked');
}
});
}, '#checknos');
};