version 1.15, 2006/04/25 21:25:13
|
version 1.19, 2006/04/26 14:43:03
|
Line 267 sub discourse {
|
Line 267 sub discourse {
|
'cfn' => 'Uncheck All'); |
'cfn' => 'Uncheck All'); |
$r->print(<<ENDDISHEADER); |
$r->print(<<ENDDISHEADER); |
<input type="hidden" name="sendmode" value="group" /> |
<input type="hidden" name="sendmode" value="group" /> |
<script> |
<script pe="text/javascript"> |
function checkall() { |
function checkall() { |
for (i=0; i<document.forms.compemail.elements.length; i++) { |
for (i=0; i<document.forms.compemail.elements.length; i++) { |
if |
if |
Line 612 sub disfolder {
|
Line 612 sub disfolder {
|
my $numblocked = 0; |
my $numblocked = 0; |
&blockcheck(\%setters,\$startblock,\$endblock); |
&blockcheck(\%setters,\$startblock,\$endblock); |
$r->print(<<ENDDISHEADER); |
$r->print(<<ENDDISHEADER); |
<script> |
<script type="text/javascript"> |
function checkall() { |
function checkall() { |
for (i=0; i<document.forms.disall.elements.length; i++) { |
for (i=0; i<document.forms.disall.elements.length; i++) { |
if |
if |
Line 1286 sub get_blockdates {
|
Line 1286 sub get_blockdates {
|
sub display_blocker_status { |
sub display_blocker_status { |
my ($r,$records,$ltext) = @_; |
my ($r,$records,$ltext) = @_; |
my $parmcount = 0; |
my $parmcount = 0; |
my @bgcols = ("#eeeeee","#dddddd"); |
|
my $function = &Apache::loncommon::get_users_function(); |
|
my $color = &Apache::loncommon::designparm($function.'.tabbg', |
|
$env{'user.domain'}); |
|
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'modi' => 'Modify', |
'modi' => 'Modify', |
'canc' => 'Cancel', |
'canc' => 'Cancel', |
); |
); |
|
$r->print(&Apache::loncommon::start_data_table()); |
$r->print(<<"END"); |
$r->print(<<"END"); |
<table border="0" cellpadding="0" cellspacing="0"> |
<tr> |
<tr> |
<th>$$ltext{'dura'}</th> |
<td width="100%" bgcolor="#000000"> |
<th>$$ltext{'setb'}</th> |
<table width="100%" border="0" cellpadding="1" cellspacing="0"> |
<th>$$ltext{'even'}</th> |
<tr> |
<th>$$ltext{'actn'}?</th> |
<td width="100%" bgcolor="#000000"> |
</tr> |
<table border="0" cellpadding="3" cellspacing="3" bgcolor="#FFFFFF"> |
|
<tr bgcolor="$color"> |
|
<td><b>$$ltext{'dura'}</b></td> |
|
<td><b>$$ltext{'setb'}</b></td> |
|
<td><b>$$ltext{'even'}</b></td> |
|
<td><b>$$ltext{'actn'}?</b></td> |
|
</tr> |
|
END |
END |
foreach (sort keys %{$records}) { |
foreach my $record (sort(keys(%{$records}))) { |
my $iter = $parmcount%2; |
|
my $onchange = 'onFocus="javascript:window.document.forms['. |
my $onchange = 'onFocus="javascript:window.document.forms['. |
"'blockform'].elements['modify_".$parmcount."'].". |
"'blockform'].elements['modify_".$parmcount."'].". |
'checked=true;"'; |
'checked=true;"'; |
my ($start,$end) = split/____/,$_; |
my ($start,$end) = split(/____/,$record); |
my $startform = &Apache::lonhtmlcommon::date_setter('blockform','startdate_'.$parmcount,$start,$onchange); |
my $startform = &Apache::lonhtmlcommon::date_setter('blockform','startdate_'.$parmcount,$start,$onchange); |
my $endform = &Apache::lonhtmlcommon::date_setter('blockform','enddate_'.$parmcount,$end,$onchange); |
my $endform = &Apache::lonhtmlcommon::date_setter('blockform','enddate_'.$parmcount,$end,$onchange); |
|
|
my ($setuname,$setudom,$title) = &parse_block_record($$records{$_}); |
my ($setuname,$setudom,$title) = |
|
&parse_block_record($$records{$record}); |
|
$title = &HTML::Entities::encode($title,'"<>'); |
my $settername = &Apache::loncommon::plainname($setuname,$setudom); |
my $settername = &Apache::loncommon::plainname($setuname,$setudom); |
|
$r->print(&Apache::loncommon::start_data_table_row()); |
$r->print(<<"END"); |
$r->print(<<"END"); |
<tr bgcolor="$bgcols[$iter]"> |
|
<td>$$ltext{'star'}: $startform<br/>$$ltext{'endd'}: $endform</td> |
<td>$$ltext{'star'}: $startform<br/>$$ltext{'endd'}: $endform</td> |
<td>$settername</td> |
<td>$settername</td> |
<td><input type="text" name="title_$parmcount" size="15" value="$title" /><input type="hidden" name="key_$parmcount" value="$_" /></td> |
<td><input type="text" name="title_$parmcount" size="15" value="$title" /><input type="hidden" name="key_$parmcount" value="$record" /></td> |
<td><label>$lt{'modi'}? <input type="checkbox" name="modify_$parmcount" /></label><br /><label>$lt{'canc'}? <input type="checkbox" name="cancel_$parmcount" /></label> |
<td><label>$lt{'modi'}? <input type="checkbox" name="modify_$parmcount" /></label><br /><label>$lt{'canc'}? <input type="checkbox" name="cancel_$parmcount" /></label> |
</tr> |
|
END |
END |
$parmcount ++; |
$r->print(&Apache::loncommon::end_data_table_row()); |
|
$parmcount++; |
} |
} |
$r->print(<<"END"); |
$r->print(<<"END"); |
</table> |
|
</td> |
|
</tr> |
|
</table> |
|
</td> |
|
</tr> |
|
</table> |
</table> |
<br /> |
<br /> |
<br /> |
<br /> |
Line 1366 sub display_addblocker_table {
|
Line 1352 sub display_addblocker_table {
|
'checked=true;"'; |
'checked=true;"'; |
my $startform = &Apache::lonhtmlcommon::date_setter('blockform','startdate_'.$parmcount,$start,$onchange); |
my $startform = &Apache::lonhtmlcommon::date_setter('blockform','startdate_'.$parmcount,$start,$onchange); |
my $endform = &Apache::lonhtmlcommon::date_setter('blockform','enddate_'.$parmcount,$end,$onchange); |
my $endform = &Apache::lonhtmlcommon::date_setter('blockform','enddate_'.$parmcount,$end,$onchange); |
my $function = &Apache::loncommon::get_users_function(); |
|
my $color = &Apache::loncommon::designparm($function.'.tabbg', |
|
$env{'user.domain'}); |
|
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'addb' => 'Add block', |
'addb' => 'Add block', |
'exam' => 'e.g., Exam 1', |
'exam' => 'e.g., Exam 1', |
Line 1376 sub display_addblocker_table {
|
Line 1359 sub display_addblocker_table {
|
); |
); |
$r->print(<<"END"); |
$r->print(<<"END"); |
<h4>$lt{'addn'}</h4> |
<h4>$lt{'addn'}</h4> |
<table border="0" cellpadding="0" cellspacing="0"> |
|
<tr> |
|
<td width="100%" bgcolor="#000000"> |
|
<table width="100%" border="0" cellpadding="1" cellspacing="0"> |
|
<tr> |
|
<td width="100%" bgcolor="#000000"> |
|
<table border="0" cellpadding="3" cellspacing="3" bgcolor="#FFFFFF"> |
|
<tr bgcolor="#CCCCFF"> |
|
<td><b>$$ltext{'dura'}</b></td> |
|
<td><b>$$ltext{'even'} $lt{'exam'}</b></td> |
|
<td><b>$$ltext{'actn'}?</b></td> |
|
</tr> |
|
<tr bgcolor="#eeeeee"> |
|
<td>$$ltext{'star'}: $startform<br />$$ltext{'endd'}: $endform</td> |
|
<td><input type="text" name="title_$parmcount" size="15" value="" /></td> |
|
<td><label>$lt{'addb'}? <input type="checkbox" name="add_$parmcount" value="1" /></label></td> |
|
</tr> |
|
</table> |
|
</td> |
|
</tr> |
|
</table> |
|
</td> |
|
</tr> |
|
</table> |
|
END |
END |
|
$r->print(&Apache::loncommon::start_data_table()); |
|
$r->print(<<"END"); |
|
<tr> |
|
<th>$$ltext{'dura'}</th> |
|
<th>$$ltext{'even'} $lt{'exam'}</th> |
|
<th>$$ltext{'actn'}?</th> |
|
</tr> |
|
END |
|
$r->print(&Apache::loncommon::start_data_table_row()); |
|
$r->print(<<"END"); |
|
<td>$$ltext{'star'}: $startform<br />$$ltext{'endd'}: $endform</td> |
|
<td><input type="text" name="title_$parmcount" size="15" value="" /></td> |
|
<td><label>$lt{'addb'}? <input type="checkbox" name="add_$parmcount" value="1" /></label></td> |
|
END |
|
$r->print(&Apache::loncommon::end_data_table_row()); |
|
$r->print(&Apache::loncommon::end_data_table()); |
return; |
return; |
} |
} |
|
|
Line 1418 sub blockcheck {
|
Line 1393 sub blockcheck {
|
# for students. |
# for students. |
return if (!%live_courses); |
return if (!%live_courses); |
|
|
&Apache::lonnet::logthis("hmm"); |
|
&Apache::lonnet::logthis(join(" ",%live_courses)); |
|
&Apache::lonnet::logthis(join(" ",%staff_of)); |
|
|
|
foreach my $course (keys(%live_courses)) { |
foreach my $course (keys(%live_courses)) { |
my ($cdom,$cnum) = split(/_/,$course); |
my $cdom = $env{'course.'.$course.'.domain'}; |
|
my $cnum = $env{'course.'.$course.'.num'}; |
|
|
# if they are a staff member and are currently not playing student |
# if they are a staff member and are currently not playing student |
next if ( $staff_of{$course} |
next if ( $staff_of{$course} |
Line 1453 sub blockcheck {
|
Line 1425 sub blockcheck {
|
|
|
sub build_block_table { |
sub build_block_table { |
my ($r,$startblock,$endblock,$setters) = @_; |
my ($r,$startblock,$endblock,$setters) = @_; |
my $function = &Apache::loncommon::get_users_function(); |
|
my $color = &Apache::loncommon::designparm($function.'.tabbg', |
|
$env{'user.domain'}); |
|
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'cacb' => 'Currently active communication blocks', |
'cacb' => 'Currently active communication blocks', |
'cour' => 'Course', |
'cour' => 'Course', |
'dura' => 'Duration', |
'dura' => 'Duration', |
'blse' => 'Block set by' |
'blse' => 'Block set by' |
); |
); |
$r->print(<<"END"); |
$r->print(<<"END"); |
<br /<br />$lt{'cacb'}:<br /><br /> |
<br /><br />$lt{'cacb'}:<br /><br /> |
<table border="0" cellpadding="0" cellspacing="0"> |
END |
<tr> |
$r->print(&Apache::loncommon::start_data_table()); |
<td width="100%" bgcolor="#000000"> |
$r->print(<<"END"); |
<table width="100%" border="0" cellpadding="1" cellspacing="0"> |
<tr> |
<tr> |
<th>$lt{'cour'}</th> |
<td width="100%" bgcolor="#000000"> |
<th>$lt{'dura'}</th> |
<table border="0" cellpadding="3" cellspacing="3" bgcolor="#FFFFFF"> |
<th>$lt{'blse'}</th> |
<tr bgcolor="$color"> |
</tr> |
<td><b>$lt{'cour'}</b></td> |
|
<td><b>$lt{'dura'}</b></td> |
|
<td><b>$lt{'blse'}</b></td> |
|
</tr> |
|
END |
END |
foreach (keys %{$setters}) { |
foreach my $course (keys(%{$setters})) { |
my %courseinfo=&Apache::lonnet::coursedescription($_); |
my %courseinfo=&Apache::lonnet::coursedescription($course); |
for (my $i=0; $i<@{$$setters{$_}{staff}}; $i++) { |
for (my $i=0; $i<@{$$setters{$course}{staff}}; $i++) { |
my ($uname,$udom) = @{$$setters{$_}{staff}[$i]}; |
my ($uname,$udom) = @{$$setters{$course}{staff}[$i]}; |
my $fullname = &Apache::loncommon::plainname($uname,$udom); |
my $fullname = &Apache::loncommon::plainname($uname,$udom); |
my ($openblock,$closeblock) = @{$$setters{$_}{times}[$i]}; |
my ($openblock,$closeblock) = @{$$setters{$course}{times}[$i]}; |
$openblock = &Apache::lonlocal::locallocaltime($openblock); |
$openblock = &Apache::lonlocal::locallocaltime($openblock); |
$closeblock= &Apache::lonlocal::locallocaltime($closeblock); |
$closeblock= &Apache::lonlocal::locallocaltime($closeblock); |
$r->print('<tr><td>'.$courseinfo{'description'}.'</td>'. |
$r->print(&Apache::loncommon::start_data_table_row(). |
|
'<td>'.$courseinfo{'description'}.'</td>'. |
'<td>'.$openblock.' to '.$closeblock.'</td>'. |
'<td>'.$openblock.' to '.$closeblock.'</td>'. |
'<td>'.$fullname.' ('.$uname.':'.$udom. |
'<td>'.$fullname.' ('.$uname.':'.$udom. |
')</td></tr>'); |
')</td>'. |
|
&Apache::loncommon::end_data_table_row()); |
} |
} |
} |
} |
$r->print('</table></td></tr></table></td></tr></table>'); |
$r->print(&Apache::loncommon::end_data_table()); |
} |
} |
|
|
# ----------------------------------------------------------- Display a message |
# ----------------------------------------------------------- Display a message |