--- loncom/interface/lonfeedback.pm 2022/11/14 15:12:30 1.370.2.5.2.3
+++ loncom/interface/lonfeedback.pm 2024/07/03 22:14:18 1.370.2.8
@@ -1,7 +1,7 @@
# The LearningOnline Network
# Feedback
#
-# $Id: lonfeedback.pm,v 1.370.2.5.2.3 2022/11/14 15:12:30 raeburn Exp $
+# $Id: lonfeedback.pm,v 1.370.2.8 2024/07/03 22:14:18 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 '
'.&send_message_link($ressymb)."
";
- }
+ &Apache::lonenc::check_encrypt(\$ressymb);
+ return '
'.&send_message_link($ressymb)."
";
}
}
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 = '
';
- unless ($nodisclink) {
- $footer .= ''.$blocktext.'';
- }
- &Apache::lonenc::check_encrypt(\$ressymb);
- if ($mode ne 'board') {
- unless ($nofdbklink) {
- $footer.=&send_message_link($ressymb);
- }
- }
- $footer.='
';
- return $footer;
+ my ($blocked,$blocktext) =
+ &Apache::loncommon::blocking_status('boards');
+ if ($blocked) {
+ $blocktext = '
'.$blocktext."";
+ &Apache::lonenc::check_encrypt(\$ressymb);
+ if ($mode ne 'board') {
+ $blocktext.=&send_message_link($ressymb).'
';
+ }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.='';
- unless ($nodisclink) {
- if (&discussion_open($status) &&
- &Apache::lonnet::allowed('pch',
- $env{'request.course.id'}.
- ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
- $discussion.= &send_feedback_link($ressymb);
- if ($env{'request.role.adv'}) {
- my $close = &Apache::lonnet::EXT('resource.0.discussend',$ressymb);
- my $canvote = &Apache::lonnet::EXT('resource.0.discussvote',$ressymb);
- if (defined($close) && $close ne '' && $close < time) {
- if ($canvote eq 'notended') {
- $discussion .= ' '.&mt('(Posting and voting closed for [_1] roles)',
- &Apache::lonnet::plaintext('st',$crstype));
- } else {
- $discussion .= ' '.&mt('(Closed for [_1] roles)',
- &Apache::lonnet::plaintext('st',$crstype));
- }
- }
+ $discussion.='
';
+ if (&discussion_open($status) &&
+ &Apache::lonnet::allowed('pch',
+ $env{'request.course.id'}.
+ ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
+ $discussion.= &send_feedback_link($ressymb);
+ if ($env{'request.role.adv'}) {
+ my $close = &Apache::lonnet::EXT('resource.0.discussend',$ressymb);
+ my $canvote = &Apache::lonnet::EXT('resource.0.discussvote',$ressymb);
+ if (defined($close) && $close ne '' && $close < time) {
+ if ($canvote eq 'notended') {
+ $discussion .= ' '.&mt('(Posting and voting closed for [_1] roles)',
+ &Apache::lonnet::plaintext('st',$crstype));
+ } else {
+ $discussion .= ' '.&mt('(Closed for [_1] roles)',
+ &Apache::lonnet::plaintext('st',$crstype));
}
- } else {
- $discussion.= ''.&mt('This discussion is closed.').'';
}
}
- unless ($nofdbklink) {
- $discussion.= &send_message_link($ressymb);
- }
- $discussion.='
';
+ } else {
+ $discussion.= '
'.&mt('This discussion is closed.').'';
}
+ $discussion.= &send_message_link($ressymb).'
';
}
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;
@@ -1688,9 +1645,8 @@ sub get_post_contents {
$$contrib{$idx.':sendername'},
$$contrib{$idx.':senderdomain'});
$$screenname=$$contrib{$idx.':screenname'};
- $$showaboutme = &Apache::lonnet::usertools_access($$contrib{$idx.':sendername'},
- $$contrib{$idx.':senderdomain'},
- 'aboutme');
+ $$showaboutme = &Apache::loncommon::aboutme_on($$contrib{$idx.':sendername'},
+ $$contrib{$idx.':senderdomain'});
my $sender = $$plainname;
if ($$showaboutme) {
$sender = &Apache::loncommon::aboutmewrapper(
@@ -2942,7 +2898,7 @@ sub no_redirect_back {
},$js_delay);";
}
$parms{'add_entries'}={'onload' => $onload};
- my $windowname = 'loncapaclient';
+ my $windowname = 'loncapaclient';
$form_for_modal = <
@@ -4685,8 +4641,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;
@@ -4731,7 +4685,7 @@ ENDREDIR
my $usersymb = &Apache::lonenc::check_encrypt($symb);
my $useranswer=
&Apache::loncommon::get_student_answers(
- $usersymb,$env{'user.name'},$env{'user.domain'},
+ $symb,$env{'user.name'},$env{'user.domain'},
$env{'request.course.id'});
&Apache::lonnet::delenv('allowed.vgr');
# Get attachments, if any, and not too large