version 1.83, 2008/12/12 15:48:05
|
version 1.85, 2009/02/04 13:03:44
|
Line 490 sub display_actions_box {
|
Line 490 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 533 sub display_actions_box {
|
Line 534 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 786 sub display_launcher {
|
Line 787 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 825 sub getitems {
|
Line 826 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 883 sub getitems {
|
Line 888 sub getitems {
|
} |
} |
|
|
} |
} |
|
return; |
} |
} |
|
|
sub check_discussions { |
sub check_discussions { |
Line 1446 sub checkversions {
|
Line 1452 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 1469 sub display_handgrade {
|
Line 1475 sub display_handgrade {
|
} |
} |
$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 1494 sub display_haserrors {
|
Line 1502 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 1501 sub display_haserrors {
|
Line 1511 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 1557 sub display_abovethreshold {
|
Line 1567 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 1590 sub display_versionchanges {
|
Line 1602 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 1655 sub display_rolechanges {
|
Line 1669 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 1685 sub display_coursediscussion {
|
Line 1699 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 1703 sub display_coursediscussion {
|
Line 1717 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>'); |
} |
} |