--- loncom/interface/lonfeedback.pm 2006/07/18 17:44:43 1.212 +++ loncom/interface/lonfeedback.pm 2006/11/28 22:27:56 1.219 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.212 2006/07/18 17:44:43 albertel Exp $ +# $Id: lonfeedback.pm,v 1.219 2006/11/28 22:27:56 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -92,6 +92,7 @@ sub list_discussion { return ''; } } + my @bgcols = ("#cccccc","#eeeeee"); my $discussiononly=0; if ($mode eq 'board') { $discussiononly=1; } @@ -186,8 +187,8 @@ sub list_discussion { push @{$roleinfo{$student}}, 'st:'.$section.':'.$status; } ($classgroups,$studentgroups) = - &Apache::loncoursedata::get_group_memberships($classlist,$keylist, - $cdom,$cnum); + &Apache::loncoursedata::get_group_memberships($classlist,$keylist, + $cdom,$cnum); } # Get discussion display default settings for user @@ -392,15 +393,23 @@ imscp_v1p1.xsd http://www.imsglobal.org/ my $colspan=$maxdepth+1; $discussion.= qq| |; @@ -713,8 +722,8 @@ END if ($discussiononly) { my $now = time; my $attachnum = 0; - my $currnewattach; - my $currdelold; + my $currnewattach = []; + my $currdelold = []; my $comment = ''; my $subject = ''; if ($env{'form.origpage'}) { @@ -752,13 +761,13 @@ END if ($outputtarget ne 'tex') { $discussion.=''. - ''. + ''. &mt('Post Discussion').'
'; } } - $discussion.=''. + '">'. &mt('Send Message').''; } return $discussion; @@ -982,7 +991,8 @@ sub build_posting_display { $sender .= '" '.$target.'>'.&mt('Edit').''; unless ($seeid) { - $sender.=" '; } } @@ -1005,14 +1015,11 @@ sub build_posting_display { } $sender .= &group_args($group); $sender .= '">'.&mt('Hide').''; - } - $sender.=' '.&mt('Delete').''; + } + my $grpargs = &group_args($group); + $sender.= + " "; + $sender .= &mt('Delete').''; } } else { if ($screenname) { @@ -1486,14 +1493,11 @@ END $numoldver = 1; } } - my $message; if ($idx > 0) { my %msgversions = (); &get_post_versions(\%msgversions,$contrib{$idx.':message'},0,$numoldver); - $message = $msgversions{$numoldver}; + $quote = $msgversions{$numoldver}; } - &newline_to_br(\$message); - $quote='
'.&Apache::lontexconvert::msgtexconverted($message).'
'; if ($idx > 0) { my %subversions = (); &get_post_versions(\%subversions,$contrib{$idx.':subject'},1,$numoldver); @@ -1588,6 +1592,11 @@ END &Apache::loncommon::start_page('Resource Feedback and Discussion',$js, {'add_entries' => \%onload}); + if ($quote ne '') { + &newline_to_br(\$quote); + $quote='
'.&Apache::lontexconvert::msgtexconverted($quote).'
'; + } + $r->print(<$title @@ -1683,7 +1692,7 @@ END } } if ($attachmsg) { - $r->print("Retained attachments:$attachmsg
\n"); + $r->print("
Retained attachments:$attachmsg
\n"); } if ($newattachmsg) { $r->print("$newattachmsg
"); @@ -2058,9 +2067,10 @@ $start_page     @@ -2545,9 +2555,9 @@ sub clear_out_html { H1=>1, H2=>1, H3=>1, H4=>1, H5=>1); } # Do the substitution of everything that is not explicitly allowed - $message =~ s/\<(\/?\s*(\w*)[^\>\<]*)/ + $message =~ s/\<(\/?\s*(\w+)[^\>\<]*)/ {($html{uc($2)}&&(length($1)<1000))?"\<$1":"\<$1"}/ge; - $message =~ s/(\]*)\>/ + $message =~ s/(\]*)\>/ {($html{uc($2)}&&(length($1)<1000))?"$1\>":"$1\>"}/ge; return $message; } @@ -2812,6 +2822,10 @@ sub show_preview { my ($r) = @_; &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; + my $start_page= + &Apache::loncommon::start_page('Preview',undef, + {'only_body' => 1,}); + my $message=&clear_out_html($env{'form.comment'}); &newline_to_br(\$message); $message=&Apache::lonspeller::markeduptext($message); @@ -2819,9 +2833,6 @@ sub show_preview { my $subject=&clear_out_html($env{'form.subject'},undef,1); $subject=~s/\n/\
/g; $subject=&Apache::lontexconvert::msgtexconverted($subject); - my $start_page= - &Apache::loncommon::start_page('Preview',undef, - {'only_body' => 1,}); my $end_page = &Apache::loncommon::end_page(); @@ -2870,6 +2881,19 @@ ENDPREVIEW sub modify_attachments { my ($r,$currnewattach,$currdelold,$symb,$idx,$attachmenturls)=@_; + + my $js = < + function setAction () { + document.modattachments.action = document.modattachments.origpage.value; + document.modattachments.submit(); + } + +END + + my $start_page = + &Apache::loncommon::start_page('Discussion Post Attachments',$js); + my $orig_subject = &unescape($env{'form.subject'}); my $subject=&clear_out_html($orig_subject,undef,1); $subject=~s/\n/\
/g; @@ -2884,17 +2908,7 @@ sub modify_attachments { &extract_attachments($attachmenturls,$idx,$numoldver,\$msg,\%attachments,\%currattach,$currdelold); } &Apache::lonenc::check_encrypt(\$symb); - my $js = < - function setAction () { - document.modattachments.action = document.modattachments.origpage.value; - document.modattachments.submit(); - } - -END - my $start_page = - &Apache::loncommon::start_page('Discussion Post Attachments',$js); my $end_page = &Apache::loncommon::end_page(); @@ -2920,7 +2934,7 @@ END } } } - if (@{$currnewattach} > 0) { + if ((ref($currnewattach) eq 'ARRAY') && (@{$currnewattach} > 0)) { $r->print("The following attachments have been uploaded for inclusion with this posting.
Check the checkboxes for any you wish to remove
\n"); foreach (@{$currnewattach}) { $_ =~ m#/([^/]+)$#; @@ -3168,8 +3182,9 @@ sub sort_filter_names { ); %{$status_types} = ( all => 'Roles of any status', - Active => 'Only active roles', - Expired => 'Only inactive roles' + Active => 'Only active roles', + Expired => 'Only past roles', + Future => 'Only future roles', ); }