--- loncom/interface/lonwhatsnew.pm 2005/04/11 12:20:23 1.6
+++ loncom/interface/lonwhatsnew.pm 2005/04/11 13:14:00 1.7
@@ -1,5 +1,5 @@
#
-# $Id: lonwhatsnew.pm,v 1.6 2005/04/11 12:20:23 raeburn Exp $
+# $Id: lonwhatsnew.pm,v 1.7 2005/04/11 13:14:00 raeburn Exp $
#
# Copyright Michigan State University Board of Trustees
#
@@ -45,6 +45,11 @@ use Time::Local;
sub handler {
my $r = shift;
+ if ($r->header_only) {
+ &Apache::loncommon::content_type($r,'text/html');
+ $r->send_http_header;
+ return OK;
+ }
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['command']);
my $command = $env{'form.command'};
@@ -53,6 +58,8 @@ sub handler {
$command = "info";
}
+ &Apache::loncommon::content_type($r,'text/html');
+ $r->send_http_header;
$r->print(&display_header());
if (! (($env{'request.course.fn'}) && (&Apache::lonnet::allowed('vsa',$env{'request.course.id'})))) {
# Not in a course, or not allowed to modify parms
@@ -60,6 +67,20 @@ sub handler {
return HTTP_NOT_ACCEPTABLE;
}
+ &Apache::lonhtmlcommon::clear_breadcrumbs();
+ if ($command eq 'config') {
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>'/adm/whatsnew?command=config',
+ text=>"Configure display"});
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs
+ (undef,'Course Action Items','Course_Action_Items_Config'));
+ } else {
+ &Apache::lonhtmlcommon::add_breadcrumb
+ ({href=>'/adm/whatsnew?command=info',
+ text=>"Display Action Items"});
+ $r->print(&Apache::lonhtmlcommon::breadcrumbs
+ (undef,'Course Action Items','Course_Action_Items_Display'));
+ }
&display_main_box($r,$command);
}
@@ -73,63 +94,32 @@ sub display_main_box {
my ($r,$command) = @_;
my $domain=&Apache::loncommon::determinedomain();
my $tabbg=&Apache::loncommon::designparm('coordinator.tabbg',$domain);
- $r->print(<
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Course Action Items |
-
-
- |
-
-
- |
-
-
- |
-
-
-
-
-
-
-END_OF_BLOCK
- &display_nav_box($r,$command);
- $r->print(' | | ');
- $r->print('');
-
+ my $selconfig;
+ my $selinfo;
if ($command eq 'config') {
- &display_config_box($r);
+ $selinfo = 'selected="selected"';
} else {
- &display_actions_box($r);
+ $selconfig = 'selected="selected"';
+ }
+ my $picker = ('
+');
+
+ $r->print('');
+
+ if ($command eq 'config') {
+ &display_config_box($r,$picker);
+ } else {
+ &display_actions_box($r,$picker);
}
$r->print(<
- |
-
- |
-
-
- |
-
-
- |
-
-
|
@@ -138,37 +128,6 @@ END_OF_BLOCK
END_OF_BLOCK
}
-#------------------------------
-# display_nav_box
-#
-# Display the navigation box
-#------------------------------
-
-sub display_nav_box {
- my ($r,$command) = @_;
- $r->print(''."\n");
- if ($command eq "info") {
- $r->print('');
- $r->print('Action Items ');
- $r->print(' |
');
- } else {
- $r->print('');
- $r->print('Current Action Items ');
- $r->print(' |
');
- }
- $r->print(' |
');
- if ($command eq "config") {
- $r->print('');
- $r->print('Display options ');
- $r->print(' |
');
- } else {
- $r->print('');
- $r->print('Display options ');
- $r->print(' |
');
- }
- $r->print('
');
-}
-
#-------------------------------
# display_header
#
@@ -196,7 +155,7 @@ ENDHEAD
#-------------------------------
sub display_actions_box() {
- my $r = shift;
+ my ($r,$picker) = @_;
my $rowColor1 = "#ffffff";
my $rowColor2 = "#eeeeee";
@@ -231,7 +190,7 @@ sub display_actions_box() {
return;
}
- $r->print('Course Action Items
');
+ $r->print(''.$picker.'
');
## UNREAD COURSE DISCUSSION POSTS ##
$r->print(<<"END");
@@ -247,11 +206,16 @@ sub display_actions_box() {
END
if (@newdiscussions > 0) {
+ $r->print(' | Location | Type | Number of new posts | ');
# @newdiscussions = sort { &cmp_title($a,$b) } @newdiscussions;
my $rowNum = 0;
foreach my $ressymb (@newdiscussions) {
my $forum_title = $unread{$ressymb}{'title'};
+ my $type = 'Resource';
my $feedurl=&Apache::lonfeedback::get_feedurl($ressymb);
+ if ($feedurl =~ /bulletinboard/) {
+ $type = 'Bulletin Board';
+ }
my $unreadnum = keys(%{$unread{$ressymb}});
$unreadnum = $unreadnum - 2;
if ($unreadnum > 0) {
@@ -260,7 +224,7 @@ END
} else {
$rowColor = $rowColor2;
}
- $r->print(''.$forum_title.': | '.$unreadnum.' | ');
+ $r->print(''.$forum_title.': | '.$type.' | '.$unreadnum.' | ');
$rowNum ++;
}
}
@@ -282,7 +246,7 @@ END
END
if (@tograde > 0) {
- $r->print('Problem Name | Number ungraded | ');
+ $r->print('Problem Name | Number ungraded | ');
my $rowNum = 0;
foreach my $res (@tograde) {
if ($rowNum %2 == 1) {
@@ -290,14 +254,48 @@ END
} else {
$rowColor = $rowColor2;
}
-
- $r->print(''.$ungraded{$res}{title}.' | '.$ungraded{$res}{count}.' | ');
+ my ($map,$id,$url)=&Apache::lonnet::decode_symb($res);
+ my $linkurl=&Apache::lonnet::clutter($url);
+ $linkurl .= '?symb='.&Apache::lonnet::escape($res);
+
+ $r->print(''.$ungraded{$res}{title}.' | '.$ungraded{$res}{count}.' | ');
$rowNum ++;
}
} else {
$r->print(' No problems require handgrading
| ');
}
$r->print('
|
');
+
+## BOMBS ##
+ $r->print(<<"END");
+
+
+
+
+
+ Problems with errors |
+
+
+
+
+END
+ my $bombnum = 0;
+ if (@bombs > 0) {
+# @bombs = sort { &cmp_title($a,$b) } @bombs;
+ foreach my $bomb (@bombs) {
+ if ($bombnum %2 == 1) {
+ $rowColor = $rowColor1;
+ } else {
+ $rowColor = $rowColor2;
+ }
+ $r->print(''.$bombed{$bomb}{errorlink}.' | ');
+ $bombnum ++;
+ }
+ } else {
+ $r->print(' No problems with errors
| ');
+ }
+ $r->print(' | |
');
+
$r->print(' | ');
## MESSAGES ##
@@ -314,6 +312,7 @@ END
END
if ($msgcount > 0) {
+ $r->print(''.&mt('Number').' | '.&mt('Subject').' | '.&mt('Sender').' | '.&mt('Date/Time').' | ');
my $rowNum = 0;
my $mailcount = 1;
foreach my $msg (@newmsgs) {
@@ -322,7 +321,7 @@ END
} else {
$rowColor = $rowColor2;
}
- $r->print(''.$mailcount.'. | '.$msg->{'shortsub'}.' | '.$msg->{'from'}.'@'.$msg->{'fromdom'}.' | '.$msg->{'sendtime'}.' | ');
+ $r->print(''.$mailcount.'. | '.$msg->{'shortsub'}.' | '.$msg->{'from'}.'@'.$msg->{'fromdom'}.' | '.$msg->{'sendtime'}.' | ');
$rowNum ++;
$mailcount ++;
}
@@ -345,6 +344,7 @@ END
END
if ($critmsgcount > 0) {
+ $r->print('Number | Subject | Sender | Date/Time | ');
my $rowNum = 0;
my $mailcount = 1;
foreach my $msg (@critmsgs) {
@@ -353,7 +353,7 @@ END
} else {
$rowColor = $rowColor2;
}
- $r->print(''.$mailcount.'. | '.$msg->{'shortsub'}.' | '.$msg->{'from'}.'@'.$msg->{'fromdom'}.' | '.$msg->{'sendtime'}.' | ');
+ $r->print(''.$mailcount.'. | '.$msg->{'shortsub'}.' | '.$msg->{'from'}.'@'.$msg->{'fromdom'}.' | '.$msg->{'sendtime'}.' | ');
$rowNum ++;
$mailcount ++;
}
@@ -363,35 +363,6 @@ END
$r->print(' |
');
-## BOMBS ##
- $r->print(<
-
-
-
-
- Problems with errors |
-
-
-
-
-END
- my $bombnum = 0;
- if (@bombs > 0) {
-# @bombs = sort { &cmp_title($a,$b) } @bombs;
- foreach my $bomb (@bombs) {
- if ($bombnum %2 == 1) {
- $rowColor = $rowColor1;
- } else {
- $rowColor = $rowColor2;
- }
- $r->print(''.$bombed{$bomb}{errorlink}.' | ');
- $bombnum ++;
- }
- } else {
- $r->print(' No problems with errors
| ');
- }
- $r->print(' | ');
$r->print('
|
@@ -428,7 +399,6 @@ sub getitems {
if ($ressymb =~ m-___adm/\w+/\w+/\d+/bulletinboard$-) {
$ressymb = $resource->wrap_symb();
}
-
# Check for unread discussion postings
if (defined($discussiontime{$ressymb})) {
push(@discussions,$ressymb);
@@ -559,3 +529,4 @@ sub cmp_title {
return $atitle cmp $btitle;
}
+1;