version 1.79, 2008/07/09 15:16:14
|
version 1.103, 2011/03/31 17:54:10
|
Line 42 use Time::Local;
|
Line 42 use Time::Local;
|
use GDBM_File; |
use GDBM_File; |
use lib '/home/httpd/lib/perl/'; |
use lib '/home/httpd/lib/perl/'; |
use LONCAPA; |
use LONCAPA; |
|
use HTML::Entities; |
|
|
#---------------------------- |
#---------------------------- |
# handler |
# handler |
Line 87 sub handler {
|
Line 88 sub handler {
|
|
|
if ( ! $env{'request.course.fn'} || ! $checkallowed{'whatsnew'}) { |
if ( ! $env{'request.course.fn'} || ! $checkallowed{'whatsnew'}) { |
# Not in a course, or no whn priv in course |
# Not in a course, or no whn priv in course |
$env{'user.error.msg'}="/adm/whatsnew::whn:0:0:Cannot display what's new page"; |
$env{'user.error.msg'}="/adm/whatsnew:whn:0:0:Cannot display what's new page"; |
return HTTP_NOT_ACCEPTABLE; |
return HTTP_NOT_ACCEPTABLE; |
} |
} |
|
|
Line 99 sub handler {
|
Line 100 sub handler {
|
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::clear_breadcrumbs(); |
&Apache::lonhtmlcommon::add_breadcrumb |
&Apache::lonhtmlcommon::add_breadcrumb |
({href=>'/adm/whatsnew', |
({href=>'/adm/whatsnew', |
text=>"Display Action Items"}); |
text=>"What's New?"}); |
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, |
Line 194 sub display_main_box {
|
Line 195 sub display_main_box {
|
); |
); |
my %initpage = &Apache::lonlocal::texthash ( |
my %initpage = &Apache::lonlocal::texthash ( |
firstres => "first resource in the $lctype", |
firstres => "first resource in the $lctype", |
whatsnew => "what's new? page", |
whatsnew => "What's New Page", |
userpref => 'your general user preferences', |
userpref => 'your general user preferences', |
coursespecific => "specific setting for this $lctype", |
coursespecific => "specific setting for this $lctype", |
); |
); |
Line 267 END
|
Line 268 END
|
'; |
'; |
} |
} |
my $course_type=&Apache::loncommon::course_type(); |
my $course_type=&Apache::loncommon::course_type(); |
return &Apache::loncommon::start_page($course_type.' Action Items', |
return &Apache::loncommon::start_page("What's New?", |
$scripttag); |
$scripttag); |
} |
} |
|
|
Line 288 sub display_actions_box {
|
Line 289 sub display_actions_box {
|
my $lctype = lc($crstype); |
my $lctype = lc($crstype); |
my %stulabel = ( |
my %stulabel = ( |
'Course' => 'students', |
'Course' => 'students', |
'Group' => 'members', |
'Community' => 'members', |
); |
); |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'yacc' => 'You are accessing an invalid course', |
'yacc' => 'You are accessing an invalid course', |
Line 327 sub display_actions_box {
|
Line 328 sub display_actions_box {
|
my %threshold = (); |
my %threshold = (); |
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", |
userpref => 'user preference', |
userpref => 'user preference', |
coursespecific => $lctype.' only', |
coursespecific => $lctype.' only', |
default => 'default', |
default => 'default', |
Line 341 sub display_actions_box {
|
Line 342 sub display_actions_box {
|
return; |
return; |
} |
} |
|
|
|
my $header = ''; |
if ($refpage eq 'start') { |
if ($refpage eq 'start') { |
if (tie(my %bighash,'GDBM_File',$env{'request.course.fn'}.'.db', |
if (tie(my %bighash,'GDBM_File',$env{'request.course.fn'}.'.db', |
&GDBM_READER(),0640)) { |
&GDBM_READER(),0640)) { |
my $furl=$bighash{'first_url'}; |
my $furl=&HTML::Entities::encode($bighash{'first_url'},'"<>&'); |
untie(%bighash); |
untie(%bighash); |
$r->print('<span style="font-size: larger;"><a href="'.$furl.'">'.$lt{'gtfr'}. |
$header .= '<b><a href="'.$furl.'">'.$lt{'gtfr'}. |
'</a></span><br />'); |
'</a></b><br />'; |
} |
} |
} |
} |
$r->print(&mt('Page set to be displayed after you have selected a role in this '.$lctype).'.' |
$header .= &mt('Page set to be displayed after you have selected a role in this '.$lctype).'.' |
.' <span class="LC_nobreak">' |
.' <span class="LC_nobreak">' |
.&mt('Currently: [_1].','<i>'.$currinit.'</i>') |
.&mt('Currently: [_1].','<i>'.$currinit.'</i>') |
.' ' |
.' ' |
.&mt('<b>Change</b> for just [_1]this course[_2]' |
.&mt('[_1]Change[_2] for just [_3]this '.$lctype.'[_4] or for [_5]all your courses/communities[_6].' |
.' or for all [_3]your courses[_2].' |
,'<b>' |
|
,'</b>' |
,'<a href="/adm/whatsnew?command=courseinit&refpage='.$refpage.'">' |
,'<a href="/adm/whatsnew?command=courseinit&refpage='.$refpage.'">' |
,'</a>' |
,'</a>' |
,'<a href="/adm/preferences?action=changecourseinit&refpage='.$refpage.'">') |
,'<a href="/adm/preferences?action=changecourseinit&refpage='.$refpage.'">' |
.' </span><br /><hr />'); |
,'</a>') |
|
.' </span>'; |
|
|
|
$r->print(&Apache::loncommon::head_subbox($header)); |
|
|
if ($command eq 'reset') { |
if ($command eq 'reset') { |
$result = &process_reset($cdom,$crs); |
$result = &process_reset($cdom,$crs); |
Line 376 sub display_actions_box {
|
Line 382 sub display_actions_box {
|
unless ($store_result eq 'ok') { |
unless ($store_result eq 'ok') { |
&Apache::lonnet::logthis('Error saving 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 save visibility settings due to [_1]', |
$result .= '<span class="LC_error">' |
$store_result); |
.&mt('Unable to save visibility settings due to [_1]', |
|
$store_result) |
|
.'</span>'; |
} |
} |
|
|
if ($result) { |
if ($result) { |
$r->print($result.'<hr width="100%" />'); |
$r->print($result.'<hr />'); |
} |
} |
$r->rflush(); |
$r->rflush(); |
|
|
Line 462 sub display_actions_box {
|
Line 470 sub display_actions_box {
|
} |
} |
|
|
$headings{'abovethreshold'} = |
$headings{'abovethreshold'} = |
&mt('Problems with av. attempts ≥ [_1] or deg. difficulty ≥ [_2] <br /> and total number of '.$stulabel{$crstype}.' with submissions ≥ [_3]', |
&mt('(Problems with av. attempts ≥ [_1] or deg. difficulty ≥ [_2]) [_3] and total number of '.$stulabel{$crstype}.' with submissions ≥ [_4]', |
$threshold{'av_attempts'},$threshold{'degdiff'}, |
$threshold{'av_attempts'},$threshold{'degdiff'}, |
$threshold{'numstudents'}); |
'<br />',$threshold{'numstudents'}); |
|
|
my @actionorder = ('handgrading','haserrors','abovethreshold','versionchanges','coursediscussion','coursenormalmail','coursecritmail','newroles','oldroles'); |
my @actionorder = ('handgrading','haserrors','abovethreshold','versionchanges','coursediscussion','coursenormalmail','coursecritmail','newroles','oldroles'); |
|
|
Line 488 sub display_actions_box {
|
Line 496 sub display_actions_box {
|
} |
} |
} |
} |
|
|
|
my $itemserror; |
if ($needitems) { |
if ($needitems) { |
&getitems(\%unread,\%ungraded,\%bombed,\%triggered,\%changed,\@newdiscussions,\@tograde,\@bombs,\@warnings,\%threshold,$cdom,$crs,\%res_title,\%show,$starttime,$countunread); |
$itemserror = &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 531 sub display_actions_box {
|
Line 540 sub display_actions_box {
|
if ($displayed == $halfway) { |
if ($displayed == $halfway) { |
$r->print('</td><td> </td><td class="LC_right_col" >'); |
$r->print('</td><td> </td><td class="LC_right_col" >'); |
} |
} |
&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,\%expired,$expirecount,\%activated,$activecount,$crstype); |
&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,\%expired,$expirecount,\%activated,$activecount,$crstype,$itemserror); |
$displayed ++; |
$displayed ++; |
} |
} |
} |
} |
Line 591 sub display_threshold_config {
|
Line 600 sub display_threshold_config {
|
&Apache::loncommon::end_data_table_row()); |
&Apache::loncommon::end_data_table_row()); |
} |
} |
$r->print(&Apache::loncommon::end_data_table()."\n". |
$r->print(&Apache::loncommon::end_data_table()."\n". |
'<br /><input type="submit" name="threshold" value="'.&mt('Make changes').'" /> |
'<br /><input type="submit" name="threshold" value="'.&mt('Save').'" /> |
<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 647 sub display_interval_config {
|
Line 656 sub display_interval_config {
|
} |
} |
$r->print('</select> |
$r->print('</select> |
<input type="submit" name="display" value="'. |
<input type="submit" name="display" value="'. |
&mt('Change interval').'" /></form>'); |
&mt('Save').'" /></form>'); |
return; |
return; |
} |
} |
|
|
Line 677 function toggle_countunread(choice) {
|
Line 686 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 '<i>What's New?</i>' page by a few seconds.").' '.&mt("Currently set to <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 discussion board which has unread posts.') |
|
.'<br />' |
|
.&mt("This can increase the time taken to gather data for the [_1]What's New Page[_2] by a few seconds.",'<i>','</i>') |
|
.' ' |
|
.&mt('Currently set to [_1].','<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 687 function toggle_countunread(choice) {
|
Line 702 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]',&mt($opposite{$current})).'" |
&mt('Change to [_1]',&mt($opposite{$current})).'" |
onclick="javascript:toggle_countunread('."'change'".')" /> |
onclick="javascript:toggle_countunread('."'change'".')" />'. |
  |
(' ' x7). |
<input type="button" name="nochange" value="'. |
'<input type="button" name="nochange" value="'. |
&mt("No change").'" |
&mt("No change").'" |
onclick="javascript:toggle_countunread('."'unchanged'".')" /> |
onclick="javascript:toggle_countunread('."'unchanged'".')" /> |
</form>'); |
</form>'); |
Line 716 sub courseinit_config {
|
Line 731 sub courseinit_config {
|
'anis' => 'and is set to display', |
'anis' => 'and is set to display', |
'padc' => 'Page display controlled by', |
'padc' => 'Page display controlled by', |
'chce' => 'Choose '.$lctype.' entry', |
'chce' => 'Choose '.$lctype.' entry', |
'moce' => 'Modify '.$lctype.' entry', |
'moce' => 'Save', |
); |
); |
$r->print(<<"END"); |
$r->print(<<"END"); |
<br />$lt{'chwp'} |
<br />$lt{'chwp'} |
Line 778 sub display_launcher {
|
Line 793 sub display_launcher {
|
$tograde,$ungraded,$bombs,$bombed,$changed,$warnings,$triggered, |
$tograde,$ungraded,$bombs,$bombed,$changed,$warnings,$triggered, |
$newdiscussions,$unread,$msgcount,$newmsgs,$critmsgcount,$critmsgs, |
$newdiscussions,$unread,$msgcount,$newmsgs,$critmsgcount,$critmsgs, |
$interval,$countunread,$expired,$expirecount,$activated,$activecount, |
$interval,$countunread,$expired,$expirecount,$activated,$activecount, |
$crstype) = @_; |
$crstype,$itemserror) = @_; |
|
|
if ($$checkallowed{$action}) { |
if ($$checkallowed{$action}) { |
&start_box($r,$show,$headings,$action,$refpage,$action); |
&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,$ungraded); |
&display_handgrade($r,$tograde,$ungraded,$itemserror); |
} elsif ($action eq 'haserrors') { # BOMBS |
} elsif ($action eq 'haserrors') { # BOMBS |
&display_haserrors($r,$bombs,$bombed,$res_title); |
&display_haserrors($r,$bombs,$bombed,$res_title,$itemserror); |
} elsif ($action eq 'versionchanges') { # VERSION CHANGES |
} elsif ($action eq 'versionchanges') { # VERSION CHANGES |
&display_versionchanges($r,$changed,$res_title,$interval->{'versions'}); |
&display_versionchanges($r,$changed,$res_title,$interval->{'versions'},$itemserror); |
} 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,$itemserror); |
} 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); |
$countunread,$res_title,$itemserror); |
} elsif ($action eq 'coursenormalmail') { # NORMAL MESSAGES |
} elsif ($action eq 'coursenormalmail') { # NORMAL MESSAGES |
&display_coursenormalmail($r,$msgcount,$newmsgs); |
&display_coursenormalmail($r,$msgcount,$newmsgs); |
} elsif ($action eq 'coursecritmail') { # CRITICAL MESSAGES |
} elsif ($action eq 'coursecritmail') { # CRITICAL MESSAGES |
Line 817 sub getitems {
|
Line 832 sub getitems {
|
$tograde,$bombs,$warnings,$threshold,$cdom,$crs,$res_title,$show, |
$tograde,$bombs,$warnings,$threshold,$cdom,$crs,$res_title,$show, |
$starttime,$countunread) = @_; |
$starttime,$countunread) = @_; |
my $navmap = Apache::lonnavmaps::navmap->new(); |
my $navmap = Apache::lonnavmaps::navmap->new(); |
|
if (!defined($navmap)) { |
|
my $itemserror = '<span class="LC_warning">'.&mt('An error occurred retrieving information about the course.').'<br />'.&mt('It is recommended that you [_1]re-select the course[_2].','<a href="/adm/roles">','</a>').'</span>'; |
|
return $itemserror; |
|
} |
# 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, |
sub {if ($_[0]->is_problem) { $_[0]->parts();} return 1;}); |
sub {if ($_[0]->is_problem) { $_[0]->parts();} return 1;}); |
Line 875 sub getitems {
|
Line 894 sub getitems {
|
} |
} |
|
|
} |
} |
|
return; |
} |
} |
|
|
sub check_discussions { |
sub check_discussions { |
Line 954 sub check_thresholds {
|
Line 974 sub check_thresholds {
|
if ($resource->handgrade($part) eq 'yes') { |
if ($resource->handgrade($part) eq 'yes') { |
next; |
next; |
} |
} |
|
if ($resource->is_anonsurvey($part)) { |
|
next; |
|
} |
if ($resource->is_survey($part)) { |
if ($resource->is_survey($part)) { |
next; |
next; |
} |
} |
Line 1110 sub process_reset {
|
Line 1133 sub process_reset {
|
|
|
sub process_update { |
sub process_update { |
my ($uname,$udom,$threshold_titles) = @_; |
my ($uname,$udom,$threshold_titles) = @_; |
my $setoutput = '<b>'.&mt('Changes to threshold(s) for problem tracking:').'</b><br />'; |
my $setoutput = '<b>'.&mt('Changes to threshold(s) for problem tracking:').'</b><br/><br />'; |
foreach (keys %env) { |
foreach (keys %env) { |
next if ($_!~/^form\.(.+)\_setparmval$/); |
next if ($_!~/^form\.(.+)\_setparmval$/); |
my $name = $1; |
my $name = $1; |
Line 1121 sub process_update {
|
Line 1144 sub process_update {
|
|
|
my ($shortname) = ($name =~ /^\Q$env{'request.course.id'}\E:threshold_(.+)$/); |
my ($shortname) = ($name =~ /^\Q$env{'request.course.id'}\E:threshold_(.+)$/); |
if ($put_result eq 'ok') { |
if ($put_result eq 'ok') { |
$setoutput.=&mt('Set threshold for [_1] to [_2]', |
$setoutput.= &Apache::lonhtmlcommon::confirm_success(&mt('Set threshold for [_1] to [_2]', |
'<b>'.$$threshold_titles{$shortname}.'</b>', |
'<b>'.$$threshold_titles{$shortname}.'</b>', |
'<b>'.$value.'</b>').'<br />'; |
'<b>'.$value.'</b>').'<br />'); |
} else { |
} else { |
$setoutput.=&mt('Unable to set threshold for [_1] to [_2] due to [_3].', |
$setoutput.= &Apache::lonhtmlcommon::confirm_success(&mt('Unable to set threshold for [_1] to [_2] due to [_3].', |
'<b>'.$name.'</b>','<b>'.$value.'</b>', |
'<b>'.$name.'</b>','<b>'.$value.'</b>', |
'<tt>'.$put_result.'</tt>').'<br />'; |
'<tt>'.$put_result.'</tt>').'<br />',1); |
} |
} |
} |
} |
} |
} |
return $setoutput; |
return &Apache::loncommon::confirmwrapper($setoutput); |
} |
} |
|
|
sub getnormalmail { |
sub getnormalmail { |
Line 1146 sub getnormalmail {
|
Line 1169 sub getnormalmail {
|
&Apache::lonmsg::unpackmsgid($msgid); |
&Apache::lonmsg::unpackmsgid($msgid); |
if (($fromcid) && ($fromcid eq $env{'request.course.id'})) { |
if (($fromcid) && ($fromcid eq $env{'request.course.id'})) { |
if (defined($sendtime) && $sendtime!~/error/) { |
if (defined($sendtime) && $sendtime!~/error/) { |
my $numsendtime = $sendtime; |
|
$sendtime = &Apache::lonlocal::locallocaltime($sendtime); |
|
if ($status eq 'new') { |
if ($status eq 'new') { |
$msgcount ++; |
$sendtime = &Apache::lonlocal::locallocaltime($sendtime); |
|
$msgcount ++; |
if ($shortsubj eq '') { |
if ($shortsubj eq '') { |
$shortsubj = &mt('No subject'); |
$shortsubj = &mt('No subject'); |
} |
} |
Line 1178 sub getcritmail {
|
Line 1200 sub getcritmail {
|
&Apache::lonmsg::unpackmsgid($msgid); |
&Apache::lonmsg::unpackmsgid($msgid); |
if (($fromcid) && ($fromcid eq $env{'request.course.id'})) { |
if (($fromcid) && ($fromcid eq $env{'request.course.id'})) { |
if (defined($sendtime) && $sendtime!~/error/) { |
if (defined($sendtime) && $sendtime!~/error/) { |
my $numsendtime = $sendtime; |
|
$sendtime = &Apache::lonlocal::locallocaltime($sendtime); |
$sendtime = &Apache::lonlocal::locallocaltime($sendtime); |
$critmsgcount ++; |
$critmsgcount ++; |
if ($shortsubj eq '') { |
if ($shortsubj eq '') { |
Line 1438 sub checkversions {
|
Line 1459 sub checkversions {
|
} |
} |
|
|
sub display_handgrade { |
sub display_handgrade { |
my ($r,$tograde,$ungraded) = @_; |
my ($r,$tograde,$ungraded,$itemserror) = @_; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'prna' => 'Problem Name', |
'prna' => 'Problem Name', |
'nmun' => 'Number ungraded', |
'nmun' => 'Number ungraded', |
Line 1452 sub display_handgrade {
|
Line 1473 sub display_handgrade {
|
foreach my $res (@{$tograde}) { |
foreach my $res (@{$tograde}) { |
$rowNum ++; |
$rowNum ++; |
my $css_class = $rowNum%2?' class="LC_odd_row"':''; |
my $css_class = $rowNum%2?' class="LC_odd_row"':''; |
my ($map,$id,$url)=&Apache::lonnet::decode_symb($res); |
my $linkurl='/adm/grades'; |
my $linkurl=&Apache::lonnet::clutter($url); |
|
$linkurl .= '?symb='.&escape($res); |
|
if ($$ungraded{$res}{'enclink'}) { |
if ($$ungraded{$res}{'enclink'}) { |
$linkurl = |
$linkurl.='?symb='.$$ungraded{$res}{'encsymb'}; |
$$ungraded{$res}{'enclink'}.'?symb='.$$ungraded{$res}{'encsymb'}; |
} else { |
} |
$linkurl.='?symb='.&escape($res); |
|
} |
|
$linkurl.='&command=ungraded'; |
$r->print('<tr'.$css_class.'><td><a href="'.$linkurl.'">'.$$ungraded{$res}{title}.'</a></td><td class="LC_right_item">'.$$ungraded{$res}{count}.'</td></tr>'); |
$r->print('<tr'.$css_class.'><td><a href="'.$linkurl.'">'.$$ungraded{$res}{title}.'</a></td><td class="LC_right_item">'.$$ungraded{$res}{count}.'</td></tr>'); |
} |
} |
|
} elsif ($itemserror) { |
|
$r->print('<tr class="LC_empty_row"><td>'.$itemserror.'</td></tr>'); |
} else { |
} else { |
$r->print('<tr class="LC_empty_row"><td>'.$lt{'nopr'}.'</td></tr>'); |
$r->print('<tr class="LC_empty_row"><td>'.$lt{'nopr'}.'</td></tr>'); |
} |
} |
} |
} |
|
|
sub display_haserrors { |
sub display_haserrors { |
my ($r,$bombs,$bombed,$res_title) = @_; |
my ($r,$bombs,$bombed,$res_title,$itemserror) = @_; |
my $bombnum = 0; |
my $bombnum = 0; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
reso => 'Resource', |
reso => 'Resource', |
Line 1486 sub display_haserrors {
|
Line 1509 sub display_haserrors {
|
'</td><td class="LC_right_item">'. |
'</td><td class="LC_right_item">'. |
$$bombed{$bomb}{errorcount}.'</td></tr>'); |
$$bombed{$bomb}{errorcount}.'</td></tr>'); |
} |
} |
|
} elsif ($itemserror) { |
|
$r->print('<tr class="LC_empty_row"><td>'.$itemserror.'</td></tr>'); |
} else { |
} else { |
$r->print('<tr class="LC_empty_row"><td>'.$lt{'noer'}.'</td></tr>'); |
$r->print('<tr class="LC_empty_row"><td>'.$lt{'noer'}.'</td></tr>'); |
} |
} |
Line 1493 sub display_haserrors {
|
Line 1518 sub display_haserrors {
|
} |
} |
|
|
sub display_abovethreshold { |
sub display_abovethreshold { |
my ($r,$refpage,$warnings,$triggered,$res_title) = @_; |
my ($r,$refpage,$warnings,$triggered,$res_title,$itemserror) = @_; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
reso => 'Resource', |
reso => 'Resource', |
part => 'Part', |
part => 'Part', |
Line 1549 sub display_abovethreshold {
|
Line 1574 sub display_abovethreshold {
|
} |
} |
} |
} |
$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>'); |
$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>'); |
|
} elsif ($itemserror) { |
|
$r->print('<tr class="LC_empty_row"><td>'.$itemserror.'</td></tr>'); |
} else { |
} else { |
$r->print('<tr class="LC_empty_row"><td>'.$lt{'nopr'}.'</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,$interval) = @_; |
my ($r,$changed,$res_title,$interval,$itemserror) = @_; |
my %lt = &Apache::lonlocal::texthash( |
my %lt = &Apache::lonlocal::texthash( |
'reso' => 'Resource', |
'reso' => 'Resource', |
'revd' => 'Last revised', |
'revd' => 'Last revised', |
Line 1582 sub display_versionchanges {
|
Line 1609 sub display_versionchanges {
|
$$changed{$item}{'current'}.'</td><td>'. |
$$changed{$item}{'current'}.'</td><td>'. |
$$changed{$item}{'version'}.'</td></tr>'); |
$$changed{$item}{'version'}.'</td></tr>'); |
} |
} |
|
} elsif ($itemserror) { |
|
$r->print('<tr class="LC_empty_row"><td>'.$itemserror.'</td></tr>'); |
} else { |
} else { |
$r->print('<tr class="LC_empty_row"><td>' |
$r->print('<tr class="LC_empty_row"><td>' |
.&mt('No '.$interval).'</td></tr>'); |
.&mt('No '.$interval).'</td></tr>'); |
Line 1647 sub display_rolechanges {
|
Line 1676 sub display_rolechanges {
|
} |
} |
|
|
sub display_coursediscussion { |
sub display_coursediscussion { |
my ($r,$newdiscussions,$unread,$countunread,$res_title) = @_; |
my ($r,$newdiscussions,$unread,$countunread,$res_title,$itemserror) = @_; |
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 1677 sub display_coursediscussion {
|
Line 1706 sub display_coursediscussion {
|
my $feedurl=&Apache::lonfeedback::get_feedurl($ressymb); |
my $feedurl=&Apache::lonfeedback::get_feedurl($ressymb); |
my $disclink = $feedurl.'?symb='.$$unread{$ressymb}{symb}; |
my $disclink = $feedurl.'?symb='.$$unread{$ressymb}{symb}; |
if ($feedurl =~ /bulletinboard/) { |
if ($feedurl =~ /bulletinboard/) { |
$type = 'Bulletin Board'; |
$type = 'Discussion Board'; |
} |
} |
if ($$unread{$ressymb}{'enclink'}) { |
if ($$unread{$ressymb}{'enclink'}) { |
$disclink = $$unread{$ressymb}{'enclink'}.'?symb='.$$unread{$ressymb}{'encsymb'}; |
$disclink = $$unread{$ressymb}{'enclink'}.'?symb='.$$unread{$ressymb}{'encsymb'}; |
Line 1695 sub display_coursediscussion {
|
Line 1724 sub display_coursediscussion {
|
} |
} |
$r->print("</tr>\n"); |
$r->print("</tr>\n"); |
} |
} |
|
} elsif ($itemserror) { |
|
$r->print('<tr class="LC_empty_row"><td>'.$itemserror.'</td></tr>'); |
} else { |
} else { |
$r->print('<tr class="LC_empty_row"><td>'.$lt{'noun'}.'</td></tr>'); |
$r->print('<tr class="LC_empty_row"><td>'.$lt{'noun'}.'</td></tr>'); |
} |
} |
Line 1811 sub store_interval_setting {
|
Line 1842 sub store_interval_setting {
|
\%interval_settings,$udom,$uname); |
\%interval_settings,$udom,$uname); |
if ($outcome eq 'ok') { |
if ($outcome eq 'ok') { |
if (ref($interval_titles->{$context}) eq 'HASH') { |
if (ref($interval_titles->{$context}) eq 'HASH') { |
$result = &mt('New filter setting: [_1].','<b>'. |
$result = &Apache::lonhtmlcommon::confirm_success(&mt('New filter setting: [_1].','<b>'. |
$interval_titles->{$context}->{$env{'form.interval'}}.'</b>').'<br />'; |
$interval_titles->{$context}->{$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 saving whatsnew '.$context.' interval setting'. |
&Apache::lonnet::logthis('Error saving whatsnew '.$context.' 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 = &Apache::lonhtmlcommon::confirm_success(&mt('Unable to set interval to [_1] due to [_2].', |
'<b>'.$interval_titles->{$context}->{$env{'form.interval'}}.'</b>', |
'<b>'.$interval_titles->{$context}->{$env{'form.interval'}}.'</b>', |
'<tt>'.$outcome.'</tt>.<br />'); |
'<tt>'.$outcome.'</tt>'),1); |
} |
} |
} |
} |
return $result; |
return &Apache::loncommon::confirmwrapper($result); |
} |
} |
|
|
sub store_discussion_setting { |
sub store_discussion_setting { |
Line 1835 sub store_discussion_setting {
|
Line 1866 sub store_discussion_setting {
|
my $outcome = &Apache::lonnet::put('nohist_whatsnew', |
my $outcome = &Apache::lonnet::put('nohist_whatsnew', |
\%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 = &Apache::lonhtmlcommon::confirm_success(&mt('Count unread posts in discussions display set to [_1]', |
'<b>'.&mt($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 saving 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 = &Apache::lonhtmlcommon::confirm_success(&mt('Unable to set "number unread posts display" to [_1]'. |
' due to [_2].', |
' due to [_2].', |
'<b>'.&mt($env{'form.countunread'}).'</b>', |
'<b>'.&mt($env{'form.countunread'}).'</b>', |
'<tt>'.$outcome.'</tt>.<br />'); |
'<tt>'.$outcome.'</tt>'),1); |
} |
} |
} |
} |
return $result; |
return &Apache::loncommon::confirmwrapper($result); |
} |
} |
|
|
sub store_courseinit_setting { |
sub store_courseinit_setting { |
Line 1873 sub store_courseinit_setting {
|
Line 1904 sub store_courseinit_setting {
|
\%courseinit_settings,$udom,$uname); |
\%courseinit_settings,$udom,$uname); |
if ($outcome eq 'ok') { |
if ($outcome eq 'ok') { |
if ($page_control eq 'global preferences') { |
if ($page_control eq 'global preferences') { |
$result = &mt("Page displayed after role selection in $lctype now set by <b>user's global preferences</b>."); |
$result = &Apache::lonhtmlcommon::confirm_success(&mt("Page displayed after role selection in $lctype now set by [_1]user's global preferences[_2].",'<b>','</b>')); |
} else { |
} else { |
$result = &mt('Page displayed after role selection in this '.$lctype.' set to <b>[_2]</b>',$lctype,$$initpage{$env{'form.courseinit_page'}}); |
$result = &Apache::lonhtmlcommon::confirm_success(&mt('Page displayed after role selection in this '.$lctype.' set to [_1].' |
|
,'<b>'.$$initpage{$env{'form.courseinit_page'}}.'</b>')); |
} |
} |
} else { |
} else { |
&Apache::lonnet::logthis('Error saving 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') { |
$result = &mt('Unable to set control of page display to [_1]'. |
$result = &Apache::lonhtmlcommon::confirm_success(&mt('Unable to set control of page display to [_1]'. |
' due to [_2].', |
' due to [_2].', |
'<b>'.$page_control.'</b>', |
'<b>'.$page_control.'</b>', |
'<tt>'.$outcome.'</tt>.<br />'); |
'<tt>'.$outcome.'</tt>'),1); |
} else { |
} else { |
$result = &mt('Unable to set page display, after role selection, for this '.$lctype.' to <b>[_2]</b> due to <tt>[_3]</tt>.<br />', |
$result = &Apache::lonhtmlcommon::confirm_success(&mt('Unable to set page display, after role selection, for this '.$lctype.' to [_1] due to [_2].' |
$$initpage{$env{'form.courseinit_page'}},$outcome); |
,'<b>'.$$initpage{$env{'form.courseinit_page'}}.'</b>' |
|
,'<tt>'.$outcome.'</tt>'),1); |
} |
} |
} |
} |
} |
} |
} |
} |
return $result; |
return &Apache::loncommon::confirmwrapper($result); |
} |
} |
|
|
sub start_box { |
sub start_box { |
Line 1925 sub start_box {
|
Line 1958 sub start_box {
|
if ($$show{$caller}) { |
if ($$show{$caller}) { |
$r->print(' |
$r->print(' |
<tr> |
<tr> |
<td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgthreshold&refpage='.$refpage.'">'.$lt{'chth'}.'</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 class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chginterval&refpage='.$refpage.'">'.$lt{'chin'}.'</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 class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgdisc&refpage='.$refpage.'">'.$lt{'chop'}.'</a></td> |
<td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgdisc&refpage='.$refpage.'">'.$lt{'chop'}.'</a></td> |
</tr>'); |
</tr>'); |
} |
} |
} elsif (($caller eq 'newroles') && ($$show{$caller})) { |
} elsif (($caller eq 'newroles') && ($$show{$caller})) { |
if ($$show{$caller}) { |
if ($$show{$caller}) { |
$r->print(' |
$r->print(' |
<tr> |
<tr> |
<td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgnewroleinterval&refpage='.$refpage.'">'.$lt{'chin'}.'</a></td> |
<td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgnewroleinterval&refpage='.$refpage.'">'.$lt{'chin'}.'</a></td> |
</tr>'); |
</tr>'); |
} |
} |
} elsif (($caller eq 'oldroles') && ($$show{$caller})) { |
} elsif (($caller eq 'oldroles') && ($$show{$caller})) { |
if ($$show{$caller}) { |
if ($$show{$caller}) { |
$r->print(' |
$r->print(' |
<tr> |
<tr> |
<td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgoldroleinterval&refpage='.$refpage.'">'.$lt{'chin'}.'</a></td> |
<td class="LC_subheader" colspan="2"><a href="/adm/whatsnew?command=chgoldroleinterval&refpage='.$refpage.'">'.$lt{'chin'}.'</a></td> |
</tr>'); |
</tr>'); |
} |
} |
} |
} |