--- loncom/interface/lonfeedback.pm 2010/11/20 01:33:04 1.273.4.12 +++ loncom/interface/lonfeedback.pm 2009/05/28 19:38:33 1.274 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.273.4.12 2010/11/20 01:33:04 raeburn Exp $ +# $Id: lonfeedback.pm,v 1.274 2009/05/28 19:38:33 kalberla Exp $ # # Copyright Michigan State University Board of Trustees # @@ -48,22 +48,13 @@ use LONCAPA; sub discussion_open { my ($status,$symb)=@_; -# Advanced roles can always discuss if ($env{'request.role.adv'}) { return 1; } -# Get discussion closing date - my $close=&Apache::lonnet::EXT('resource.0.discussend',$symb); -# If it is defined and in the future, the instructor wants this discussion to be open - if (defined($close) && $close ne '' && $close > time) { - return 1; - } -# It was not explicitly open, check if the problem is available. -# If the problem is not available, close the discussion if (defined($status) && !($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER' || $status eq 'OPEN')) { return 0; } -# The problem is available, but check if the instructor explictly closed discussion + my $close=&Apache::lonnet::EXT('resource.0.discussend',$symb); if (defined($close) && $close ne '' && $close < time) { return 0; } @@ -100,7 +91,7 @@ sub list_discussion { if (not &discussion_visible($status)) { if ($mode ne 'board') { &Apache::lonenc::check_encrypt(\$ressymb); - return '
'.&send_message_link($ressymb); + return '
"; } } if ($group ne '' && $mode eq 'board') { @@ -114,7 +105,7 @@ sub list_discussion { if ($blocked) { &Apache::lonenc::check_encrypt(\$ressymb); if ($mode ne 'board') { - $blocktext.='
'.&send_message_link($ressymb); + $blocktext.='
'; } return $blocktext; } @@ -178,8 +169,6 @@ sub list_discussion { my $cdom = $env{'course.'.$cid.'.domain'}; my $cnum = $env{'course.'.$cid.'.num'}; - my $crstype = &Apache::loncommon::course_type(); - # Get information about students and non-students in course for filtering display of posts my %roleshash = (); @@ -363,10 +352,10 @@ sub list_discussion { $togglink = 'toggoff'; } - $chglink .= '&changes='.$displinkA.'_'.$displinkB.'_'.$marklink.'_'.$togglink; + $chglink .= '&changes='.$displinkA.'_'.$displinkB.'_'.$marklink.'_'.$togglink; if ($newpostsflag) { - $chglink .= '&previous='.$prevread; + $chglink .= '&previous='.$prevread; } $chglink.=&group_args($group); @@ -409,8 +398,8 @@ sub list_discussion { my $manifestfilename = $tempexport.$manifest; if ($manifestfile = Apache::File->new('>'.$manifestfilename)) { $manifestok=1; - print $manifestfile qq| - + print $manifestfile qq| + '. ''.&mt('Show all posts').' '.&mt('to display').' '. @@ -537,11 +526,11 @@ imscp_v1p1.xsd http://www.imsglobal.org/ print $manifestfile "\n". ''. - ''.$imsitems{$alldiscussion{$post}}{'title'}.''; + ''.$imsitems{$alldiscussion{$post}}{'title'}.''; $imsresources .= "\n". ''."\n". ''."\n". - $imsfiles{$alldiscussion{$post}}{$imsitems{$alldiscussion{$post}}{'currversion'}}.''."\n". + $imsfiles{$alldiscussion{$post}}{$imsitems{$alldiscussion{$post}}{'currversion'}}."\n". ''; } my $postingfile; @@ -576,7 +565,7 @@ imscp_v1p1.xsd http://www.imsglobal.org/ + $lt{'cuse'}:
- $lt{'cuse'}:  END @@ -598,7 +587,7 @@ END   - $lt{'chgt'}? + $lt{'chgt'}?
@@ -608,7 +597,7 @@ END my %sort_types = (); my %role_types = (); my %status_types = (); - &sort_filter_names(\%sort_types,\%role_types,\%status_types,$crstype); + &sort_filter_names(\%sort_types,\%role_types,\%status_types); $discussion .= ''.&mt('Sorted by').': '.$sort_types{$sortposts}.'
'; if (defined($env{'form.totposters'})) { @@ -727,34 +716,22 @@ END $attachnum += @{$currnewattach}; } } - if ((&discussion_open($status)) && ($outputtarget ne 'tex')) { + if (&discussion_open($status)) { if (($group ne '') && ($mode eq 'board')) { - if ((&check_group_priv($group,'pgd') eq 'ok') && - ($ressymb =~ m{^bulletin___\d+___adm/wrapper/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard$})) { + if (&check_group_priv($group,'pgd') eq 'ok') { $discussion .= &postingform_display($mode,$ressymb,$now,$subject, $comment,$outputtarget,$attachnum, $currnewattach,$currdelold, - $group,$crstype); + $group); } } else { - if (&Apache::lonnet::allowed('pch',$env{'request.course.id'}. - ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { - - $discussion.= - &postingform_display($mode,$ressymb,$now,$subject, - $comment,$outputtarget,$attachnum, - $currnewattach,$currdelold,'',$crstype); - } else { - $discussion.= ''. - &mt('This discussion is closed.').''; - } + $discussion.= + &postingform_display($mode,$ressymb,$now,$subject, + $comment,$outputtarget,$attachnum, + $currnewattach,$currdelold); } } - if (!(&discussion_open($status)) && ($outputtarget ne 'tex')) { - $discussion.= ''. - &mt('This discussion is closed.').''; - } } else { $discussion.=''; + $discussion.=''; } return $discussion; } @@ -786,9 +755,9 @@ sub send_feedback_link { my $output = ''. ' '. - ''.&mt('Post Discussion').''; + '" border="0" />'.&mt('Post Discussion').''; return $output; } @@ -796,22 +765,22 @@ sub send_message_link { my ($ressymb) = @_; my $output = ''. ' '.&mt('Send Feedback').''; + '" border="0" />'.&mt('Send Feedback').''; return $output; } sub action_links_bar { my ($colspan,$ressymb,$visible,$newpostsflag,$group,$prevread,$markondisp) = @_; my $discussion = ''. - ''. - ' - END $r->print(&Apache::loncommon::end_data_table_row()); @@ -1998,7 +1961,7 @@ END $r->print(<$lt{'dotm'} - + END my $save = &mt('Save'); $r->print(&Apache::loncommon::end_data_table_row()); @@ -2012,7 +1975,7 @@ END - + END if (exists($env{'form.group'})) { $r->print(''); @@ -2043,13 +2006,6 @@ sub print_sortfilter_options { my $group_sel = ''; my $numgroupvis = 5; my %sectioncount = &Apache::loncommon::get_sections(); - my @courseroles = qw(st ad ep ta in); - my $crstype = &Apache::loncommon::course_type(); - my $ccrole = 'cc'; - if ($crstype eq 'Community') { - $ccrole = 'co'; - } - push(@courseroles,$ccrole); if ($env{'request.course.sec'} !~ /^\s*$/) { #Restrict section choice to current section @sections = ('all',$env{'request.course.sec'}); @@ -2113,7 +2069,7 @@ sub print_sortfilter_options { my %sort_types = (); my %role_types = (); my %status_types = (); - &sort_filter_names(\%sort_types,\%role_types,\%status_types,$crstype); + &sort_filter_names(\%sort_types,\%role_types,\%status_types); my $js = < @@ -2165,17 +2121,17 @@ $start_page

'; + ''; my $escsymb=&escape($ressymb); if ($visible>2) { - $discussion .= ''. + ''.&mt('Threaded View').'  '. @@ -827,6 +796,8 @@ sub action_links_bar { } $discussion .= &group_args($group); $discussion .='">'.&mt('Sorting/Filtering options').''.(' ' x2); + } else { + $discussion .= ''; + $discussion .= '">'.&mt('Mark NEW posts no longer new').''; } else { $discussion .= ''; } @@ -855,7 +826,7 @@ sub action_links_bar { sub postingform_display { my ($mode,$ressymb,$now,$subject,$comment,$outputtarget,$attachnum, - $currnewattach,$currdelold,$group,$crstype) = @_; + $currnewattach,$currdelold,$group) = @_; my $newattachmsg; my %lt = &Apache::lonlocal::texthash( 'note' => 'Note: in anonymous discussion, your name is visible only to course faculty', @@ -864,9 +835,6 @@ sub postingform_display { 'poan' => 'Post Anonymous Discussion', 'newa' => 'New attachments', ); - if ($crstype eq 'Community') { - $lt{'note'} = &mt('Note: in anonymous discussion, your name is visible only to community facilitators'); - } my $postingform = (< @@ -875,7 +843,7 @@ sub postingform_display {
$lt{'note'}
$lt{'title'}: 

- + ENDDISCUSS if ($env{'form.origpage'}) { $postingform .= '\n"; if ($outputtarget ne 'tex') { @@ -1043,7 +1011,6 @@ sub build_posting_display { $contrib{$idx.':senderdomain'}).' ('. $contrib{$idx.':sendername'}.':'. $contrib{$idx.':senderdomain'}.')'; - $sender = ''.$sender.''; if ($contrib{$idx.':anonymous'}) { $sender.=' ['.$$anonhash{$key}.'] '. $screenname; @@ -1051,7 +1018,6 @@ sub build_posting_display { if ($see_anonymous) { $sender.=&Apache::loncommon::student_image_tag($contrib{$idx.':senderdomain'},$contrib{$idx.':sendername'}); } - $sender = ''.$sender.''; # Set up for sorting by domain, then username unless (defined($$usernamesort{$contrib{$idx.':senderdomain'}})) { %{$$usernamesort{$contrib{$idx.':senderdomain'}}} = (); @@ -1086,7 +1052,7 @@ sub build_posting_display { $sender.=' '.&mt('Edit').''; @@ -1112,7 +1078,7 @@ sub build_posting_display { $sender.=' '.&mt('Hide').''; @@ -1153,7 +1119,7 @@ sub build_posting_display { $sender.=' '.&mt('Reply').''; @@ -1201,7 +1167,7 @@ sub build_posting_display { $$imsitems{$idx}{'attach'}=$attachtxt{$numoldver}; $$imsitems{$idx}{'timestamp'}=$contrib{$idx.':timestamp'}; $$imsitems{$idx}{'sender'}=$plainname.' ('. - $contrib{$idx.':sendername'}.':'. + $contrib{$idx.':sendername'}.' at '. $contrib{$idx.':senderdomain'}.')'; $$imsitems{$idx}{'isanonymous'}='false'; if ($contrib{$idx.':anonymous'}) { @@ -1274,24 +1240,24 @@ sub build_posting_display { if ($prevread > 0 && $prevread <= $posttime) { $$newitem{$idx} = 1; $$discussionitems[$idx] .= ' -

'.&mt('Mark NEW posts no longer new').'
 
+

'; } else { $$newitem{$idx} = 0; $$discussionitems[$idx] .= ' -
'.&mt('NEW').'
+

'; } $$discussionitems[$idx] .= ''; if ($$dischash{$toggkey}) { $$discussionitems[$idx].=''; } $$discussionitems[$idx].= '
   '. ''.$subject.'  '. - $sender.' '.$vgrlink.' ('. + $sender.' '.$vgrlink.' ('. &Apache::lonlocal::locallocaltime($posttime).')  '. $ctlink.'
'. - $message.'
'; + $message.'

'; if ($contrib{$idx.':history'}) { my @postversions = (); $$discussionitems[$idx] .= &mt('This post has been edited by the author.'); @@ -1398,7 +1364,7 @@ sub get_post_contents { $$plainname, $$contrib{$idx.':sendername'}, $$contrib{$idx.':senderdomain'}).' ('. - $$contrib{$idx.':sendername'}.':'. + $$contrib{$idx.':sendername'}.' at '. $$contrib{$idx.':senderdomain'}.')'; my $attachmenturls = $$contrib{$idx.':attachmenturl'}; my @postversions = (); @@ -1426,9 +1392,7 @@ sub get_post_contents { my ($timesent,$attachmsg); my %currattach = (); $timesent = &Apache::lonlocal::locallocaltime($postversions[$i]); - unless (&contains_block_html($messages->{$i})) { - &newline_to_br(\$messages->{$i}); - } + &newline_to_br(\$messages->{$i}); $$messages{$i}=&Apache::lontexconvert::msgtexconverted($$messages{$i}); $$subjects{$i}=~s/\n/\
/g; $$subjects{$i}=&Apache::lontexconvert::msgtexconverted($$subjects{$i}); @@ -1442,7 +1406,7 @@ sub get_post_contents { foreach my $key (sort(keys(%currattach))) { if ($$allattachments{$key}{'filename'} =~ m-^/uploaded/([^/]+/[^/]+)(/feedback)?(/?\d*)/([^/]+)$-) { my $fname = $1.$3.'/'.$4; - $$imsfiles{$idx}{$i} .= ''."\n"; + $$imsfiles{$idx}{$i} .= ''."\n"; $$attachtxt{$i}.= ''.$4.'
'; } } @@ -1515,6 +1479,7 @@ sub mail_screen { } 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', @@ -1702,10 +1667,7 @@ END {'add_entries' => \%onload}); if ($quote ne '') { - $quote = &HTML::Entities::decode($quote); - unless (&contains_block_html($quote)) { - &newline_to_br(\$quote); - } + &newline_to_br(\$quote); $quote='
'.&Apache::lontexconvert::msgtexconverted($quote).'
'; } @@ -1728,6 +1690,7 @@ END END } $r->print(< $quote

$lt{'myqu'}

@@ -1737,8 +1700,9 @@ $latexHelp

$lt{'title'}:

-

+

END if ( ($env{'form.editdisc'}) || ($env{'form.replydisc'}) ) { if ($env{'form.origpage'}) { @@ -1760,7 +1724,6 @@ END } } else { $r->print(< $lt{'atta'} $attachmaxtext:

END @@ -1774,7 +1737,7 @@ END $r->print(< - +

END @@ -1981,9 +1944,9 @@ END $r->print(<$lt{'disa'}
$lt{$discdisp} +
- +
$lt{$disctogg}
- - - - - - - - - - - + + + + + + + + + + + @@ -2230,7 +2185,7 @@ $start_page
- + END if (exists($env{'form.group'})) { $r->print(''); @@ -2264,7 +2219,7 @@ sub print_showposters { my $group = $env{'form.group'}; my $ressymb = &wrap_symb($symb); if (($group ne '') && - ($ressymb =~ m|^bulletin___\d+___adm/wrapper/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard$|)) { + ($ressymb =~ m|^bulletin___ \d+___adm/wrapper/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard$|)) { if (&check_group_priv($group,'dgp') eq 'ok') { $seeid = 1; } @@ -2353,7 +2308,7 @@ END
- + $end_page END @@ -2456,7 +2411,7 @@ sub redirect_back { if ($previous > 0) { $qrystr = 'previous='.$previous; if ($feedurl =~ /\?register=1/) { - $feedurl .= '&'.$qrystr; + $feedurl .= '&'.$qrystr; } else { $feedurl .= '?'.$qrystr; } @@ -2465,14 +2420,14 @@ sub redirect_back { if (defined($sort)) { my $sortqry = 'sortposts='.$sort; if (($feedurl =~ /\?register=1/) || ($feedurl =~ /\?previous=/)) { - $feedurl .= '&'.$sortqry; + $feedurl .= '&'.$sortqry; } else { $feedurl .= '?'.$sortqry; } $sorttag = ''; if (defined($numpicks)) { my $userpickqry = 'totposters='.$numpicks; - $feedurl .= '&'.$userpickqry; + $feedurl .= '&'.$userpickqry; $userpicktag = ''; } else { if (ref($sectionpick) eq 'ARRAY') { @@ -2486,7 +2441,7 @@ sub redirect_back { $sectag =~ s/,$//; $sectag .= '" />'; } else { - $feedurl .= '&sectionpick='.$sectionpick; + $feedurl .= '§ionpick='.$sectionpick; $sectag = ''; } if (ref($grouppick) eq 'ARRAY') { @@ -2500,7 +2455,7 @@ sub redirect_back { $grptag =~ s/,$//; $grptag .= '" />'; } else { - $feedurl .= '&grouppick='.$grouppick; + $feedurl .= '&grouppick='.$grouppick; $grptag = ''; } if (ref($rolefilter) eq 'ARRAY') { @@ -2517,7 +2472,7 @@ sub redirect_back { $feedurl .= '&rolefilter='.$rolefilter; $roletag = ''; } - $feedurl .= '&statusfilter='.$statusfilter; + $feedurl .= '&statusfilter='.$statusfilter; $statustag =''; } } @@ -2605,23 +2560,7 @@ ENDNOREDIRTWO } sub screen_header { - my ($feedurl,$symb,$group) = @_; - my $crscontent = &mt('Question/Comment/Feedback about course content'); - my $crspolicy = &mt('Question/Comment/Feedback about course policy'); - my $contribdisc = &mt('Contribution to course discussion of resource'); - my $anoncontrib = &mt('Anonymous contribution to course discussion of resource'); - my $namevis = &mt('name only visible to course faculty'); - my $crstype; - if ($env{'request.course.id'}) { - $crstype = &Apache::loncommon::course_type(); - if ($crstype eq 'Community') { - $crscontent = &mt('Question/Comment/Feedback about community content'); - $crspolicy = &mt('Question/Comment/Feedback about community policy'); - $contribdisc = &mt('Contribution to community discussion of resource'); - $anoncontrib = &mt('Anonymous contribution to community discussion of resource'); - $namevis = &mt('name only visible to community facilitators'); - } - } + my ($feedurl,$symb) = @_; my $msgoptions=''; my $discussoptions=''; unless (($env{'form.replydisc'}) || ($env{'form.editdisc'})) { @@ -2642,52 +2581,42 @@ sub screen_header { if (&feedback_available(0,1)) { $msgoptions.= '

'; } if (&feedback_available(0,0,1)) { $msgoptions.= '

'; } } if (($env{'request.course.id'}) && (!$env{'form.sendmessageonly'})) { my ($blocked,$blocktext) = &Apache::loncommon::blocking_status('boards'); - my $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; - my $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; - my $realsymb = $symb; - if ($symb=~/^bulletin___/) { - my $filename=(&Apache::lonnet::decode_symb($symb))[2]; - $filename=~s|^adm/wrapper/||; - $realsymb=&Apache::lonnet::symbread($filename); - } - if (!$blocked && &discussion_open(undef,$realsymb) && - (&Apache::lonnet::allowed('pch', - $env{'request.course.id'}. - ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')) || - (($group ne '') && ($symb =~ m{^bulletin___\d+___adm/wrapper/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard$}) && (&check_group_priv($group,'pgd') eq 'ok')))) { + if (!$blocked && &discussion_open(undef,$symb) && + &Apache::lonnet::allowed('pch', + $env{'request.course.id'}. + ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { $discussoptions='
'. - + &mt('Contribution to course discussion of resource'); + $discussoptions.='
'. ''.&mt('Change Screenname').''; my $blockblog = &Apache::loncommon::blocking_status('blogs'); if (!$blockblog) { - $discussoptions.= &add_blog_checkbox($crstype); + $discussoptions.= &add_blog_checkbox(); } } } if ($msgoptions) { $msgoptions='

' - .' '.&mt('Send Feedback').'

'.&Apache::lonhtmlcommon::coursepreflink(&mt('Feedback Settings'),'feedback').'

' + .' '.&mt('Send Feedback').'' .$msgoptions; } if ($discussoptions) { - $discussoptions='

' - .' '.&mt('Discussion Contributions').'

'.&Apache::lonhtmlcommon::coursepreflink(&mt('Discussion Settings'),'discussion').'

' + $discussoptions='

' + .' '.&mt('Discussion Contributions').'

' .$discussoptions; } return $msgoptions.$discussoptions; @@ -2718,13 +2647,11 @@ sub clear_out_html { ($override)) { # allows


      • #

        - #

  • $lt{'soor'} $lt{'sprs'} $lt{'spur'} $lt{'spse'} $lt{'spgr'} $lt{'psub'}$lt{'soor'} $lt{'sprs'} $lt{'spur'} $lt{'spse'} $lt{'spgr'} $lt{'psub'}
    @@ -2202,11 +2158,10 @@ $start_page
    + # %html=(B=>1, I=>1, P=>1, A=>1, LI=>1, OL=>1, UL=>1, EM=>1, BR=>1, TT=>1, STRONG=>1, BLOCKQUOTE=>1, DIV=>1, IMG=>1, M=>1, ALGEBRA=>1, SUB=>1, SUP=>1, SPAN=>1, - H1=>1, H2=>1, H3=>1, H4=>1, H5=>1, H6=>1, - TABLE=>1, TR=>1, TD=>1, TH=>1, TBODY=>1); - + H1=>1, H2=>1, H3=>1, H4=>1, H5=>1); } # Do the substitution of everything that is not explicitly allowed $message =~ s/\<(\/?\s*(\w+)[^\>\<]*)/ @@ -2806,7 +2733,7 @@ sub send_msg { } sub adddiscuss { - my ($symb,$email,$anon,$attachmenturl,$subject,$group)=@_; + my ($symb,$email,$anon,$attachmenturl,$subject)=@_; my $status=''; my $realsymb; if ($symb=~/^bulletin___/) { @@ -2814,16 +2741,9 @@ sub adddiscuss { $filename=~s|^adm/wrapper/||; $realsymb=&Apache::lonnet::symbread($filename); } - my ($cnum,$cdom); - if ($env{'request.course.id'}) { - $cdom = $env{'course.'.$env{'request.course.id'}.'.domain'}; - $cnum = $env{'course.'.$env{'request.course.id'}.'.num'}; - } if (&discussion_open(undef,$realsymb) && - (&Apache::lonnet::allowed('pch',$env{'request.course.id'}. - ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')) || - (($group ne '') && (&check_group_priv($group,'pgd') eq 'ok') && - ($symb =~ m{^bulletin___\d+___adm/wrapper/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard$})))) { + &Apache::lonnet::allowed('pch',$env{'request.course.id'}. + ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { my %contrib=('message' => $email, 'sendername' => $env{'user.name'}, @@ -2994,19 +2914,6 @@ sub show_preview { ); } -sub contains_block_html { - my ($message)=@_; - return ($message =~ m{ - <(br|h1|h2|h3|h4|h5|h6|p|ol|ul|table|pre|address|blockquote|center|div) - \s* - (\w+\=['"]\w+['"])* - \s* - ( - \s*/>| - >.* - )}xs - ); -} sub newline_to_br { my ($message)=@_; @@ -3040,7 +2947,7 @@ sub generate_preview_button { +onClick="if (typeof(document.$formname.onsubmit)=='function') {document.$formname.onsubmit();};this.form.comment.value=document.$formname.$fieldname.value;this.form.subject.value=document.$formname.subject.value;this.form.submit();" /> ENDPREVIEW } @@ -3095,7 +3002,7 @@ $toolarge
    @@ -3146,7 +3053,7 @@ END $r->print(''."\n"); } $r->print(< + $end_page END @@ -3338,8 +3245,7 @@ sub construct_attachmenturl { } sub add_blog_checkbox { - my ($crstype) = @_; - my $checkstatus; + my ($checkstatus); if ($env{'form.blog'}) { $checkstatus = 'checked="checked"'; } @@ -3353,13 +3259,8 @@ function setblogvalue() { } }
    -
    '."\n"; +
    '."\n"; return $output; } @@ -3383,9 +3284,8 @@ sub has_discussion { } sub sort_filter_names { - my ($sort_types,$role_types,$status_types,$crstype) = @_; - if (ref($sort_types) eq 'HASH') { - %{$sort_types} = ( + my ($sort_types,$role_types,$status_types) = @_; + %{$sort_types} = ( ascdate => 'Date order - oldest first', descdate => 'Date order - newest first', thread => 'Threaded', @@ -3393,30 +3293,24 @@ sub sort_filter_names { username => 'By domain and username', lastfirst => 'By last name, first name' ); - } - my @courseroles = qw(st in ta ep ad); - if ($crstype eq 'Community') { - push(@courseroles,'co'); - } else { - push(@courseroles,'cc'); - } - if (ref($role_types) eq 'HASH') { - foreach my $role (@courseroles) { - $role_types->{$role} = &Apache::lonnet::plaintext($role,$crstype); - } - $role_types->{'all'} = 'All roles'; - $role_types->{'cr'} = 'Custom role'; - } - if (ref($status_types) eq 'HASH') { - %{$status_types} = ( - all => 'Roles of any status', - Active => 'Only active roles', - Expired => 'Only past roles', - Future => 'Only future roles', - ); - } + %{$role_types} = ( + all => 'All roles', + st => 'Students', + cc => 'Course Coordinators', + in => 'Instructors', + ta => 'TAs', + ep => 'Exam proctors', + ad => 'Administrators', + cr => 'Custom roles' + ); + %{$status_types} = ( + all => 'Roles of any status', + Active => 'Only active roles', + Expired => 'Only past roles', + Future => 'Only future roles', + ); } - + sub handler { my $r = shift; if ($r->header_only) { @@ -3850,7 +3744,7 @@ ENDREDIR return OK; } } - my $options=&screen_header($feedurl,$symb,$group); + my $options=&screen_header($feedurl,$symb); if ($options) { &mail_screen($r,$feedurl,$options,$symb,$attachmax{'text'}); } else { @@ -3929,7 +3823,7 @@ ENDREDIR my $subject = &clear_out_html($env{'form.subject'},undef,1); my $anonmode=($env{'form.discuss'} eq 'anon' || $env{'form.anondiscuss'} ); $typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl, - $subject,$group); + $subject); $numpost++; } @@ -3942,11 +3836,7 @@ ENDREDIR $env{'user.domain'}, 'CourseBlog_'.$env{'request.course.id'}, $subject,$message,$feedurl,'public'); - if (&Apache::loncommon::course_type() eq 'Community') { - $blog='
    '.&mt('Added to my community blog').'
    '; - } else { - $blog='
    '.&mt('Added to my course blog').'
    '; - } + $blog='
    '.&mt('Added to my course blog').'
    '; } # Receipt screen and redirect back to where came from
    - Subject: $subject

    + Subject: $subject

    END if ($idx) { if ($attachmenturls) { @@ -3123,7 +3030,7 @@ END
    - $lt{'adda'} + $lt{'adda'}