- Subject:$subject
+ Subject: $subject
END
if ($idx) {
if ($attachmenturls) {
@@ -2600,7 +2577,7 @@ sub generate_attachments_button {
my $response = (<
Click to add/remove attachments: new();
+ my @allres=$navmap->retrieveResources();
+ foreach my $resource (@allres) {
+ if ($resource->hasDiscussion()) {
+ my $ressymb;
+ if ($resource->symb() =~ m-(___adm/\w+/\w+)/(\d+)/bulletinboard$-) {
+ $ressymb = 'bulletin___'.$2.$1.'/'.$2.'/bulletinboard';
+ } else {
+ $ressymb = $resource->symb();
+ }
+ push @{$resourcesref}, $ressymb;
+ }
+ }
+ return;
+}
sub handler {
my $r = shift;
@@ -2752,7 +2747,7 @@ sub handler {
# --------------------------- Get query string for limited number of parameters
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
- ['hide','unhide','deldisc','postdata','preview','replydisc','editdisc','threadedon','threadedoff','onlyunread','allposts','onlyunmark','previous','markread','markonread','markondisp','toggoff','toggon','modifydisp','changes','navmaps','navurl','sortfilter','sortposts','applysort','rolefilter','statusfilter','sectionpick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold','allversions','export']);
+ ['hide','unhide','deldisc','postdata','preview','replydisc','editdisc','threadedon','threadedoff','onlyunread','allposts','onlyunmark','previous','markread','markonread','markondisp','toggoff','toggon','modifydisp','changes','navtime','navmaps','navurl','sortfilter','sortposts','applysort','rolefilter','statusfilter','sectionpick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold','allversions','export']);
if ($ENV{'form.discsymb'}) {
my $symb = $ENV{'form.discsymb'};
my $readkey = $symb.'_read';
@@ -2899,13 +2894,17 @@ END
}
&print_sortfilter_options($r,$symb,$previous,$feedurl);
return OK;
- } elsif ($ENV{'form.navmaps'}) {
+ } elsif ($ENV{'form.navtime'}) {
my %discinfo = ();
my @resources = ();
- if ($ENV{'form.navmaps'} =~ /:/) {
- @resources = split/:/,$ENV{'form.navmaps'};
+ if (defined($ENV{'form.navmaps'})) {
+ if ($ENV{'form.navmaps'} =~ /:/) {
+ @resources = split/:/,$ENV{'form.navmaps'};
+ } else {
+ @resources = ("$ENV{'form.navmaps'}");
+ }
} else {
- @resources = ("$ENV{'form.navmaps'}");
+ &has_discussion(\@resources);
}
my $numitems = @resources;
my $feedurl = '/adm/navmaps';
@@ -2914,7 +2913,8 @@ END
}
my %lt = &Apache::lonlocal::texthash(
'mnpa' => 'Marked "New" posts as read in a total of',
- 'robb' => 'resources/bulletin boards.'
+ 'robb' => 'resources/bulletin boards.',
+ 'twnp' => 'There are currently no resources or bulletin boards with unread discussion postings.'
);
foreach (@resources) {
# backward compatibility (bulletin boards used to be 'wrapped')
@@ -2925,9 +2925,14 @@ END
}
}
my $lastkey = $ressymb.'_lastread';
- $discinfo{$lastkey} = time;
+ $discinfo{$lastkey} = $ENV{'form.navtime'};
+ }
+ my $textline = "$lt{'mnpa'} $numitems $lt{'robb'}";
+ if ($numitems > 0) {
+ &Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss',\%discinfo,$ENV{'user.domain'},$ENV{'user.name'});
+ } else {
+ $textline = "$lt{'twnp'}";
}
- &Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss',\%discinfo,$ENV{'user.domain'},$ENV{'user.name'});
&Apache::loncommon::content_type($r,'text/html');
$r->send_http_header;
$r->print (<
-$lt{'mnpa'} $numitems $lt{'robb'}
+$textline
Continue
@@ -3194,7 +3199,6 @@ ENDREDIR
$status=$Apache::inputtags::status[-1];
}
my $discussion = &list_discussion($mode,$status,$symb);
-# &build_ims_export($r,$symb,$previous,$feedurl);
my $bodytag=&Apache::loncommon::bodytag('Resource Feedback and Discussion');
$r->print($bodytag.$discussion);
return OK;
|