--- 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 '
'.&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;
@@ -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