--- loncom/interface/lonfeedback.pm 2023/10/06 23:03:46 1.370.2.5.2.5 +++ loncom/interface/lonfeedback.pm 2022/01/19 01:35:58 1.370.2.6 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.370.2.5.2.5 2023/10/06 23:03:46 raeburn Exp $ +# $Id: lonfeedback.pm,v 1.370.2.6 2022/01/19 01:35:58 raeburn Exp $ # # Copyright Michigan State University Board of Trustees # @@ -118,16 +118,10 @@ sub list_discussion { $outputtarget = 'export'; } } - my ($nofooter,$nodisclink,$nofdbklink); if (not &discussion_visible($status)) { if ($mode ne 'board') { - ($nofooter,$nodisclink,$nofdbklink) = &check_menucoll(); - if ($nofooter || $nofdbklink) { - return '
'; - } else { - &Apache::lonenc::check_encrypt(\$ressymb); - return '
"; - } + &Apache::lonenc::check_encrypt(\$ressymb); + return '
"; } } if ($group ne '' && $mode eq 'board') { @@ -136,27 +130,17 @@ sub list_discussion { } } - unless ($outputtarget eq 'export') { - ($nofooter,$nodisclink,$nofdbklink) = &check_menucoll(); - } - - unless ($nofooter) { - my ($blocked,$blocktext) = - &Apache::loncommon::blocking_status('boards'); - if ($blocked) { - my $footer = '
'; - return $footer; + my ($blocked,$blocktext) = + &Apache::loncommon::blocking_status('boards'); + if ($blocked) { + $blocktext = '
'; + }else{ + $blocktext.=""; } + return $blocktext; } my @bgcols = ("LC_disc_old_item","LC_disc_new_item"); @@ -690,7 +674,7 @@ END $newpostsflag,$group, $prevread,$markondisp,$seehidden); $discussion .= "\n"; - } + } if ($outputtarget eq 'export') { if ($manifestok) { while ($currdepth > 0) { @@ -790,60 +774,33 @@ END &mt('This discussion is closed.').''; } } elsif ($outputtarget ne 'tex') { - unless ($nofooter) { - $discussion.=''; } return $discussion; } -sub check_menucoll { - my ($nofooter,$nodisclink,$nofdbklink); - my ($menucoll,$deeplinkmenu,$menuref) = &Apache::loncommon::menucoll_in_effect(); - if ($menucoll) { - if (ref($menuref) eq 'HASH') { - if ($menuref->{'foot'} eq 'n') { - $nofooter = 1; - } else { - unless ($menuref->{'disc'}) { - $nodisclink = 1; - } - unless ($menuref->{'fdbk'}) { - $nofdbklink = 1; - } - } - } - } - return ($nofooter,$nodisclink,$nofdbklink); -} - sub can_see_hidden { my ($mode,$ressymb,$feedurl,$group,$cdom,$cnum,$crs) = @_; my $seehidden; @@ -1307,8 +1264,9 @@ sub build_posting_display { @{$$usernamesort{$contrib{$idx.':senderdomain'}}{$contrib{$idx.':sendername'}}} = ("$idx"); } # Set up for sorting by last name, then first name - my %names = &Apache::loncommon::getnames($contrib{$idx.':sendername'}, - $contrib{$idx.':senderdomain'}); + my %names = &Apache::lonnet::get('environment', + ['firstname','lastname'],$contrib{$idx.':senderdomain'}, + ,$contrib{$idx.':sendername'}); my $lastname = $names{'lastname'}; my $firstname = $names{'firstname'}; if ($lastname eq '') { @@ -1688,8 +1646,9 @@ sub get_post_contents { $$contrib{$idx.':sendername'}, $$contrib{$idx.':senderdomain'}); $$screenname=$$contrib{$idx.':screenname'}; - $$showaboutme = &Apache::loncommon::aboutme_on($$contrib{$idx.':sendername'}, - $$contrib{$idx.':senderdomain'}); + $$showaboutme = &Apache::lonnet::usertools_access($$contrib{$idx.':sendername'}, + $$contrib{$idx.':senderdomain'}, + 'aboutme'); my $sender = $$plainname; if ($$showaboutme) { $sender = &Apache::loncommon::aboutmewrapper( @@ -2941,7 +2900,7 @@ sub no_redirect_back { },$js_delay);"; } $parms{'add_entries'}={'onload' => $onload}; - my $windowname = 'loncapaclient'; + my $windowname = 'loncapaclient'; $form_for_modal = < @@ -4684,8 +4643,6 @@ ENDREDIR ($env{'request.course.id'} && ($feedurl!~m:^/adm:)) || ($env{'request.course.id'} && ($symb=~/^bulletin\_\_\_/)) - || - (($env{'request.course.id'}) && ($feedurl =~ /ext\.tool$/)) ) { &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; @@ -4730,7 +4687,7 @@ ENDREDIR my $usersymb = &Apache::lonenc::check_encrypt($symb); my $useranswer= &Apache::loncommon::get_student_answers( - $symb,$env{'user.name'},$env{'user.domain'}, + $usersymb,$env{'user.name'},$env{'user.domain'}, $env{'request.course.id'}); &Apache::lonnet::delenv('allowed.vgr'); # Get attachments, if any, and not too large