version 1.59, 2006/06/03 21:28:07
|
version 1.75, 2008/03/11 00:44:09
|
Line 99 sub handler {
|
Line 99 sub handler {
|
text=>"Display Action Items"}); |
text=>"Display Action Items"}); |
if (($command eq 'chgthreshold') && $checkallowed{'abovethreshold'}) { |
if (($command eq 'chgthreshold') && $checkallowed{'abovethreshold'}) { |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>'/adm/whatsnew?command=chgthreshold&refpage='.$refpage, |
({href=>'/adm/whatsnew?command=chgthreshold&refpage='.$refpage, |
text=>"Change thresholds"}); |
text=>"Change thresholds"}); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
("What's New?",#'Course_Action_Items_Thresholds' |
("What's New?",#'Course_Action_Items_Thresholds' |
)); |
)); |
} elsif (($command eq 'chginterval') && $checkallowed{'versionchanges'} ) { |
} elsif (($command eq 'chginterval') && $checkallowed{'versionchanges'} ) { |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>'/adm/whatsnew?command=chginterval&refpage='.$refpage, |
({href=>'/adm/whatsnew?command=chginterval&refpage='.$refpage, |
text=>"Change interval"}); |
text=>"Change interval"}); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
("What's New?",#'Course_Action_Items_Intervals' |
("What's New?",#'Course_Action_Items_Intervals' |
)); |
)); |
} elsif (($command eq 'chgdisc') && $checkallowed{'coursediscussion'}) { |
} elsif (($command eq 'chgdisc') && $checkallowed{'coursediscussion'}) { |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>'/adm/whatsnew?command=chgdisc&refpage='.$refpage, |
({href=>'/adm/whatsnew?command=chgdisc&refpage='.$refpage, |
text=>"Change discussion display"}); |
text=>"Change discussion display"}); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
("What's New?",#'Course_Action_Items_Intervals' |
("What's New?",#'Course_Action_Items_Intervals' |
)); |
)); |
} elsif ($command eq 'courseinit') { |
} elsif ($command eq 'courseinit') { |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>'/adm/whatsnew?command=courseinit&refpage='.$refpage, |
({href=>'/adm/whatsnew?command=courseinit&refpage='.$refpage, |
text=>"Course initialization preference"}); |
text=>"Course initialization preference"}); |
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
$r->print(&Apache::lonhtmlcommon::breadcrumbs |
("What's New?",#'Course_Action_Items_Initialization' |
("What's New?",#'Course_Action_Items_Initialization' |
Line 144 sub display_main_box {
|
Line 144 sub display_main_box {
|
my ($r,$command,$refpage,$checkallowed) = @_; |
my ($r,$command,$refpage,$checkallowed) = @_; |
my $domain=&Apache::loncommon::determinedomain(); |
my $domain=&Apache::loncommon::determinedomain(); |
my $function = &Apache::loncommon::get_users_function(); |
my $function = &Apache::loncommon::get_users_function(); |
my $tabbg=&Apache::loncommon::designparm($function.'.tabbg',$domain); |
|
my $lctype = lc(&Apache::loncommon::course_type()); |
my $lctype = lc(&Apache::loncommon::course_type()); |
$r->print('<table width="100%" border="0" cellpadding="5" cellspacing="0"><tr><td width="100%">'); |
$r->print('<table width="100%" border="0" cellpadding="5" cellspacing="0"><tr><td width="100%">'); |
|
|
Line 172 sub display_main_box {
|
Line 171 sub display_main_box {
|
|
|
if (($command eq 'chgthreshold') |
if (($command eq 'chgthreshold') |
&& $checkallowed->{'abovethreshold'}) { |
&& $checkallowed->{'abovethreshold'}) { |
&display_threshold_config($r,$refpage,$tabbg,\%threshold_titles, |
&display_threshold_config($r,$refpage,\%threshold_titles, |
$cdom,$crs); |
$cdom,$crs); |
} elsif (($command eq 'chginterval') |
} elsif (($command eq 'chginterval') |
&& $checkallowed->{'versionchanges'}) { |
&& $checkallowed->{'versionchanges'}) { |
Line 183 sub display_main_box {
|
Line 182 sub display_main_box {
|
} elsif ($command eq 'courseinit') { |
} elsif ($command eq 'courseinit') { |
&courseinit_config($r,$refpage,\%initpage); |
&courseinit_config($r,$refpage,\%initpage); |
} else { |
} else { |
&display_actions_box($r,$tabbg,$command,$refpage,\%threshold_titles, |
&display_actions_box($r,$command,$refpage,\%threshold_titles, |
\%interval_titles,\%initpage,$cdom,$crs,$checkallowed); |
\%interval_titles,\%initpage,$cdom,$crs,$checkallowed); |
} |
} |
my $end_page = &Apache::loncommon::end_page(); |
my $end_page = &Apache::loncommon::end_page(); |
Line 241 END
|
Line 240 END
|
#------------------------------- |
#------------------------------- |
|
|
sub display_actions_box { |
sub display_actions_box { |
my ($r,$tabbg,$command,$refpage,$threshold_titles,$interval_titles, |
my ($r,$command,$refpage,$threshold_titles,$interval_titles,$initpage, |
$initpage,$cdom,$crs,$checkallowed) = @_; |
$cdom,$crs,$checkallowed) = @_; |
my $rowColor1 = "#ffffff"; |
|
my $rowColor2 = "#eeeeee"; |
|
|
|
my $udom = $env{'user.domain'}; |
my $udom = $env{'user.domain'}; |
my $uname = $env{'user.name'}; |
my $uname = $env{'user.name'}; |
my $cid = $env{'request.course.id'}; |
my $cid = $env{'request.course.id'}; |
Line 256 sub display_actions_box {
|
Line 252 sub display_actions_box {
|
'Group' => 'members', |
'Group' => 'members', |
); |
); |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'yacc' => 'You are accessing an invalid course or group', |
'yacc' => 'You are accessing an invalid course', |
'gtfr' => 'Go to first resource', |
'gtfr' => 'Go to first resource', |
'hial' => 'Hide all', |
'hial' => 'Hide all', |
'shal' => 'Show all', |
'shal' => 'Show all', |
Line 286 sub display_actions_box {
|
Line 282 sub display_actions_box {
|
$result = &store_courseinit_setting($uname,$udom,$cid,$initpage); |
$result = &store_courseinit_setting($uname,$udom,$cid,$initpage); |
} |
} |
|
|
my %threshold = ( |
my %threshold = (); |
av_attempts => 2, |
|
degdiff => 0.5, |
|
numstudents => 2, |
|
); |
|
my %pagedesc = &Apache::lonlocal::texthash ( |
my %pagedesc = &Apache::lonlocal::texthash ( |
firstres => 'First resource', |
firstres => 'First resource', |
whatsnew => "What's New? page", |
whatsnew => "What's New? page", |
Line 303 sub display_actions_box {
|
Line 295 sub display_actions_box {
|
my $currinit = $pagedesc{$initdisp}.' ('.$pagedesc{$initcontrol}.')'; |
my $currinit = $pagedesc{$initdisp}.' ('.$pagedesc{$initcontrol}.')'; |
|
|
unless ($cid) { |
unless ($cid) { |
$r->print('<br /><b><center>'.$lt{'yacc'}.'</center></b><br /><br />'); |
$r->print('<p><span style="text-align: center; font-weight: bold;">'.$lt{'yacc'}.'</span></p>'); |
return; |
return; |
} |
} |
|
|
Line 312 sub display_actions_box {
|
Line 304 sub display_actions_box {
|
&GDBM_READER(),0640)) { |
&GDBM_READER(),0640)) { |
my $furl=$bighash{'first_url'}; |
my $furl=$bighash{'first_url'}; |
untie(%bighash); |
untie(%bighash); |
$r->print('<font size="+1"><a href="'.$furl.'">'.$lt{'gtfr'}. |
$r->print('<span style="font-size: larger;"><a href="'.$furl.'">'.$lt{'gtfr'}. |
'</a></font><br />'); |
'</a></span><br />'); |
} |
} |
} |
} |
$r->print(&mt('Page set to be displayed after you have selected a role in this '.$lctype). |
$r->print(&mt('Page set to be displayed after you have selected a role in this '.$lctype).'.' |
'. <nobr>'.&mt('Currently: <i>[_1]</i>',$currinit).'. '. |
.' <span class="LC_nobreak">' |
&mt('<b>Change</b> for just <a href="/adm/whatsnew?command=courseinit&refpage=[_1]">this '.$lctype.'</a>',$refpage).' '. |
.&mt('Currently: <i>[_1]</i>',$currinit) |
&mt('or for all <a href="/adm/preferences?action=changecourseinit&refpage=[_1]">your courses/groups</a>',$refpage).'</nobr><br /><hr />'); |
.'. ' |
|
# &mt('<b>Change</b> for just <a href="/adm/whatsnew?command=courseinit&refpage=[_1]">this '.$lctype.'</a>',$refpage).' '. |
|
# &mt('or for all <a href="/adm/preferences?action=changecourseinit&refpage=[_1]">your courses</a>.',$refpage).'</span><br /><hr />'); |
|
.&mt('<b>Change</b> for just [_1]this course[_2]' |
|
.' or for all [_3]your courses[_2].' |
|
,'<a href="/adm/whatsnew?command=courseinit&refpage='.$refpage.'">' |
|
,'</a>' |
|
,'<a href="/adm/preferences?action=changecourseinit&refpage='.$refpage.'">') |
|
.' </span><br /><hr />'); |
|
|
if ($command eq 'reset') { |
if ($command eq 'reset') { |
$result = &process_reset($cdom,$crs); |
$result = &process_reset($cdom,$crs); |
Line 334 sub display_actions_box {
|
Line 334 sub display_actions_box {
|
my $store_result=&store_display_settings($uname,$udom,$cid,$checkallowed); |
my $store_result=&store_display_settings($uname,$udom,$cid,$checkallowed); |
|
|
unless ($store_result eq 'ok') { |
unless ($store_result eq 'ok') { |
&Apache::lonnet::logthis('Error storing whatsnew settings: '. |
&Apache::lonnet::logthis('Error saving whatsnew settings: '. |
$store_result.' for '.'user '.$uname.':'.$udom.' in '.$lctype.' '.$cid); |
$store_result.' for '.'user '.$uname.':'.$udom.' in '.$lctype.' '.$cid); |
$result .= &mt('Unable to store visibility settings due to [_1]', |
$result .= &mt('Unable to save visibility settings due to [_1]', |
$store_result); |
$store_result); |
} |
} |
|
|
Line 400 sub display_actions_box {
|
Line 400 sub display_actions_box {
|
} |
} |
|
|
if ($needitems) { |
if ($needitems) { |
&getitems(\%unread,\%ungraded,\%bombed,\%triggered,\%changed,\@newdiscussions,\@tograde,\@bombs,\@warnings,$rowColor1,$rowColor2,\%threshold,$cdom,$crs,\%res_title,\%show,$starttime,$countunread); |
&getitems(\%unread,\%ungraded,\%bombed,\%triggered,\%changed,\@newdiscussions,\@tograde,\@bombs,\@warnings,\%threshold,$cdom,$crs,\%res_title,\%show,$starttime,$countunread); |
} |
} |
if ($show{'coursenormalmail'}) { |
if ($show{'coursenormalmail'}) { |
$msgcount = &getnormalmail(\@newmsgs); |
$msgcount = &getnormalmail(\@newmsgs); |
Line 419 sub display_actions_box {
|
Line 419 sub display_actions_box {
|
} |
} |
} |
} |
|
|
$r->print('<input type="hidden" name="refpage" value="'.$refpage.'"></form><br /><table border="0" width="100%" cellpadding="2" cellspacing="4"><tr><td align="left" valign="top" width="45%">'); |
$r->print('<input type="hidden" name="refpage" value="'.$refpage.'" /></form><table class="LC_double_column"><tr><td class="LC_left_col">'); |
|
|
my $displayed = 0; |
my $displayed = 0; |
my $totalboxes = 0; |
my $totalboxes = 0; |
Line 434 sub display_actions_box {
|
Line 434 sub display_actions_box {
|
foreach my $actionitem (@actionorder) { |
foreach my $actionitem (@actionorder) { |
if ($$checkallowed{$actionitem}) { |
if ($$checkallowed{$actionitem}) { |
if ($displayed == $halfway) { |
if ($displayed == $halfway) { |
$r->print('</td><td width="6%"> </td><td align="left" valign="top" width="47%">'); |
$r->print('</td><td> </td><td class="LC_right_col" >'); |
} |
} |
&display_launcher($r,$actionitem,$refpage,$checkallowed,$tabbg,$rowColor1,$rowColor2,\%show,\%headings,\%res_title,\@tograde,\%ungraded,\@bombs,\%bombed,\%changed,\@warnings,\%triggered,\@newdiscussions,\%unread,$msgcount,\@newmsgs,$critmsgcount,\@critmsgs,$interval,$countunread); |
&display_launcher($r,$actionitem,$refpage,$checkallowed,\%show,\%headings,\%res_title,\@tograde,\%ungraded,\@bombs,\%bombed,\%changed,\@warnings,\%triggered,\@newdiscussions,\%unread,$msgcount,\@newmsgs,$critmsgcount,\@critmsgs,$interval,$countunread); |
$displayed ++; |
$displayed ++; |
} |
} |
} |
} |
$r->print(' |
$r->print(' |
</table> |
|
</td> |
|
</tr> |
|
</table> |
|
</td> |
</td> |
</tr> |
</tr> |
</table>'); |
</table> |
|
'); |
} |
} |
|
|
#------------------------------- |
#------------------------------- |
Line 458 sub display_actions_box {
|
Line 455 sub display_actions_box {
|
#------------------------------- |
#------------------------------- |
|
|
sub display_threshold_config { |
sub display_threshold_config { |
my ($r,$refpage,$tabbg,$threshold_titles,$cdom,$crs) = @_; |
my ($r,$refpage,$threshold_titles,$cdom,$crs) = @_; |
my $uname = $env{'user.name'}; |
my $uname = $env{'user.name'}; |
my $udom = $env{'user.dom'}; |
my $udom = $env{'user.dom'}; |
my $cid = $env{'request.course.id'}; |
my $cid = $env{'request.course.id'}; |
Line 468 sub display_threshold_config {
|
Line 465 sub display_threshold_config {
|
my $rowColor; |
my $rowColor; |
|
|
my @thresholditems = ("av_attempts","degdiff","numstudents"); |
my @thresholditems = ("av_attempts","degdiff","numstudents"); |
foreach my $item (@thresholditems) { |
|
$threshold{$item} = ''; |
|
} |
|
my %threshold_titles = &Apache::lonlocal::texthash( |
my %threshold_titles = &Apache::lonlocal::texthash( |
av_attempts => 'Average number of attempts', |
av_attempts => 'Average number of attempts', |
degdiff => 'Degree of difficulty', |
degdiff => 'Degree of difficulty', |
Line 478 sub display_threshold_config {
|
Line 472 sub display_threshold_config {
|
); |
); |
&get_curr_thresholds(\%threshold,$uname,$udom,$cid,$cdom,$crs); |
&get_curr_thresholds(\%threshold,$uname,$udom,$cid,$cdom,$crs); |
|
|
$r->print('<br /><form name="thresholdform" method="post" action="/adm/whatsnew"> |
$r->print('<br /><form name="thresholdform" method="post" action="/adm/whatsnew">'. |
<table border="0" cellpadding="2" cellspacing="4"> |
&Apache::loncommon::start_data_table(). |
<tr> |
&Apache::loncommon::start_data_table_header_row(). |
<td align="left" valign="top" width="45%"> |
'<th>'.&mt('Threshold Name').'</th>'."\n". |
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#000000"> |
'<th>'.&mt('Current value').'</th>'."\n". |
<tr> |
'<th>'.&mt('Change?').'</th>'."\n". |
<td> |
&Apache::loncommon::end_data_table_header_row()); |
<table border="0" cellpadding="1" cellspacing="1" bgcolor="#000000"> |
|
<tr> |
|
<td bgcolor="#ffffff"> |
|
<table cellspacing="0" cellpadding="4" border="0"> |
|
<tr bgcolor="'.$tabbg.'"> |
|
<th>Threshold Name</th> |
|
<th>Current value</th> |
|
<th>Change?</th> |
|
</tr>'); |
|
my $rowNum =0; |
|
foreach my $type (@thresholditems) { |
foreach my $type (@thresholditems) { |
my $parameter = $env{'request.course.id'}.':threshold_'.$type; |
my $parameter = $env{'request.course.id'}.':threshold_'.$type; |
# onchange is javascript to automatically check the 'Set' button. |
# onchange is javascript to automatically check the 'Set' button. |
my $onchange = 'onFocus="javascript:window.document.forms'. |
my $onchange = 'onFocus="javascript:window.document.forms'. |
"['thresholdform'].elements['".$parameter."_setparmval']". |
"['thresholdform'].elements['".$parameter."_setparmval']". |
'.checked=true;"'; |
'.checked=true;"'; |
if ($rowNum %2 == 1) { |
$r->print(&Apache::loncommon::start_data_table_row()."\n". |
$rowColor = $rowColor1; |
'<td>'.$threshold_titles{$type}.'</td>'."\n". |
} else { |
'<td>'.&Apache::lonhtmlcommon::textbox($parameter.'_value', |
$rowColor = $rowColor2; |
|
} |
|
$r->print(' |
|
<tr bgcolor="'.$rowColor.'"> |
|
<td>'.$threshold_titles{$type}.'</td> |
|
<td>'.&Apache::lonhtmlcommon::textbox($parameter.'_value', |
|
$threshold{$type}, |
$threshold{$type}, |
10,$onchange).'</td> |
10,$onchange).'</td>'."\n". |
<td>' |
'<td>'. |
.&Apache::lonhtmlcommon::checkbox($parameter.'_setparmval'). |
&Apache::lonhtmlcommon::checkbox($parameter.'_setparmval'). |
'</td> |
'</td>'."\n". |
</tr>'); |
&Apache::loncommon::end_data_table_row()); |
$rowNum ++; |
|
} |
} |
$r->print('</table></td></tr></table></td></tr></table> |
$r->print(&Apache::loncommon::end_data_table()."\n". |
<br /><input type="submit" name="threshold" value="Make changes" /> |
'<br /><input type="submit" name="threshold" value="'.&mt('Make changes').'" /> |
<input type="hidden" name="command" value="update" /> |
<input type="hidden" name="command" value="update" /> |
<input type="hidden" name="refpage" value="'.$refpage.'" /> |
<input type="hidden" name="refpage" value="'.$refpage.'" /> |
</form>'); |
</form>'); |
Line 537 sub display_interval_config {
|
Line 514 sub display_interval_config {
|
my $lctype = lc(&Apache::loncommon::course_type()); |
my $lctype = lc(&Apache::loncommon::course_type()); |
my $current = &get_current($env{'user.name'},$env{'user.domain'}, |
my $current = &get_current($env{'user.name'},$env{'user.domain'}, |
$env{'request.course.id'},'interval'); |
$env{'request.course.id'},'interval'); |
$r->print('<br />'.&mt('Choose the time window to use for display of version changes for resources in the '.$lctype.'.')); |
$r->print('<br />'.&mt('Choose the time window to use for display of version changes for resources in the '.$lctype.'.').'<br />'); |
unless ($current eq '') { |
unless ($current eq '') { |
$r->print(' '.&mt('Current value is [_1]','<b>'. |
$r->print(' '.&mt('Current value is [_1].','<b>'. |
$$interval_titles{$current}.'</b>.')); |
$$interval_titles{$current}.'</b>')); |
} |
} |
$r->print('<br /><br /> |
$r->print('<br /><br /> |
<form method="post" name="intervalswitch" action="/adm/whatsnew"> |
<form method="post" name="intervalswitch" action="/adm/whatsnew"> |
Line 549 sub display_interval_config {
|
Line 526 sub display_interval_config {
|
<select name="interval"> |
<select name="interval"> |
'); |
'); |
foreach my $key (reverse sort ({$a cmp $b} (keys(%{$interval_titles})))) { |
foreach my $key (reverse sort ({$a cmp $b} (keys(%{$interval_titles})))) { |
$r->print('<option value="'.$key.'">Version changes '.$$interval_titles{$key}. |
$r->print('<option value="'.$key.'">'.&mt('Version changes').' '.$$interval_titles{$key}. |
'</option>'."\n"); |
'</option>'."\n"); |
} |
} |
$r->print('</select> |
$r->print('</select> |
Line 584 function toggle_countunread(choice) {
|
Line 561 function toggle_countunread(choice) {
|
document.discussionswitch.submit(); |
document.discussionswitch.submit(); |
} |
} |
</script>'); |
</script>'); |
$r->print('<br />'.&mt('Choose whether or not to display a count of the number of new posts for each resource or bulletin board which has unread posts.').'<br />'.&mt('This can increase the time taken to gather data for the [_1] page by a few seconds.',"<i>What's New?</i>").' '.&mt('Currently set to [_1].','<b>'.$current.'</b>')); |
$r->print('<br />'.&mt('Choose whether or not to display a count of the number of new posts for each resource or bulletin board which has unread posts.').'<br />'.&mt("This can increase the time taken to gather data for the '<i>What's New?</i>' page by a few seconds.").' '.&mt("Currently set to <b>$current</b>.")); |
$r->print('<br /><br /> |
$r->print('<br /><br /> |
<form method="post" name="discussionswitch" action="/adm/whatsnew"> |
<form method="post" name="discussionswitch" action="/adm/whatsnew"> |
<input type="hidden" name="command" value="newdiscconf" /> |
<input type="hidden" name="command" value="newdiscconf" /> |
Line 593 function toggle_countunread(choice) {
|
Line 570 function toggle_countunread(choice) {
|
'); |
'); |
$r->print('<br/> |
$r->print('<br/> |
<input type="button" name="display" value="'. |
<input type="button" name="display" value="'. |
&mt('Change to [_1]',$opposite{$current}).'" |
&mt('Change to [_1]',&mt($opposite{$current})).'" |
onclick="javascript:toggle_countunread('."'change'".')" /> |
onclick="javascript:toggle_countunread('."'change'".')" /> |
  |
  |
<input type="button" name="nochange" value="'. |
<input type="button" name="nochange" value="'. |
Line 640 END
|
Line 617 END
|
if ($choice eq $control) { |
if ($choice eq $control) { |
$chkstring = ' checked="checked" '; |
$chkstring = ' checked="checked" '; |
} |
} |
$r->print('<nobr><label><input type="radio" name="courseinit_control" value="'. |
$r->print('<span class="LC_nobreak"><label><input type="radio" name="courseinit_control" value="'. |
$choice.'"'.$chkstring.'/>'.$$initpage{$choice}. |
$choice.'"'.$chkstring.'/>'.$$initpage{$choice}. |
' </label></nobr>'); |
' </label></span>'); |
} |
} |
$r->print('<br /><br />'.&mt('If').' '.$$initpage{'coursespecific'}. |
$r->print('<br /><br />'.&mt('If').' '.$$initpage{'coursespecific'}. |
' - <br />'.$lt{'chce'}.": \n"); |
' - <br />'.$lt{'chce'}.": \n"); |
Line 651 END
|
Line 628 END
|
if (($choice eq $current) && ($control eq 'coursespecific')) { |
if (($choice eq $current) && ($control eq 'coursespecific')) { |
$chkstring = ' checked="checked" '; |
$chkstring = ' checked="checked" '; |
} |
} |
$r->print('<nobr><label><input type="radio" name="courseinit_page" value="'. |
$r->print('<span class="LC_nobreak"><label><input type="radio" name="courseinit_page" value="'. |
$choice.'"'.$chkstring.'/>'.$$initpage{$choice}. |
$choice.'"'.$chkstring.'/>'.$$initpage{$choice}. |
' </label></nobr>'); |
' </label></span>'); |
} |
} |
$r->print('<br /><br /><input type="submit" name="display" value="'. |
$r->print('<br /><br /><input type="submit" name="display" value="'. |
$lt{'moce'}.'" /></form>'); |
$lt{'moce'}.'" /></form>'); |
Line 681 sub curr_courseinit {
|
Line 658 sub curr_courseinit {
|
} |
} |
|
|
sub display_launcher { |
sub display_launcher { |
my ($r,$action,$refpage,$checkallowed,$tabbg,$rowColor1,$rowColor2,$show, |
my ($r,$action,$refpage,$checkallowed,$show,$headings,$res_title, |
$headings,$res_title,$tograde,$ungraded,$bombs,$bombed,$changed, |
$tograde,$ungraded,$bombs,$bombed,$changed,$warnings,$triggered, |
$warnings,$triggered,$newdiscussions,$unread,$msgcount,$newmsgs, |
$newdiscussions,$unread,$msgcount,$newmsgs,$critmsgcount,$critmsgs, |
$critmsgcount,$critmsgs,$interval,$countunread) = @_; |
$interval,$countunread) = @_; |
|
|
if ($$checkallowed{$action}) { |
if ($$checkallowed{$action}) { |
&start_box($r,$tabbg,$show,$headings,$action,$refpage); |
&start_box($r,$show,$headings,$action,$refpage,$action); |
if ($$show{$action}) { |
if ($$show{$action}) { |
if ($action eq 'handgrading') { # UNGRADED ITEMS |
if ($action eq 'handgrading') { # UNGRADED ITEMS |
&display_handgrade($r,$tograde,$rowColor1,$rowColor2, |
&display_handgrade($r,$tograde,$ungraded); |
$ungraded); |
|
} elsif ($action eq 'haserrors') { # BOMBS |
} elsif ($action eq 'haserrors') { # BOMBS |
&display_haserrors($r,$bombs,$rowColor1,$rowColor2,$bombed, |
&display_haserrors($r,$bombs,$bombed,$res_title); |
$res_title); |
|
} elsif ($action eq 'versionchanges') { # VERSION CHANGES |
} elsif ($action eq 'versionchanges') { # VERSION CHANGES |
&display_versionchanges($r,$changed,$res_title,$rowColor1, |
&display_versionchanges($r,$changed,$res_title,$interval); |
$rowColor2,$interval); |
|
|
|
} elsif ($action eq 'abovethreshold') { # DEGDIFF/AV. TRIES TRIGGERS |
} elsif ($action eq 'abovethreshold') { # DEGDIFF/AV. TRIES TRIGGERS |
&display_abovethreshold($r,$refpage,$warnings,$triggered, |
&display_abovethreshold($r,$refpage,$warnings,$triggered, |
$res_title); |
$res_title); |
} elsif ($action eq 'coursediscussion') { # UNREAD COURSE DISCUSSION |
} elsif ($action eq 'coursediscussion') { # UNREAD COURSE DISCUSSION |
&display_coursediscussion($r,$newdiscussions,$unread, |
&display_coursediscussion($r,$newdiscussions,$unread, |
$countunread,$res_title,$rowColor1,$rowColor2); |
$countunread,$res_title); |
} elsif ($action eq 'coursenormalmail') { # NORMAL MESSAGES |
} elsif ($action eq 'coursenormalmail') { # NORMAL MESSAGES |
&display_coursenormalmail($r,$msgcount,$newmsgs,$rowColor1, |
&display_coursenormalmail($r,$msgcount,$newmsgs); |
$rowColor2); |
|
} elsif ($action eq 'coursecritmail') { # CRITICAL MESSAGES |
} elsif ($action eq 'coursecritmail') { # CRITICAL MESSAGES |
&display_coursecritmail($r,$critmsgcount,$critmsgs,$rowColor1, |
&display_coursecritmail($r,$critmsgcount,$critmsgs); |
$rowColor2); |
|
} |
} |
} |
} |
&end_box($r); |
&end_box($r); |
Line 720 sub display_launcher {
|
Line 691 sub display_launcher {
|
|
|
sub getitems { |
sub getitems { |
my ($unread,$ungraded,$bombed,$triggered,$changed,$newdiscussions, |
my ($unread,$ungraded,$bombed,$triggered,$changed,$newdiscussions, |
$tograde,$bombs,$warnings,$rowColor1,$rowColor2,$threshold,$cdom,$crs, |
$tograde,$bombs,$warnings,$threshold,$cdom,$crs,$res_title,$show, |
$res_title,$show,$starttime,$countunread) = @_; |
$starttime,$countunread) = @_; |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
# force retrieve Resource to seed the part id cache we'll need it later |
# force retrieve Resource to seed the part id cache we'll need it later |
my @allres=$navmap->retrieveResources(undef, |
my @allres=$navmap->retrieveResources(undef, |
Line 739 sub getitems {
|
Line 710 sub getitems {
|
$cdom,$crs); |
$cdom,$crs); |
} |
} |
|
|
my $warningnum = 0; |
|
foreach my $resource (@allres) { |
foreach my $resource (@allres) { |
my $result = ''; |
my $result = ''; |
my $applies = 0; |
my $applies = 0; |
Line 748 sub getitems {
|
Line 718 sub getitems {
|
%{$$ungraded{$symb}} = (); |
%{$$ungraded{$symb}} = (); |
%{$$triggered{$symb}} = (); |
%{$$triggered{$symb}} = (); |
$$triggered{$symb}{numparts} = 0; |
$$triggered{$symb}{numparts} = 0; |
|
if ($resource->encrypted()) { |
|
$$triggered{$symb}{'enclink'} = $resource->link(); |
|
$$triggered{$symb}{'encsymb'} = $resource->shown_symb(); |
|
} |
my $title = $resource->compTitle(); |
my $title = $resource->compTitle(); |
$$res_title{$symb} = $title; |
$$res_title{$symb} = $title; |
my $ressymb = $resource->wrap_symb(); |
my $ressymb = $resource->wrap_symb(); |
Line 773 sub getitems {
|
Line 747 sub getitems {
|
|
|
# Maxtries and degree of difficulty for problem parts, unless handgradeable |
# Maxtries and degree of difficulty for problem parts, unless handgradeable |
if ($$show{'abovethreshold'}) { |
if ($$show{'abovethreshold'}) { |
$warningnum = &check_thresholds($resource,$symb,\%resourcetracker, |
&check_thresholds($resource,$symb,\%resourcetracker, |
$triggered,$threshold,$warnings, |
$triggered,$threshold,$warnings); |
$warningnum,$rowColor1,$rowColor2); |
|
} |
} |
|
|
} |
} |
Line 790 sub check_discussions {
|
Line 763 sub check_discussions {
|
%{$$unread{$ressymb}} = (); |
%{$$unread{$ressymb}} = (); |
$$unread{$ressymb}{'title'} = $title; |
$$unread{$ressymb}{'title'} = $title; |
$$unread{$ressymb}{'symb'} = $symb; |
$$unread{$ressymb}{'symb'} = $symb; |
|
if ($resource->encrypted()) { |
|
$$unread{$ressymb}{'enclink'} = $resource->link(); |
|
$$unread{$ressymb}{'encsymb'} = $resource->shown_symb(); |
|
} |
push(@{$newdiscussions}, $ressymb); |
push(@{$newdiscussions}, $ressymb); |
|
|
$$unread{$ressymb}{'lastpost'} = $resource->last_post_time(); |
$$unread{$ressymb}{'lastpost'} = $resource->last_post_time(); |
|
|
if ($countunread eq 'on') { |
if ($countunread eq 'on') { |
$$unread{$ressymb}{'unreadcount'} = $resource->unread_discussion(); |
$$unread{$ressymb}{'unreadcount'} = |
|
$resource->discussion_info('unread'); |
} |
} |
} |
} |
|
|
Line 816 sub check_handgraded {
|
Line 794 sub check_handgraded {
|
if (@ungraded > 0) { |
if (@ungraded > 0) { |
$$ungraded{$symb}{count} = scalar(@ungraded); |
$$ungraded{$symb}{count} = scalar(@ungraded); |
$$ungraded{$symb}{title} = $title; |
$$ungraded{$symb}{title} = $title; |
push(@{$tograde}, $symb); |
if ($resource->encrypted()) { |
|
$$ungraded{$symb}{'enclink'} = $resource->link(); |
|
$$ungraded{$symb}{'encsymb'} = $resource->shown_symb(); |
|
} |
|
push(@{$tograde},$symb); |
} |
} |
} |
} |
} |
} |
Line 839 sub check_bombed {
|
Line 821 sub check_bombed {
|
} |
} |
|
|
sub check_thresholds { |
sub check_thresholds { |
my ($resource,$symb,$resourcetracker,$triggered,$threshold,$warnings, |
my ($resource,$symb,$resourcetracker,$triggered,$threshold,$warnings) = @_; |
$warningnum,$rowColor1,$rowColor2) = @_; |
|
# Compile maxtries and degree of difficulty for problem parts, unless handgradeable |
# Compile maxtries and degree of difficulty for problem parts, unless handgradeable |
my @parts = @{$resource->parts()}; |
my @parts = @{$resource->parts()}; |
my %stats; |
my %stats; |
my %lastreset = (); |
my %lastreset = (); |
my $warning = 0; |
my $warning = 0; |
my $rowColor; |
|
foreach my $part (@parts) { |
foreach my $part (@parts) { |
if ($resource->handgrade($part) eq 'yes') { |
if ($resource->handgrade($part) eq 'yes') { |
next; |
next; |
Line 885 sub check_thresholds {
|
Line 865 sub check_thresholds {
|
} |
} |
} |
} |
if ($warning) { |
if ($warning) { |
if ($warningnum%2 == 1) { |
|
$rowColor = $rowColor1; |
|
} else { |
|
$rowColor = $rowColor2; |
|
} |
|
$$triggered{$symb}{rowColor} = $rowColor; |
|
$$triggered{$symb}{title} = $resource->title; |
$$triggered{$symb}{title} = $resource->title; |
|
my $partcount = 0; |
|
@{$$triggered{$symb}{text}} = (); |
foreach my $part (@parts) { |
foreach my $part (@parts) { |
if (exists($stats{$part}{users})) { |
if (exists($stats{$part}{users})) { |
my $resetname = 'reset_'.&escape($symb."\0".$part); |
my $resetname = 'reset_'.&escape($symb."\0".$part); |
my $resettitle = 'title_'.&escape($symb."\0".$part); |
my $resettitle = 'title_'.&escape($symb."\0".$part); |
if ($$triggered{$symb}{numparts}) { |
|
$$triggered{$symb}{text} .= '<tr bgcolor="'.$rowColor.'">'."\n"; |
|
} |
|
if (@parts > 1) { |
if (@parts > 1) { |
$$triggered{$symb}{text} .= ' |
$$triggered{$symb}{text}[$partcount] = ' |
<td align="right"><small>part - '.$part.'<small></td>'; |
<td>'.&mt('part - ').$part.'</td>'; |
} else { |
} else { |
$$triggered{$symb}{text} .= ' |
$$triggered{$symb}{text}[$partcount] = ' |
<td align="right"><small>single part</small></td>'; |
<td>'.&mt('single part').'</td>'; |
} |
} |
$$triggered{$symb}{text} .= ' |
$$triggered{$symb}{text}[$partcount] .= ' |
<td align="right"><small>'.$stats{$part}{users}.'</small></td> |
<td>'.$stats{$part}{users}.'</td> |
<td align="right"><small>'.$stats{$part}{attempts}.'</small></td> |
<td>'.$stats{$part}{attempts}.'</td> |
<td align="right"><small>'.$stats{$part}{degdiff}.'</small></td> |
<td>'.$stats{$part}{degdiff}.'</td> |
<td align="right"><small>'.$lastreset{$part}.'</small></td> |
<td>'.$lastreset{$part}.'</td> |
<td align="right"><small><input type="checkbox" name="'.$resetname.'" /><input type="hidden" name="'.$resettitle.'" value="'.&escape($$triggered{$symb}{title}).'" /></td> |
<td><input type="checkbox" name="'.$resetname.'" /><input type="hidden" name="'.$resettitle.'" value="'.&escape($$triggered{$symb}{title}).'" /></td>'; |
</tr>'; |
$partcount ++; |
$$triggered{$symb}{numparts} ++; |
|
} |
} |
|
$$triggered{$symb}{numparts} = $partcount; |
} |
} |
push(@{$warnings},$symb); |
push(@{$warnings},$symb); |
$warningnum ++; |
|
} |
} |
return $warningnum; |
|
} |
} |
|
|
|
|
sub get_curr_thresholds { |
sub get_curr_thresholds { |
my ($threshold,$uname,$udom,$cid,$cdom,$crs) = @_; |
my ($threshold,$uname,$udom,$cid,$cdom,$crs) = @_; |
|
# set default values |
|
%$threshold = (av_attempts => 2, |
|
degdiff => 0.5, |
|
numstudents => 2 |
|
); |
my %thresholdsettings = &Apache::lonnet::dump('nohist_whatsnew',$udom, |
my %thresholdsettings = &Apache::lonnet::dump('nohist_whatsnew',$udom, |
$uname,$cid.':threshold'); |
$uname,$cid.':threshold'); |
my $thresholdcount = 0; |
my $thresholdcount = 0; |
Line 1011 sub process_reset {
|
Line 987 sub process_reset {
|
|
|
sub process_update { |
sub process_update { |
my ($uname,$udom,$threshold_titles) = @_; |
my ($uname,$udom,$threshold_titles) = @_; |
my $setoutput = '<b>Changes to threshold(s) for problem tracking:</b><br />'; |
my $setoutput = '<b>'.&mt('Changes to threshold(s) for problem tracking:').'</b><br />'; |
foreach (keys %env) { |
foreach (keys %env) { |
next if ($_!~/^form\.(.+)\_setparmval$/); |
next if ($_!~/^form\.(.+)\_setparmval$/); |
my $name = $1; |
my $name = $1; |
my $value = $env{'form.'.$name.'_value'}; |
my $value = $env{'form.'.$name.'_value'}; |
if ($name && defined($value)) { |
if ($name && defined($value) && ($value ne '')) { |
my $put_result = &Apache::lonnet::put('nohist_whatsnew', |
my $put_result = &Apache::lonnet::put('nohist_whatsnew', |
{$name=>$value},$udom,$uname); |
{$name=>$value},$udom,$uname); |
|
|
Line 1140 sub checkversions {
|
Line 1116 sub checkversions {
|
} |
} |
|
|
sub display_handgrade { |
sub display_handgrade { |
my ($r,$tograde,$rowColor1,$rowColor2,$ungraded) = @_; |
my ($r,$tograde,$ungraded) = @_; |
my $rowColor; |
|
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'prna' => 'Problem Name', |
'prna' => 'Problem Name', |
'nmun' => 'Number ungraded', |
'nmun' => 'Number ungraded', |
'nopr' => 'No problems require handgrading', |
'nopr' => 'No problems require handgrading', |
); |
); |
if (@{$tograde} > 0) { |
if (@{$tograde} > 0) { |
$r->print('<tr bgcolor="#cccccc"><td><b><small>'.$lt{'prna'}.'</small></b></td><td align="right"><b><small>'.$lt{'nmun'}.'</small></b></td></tr>'); |
$r->print('<tr class="LC_info_row"><td class="LC_left_item">'. |
|
$lt{'prna'}.'</td><td class="LC_right_item">'. |
|
$lt{'nmun'}.'</td></tr>'); |
my $rowNum = 0; |
my $rowNum = 0; |
foreach my $res (@{$tograde}) { |
foreach my $res (@{$tograde}) { |
if ($rowNum %2 == 1) { |
$rowNum ++; |
$rowColor = $rowColor1; |
my $css_class = $rowNum%2?' class="LC_odd_row"':''; |
} else { |
|
$rowColor = $rowColor2; |
|
} |
|
my ($map,$id,$url)=&Apache::lonnet::decode_symb($res); |
my ($map,$id,$url)=&Apache::lonnet::decode_symb($res); |
my $linkurl=&Apache::lonnet::clutter($url); |
my $linkurl=&Apache::lonnet::clutter($url); |
$linkurl .= '?symb='.&escape($res); |
$linkurl .= '?symb='.&escape($res); |
|
if ($$ungraded{$res}{'enclink'}) { |
$r->print('<tr bgcolor="'.$rowColor.'"><td><a href="'.$linkurl.'"><small>'.$$ungraded{$res}{title}.'</small></a></td><td align="right"><small>'.$$ungraded{$res}{count}.'</small></td></tr>'); |
$linkurl = |
$rowNum ++; |
$$ungraded{$res}{'enclink'}.'?symb='.$$ungraded{$res}{'encsymb'}; |
|
} |
|
$r->print('<tr'.$css_class.'><td><a href="'.$linkurl.'">'.$$ungraded{$res}{title}.'</a></td><td class="LC_right_item">'.$$ungraded{$res}{count}.'</td></tr>'); |
} |
} |
} else { |
} else { |
$r->print('<tr><td bgcolor="#ffffff"><br><center><i><b><small> '.$lt{'nopr'}.' </small><br><br></b></i></td></tr>'); |
$r->print('<tr class="LC_empty_row"><td>'.$lt{'nopr'}.'</td></tr>'); |
} |
} |
} |
} |
|
|
sub display_haserrors { |
sub display_haserrors { |
my ($r,$bombs,$rowColor1,$rowColor2,$bombed,$res_title) = @_; |
my ($r,$bombs,$bombed,$res_title) = @_; |
my $bombnum = 0; |
my $bombnum = 0; |
my $rowColor; |
|
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
reso => 'Resource', |
reso => 'Resource', |
nmer => 'Number of errors', |
nmer => 'Number of errors', |
noer => 'No problems with errors', |
noer => 'No problems with errors', |
); |
); |
if (@{$bombs} > 0) { |
if (@{$bombs} > 0) { |
$r->print('<tr bgcolor="#cccccc"><td><b><small>'.$lt{'reso'}.'</small></b></td><td align="right"><b><small>'.$lt{'nmer'}.'</small></b></td></tr>'); |
$r->print('<tr class="LC_info_row"><td class="LC_left_item">'. |
|
$lt{'reso'}.'</td><td class="LC_right_item">'. |
|
$lt{'nmer'}.'</td></tr>'); |
@{$bombs} = sort { &cmp_title($a,$b,$res_title) } @{$bombs}; |
@{$bombs} = sort { &cmp_title($a,$b,$res_title) } @{$bombs}; |
foreach my $bomb (@{$bombs}) { |
foreach my $bomb (@{$bombs}) { |
if ($bombnum %2 == 1) { |
|
$rowColor = $rowColor1; |
|
} else { |
|
$rowColor = $rowColor2; |
|
} |
|
$r->print('<tr bgcolor="'.$rowColor.'"><td><small>'.$$bombed{$bomb}{errorlink}.'</small></td><td align="right"><small>'.$$bombed{$bomb}{errorcount}.'</small></td></tr>'); |
|
$bombnum ++; |
$bombnum ++; |
|
my $css_class = $bombnum%2?' class="LC_odd_row"':''; |
|
$r->print('<tr'.$css_class.'><td>'.$$bombed{$bomb}{errorlink}. |
|
'</td><td class="LC_right_item">'. |
|
$$bombed{$bomb}{errorcount}.'</td></tr>'); |
} |
} |
} else { |
} else { |
$r->print('<tr><td bgcolor="#ffffff"><br /><center><b><i><small>'.$lt{'noer'}.'</small></i></b></center><br /></td></tr>'); |
$r->print('<tr class="LC_empty_row"><td>'.$lt{'noer'}.'</td></tr>'); |
} |
} |
return; |
return; |
} |
} |
Line 1214 sub display_abovethreshold {
|
Line 1189 sub display_abovethreshold {
|
' <input type="hidden" name="command" value="reset" />'."\n". |
' <input type="hidden" name="command" value="reset" />'."\n". |
' <input type="hidden" name="refpage" value="'.$refpage.'" />'. |
' <input type="hidden" name="refpage" value="'.$refpage.'" />'. |
"\n"); |
"\n"); |
$r->print('<tr bgcolor="#cccccc"><td><b><small>'.$lt{'reso'}.'</small></b></td><td align="right"><b><small>'.$lt{'part'}.'</small></b></td><td align="right"><b><small>'.$lt{'nust'}.'</small></b></td><td align="right"><b><small>'.$lt{'avat'}.'</small></b></td><td align="right"><b><small>'.$lt{'dedi'}.'</small></b></td><td align="right"><b><small>'.$lt{'lare'}.'</small></b></td><td align="right"><b><small>'.$lt{'reco'}.'</small></b></td></tr>'); |
$r->print('<tr class="LC_info_row">'. |
|
'<td class="LC_left_item">'.$lt{'reso'}.'</td>'. |
|
'<td>'.$lt{'part'}.'</td><td>'.$lt{'nust'}.'</td>'. |
|
'<td>'.$lt{'avat'}.'</td><td>'.$lt{'dedi'}.'</td>'. |
|
'<td>'.$lt{'lare'}.'</td><td class="LC_right_item">'. |
|
$lt{'reco'}.'</td></tr>'); |
|
my $row; |
foreach my $res (@{$warnings}) { |
foreach my $res (@{$warnings}) { |
|
$row++; |
my ($map,$id,$url)=&Apache::lonnet::decode_symb($res); |
my ($map,$id,$url)=&Apache::lonnet::decode_symb($res); |
my $linkurl=&Apache::lonnet::clutter($url); |
my $linkurl=&Apache::lonnet::clutter($url); |
my $rowspan; |
my $rowspan; |
Line 1223 sub display_abovethreshold {
|
Line 1205 sub display_abovethreshold {
|
$rowspan = 'rowspan="'.$$triggered{$res}{numparts}.'"'; |
$rowspan = 'rowspan="'.$$triggered{$res}{numparts}.'"'; |
} |
} |
$linkurl .= '?symb='.&escape($res); |
$linkurl .= '?symb='.&escape($res); |
$r->print('<tr bgcolor="'.$$triggered{$res}{rowColor}.'"><td '.$rowspan.'><a href="'.$linkurl.'"><small>'.$$triggered{$res}{title}.'</small></a></td>'.$$triggered{$res}{text}); |
if ($$triggered{$res}{'enclink'}) { |
|
$linkurl = |
|
$$triggered{$res}{'enclink'}.'?symb='.$$triggered{$res}{'encsymb'}; |
|
} |
|
my $css_class = $row%2?' class="LC_odd_row"':''; |
|
$r->print('<tr'.$css_class.'>'. |
|
'<td class="LC_first_item" '.$rowspan.'><a href="'.$linkurl.'">'. |
|
$$triggered{$res}{title}.'</a></td>'); |
|
if (ref($$triggered{$res}{text}) eq 'ARRAY') { |
|
$r->print($$triggered{$res}{text}[0]); |
|
} |
|
$r->print('</tr>'); |
|
if (ref($$triggered{$res}{text}) eq 'ARRAY') { |
|
if (@{$$triggered{$res}{text}} > 1) { |
|
for (my $i=1; $i<@{$$triggered{$res}{text}}; $i++) { |
|
$r->print('<tr class="'.$css_class.'">'. |
|
$$triggered{$res}{text}[$i].'</tr>'); |
|
} |
|
} |
|
} |
} |
} |
$r->print('<tr bgcolor="#cccccc"><td colspan="7" align="right"><br /><b><small><input type="submit" name="counters" value="'.$lt{'rese'}.'" /></form>'); |
$r->print('<tr class="LC_info_row"><td colspan="7" class="LC_right_item"><br /><input type="submit" name="counters" value="'.$lt{'rese'}.'" /></td></tr></form>'); |
} else { |
} else { |
$r->print('<tr><td bgcolor="#ffffff"><br /><center><b><i><small>'.$lt{'nopr'}.'</small></i></b></center><br /></td></tr>'); |
$r->print('<tr class="LC_empty_row"><td>'.$lt{'nopr'}.'</td></tr>'); |
} |
} |
} |
} |
|
|
sub display_versionchanges { |
sub display_versionchanges { |
my ($r,$changed,$res_title,$rowColor1,$rowColor2,$interval) = @_; |
my ($r,$changed,$res_title,$interval) = @_; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'reso' => 'Resource', |
'reso' => 'Resource', |
'revd' => 'Last revised', |
'revd' => 'Last revised', |
Line 1240 sub display_versionchanges {
|
Line 1241 sub display_versionchanges {
|
'veru' => 'Version used', |
'veru' => 'Version used', |
'noup' => 'No updated versions', |
'noup' => 'No updated versions', |
); |
); |
my $rowColor; |
|
if (keys(%{$changed}) > 0) { |
if (keys(%{$changed}) > 0) { |
$r->print('<tr bgcolor="#cccccc"><td><b><small>'.$lt{'reso'}.'</small></b></td><td><b><small>'.$lt{'revd'}.'</small></b></td><td><b><small>'.$lt{'newv'}.'</small></b></td><td><b><small>'.$lt{'veru'}.'</small></b></td></tr>'); |
$r->print('<tr class="LC_info_row"><td class="LC_left_item">'. |
|
$lt{'reso'}.'</td><td>'.$lt{'revd'}.'</td><td>'. |
|
$lt{'newv'}.'</td><td class="LC_right_item">'. |
|
$lt{'veru'}.'</td></tr>'); |
my @changes = sort { &cmp_title($a,$b,$res_title) } keys(%{$changed}); |
my @changes = sort { &cmp_title($a,$b,$res_title) } keys(%{$changed}); |
my $changenum = 0; |
my $changenum = 0; |
foreach my $item (@changes) { |
foreach my $item (@changes) { |
if ($changenum %2 == 1) { |
$changenum ++; |
$rowColor = $rowColor1; |
my $css_class = $changenum%2?' class="LC_odd_row"':''; |
} else { |
|
$rowColor = $rowColor2; |
|
} |
|
my ($map,$id,$url)=&Apache::lonnet::decode_symb($item); |
my ($map,$id,$url)=&Apache::lonnet::decode_symb($item); |
my $linkurl=&Apache::lonnet::clutter($url); |
my $linkurl=&Apache::lonnet::clutter($url); |
$linkurl .= '?symb='.&escape($item); |
$linkurl .= '?symb='.&escape($item); |
|
|
$r->print('<tr bgcolor="'.$rowColor.'"><td><small><a href="'.$linkurl.'">'.$$res_title{$item}.'</a></small></td><td><small>'.$$changed{$item}{'revdate'}.'</small></td><td><small>'.$$changed{$item}{'current'}.'</small></td><td><small>'.$$changed{$item}{'version'}.'</small></td></tr>'); |
$r->print('<tr'.$css_class.'><td><a href="'.$linkurl.'">'. |
$changenum ++; |
$$res_title{$item}.'</a></td><td>'. |
|
$$changed{$item}{'revdate'}.'</td><td>'. |
|
$$changed{$item}{'current'}.'</td><td>'. |
|
$$changed{$item}{'version'}.'</td></tr>'); |
} |
} |
} else { |
} else { |
$r->print('<tr><td bgcolor="#ffffff"><br /><center><b><i><small>'.$lt{'noup'}.' '.$interval.'</small></i></b></center><br /></td></tr>'); |
$r->print('<tr class="LC_empty_row"><td>'.$lt{'noup'}. |
|
' '.$interval.'</td></tr>'); |
} |
} |
return; |
return; |
} |
} |
|
|
sub display_coursediscussion { |
sub display_coursediscussion { |
my ($r,$newdiscussions,$unread,$countunread,$res_title,$rowColor1, |
my ($r,$newdiscussions,$unread,$countunread,$res_title) = @_; |
$rowColor2) = @_; |
|
my $lctype = lc(&Apache::loncommon::course_type()); |
my $lctype = lc(&Apache::loncommon::course_type()); |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'loca' => 'Location', |
'loca' => 'Location', |
Line 1277 sub display_coursediscussion {
|
Line 1278 sub display_coursediscussion {
|
'noun' => 'No unread posts in '.$lctype.' discussions', |
'noun' => 'No unread posts in '.$lctype.' discussions', |
'tmlp' => 'Time of last post', |
'tmlp' => 'Time of last post', |
); |
); |
my $rowColor; |
|
if (@{$newdiscussions} > 0) { |
if (@{$newdiscussions} > 0) { |
$r->print('<tr bgcolor="#cccccc"><td><b><small>'.$lt{'loca'}. |
$r->print('<tr class="LC_info_row"><td class="LC_left_item">'. |
'</small></b></td><td><b><small>'.$lt{'type'}. |
$lt{'loca'}.'</td><td>'. |
'</small></b>'); |
$lt{'type'}.'</td>'); |
if ($countunread eq 'on') { |
if ($countunread eq 'on') { |
$r->print('<td><b><small>'.$lt{'tmlp'}.'</small></b></td>'. |
$r->print('<td>'.$lt{'tmlp'}.'</td>'. |
'<td align="right"><b><small>'.$lt{'numn'}. |
'<td class="LC_right_item">'.$lt{'numn'}.'</td>'); |
'</small></b></td>'); |
|
} else { |
} else { |
$r->print('<td align="right"><b><small>'.$lt{'tmlp'}. |
$r->print('<td class="LC_right_item">'.$lt{'tmlp'}.'</td>'); |
'</small></b></td>'); |
|
} |
} |
$r->print("</tr>\n"); |
$r->print("</tr>\n"); |
@{$newdiscussions} = sort { &cmp_title($a,$b,$res_title) } |
@{$newdiscussions} = sort { &cmp_title($a,$b,$res_title) } |
@{$newdiscussions}; |
@{$newdiscussions}; |
my $rowNum = 0; |
my $rowNum = 0; |
foreach my $ressymb (@{$newdiscussions}) { |
foreach my $ressymb (@{$newdiscussions}) { |
|
$rowNum ++; |
my $forum_title = $$unread{$ressymb}{'title'}; |
my $forum_title = $$unread{$ressymb}{'title'}; |
my $type = 'Resource'; |
my $type = 'Resource'; |
my $feedurl=&Apache::lonfeedback::get_feedurl($ressymb); |
my $feedurl=&Apache::lonfeedback::get_feedurl($ressymb); |
|
my $disclink = $feedurl.'?symb='.$$unread{$ressymb}{symb}; |
if ($feedurl =~ /bulletinboard/) { |
if ($feedurl =~ /bulletinboard/) { |
$type = 'Bulletin Board'; |
$type = 'Bulletin Board'; |
} |
} |
if ($rowNum %2 == 1) { |
if ($$unread{$ressymb}{'enclink'}) { |
$rowColor = $rowColor1; |
$disclink = $$unread{$ressymb}{'enclink'}.'?symb='.$$unread{$ressymb}{'encsymb'}; |
} else { |
|
$rowColor = $rowColor2; |
|
} |
} |
|
my $css_class = $rowNum%2?' class="LC_odd_row"':''; |
my $lastpost = &Apache::lonnavmaps::timeToHumanString( |
my $lastpost = &Apache::lonnavmaps::timeToHumanString( |
$$unread{$ressymb}{'lastpost'}); |
$$unread{$ressymb}{'lastpost'}); |
$r->print('<tr bgcolor="'.$rowColor.'"><td><small><a href="'.$feedurl.'?symb='.$$unread{$ressymb}{symb}.'">'.$forum_title.'</a> </td><td><small>'.$type.' </small></td>'); |
$r->print('<tr'.$css_class.'><td><a href="'.$disclink.'">'.$forum_title.'</a> </td><td>'.&mt($type).' </td>'); |
if ($countunread eq 'on') { |
if ($countunread eq 'on') { |
my $unreadnum = $$unread{$ressymb}{'unreadcount'}; |
my $unreadnum = $$unread{$ressymb}{'unreadcount'}; |
$r->print('<td><small>'.$lastpost.'<small></td><td align="right">'. |
$r->print('<td>'.$lastpost.'</td><td class="LC_right_item">'. |
'<small>',$unreadnum.' </small></td>'); |
$unreadnum.' </td>'); |
} else { |
} else { |
$r->print('<td align="right"><small>'.$lastpost.'</small></td>'); |
$r->print('<td class="LC_right_item">'.$lastpost.'</td>'); |
} |
} |
$r->print("</tr>\n"); |
$r->print("</tr>\n"); |
$rowNum ++; |
|
} |
} |
} else { |
} else { |
$r->print('<tr><td bgcolor="#ffffff"><br><center> <i><b><small>'. |
$r->print('<tr class="LC_empty_row"><td>'.$lt{'noun'}.'</td></tr>'); |
$lt{'noun'}.'</small></b></i><br><br></td></tr>'); |
|
} |
} |
} |
} |
|
|
sub display_coursenormalmail { |
sub display_coursenormalmail { |
my ($r,$msgcount,$newmsgs,$rowColor1,$rowColor2) = @_; |
my ($r,$msgcount,$newmsgs) = @_; |
my $rowColor; |
|
my $lctype = lc(&Apache::loncommon::course_type()); |
my $lctype = lc(&Apache::loncommon::course_type()); |
if ($msgcount > 0) { |
if ($msgcount > 0) { |
$r->print('<tr bgcolor="#cccccc"><td><b><small>'.&mt('Number').'</small></b></td><td><b><small>'.&mt('Subject').'</small></b></td><td><b><small>'.&mt('Sender').'</small></b></td><td><b><small>'.&mt('Date/Time').'</small></b></td></tr>'); |
$r->print('<tr class="LC_info_row"><td class="LC_left_item">'. |
my $rowNum = 0; |
&mt('Number').'</td><td>'.&mt('Subject').'</td><td>'. |
my $mailcount = 1; |
&mt('Sender').'</td><td class="LC_right_item">'. |
|
&mt('Date/Time').'</td></tr>'); |
|
my $mailcount = 0; |
foreach my $msg (@{$newmsgs}) { |
foreach my $msg (@{$newmsgs}) { |
if ($rowNum %2 == 1) { |
|
$rowColor = $rowColor1; |
|
} else { |
|
$rowColor = $rowColor2; |
|
} |
|
$r->print('<tr bgcolor="'.$rowColor.'"><td valign="top"><small>'.$mailcount.'. </small></td><td valign="top"><small><a href="/adm/communicate">'.$msg->{'shortsub'}.'</a> </small></td><td valign="top"><small> '.$msg->{'from'}.'@'.$msg->{'fromdom'}.' </small></td><td valign="top"><small>'.$msg->{'sendtime'}.'</small></td></tr>'); |
|
$rowNum ++; |
|
$mailcount ++; |
$mailcount ++; |
|
my $css_class = $mailcount%2?' class="LC_odd_row"':''; |
|
$r->print('<tr'.$css_class.'><td>'.$mailcount. |
|
'. </td><td><a href="/adm/email?display='. |
|
$msg->{'msgid'}.'">'. |
|
$msg->{'shortsub'}.'</a> </td><td> '. |
|
$msg->{'from'}.':'.$msg->{'fromdom'}.' </td><td>'. |
|
$msg->{'sendtime'}.'</td></tr>'); |
} |
} |
} else { |
} else { |
$r->print('<tr><td bgcolor="#ffffff" width="100%"><center><br /><b><i><small>'.&mt('No new '.$lctype.' messages').'</small></i></b><br /><br /></center></td></tr>'); |
$r->print('<tr class="LC_empty_row"><td>'. |
|
&mt('No new '.$lctype.' messages').'</td></tr>'); |
} |
} |
} |
} |
|
|
sub display_coursecritmail { |
sub display_coursecritmail { |
my ($r,$critmsgcount,$critmsgs,$rowColor1,$rowColor2) = @_; |
my ($r,$critmsgcount,$critmsgs) = @_; |
my $rowColor; |
|
my $lctype = lc(&Apache::loncommon::course_type()); |
my $lctype = lc(&Apache::loncommon::course_type()); |
if ($critmsgcount > 0) { |
if ($critmsgcount > 0) { |
$r->print('<tr bgcolor="#cccccc"><td><b><small>'.&mt('Number').'</small></b></td><td><b><small>'.&mt('Subject').'</small></b></td><td><b><small>'.&mt('Sender').'</small></b></td><td><b><small>'.&mt('Date/Time').'</small></b></td></tr>'); |
$r->print('<tr class="LC_info_row"><td class="LC_left_item">'. |
my $rowNum = 0; |
&mt('Number').'</td><td>'.&mt('Subject').'</td><td>'. |
my $mailcount = 1; |
&mt('Sender').'</td><td class="LC_right_item">'. |
|
&mt('Date/Time').'</td></tr>'); |
|
my $mailcount = 0; |
foreach my $msg (@{$critmsgs}) { |
foreach my $msg (@{$critmsgs}) { |
if ($rowNum %2 == 1) { |
|
$rowColor = $rowColor1; |
|
} else { |
|
$rowColor = $rowColor2; |
|
} |
|
$r->print('<tr bgcolor="'.$rowColor.'"><td valign="top"><small>'.$mailcount.'. <small></td><td valign="top"><small><a href="/adm/email?folder=critical">'.$msg->{'shortsub'}.'</a> </small></td><td valign="top"><small> '.$msg->{'from'}.'@'.$msg->{'fromdom'}.' </small></td><td valign="top"><small>'.$msg->{'sendtime'}.'</small></td></tr>'); |
|
$rowNum ++; |
|
$mailcount ++; |
$mailcount ++; |
|
my $css_class = $mailcount%2?' class="LC_odd_row"':''; |
|
$r->print('<tr'.$css_class.'><td>'.$mailcount. |
|
'. </td><td><a href="/adm/email?folder=critical">'. |
|
$msg->{'shortsub'}.'</a> </td><td> '. |
|
$msg->{'from'}.':'.$msg->{'fromdom'}.' </td><td>'. |
|
$msg->{'sendtime'}.'</td></tr>'); |
} |
} |
} else { |
} else { |
$r->print('<tr><td bgcolor="#ffffff" width="100%"><center><br /><b><i><small>'.&mt('No unread critical messages in '.$lctype).'</small></i></b><br /><br /></center></td></tr>'); |
$r->print('<tr class="LC_empty_row"><td>'. |
|
&mt('No unread critical messages in '.$lctype). |
|
'</td></tr>'); |
} |
} |
} |
} |
|
|
Line 1425 sub store_interval_setting {
|
Line 1426 sub store_interval_setting {
|
\%interval_settings,$udom,$uname); |
\%interval_settings,$udom,$uname); |
if ($outcome eq 'ok') { |
if ($outcome eq 'ok') { |
$result = &mt('Interval set to version changes [_1]', |
$result = &mt('Interval set to version changes [_1]', |
'<b>'.$$interval_titles{$env{'form.interval'}}.'</b><br />'); |
'<b>'.$$interval_titles{$env{'form.interval'}}.'</b>').'<br />'; |
|
|
} else { |
} else { |
my $lctype = lc(&Apache::loncommon::course_type()); |
my $lctype = lc(&Apache::loncommon::course_type()); |
&Apache::lonnet::logthis('Error storing whatsnew interval setting'. |
&Apache::lonnet::logthis('Error saving whatsnew interval setting'. |
' '.$outcome.' for '.$uname.':'.$udom.' in '.$lctype.' '.$cid); |
' '.$outcome.' for '.$uname.':'.$udom.' in '.$lctype.' '.$cid); |
$result = &mt('Unable to set interval to [_1] due to [_2].', |
$result = &mt('Unable to set interval to [_1] due to [_2].', |
'<b>'.$$interval_titles{$env{'form.interval'}}.'</b>', |
'<b>'.$$interval_titles{$env{'form.interval'}}.'</b>', |
Line 1449 sub store_discussion_setting {
|
Line 1450 sub store_discussion_setting {
|
\%discussion_settings,$udom,$uname); |
\%discussion_settings,$udom,$uname); |
if ($outcome eq 'ok') { |
if ($outcome eq 'ok') { |
$result = &mt('Count unread posts in discussions display set to [_1]', |
$result = &mt('Count unread posts in discussions display set to [_1]', |
'<b>'.$env{'form.countunread'}.'</b><br />'); |
'<b>'.&mt($env{'form.countunread'}).'</b>').'<br />'; |
|
|
} else { |
} else { |
my $lctype = lc(&Apache::loncommon::course_type()); |
my $lctype = lc(&Apache::loncommon::course_type()); |
&Apache::lonnet::logthis('Error storing whatsnew countunread setting'. |
&Apache::lonnet::logthis('Error saving whatsnew countunread setting'. |
' '.$outcome.' for '.$uname.':'.$udom.' in '.$lctype.' '.$cid); |
' '.$outcome.' for '.$uname.':'.$udom.' in '.$lctype.' '.$cid); |
$result = &mt('Unable to set "number unread posts display" to [_1]'. |
$result = &mt('Unable to set "number unread posts display" to [_1]'. |
' due to [_2].', |
' due to [_2].', |
'<b>'.$env{'form.countunread'}.'</b>', |
'<b>'.&mt($env{'form.countunread'}).'</b>', |
'<tt>'.$outcome.'</tt>.<br />'); |
'<tt>'.$outcome.'</tt>.<br />'); |
} |
} |
} |
} |
Line 1491 sub store_courseinit_setting {
|
Line 1492 sub store_courseinit_setting {
|
$result = &mt('Page displayed after role selection in this '.$lctype.' set to <b>[_2]</b>',$lctype,$$initpage{$env{'form.courseinit_page'}}); |
$result = &mt('Page displayed after role selection in this '.$lctype.' set to <b>[_2]</b>',$lctype,$$initpage{$env{'form.courseinit_page'}}); |
} |
} |
} else { |
} else { |
&Apache::lonnet::logthis('Error storing whatsnew courseinit '. |
&Apache::lonnet::logthis('Error saving whatsnew courseinit '. |
'setting: '.$outcome.' for '.$uname. |
'setting: '.$outcome.' for '.$uname. |
':'.$udom.' in '.$lctype.' '.$cid); |
':'.$udom.' in '.$lctype.' '.$cid); |
if ($page_control eq 'global preferences') { |
if ($page_control eq 'global preferences') { |
Line 1510 sub store_courseinit_setting {
|
Line 1511 sub store_courseinit_setting {
|
} |
} |
|
|
sub start_box { |
sub start_box { |
my ($r,$tabbg,$show,$heading,$caller,$refpage) = @_; |
my ($r,$show,$heading,$caller,$refpage) = @_; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
chth => 'Change thresholds?', |
chth => 'Change thresholds?', |
chin => 'Change interval?', |
chin => 'Change interval?', |
Line 1519 sub start_box {
|
Line 1520 sub start_box {
|
my $showhide; |
my $showhide; |
if ($$show{$caller}) { |
if ($$show{$caller}) { |
$showhide = '<b><a href="javascript:change_display(document.visible.'. |
$showhide = '<b><a href="javascript:change_display(document.visible.'. |
'display_'.$caller.",'hide'".');">Hide</a></b>'; |
'display_'.$caller.",'hide'".');">'. |
|
&mt('Hide').'</a></b>'; |
|
|
} else { |
} else { |
$showhide = '<b><a href="javascript:change_display(document.visible.'. |
$showhide = '<b><a href="javascript:change_display(document.visible.'. |
'display_'.$caller.",'show'".');">Show</a></b>'; |
'display_'.$caller.",'show'".');">'. |
|
&mt('Show').'</a></b>'; |
} |
} |
|
|
$r->print(' |
$r->print(' |
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#000000" width="100%"> |
<table class="LC_nested_outer"> |
<tr> |
<tr> |
<td> |
<th class="LC_left_item">'.$$heading{$caller}.'</th> |
<table border="0" cellpadding="1" cellspacing="1" bgcolor="#000000" width="100%"> |
<th class="LC_right_item">'.$showhide.'</th> |
<tr> |
</tr>'); |
<td bgcolor="'.$tabbg.'"> |
|
<table width="100%" border="0" cellspacing="0" cellpadding="0"> |
|
<tr> |
|
<td><b>'.$$heading{$caller}.'</b></td> |
|
<td valign="top" align="right">'.$showhide.'</td> |
|
</tr> |
|
</table> |
|
</td> |
|
</tr>'); |
|
if (($caller eq 'abovethreshold') && ($$show{$caller})) { |
if (($caller eq 'abovethreshold') && ($$show{$caller})) { |
if ($$show{$caller}) { |
if ($$show{$caller}) { |
$r->print(' |
$r->print(' |
<tr> |
<tr> |
<td bgcolor="'.$tabbg.'" align="right"><a href="/adm/whatsnew?command=chgthreshold&refpage='.$refpage.'"><b><small>'.$lt{'chth'}.'</small></b></a></td> |
<td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgthreshold&refpage='.$refpage.'">'.$lt{'chth'}.'</a></td> |
</tr>'); |
</tr>'); |
} |
} |
} elsif (($caller eq 'versionchanges') && ($$show{$caller})) { |
} elsif (($caller eq 'versionchanges') && ($$show{$caller})) { |
if ($$show{$caller}) { |
if ($$show{$caller}) { |
$r->print(' |
$r->print(' |
<tr> |
<tr> |
<td bgcolor="'.$tabbg.'" align="right"><a href="/adm/whatsnew?command=chginterval&refpage='.$refpage.'"><b><small>'.$lt{'chin'}.'</small></b></a></td> |
<td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chginterval&refpage='.$refpage.'">'.$lt{'chin'}.'</a></td> |
</tr>'); |
</tr>'); |
} |
} |
} elsif ($caller eq 'coursediscussion') { |
} elsif ($caller eq 'coursediscussion') { |
if ($$show{$caller}) { |
if ($$show{$caller}) { |
$r->print(' |
$r->print(' |
<tr> |
<tr> |
<td bgcolor="'.$tabbg.'" align="right"><a href="/adm/whatsnew?command=chgdisc&refpage='.$refpage.'"><b><small>'.$lt{'chop'}.'</small></b></a></td> |
<td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgdisc&refpage='.$refpage.'">'.$lt{'chop'}.'</a></td> |
</tr>'); |
</tr>'); |
} |
} |
} |
} |
$r->print(' |
$r->print(' |
<tr> |
<tr> |
<td bgcolor="#ffffff"> |
<td colspan="2"> |
<table cellpadding="2" cellspacing="0" border="0" width="100%"> |
<table class="LC_nested"> |
'); |
'); |
return; |
return; |
} |
} |
Line 1574 sub start_box {
|
Line 1568 sub start_box {
|
sub end_box { |
sub end_box { |
my ($r) = shift; |
my ($r) = shift; |
$r->print(' |
$r->print(' |
</table> |
|
</td> |
|
</tr> |
|
</table> |
</table> |
</td> |
</td> |
</tr> |
</tr> |