version 1.131, 2006/03/02 23:56:55
|
version 1.133, 2006/03/07 16:09:59
|
Line 2306 sub render {
|
Line 2306 sub render {
|
} |
} |
} |
} |
} |
} |
|
function checkexpired() { |
|
for (i=0; i<document.forms.helpform.elements.length; i++) { |
|
if (document.forms.helpform.elements[i].value.indexOf(':Expired') != -1) { |
|
document.forms.helpform.elements[i].checked=true; |
|
} |
|
} |
|
} |
function uncheckexpired() { |
function uncheckexpired() { |
for (i=0; i<document.forms.helpform.elements.length; i++) { |
for (i=0; i<document.forms.helpform.elements.length; i++) { |
if (document.forms.helpform.elements[i].value.indexOf(':Expired') != -1) { |
if (document.forms.helpform.elements[i].value.indexOf(':Expired') != -1) { |
Line 2395 BUTTONS
|
Line 2402 BUTTONS
|
delete($defaultUsers{''}); |
delete($defaultUsers{''}); |
} |
} |
my $choices = []; |
my $choices = []; |
|
my $expired_students = []; # Will hold expired students. |
|
|
# Load up the non-students, if necessary |
# Load up the non-students, if necessary |
if ($self->{'coursepersonnel'}) { |
if ($self->{'coursepersonnel'}) { |
Line 2479 SECTIONSELECT
|
Line 2487 SECTIONSELECT
|
|
|
# username, fullname, section, type |
# username, fullname, section, type |
for (@keys) { |
for (@keys) { |
# Filter out inactive students if we've set "activeonly" |
|
if (!$self->{'activeonly'} || $classlist->{$_}->[$status] eq |
# We split the active students into the choices array and |
|
# inactive ones into expired_students so that we can put them in 2 separate |
|
# tables. |
|
|
|
if ( $classlist->{$_}->[$status] eq |
'Active') { |
'Active') { |
push @$choices, [$_, $classlist->{$_}->[$fullname], |
push @$choices, [$_, $classlist->{$_}->[$fullname], |
$classlist->{$_}->[$section], |
$classlist->{$_}->[$section], |
$classlist->{$_}->[$status], 'Student']; |
$classlist->{$_}->[$status], 'Student']; |
|
} else { |
|
push @$expired_students, [$_, $classlist->{$_}->[$fullname], |
|
$classlist->{$_}->[$section], |
|
$classlist->{$_}->[$status], 'Student']; |
} |
} |
} |
} |
|
|
Line 2499 SECTIONSELECT
|
Line 2515 SECTIONSELECT
|
"<td align='center'><b>".&mt('Username').":".&mt('Domain')."</b></td></tr>"; |
"<td align='center'><b>".&mt('Username').":".&mt('Domain')."</b></td></tr>"; |
|
|
my $checked = 0; |
my $checked = 0; |
|
# |
|
# Give the active students and staff: |
|
# |
for my $choice (@$choices) { |
for my $choice (@$choices) { |
$result .= "<tr><td><input type='$type' name='" . |
$result .= "<tr><td><input type='$type' name='" . |
$self->{'variable'} . '.forminput' . "'"; |
$self->{'variable'} . '.forminput' . "'"; |
Line 2530 SECTIONSELECT
|
Line 2549 SECTIONSELECT
|
. HTML::Entities::encode($choice->[0],'<>&"') |
. HTML::Entities::encode($choice->[0],'<>&"') |
. "</td></tr>\n"; |
. "</td></tr>\n"; |
} |
} |
|
|
$result .= "</table>\n\n"; |
$result .= "</table>\n\n"; |
|
|
|
# If activeonly is not set then we can also give the expired students: |
|
# |
|
if (!$self->{'activeonly'} && ((scalar @$expired_students) > 0)) { |
|
$result .= "<p>Inactive students: </p>\n"; |
|
$result .= <<INACTIVEBUTTONS; |
|
<table> |
|
<tr> |
|
<td><input type="button" value="Select expired" onclick="checkexpired();" /> </td> |
|
<td><input type="button" value="Unselect expired" onclick="uncheckexpired();" /></td> |
|
</tr> |
|
</table> |
|
INACTIVEBUTTONS |
|
$result .= "<table>\n"; |
|
|
|
for my $choice (@$expired_students) { |
|
$result .= "<tr><td><input type='$type' name='" . |
|
$self->{'variable'} . '.forminput' . "'"; |
|
|
|
if (%defaultUsers) { |
|
my $user=$choice->[0]; |
|
if (exists($defaultUsers{$user})) { |
|
$result .= " checked='checked' "; |
|
$checked = 1; |
|
} |
|
} elsif (!$self->{'multichoice'} && !$checked) { |
|
$result .= " checked='checked' "; |
|
$checked = 1; |
|
} |
|
$result .= |
|
" value='" . HTML::Entities::encode($choice->[0] . ':' |
|
.$choice->[2] . ':' |
|
.$choice->[1] . ':' |
|
.$choice->[3], "<>&\"'") |
|
. "' /></td><td>" |
|
. HTML::Entities::encode($choice->[1],'<>&"') |
|
. "</td><td align='center'>" |
|
. HTML::Entities::encode($choice->[2],'<>&"') |
|
. "</td>\n<td>" |
|
. HTML::Entities::encode($choice->[3],'<>&"') |
|
. "</td>\n<td>" |
|
. HTML::Entities::encode($choice->[4],'<>&"') |
|
. "</td>\n<td>" |
|
. HTML::Entities::encode($choice->[0],'<>&"') |
|
. "</td></tr>\n"; |
|
} |
|
$result .= "</table>\n"; |
|
|
|
} |
|
|
|
|
|
|
return $result; |
return $result; |
} |
} |
Line 2959 sub start_section {
|
Line 3027 sub start_section {
|
$paramHash->{'variable'} = $token->[2]{'variable'}; |
$paramHash->{'variable'} = $token->[2]{'variable'}; |
$helper->declareVar($paramHash->{'variable'}); |
$helper->declareVar($paramHash->{'variable'}); |
$paramHash->{'multichoice'} = $token->[2]{'multichoice'}; |
$paramHash->{'multichoice'} = $token->[2]{'multichoice'}; |
|
$paramHash->{'allowempty'} = $token->[2]{'allowempty'}; |
if (defined($token->[2]{'nextstate'})) { |
if (defined($token->[2]{'nextstate'})) { |
$paramHash->{NEXTSTATE} = $token->[2]{'nextstate'}; |
$paramHash->{NEXTSTATE} = $token->[2]{'nextstate'}; |
} |
} |
Line 3031 sub start_group {
|
Line 3100 sub start_group {
|
$paramHash->{'variable'} = $token->[2]{'variable'}; |
$paramHash->{'variable'} = $token->[2]{'variable'}; |
$helper->declareVar($paramHash->{'variable'}); |
$helper->declareVar($paramHash->{'variable'}); |
$paramHash->{'multichoice'} = $token->[2]{'multichoice'}; |
$paramHash->{'multichoice'} = $token->[2]{'multichoice'}; |
|
$paramHash->{'allowempty'} = $token->[2]{'allowempty'}; |
if (defined($token->[2]{'nextstate'})) { |
if (defined($token->[2]{'nextstate'})) { |
$paramHash->{NEXTSTATE} = $token->[2]{'nextstate'}; |
$paramHash->{NEXTSTATE} = $token->[2]{'nextstate'}; |
} |
} |