version 1.112, 2005/07/12 16:11:19
|
version 1.115, 2005/09/28 19:03:42
|
Line 2243 sub render {
|
Line 2243 sub render {
|
} |
} |
} |
} |
} |
} |
|
function getDesiredState() { // Return desired person state radio value. |
|
numRadio = document.forms.helpform.personstate.length; |
|
for (i =0; i < numRadio; i++) { |
|
if (document.forms.helpform.personstate[i].checked) { |
|
return document.forms.helpform.personstate[i].value; |
|
} |
|
} |
|
return ""; |
|
} |
|
|
|
function checksections(value) { // Check selected sections. |
|
numSections = document.forms.helpform.chosensections.length; |
|
desiredState = getDesiredState(); |
|
|
|
for (option = 0; option , numSections; option++) { |
|
if(document.forms.helpform.chosensections.options[option].selected) { |
|
section = document.forms.helpform.chosensections.options[option].text; |
|
if (section == "Staff") { // Staff are indicated by an empty section. |
|
section =""; |
|
} |
|
for (i = 0; i < document.forms.helpform.elements.length; i++ ) { |
|
if (document.forms.helpform.elements[i].value.indexOf(':') != -1) { |
|
info = document.forms.helpform.elements[i].value.split(':'); |
|
hisSection = info[2]; |
|
hisState = info[4]; |
|
if((hisSection == section) && ((desiredState ==hisState) || (section =="") || (desiredState == "All"))) { |
|
document.forms.helpform.elements[i].checked = value; |
|
} |
|
} |
|
} |
|
} |
|
} |
|
} |
// --> |
// --> |
</script> |
</script> |
SCRIPT |
SCRIPT |
Line 2258 SCRIPT
|
Line 2291 SCRIPT
|
$buttons = <<BUTTONS; |
$buttons = <<BUTTONS; |
<br /> |
<br /> |
<table> |
<table> |
<tr> |
|
|
|
<td><input type="button" onclick="checkactive()" value="$lt{'ocs'}" /></td> |
|
<td><input type="button" onclick="uncheckexpired()" value="$lt{'ues'}" /><br /></td> |
|
</tr> |
|
<tr> |
<tr> |
<td><input type="button" onclick="checkall(true, '$var')" value="$lt{'sas'}" /></td> |
<td><input type="button" onclick="checkall(true, '$var')" value="$lt{'sas'}" /></td> |
<td> <input type="button" onclick="checkall(false, '$var')" value="$lt{'uas'}" /><br /></td> |
<td> <input type="button" onclick="checkall(false, '$var')" value="$lt{'uas'}" /><br /></td> |
</tr> |
</tr> |
<tr> |
|
<td><input type="button" onclick="checksec(true)" value="$lt{'sfsg'}"></td> |
|
<td><input type="text" size="5" name="chksec"> </td> |
|
</tr> |
|
<tr> |
|
<td><input type="button" onclick="checksec(false)" value="$lt{'ufsg'}"></td> |
|
<td></td> |
|
</tr> |
|
</table> |
</table> |
<br /> |
<br /> |
BUTTONS |
BUTTONS |
Line 2372 BUTTONS
|
Line 2394 BUTTONS
|
} |
} |
|
|
$result .= "</table>\n\n"; |
$result .= "</table>\n\n"; |
$result .= $buttons; |
$result .= $buttons; |
|
# |
|
# now add the fancy section choice... first enumerate the sections: |
|
|
|
my %sections; |
|
for my $key (@keys) { |
|
my $section_name = $classlist->{$key}->[$section]; |
|
if ($section_name ne "") { |
|
$sections{$section_name} = 1; |
|
} |
|
} |
|
# The variable $choice_widget will have the html to make the choice |
|
# selector. |
|
|
|
my $choice_widget = '<select multiple name="chosensections" size="5">'."\n"; |
|
foreach my $sec (sort (keys %sections)) { |
|
$choice_widget .= "<option name=\"$sec\">$sec</option>\n"; |
|
} |
|
$choice_widget .= "<option>Staff</option></select>\n"; |
|
|
|
# Build a table without any borders to contain the section based |
|
# selection: |
|
|
|
my $section_selectors = '<table border="0">'."\n"; |
|
$section_selectors .= "<tr valign=\"top\">\n<td>For Sections:</td><td>$choice_widget</td>\n"; |
|
$section_selectors .= ' <td><label><input type="radio" name="personstate" value="Active" checked />'; |
|
$section_selectors .= " Current Students</label></td>\n"; |
|
$section_selectors .= ' <td><label><input type="radio" name="personstate" value="All" />'; |
|
$section_selectors .= " All students</label></td>\n"; |
|
$section_selectors .= ' <td><label><input type="radio" name="personstate" value="Expired" />'; |
|
$section_selectors .= " Expired Students</label></td>\n"; |
|
$section_selectors .= "</tr>\n"; |
|
$section_selectors .= "<tr>\n"; |
|
$section_selectors .= ' <td><input type="button" value="Select" onclick="checksections(true);" /></td>'."\n"; |
|
$section_selectors .= ' <td><input type="button" value="Unselect" onclick="checksections(false);" /></td></tr>'."\n</table>\n"; |
|
$section_selectors .= "<br />"; |
|
|
|
$result .= $section_selectors; |
return $result; |
return $result; |
} |
} |
|
|