--- loncom/interface/lonfeedback.pm 2004/05/05 21:04:14 1.80 +++ loncom/interface/lonfeedback.pm 2004/05/07 12:03:53 1.82 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.80 2004/05/05 21:04:14 raeburn Exp $ +# $Id: lonfeedback.pm,v 1.82 2004/05/07 12:03:53 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -37,7 +37,7 @@ use Apache::lontexconvert(); use Apache::lonlocal; sub list_discussion { - my ($mode,$status,$symb,$previous)=@_; + my ($mode,$status,$symb)=@_; # &Apache::lonnet::logthis("status is $status"); if (!($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER' || $status eq 'OPEN')) { @@ -71,9 +71,13 @@ sub list_discussion { my %dischash = &Apache::lonnet::get('nohist_'.$ENV{'request.course.id'}.'_discuss',[$lastkey,$showkey,$visitkey],$ENV{'user.domain'},$ENV{'user.name'}); my $showonlyunread = 0; my $prevread = 0; + my $previous = 0; my $visit = 0; my $newpostsflag = 0; +# Retain identification of "NEW" posts identified in last display, if continuing 'previous' browsing of posts. + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['previous']); + $previous = $ENV{'form.previous'}; if ($previous > 0) { $prevread = $previous; } elsif (defined($dischash{$lastkey})) { @@ -155,12 +159,13 @@ sub list_discussion { $subject=&Apache::lontexconvert::msgtexconverted($subject); } if ($contrib{$idx.':attachmenturl'}) { - my ($fname,$ft) - =($contrib{$idx.':attachmenturl'}=~/\/(\w+)\.(\w+)$/); - $message.='
'.&mt('Attachment').': '.$fname.'.'.$ft.'
'; + my ($fname) + =($contrib{$idx.':attachmenturl'}=~m|/([^/]+)$|); + &Apache::lonnet::allowuploaded('/adm/feedback', + $contrib{$idx.':attachmenturl'}); + $message.=''.&mt('Attachment'). + ': '. + $fname.'
'; } if ($message) { if ($hidden) { @@ -972,7 +977,7 @@ sub handler { my $attachmenturl=''; if ($ENV{'form.attachment.filename'}) { unless (length($ENV{'form.attachment'})>131072) { - $attachmenturl=&Apache::lonnet::userfileupload('attachment'); + $attachmenturl=&Apache::lonnet::userfileupload('attachment',undef,'feedback'); } } # Filter HTML out of message (could be nasty)