--- loncom/interface/lonfeedback.pm 2006/11/28 21:44:37 1.218 +++ loncom/interface/lonfeedback.pm 2006/11/30 04:05:47 1.224 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.218 2006/11/28 21:44:37 albertel Exp $ +# $Id: lonfeedback.pm,v 1.224 2006/11/30 04:05:47 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -92,6 +92,12 @@ sub list_discussion { return ''; } } + + my ($blocked,$blocktext) = &blocking_posts('boards',1); + if ($blocked) { + return $blocktext; + } + my @bgcols = ("#cccccc","#eeeeee"); my $discussiononly=0; if ($mode eq 'board') { $discussiononly=1; } @@ -132,7 +138,7 @@ sub list_discussion { my $previous = 0; my $visit = 0; my $newpostsflag = 0; - my @posters = split/\&/,$dischash{$userpickkey}; + my @posters = split(/\&/,$dischash{$userpickkey}); # Retain identification of "NEW" posts identified in last display, if continuing 'previous' browsing of posts. &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['previous','sortposts','rolefilter','statusfilter','sectionpick','grouppick','totposters']); @@ -161,19 +167,19 @@ sub list_discussion { my ($classgroups,$studentgroups); if ($env{'form.rolefilter'}) { %roleshash = &Apache::lonnet::dump('nohist_userroles',$cdom,$cnum); - foreach (keys %roleshash) { - my ($role,$uname,$udom,$sec) = split/:/,$_; + foreach my $rolekey (keys(%roleshash)) { + my ($role,$uname,$udom,$sec) = split(/:/,$rolekey); if ($role =~ /^cr/) { $role = 'cr'; } - my ($end,$start) = split/:/,$roleshash{$_}; + my ($end,$start) = split(/:/,$roleshash{$rolekey}); my $now = time; my $status = 'Active'; if (($now < $start) || ($end > 0 && $now > $end)) { $status = 'Expired'; } if ($uname && $udom) { - push @{$roleinfo{$uname.':'.$udom}}, $role.':'.$sec.':'.$status; + push(@{$roleinfo{$uname.':'.$udom}}, $role.':'.$sec.':'.$status); } } my ($classlist,$keylist) = @@ -183,7 +189,7 @@ sub list_discussion { while (my ($student,$data) = each %$classlist) { my ($section,$status) = ($data->[$sec_index], $data->[$status_index]); - push @{$roleinfo{$student}}, 'st:'.$section.':'.$status; + push(@{$roleinfo{$student}}, 'st:'.$section.':'.$status); } ($classgroups,$studentgroups) = &Apache::loncoursedata::get_group_memberships($classlist,$keylist, @@ -290,6 +296,13 @@ sub list_discussion { 'disp' => 'Display', 'nolo' => 'Not new', 'togg' => 'Toggle read/unread', + 'aner' => 'An error occurred opening the manifest file.', + 'difo' => 'Discussion for', + 'aerr' => 'An error occurred opening the export file for posting', + 'aysu' => 'Are you sure you want to delete this post?', + 'dpwn' => 'Deleted posts will no longer be visible to you and other students', + 'bwco' => 'but will continue to be visible to your instructor', + 'depo' => 'Deleted posts will no longer be visible to you or anyone else.', ); my $currdisp = $lt{'allposts'}; @@ -384,77 +397,40 @@ identifier="MANIFEST-$ressymb" xsi:schem imscp_v1p1.xsd http://www.imsglobal.org/xsd/imsmd_v1p2 imsmd_v1p2p2.xsd"> - Discussion for $ressymb\n|; + $lt{'difo'} $ressymb\n|; } else { - $discussion .= 'An error occurred opening the manifest file.
'; + $discussion .= $lt{'aner'}.'
'; } } else { my $colspan=$maxdepth+1; $discussion.= qq| |; $discussion.='
'; - $discussion .=''; - - my $numhidden = keys %notshown; + $discussion .= &action_links_bar($colspan,$ressymb,$visible, + $newpostsflag,$group, + $prevread,$markondisp); + my $escsymb=&escape($ressymb); + my $numhidden = keys(%notshown); if ($numhidden > 0) { my $colspan = $maxdepth+1; $discussion.="\n".'"; } - my $thisdepth=$depth[$alldiscussion{$_}]; + my $thisdepth=$depth[$alldiscussion{$post}]; if ($outputtarget ne 'tex' && $outputtarget ne 'export') { for (1..$thisdepth) { $discussion.=''; @@ -518,52 +494,52 @@ imscp_v1p1.xsd http://www.imsglobal.org/ my $colspan=$maxdepth-$thisdepth+1; if ($outputtarget eq 'tex') { #cleanup block - $discussionitems[$alldiscussion{$_}]=~s/]*)>/
'. - ''; - my $escsymb=&escape($ressymb); - if ($visible>2) { - $discussion.=''; - if ($newpostsflag) { - if (!$markondisp) { - $discussion .=''; - } - } else { - $discussion .= ''; - } - $discussion .= '
'. - ''.&mt('Threaded View').'  '. - ''.&mt('Chronological View').'   - '.&mt('Sorting/Filtering options').'  '; - } else { - $discussion .= ''; - } - $discussion .=''.&mt('Export').'?  '. - &mt('Preferences on what is marked as NEW'). - '
'.&mt('Mark NEW posts no longer new').''; - } else { - $discussion .= '
  
'. @@ -477,39 +453,39 @@ imscp_v1p1.xsd http://www.imsglobal.org/ # Choose sort mechanism my @showposts = (); if ($sortposts eq 'descdate') { - @showposts = (sort { $b <=> $a } keys %alldiscussion); + @showposts = (sort { $b <=> $a } keys(%alldiscussion)); } elsif ($sortposts eq 'thread') { - @showposts = (sort { $a <=> $b } keys %alldiscussion); + @showposts = (sort { $a <=> $b } keys(%alldiscussion)); } elsif ($sortposts eq 'subject') { - foreach (sort keys %subjectsort) { - push @showposts, @{$subjectsort{$_}}; + foreach my $key (sort(keys(%subjectsort))) { + push(@showposts, @{$subjectsort{$key}}); } } elsif ($sortposts eq 'username') { - foreach my $domain (sort keys %usernamesort) { - foreach (sort keys %{$usernamesort{$domain}}) { - push @showposts, @{$usernamesort{$domain}{$_}}; + foreach my $domain (sort(keys(%usernamesort))) { + foreach my $key (sort(keys(%{$usernamesort{$domain}}))) { + push(@showposts, @{$usernamesort{$domain}{$key}}); } } } elsif ($sortposts eq 'lastfirst') { - foreach my $last (sort keys %namesort) { - foreach (sort keys %{$namesort{$last}}) { - push @showposts, @{$namesort{$last}{$_}}; + foreach my $last (sort(keys(%namesort))) { + foreach my $key (sort(keys(%{$namesort{$last}}))) { + push(@showposts, @{$namesort{$last}{$key}}); } } } else { - @showposts = (sort { $a <=> $b } keys %alldiscussion); + @showposts = (sort { $a <=> $b } keys(%alldiscussion)); } my $currdepth = 0; my $firstidx = $alldiscussion{$showposts[0]}; - foreach (@showposts) { + foreach my $post (@showposts) { unless (($sortposts eq 'thread') || (($sortposts eq '') && ($env{'environment.threadeddiscussion'})) || ($outputtarget eq 'export')) { - $alldiscussion{$_} = $_; + $alldiscussion{$post} = $post; } - unless ( ($notshown{$alldiscussion{$_}} eq '1') || ($shown{$alldiscussion{$_}} == 0) ) { + unless ( ($notshown{$alldiscussion{$post}} eq '1') || ($shown{$alldiscussion{$post}} == 0) ) { if ($outputtarget ne 'tex' && $outputtarget ne 'export') { $discussion.="\n
   
/; - $discussionitems[$alldiscussion{$_}]=~s/]*)>]*)>/ -
/; + $discussionitems[$alldiscussion{$post}]=~s/]*)>//; + $discussionitems[$alldiscussion{$post}]=~s/]*)>]*)>/'; } } @@ -618,7 +594,6 @@ END $discussion .= &mt('Posts by').':'; if ($totposters > 0) { foreach my $poster (@posters) { - $poster =~ s/:/\@/; $discussion .= ' '.$poster.','; } $discussion =~ s/,$//; @@ -637,8 +612,8 @@ END } if (@rolefilter > 0) { $filterchoice .= ''.&mt('roles').'-'; - foreach (@rolefilter) { - $filterchoice .= ' '.$role_types{$_}.','; + foreach my $role (@rolefilter) { + $filterchoice .= ' '.$role_types{$role}.','; } $filterchoice =~ s/,$//; $filterchoice .= '
        '; @@ -665,9 +640,13 @@ END
/; my $threadinsert=''; if ($thisdepth > 0) { $threadinsert='
Reply: '.$thisdepth.''; } - $discussionitems[$alldiscussion{$_}]=~s/<\/td>]*)>/$threadinsert<\/td>
/; - $discussionitems[$alldiscussion{$_}]=~s/]+)>(Edit|Hide|Delete|Reply|Submissions)<\/a>//g; - $discussionitems[$alldiscussion{$_}]=~s/(|<\/b>|<\/a>|]+)>)//g; + $discussionitems[$alldiscussion{$post}]=~s/<\/td>]*)>/$threadinsert<\/td>/; + $discussionitems[$alldiscussion{$post}]=~s/]+)>(Edit|Hide|Delete|Reply|Submissions)<\/a>//g; + $discussionitems[$alldiscussion{$post}]=~s/(|<\/b>|<\/a>|]+)>)//g; - $discussionitems[$alldiscussion{$_}]='\vskip 0 mm\noindent\makebox[2 cm][b]{\hrulefill}'.$discussionitems[$alldiscussion{$_}]; - $discussion.=$discussionitems[$alldiscussion{$_}]; + $discussionitems[$alldiscussion{$post}]='\vskip 0 mm\noindent\makebox[2 cm][b]{\hrulefill}'.$discussionitems[$alldiscussion{$post}]; + $discussion.=$discussionitems[$alldiscussion{$post}]; } elsif ($outputtarget eq 'export') { - my $postfilename = $alldiscussion{$_}.'-'.$imsitems{$alldiscussion{$_}}{'timestamp'}.'.html'; + my $postfilename = $alldiscussion{$post}.'-'.$imsitems{$alldiscussion{$post}}{'timestamp'}.'.html'; if ($manifestok) { - if (($depth[$alldiscussion{$_}] <= $currdepth) && ($alldiscussion{$_} != $firstidx)) { + if (($depth[$alldiscussion{$post}] <= $currdepth) && ($alldiscussion{$post} != $firstidx)) { print $manifestfile ' '."\n"; } - $currdepth = $depth[$alldiscussion{$_}]; + $currdepth = $depth[$alldiscussion{$post}]; print $manifestfile "\n". - ''. - ''.$imsitems{$alldiscussion{$_}}{'title'}.''; + ''. + ''.$imsitems{$alldiscussion{$post}}{'title'}.''; $imsresources .= "\n". - ''."\n". + ''."\n". ''."\n". - $imsfiles{$alldiscussion{$_}}{$imsitems{$alldiscussion{$_}}{'currversion'}}."\n". + $imsfiles{$alldiscussion{$post}}{$imsitems{$alldiscussion{$post}}{'currversion'}}."\n". ''; } my $postingfile; my $postingfilename = $tempexport.'/'.$postfilename; if ($postingfile = Apache::File->new('>'.$postingfilename)) { print $postingfile 'Discussion Post'. - $imsitems{$alldiscussion{$_}}{'title'}.' '. - $imsitems{$alldiscussion{$_}}{'sender'}. - $imsitems{$alldiscussion{$_}}{'timestamp'}.'

'. - $imsitems{$alldiscussion{$_}}{'message'}.'
'. - $imsitems{$alldiscussion{$_}}{'attach'}.''."\n"; + $imsitems{$alldiscussion{$post}}{'title'}.' '. + $imsitems{$alldiscussion{$post}}{'sender'}. + $imsitems{$alldiscussion{$post}}{'timestamp'}.'

'. + $imsitems{$alldiscussion{$post}}{'message'}.'
'. + $imsitems{$alldiscussion{$post}}{'attach'}.''."\n"; close($postingfile); } else { - $discussion .= 'An error occurred opening the export file for posting '.$alldiscussion{$_}.'
'; + $discussion .= $lt{'aerr'}.' '.$alldiscussion{$post}.'
'; } - $copyresult.=&replicate_attachments($imsitems{$alldiscussion{$_}}{'allattachments'},$tempexport); + $copyresult.=&replicate_attachments($imsitems{$alldiscussion{$post}}{'allattachments'},$tempexport); } else { - $discussion.='
'. $discussionitems[$alldiscussion{$_}]. + $discussion.=''. $discussionitems[$alldiscussion{$post}]. '
-

END + $discussion .= &action_links_bar($colspan,$ressymb,$visible, + $newpostsflag,$group, + $prevread,$markondisp); + $discussion .= " + +

\n"; } if ($outputtarget eq 'export') { if ($manifestok) { @@ -699,13 +678,13 @@ END open(OUTPUT, "zip -r $imszip * 2> /dev/null |"); close(OUTPUT); chdir $cwd; - $discussion .= 'Download the zip file from Discussion Posting Archive
'; + $discussion .= &mt('Download the zip file from [_1]Discussion Posting Archive','').'
'; if ($copyresult) { - $discussion .= 'The following errors occurred during export -
'.$copyresult; + $discussion .= &mt('The following errors occurred during export').' -
'.$copyresult; } } } else { - $discussion .= '
Unfortunately you will not be able to retrieve an archive of the discussion posts at this time, because there was a problem creating a manifest file.
'; + $discussion .= '
'.&mt('Unfortunately you will not be able to retrieve an archive of the discussion posts at this time, because there was a problem creating a manifest file.').'
'; } return $discussion; } @@ -764,19 +743,97 @@ END return $discussion; } +sub action_links_bar { + my ($colspan,$ressymb,$visible,$newpostsflag,$group,$prevread,$markondisp) = @_; + my $discussion = ''. + ''; + my $escsymb=&escape($ressymb); + if ($visible>2) { + $discussion .= ''; + if ($newpostsflag) { + if (!$markondisp) { + $discussion .=''; + } + } else { + $discussion .= ''; + } + $discussion .= '
'. + ''.&mt('Threaded View').'  '. + ''.&mt('Chronological View').'   + '.&mt('Sorting/Filtering options').'  '; + } else { + $discussion .= ''; + } + $discussion .=''.&mt('Export').'?  '. + &mt('Preferences on what is marked as NEW'). + '
'.&mt('Mark NEW posts no longer new').''; + } else { + $discussion .= '
  
'; + return $discussion; +} + +sub blocking_posts { + my ($type,$showstatus) = @_; + my %setters; + my ($blocked,$output); + my ($startblock,$endblock) = + &Apache::loncommon::blockcheck(\%setters,$type); + if ($startblock && $endblock) { + $blocked = 1; + if ($showstatus) { + my $showstart = &Apache::lonlocal::locallocaltime($startblock); + my $showend = &Apache::lonlocal::locallocaltime($endblock); + $output = &mt('Discussion postings will not be viewable for resources in this course between [_1] and [_2] because communication is being blocked.',$showstart, $showend).'
'. + &Apache::loncommon::build_block_table($startblock,$endblock, + \%setters); + } + } + return ($blocked,$output); +} + sub postingform_display { my ($mode,$ressymb,$now,$subject,$comment,$outputtarget,$attachnum, $currnewattach,$currdelold,$group) = @_; my $newattachmsg; + my %lt = &Apache::lonlocal::texthash( + 'note' => 'Note: in anonymous discussion, your name is visible only to course faculty', + 'title' => 'Title', + 'podi' => 'Post Discussion', + 'poan' => 'Post Anonymous Discussion', + 'newa' => 'New attachments', + ); my $postingform = (< - +
+
-Note: in anonymous discussion, your name is visible only -to course faculty
-Title: 

+$lt{'note'}
+$lt{'title'}: 

ENDDISCUSS if ($env{'form.origpage'}) { @@ -794,13 +851,18 @@ ENDDISCUSS if ($group ne '') { $postingform .=''; } + my ($blockblog) = &blocking_posts('blogs'); + if (!$blockblog) { + $postingform .= &add_blog_checkbox(); + } $postingform .= "
\n"; if ($outputtarget ne 'tex') { $postingform .= &generate_attachments_button('',$attachnum,$ressymb, $now,$currnewattach, - $currdelold,'',$mode); + $currdelold,'',$mode, + $blockblog); if ((ref($currnewattach) eq 'ARRAY') && (@{$currnewattach} > 0)) { - $newattachmsg = '
New attachments
'; + $newattachmsg = '
'.$lt{'newa'}.'
'; if (@{$currnewattach} > 1) { $newattachmsg .= '
    '; foreach my $item (@{$currnewattach}) { @@ -880,7 +942,7 @@ sub build_posting_display { $$visible++; if ($contrib{$idx.':history'}) { if ($contrib{$idx.':history'} =~ /:/) { - my @oldversions = split/:/,$contrib{$idx.':history'}; + my @oldversions = split(/:/,$contrib{$idx.':history'}); $numoldver = @oldversions; } else { $numoldver = 1; @@ -919,13 +981,13 @@ sub build_posting_display { if ($subject eq '') { if (defined($$subjectsort{'__No subject'})) { - push @{$$subjectsort{'__No subject'}}, $idx; + push(@{$$subjectsort{'__No subject'}}, $idx); } else { @{$$subjectsort{'__No subject'}} = ("$idx"); } } else { if (defined($$subjectsort{$subject})) { - push @{$$subjectsort{$subject}}, $idx; + push(@{$$subjectsort{$subject}}, $idx); } else { @{$$subjectsort{$subject}} = ("$idx"); } @@ -947,7 +1009,7 @@ sub build_posting_display { %{$$usernamesort{$contrib{$idx.':senderdomain'}}} = (); } if (defined($$usernamesort{$contrib{$idx.':senderdomain'}}{$contrib{$idx.':sendername'}})) { - push @{$$usernamesort{$contrib{$idx.':senderdomain'}}{$contrib{$idx.':sendername'}}}, $idx; + push(@{$$usernamesort{$contrib{$idx.':senderdomain'}}{$contrib{$idx.':sendername'}}}, $idx); } else { @{$$usernamesort{$contrib{$idx.':senderdomain'}}{$contrib{$idx.':sendername'}}} = ("$idx"); } @@ -967,7 +1029,7 @@ sub build_posting_display { %{$$namesort{$lastname}} = (); } if (defined($$namesort{$lastname}{$firstname})) { - push @{$$namesort{$lastname}{$firstname}}, $idx; + push(@{$$namesort{$lastname}{$firstname}}, $idx); } else { @{$$namesort{$lastname}{$firstname}} = ("$idx"); } @@ -982,7 +1044,8 @@ sub build_posting_display { $sender .= '" '.$target.'>'.&mt('Edit').''; unless ($seeid) { - $sender.=" '; } } @@ -1005,14 +1068,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) { @@ -1025,7 +1085,7 @@ sub build_posting_display { %{$$usernamesort{'__anon'}} = (); } if (defined($$usernamesort{'__anon'}{'__anon'})) { - push @{$$usernamesort{'__anon'}{'__anon'}}, $idx; + push(@{$$usernamesort{'__anon'}{'__anon'}}, $idx); } else { @{$$usernamesort{'__anon'}{'__anon'}} = ("$idx"); } @@ -1034,7 +1094,7 @@ sub build_posting_display { %{$$namesort{'__anon'}} = (); } if (defined($$namesort{'__anon'}{'__anon'})) { - push @{$$namesort{'__anon'}{'__anon'}}, $idx; + push(@{$$namesort{'__anon'}{'__anon'}}, $idx); } else { @{$$namesort{'__anon'}{'__anon'}} = ("$idx"); } @@ -1194,7 +1254,7 @@ sub build_posting_display { } $$discussionitems[$idx].='
    '.&mt('Earlier version(s) were posted on: '); if ($contrib{$idx.':history'} =~ m/:/) { - @postversions = split/:/,$contrib{$idx.':history'}; + @postversions = split(/:/,$contrib{$idx.':history'}); } else { @postversions = ("$contrib{$idx.':history'}"); } @@ -1217,9 +1277,9 @@ sub filter_regexp { my $skiptest = 1; if (@{$rolefilter} > 0) { my @okrolefilter = (); - foreach (@{$rolefilter}) { - unless ($_ eq '') { - push @okrolefilter, $_; + foreach my $role (@{$rolefilter}) { + unless ($role eq '') { + push(@okrolefilter, $role); } } if (@okrolefilter > 0) { @@ -1237,9 +1297,9 @@ sub filter_regexp { } if (@{$sectionpick} > 0) { my @oksectionpick = (); - foreach (@{$sectionpick}) { - unless ($_ eq '') { - push @oksectionpick, $_; + foreach my $sec (@{$sectionpick}) { + unless ($sec eq '') { + push(@oksectionpick, $sec); } } if ((@oksectionpick > 0) && (!grep/^all$/,@oksectionpick)) { @@ -1301,7 +1361,7 @@ sub get_post_contents { } &get_post_versions($messages,$$contrib{$idx.':message'},1); &get_post_versions($subjects,$$contrib{$idx.':subject'},1); - push @postversions,$$contrib{$idx.':timestamp'}; + push(@postversions,$$contrib{$idx.':timestamp'}); $end = @postversions; } else { &get_post_versions($messages,$$contrib{$idx.':message'},1,$numver); @@ -1328,9 +1388,9 @@ sub get_post_contents { if ($type eq 'export') { $$imsfiles{$idx}{$i} = ''; if ($attachmsg) { - $$attachtxt{$i} = '
    Attachments:
    '; - foreach (sort keys %currattach) { - if ($$allattachments{$_}{'filename'} =~ m-^/uploaded/([^/]+/[^/]+)(/feedback)?(/?\d*)/([^/]+)$-) { + $$attachtxt{$i} = '
    '.&mt('Attachments').':
    '; + foreach my $key (sort(keys(%currattach))) { + if ($$allattachments{$key}{'filename'} =~ m-^/uploaded/([^/]+/[^/]+)(/feedback)?(/?\d*)/([^/]+)$-) { my $fname = $1.$3.'/'.$4; $$imsfiles{$idx}{$i} .= ''."\n"; $$attachtxt{$i}.= ''.$4.'
    '; @@ -1339,7 +1399,7 @@ sub get_post_contents { } } else { if ($attachmsg) { - $$attachtxt{$i} = '
    Attachments:'.$attachmsg.'
    '; + $$attachtxt{$i} = '
    '.&mt('Attachments').':'.$attachmsg.'
    '; } else { $$attachtxt{$i} = ''; } @@ -1363,11 +1423,11 @@ END sub replicate_attachments { my ($attachrefs,$tempexport) = @_; my $response; - foreach my $id (keys %{$attachrefs}) { + foreach my $id (keys(%{$attachrefs})) { if ($$attachrefs{$id}{'filename'} =~ m-^/uploaded/([^/]+)/([^/]+)(/feedback)?(/?\d*)/([^/]+)$-) { my $path = $tempexport; my $tail = $1.'/'.$2.$4; - my @extras = split/\//,$tail; + my @extras = split(/\//,$tail); my $destination = $tempexport.'/'.$1.'/'.$2.$4.'/'.$5; if (!-e $destination) { my $i= 0; @@ -1386,11 +1446,11 @@ sub replicate_attachments { print $attachcopy $content; close($attachcopy); } else { - $response .= 'Error copying file attachment - '.$5.' to IMS package: '.$!.'
    '."\n"; + $response .= &mt('Error copying file attachment - [_1] to IMS package',$5).': '.$!.'
    '."\n"; } } else { &Apache::lonnet::logthis("Replication of attachment failed when building IMS export of discussion posts - domain: $1, course: $2, file: $$attachrefs{$id}{'filename'} -error: $rtncode"); - $response .= 'Error copying file attachment - '.$5.' to IMS package: '.$rtncode.'
    '."\n"; + $response .= &mt('Error copying file attachment - [_1] to IMS package: ',$5).$rtncode.'
    '."\n"; } } } @@ -1404,6 +1464,13 @@ sub mail_screen { &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','currnewattach','addnewattach','deloldattach','delnewattach','timestamp','idx','anondiscuss','discuss','blog','group','ref']); } + my %lt = &Apache::lonlocal::texthash( + 'plch' => 'Please check at least one of the following feedback types:', + 'myqu' => 'My question/comment/feedback:', + 'title' => 'Title', + 'reta' => 'Retained attachments', + 'atta' => 'Attachment (128 KB max size)', + ); my $title=&Apache::lonnet::gettitle($feedurl); if (!$title) { $title = $feedurl; } my $quote=''; @@ -1471,7 +1538,7 @@ END unless (($contrib{'hidden'}=~/\.$idx\./) || ($contrib{'deleted'}=~/\.$idx\./)) { if ($contrib{$idx.':history'}) { if ($contrib{$idx.':history'} =~ /:/) { - my @oldversions = split/:/,$contrib{$idx.':history'}; + my @oldversions = split(/:/,$contrib{$idx.':history'}); $numoldver = @oldversions; } else { $numoldver = 1; @@ -1480,7 +1547,7 @@ END if ($env{'form.replydisc'}) { if ($contrib{$idx.':history'}) { if ($contrib{$idx.':history'} =~ /:/) { - my @oldversions = split/:/,$contrib{$idx.':history'}; + my @oldversions = split(/:/,$contrib{$idx.':history'}); $numoldver = @oldversions; } else { $numoldver = 1; @@ -1494,7 +1561,7 @@ END if ($idx > 0) { my %subversions = (); &get_post_versions(\%subversions,$contrib{$idx.':subject'},1,$numoldver); - $subject = 'Re: '.$subversions{$numoldver}; + $subject = &mt('Re: ').$subversions{$numoldver}; } $subject = &HTML::Entities::encode($subject,'<>&"'); } else { @@ -1541,6 +1608,7 @@ END } my $latexHelp=&Apache::loncommon::helpLatexCheatsheet(); my $send=&mt('Send'); + my $alert = &mt('Please select a feedback type.'); my $js= < //