Diff for /loncom/interface/lonfeedback.pm between versions 1.370.2.5 and 1.370.2.5.2.1

version 1.370.2.5, 2021/01/04 03:43:30 version 1.370.2.5.2.1, 2021/12/31 20:39:00
Line 118  sub list_discussion { Line 118  sub list_discussion {
             $outputtarget = 'export';              $outputtarget = 'export';
         }          }
     }      }
       my ($nofooter,$nodisclink,$nofdbklink);
     if (not &discussion_visible($status)) {      if (not &discussion_visible($status)) {
         if ($mode ne 'board') {          if ($mode ne 'board') {
             &Apache::lonenc::check_encrypt(\$ressymb);               ($nofooter,$nodisclink,$nofdbklink) = &check_menucoll();
             return '<br /><div class="LC_feedback_link">'.&send_message_link($ressymb)."</div>";              if ($nofooter || $nofdbklink) {
                   return '<br />';
               } else {
                   &Apache::lonenc::check_encrypt(\$ressymb);
                   return '<br /><div class="LC_feedback_link">'.&send_message_link($ressymb)."</div>";
               }
         }          }
     }      }
     if ($group ne '' && $mode eq 'board') {      if ($group ne '' && $mode eq 'board') {
Line 130  sub list_discussion { Line 136  sub list_discussion {
         }          }
     }      }
   
     my ($blocked,$blocktext) =       unless ($outputtarget eq 'export') {
         &Apache::loncommon::blocking_status('boards');          ($nofooter,$nodisclink,$nofdbklink) = &check_menucoll();
     if ($blocked) {      }
         $blocktext = '<br /><div class="LC_feedback_link"><span class="LC_feedback_link">'.$blocktext."</span>";  
         &Apache::lonenc::check_encrypt(\$ressymb);      unless ($nofooter) {
         if ($mode ne 'board') {          my ($blocked,$blocktext) = 
             $blocktext.=&send_message_link($ressymb).'</div>';              &Apache::loncommon::blocking_status('boards');
         }else{          if ($blocked) {
             $blocktext.="</div>";              my $footer = '<br /><div class="LC_feedback_link">';
               unless ($nodisclink) {
                   $footer .= '<span class="LC_feedback_link">'.$blocktext.'</span>';
               }
               &Apache::lonenc::check_encrypt(\$ressymb);
               if ($mode ne 'board') {
                   unless ($nofdbklink) {
                       $footer.=&send_message_link($ressymb);
                   }
               }
               $footer.='</div>';
               return $footer;
         }          }
         return $blocktext;   
     }      }
   
     my @bgcols = ("LC_disc_old_item","LC_disc_new_item");      my @bgcols = ("LC_disc_old_item","LC_disc_new_item");
Line 674  END Line 690  END
                                              $newpostsflag,$group,                                               $newpostsflag,$group,
                                              $prevread,$markondisp,$seehidden);                                               $prevread,$markondisp,$seehidden);
             $discussion .= "</table></form>\n";              $discussion .= "</table></form>\n";
         }           }
         if ($outputtarget eq 'export') {          if ($outputtarget eq 'export') {
             if ($manifestok) {              if ($manifestok) {
                 while ($currdepth > 0) {                  while ($currdepth > 0) {
Line 774  END Line 790  END
                           &mt('This discussion is closed.').'</span>';                            &mt('This discussion is closed.').'</span>';
         }          }
     } elsif ($outputtarget ne 'tex') {      } elsif ($outputtarget ne 'tex') {
         $discussion.='<div class="LC_feedback_link">';          unless ($nofooter) {
         if (&discussion_open($status) &&              $discussion.='<div class="LC_feedback_link">';
             &Apache::lonnet::allowed('pch',              unless ($nodisclink) {
            $env{'request.course.id'}.                  if (&discussion_open($status) &&
         ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {                      &Apache::lonnet::allowed('pch',
             $discussion.= &send_feedback_link($ressymb);                     $env{'request.course.id'}.
             if ($env{'request.role.adv'}) {                  ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
                 my $close = &Apache::lonnet::EXT('resource.0.discussend',$ressymb);                      $discussion.= &send_feedback_link($ressymb);
                 my $canvote = &Apache::lonnet::EXT('resource.0.discussvote',$ressymb);                      if ($env{'request.role.adv'}) {
                 if (defined($close) && $close ne '' && $close < time) {                          my $close = &Apache::lonnet::EXT('resource.0.discussend',$ressymb);
                     if ($canvote eq 'notended') {                          my $canvote = &Apache::lonnet::EXT('resource.0.discussvote',$ressymb);
                         $discussion .= '&nbsp;'.&mt('(Posting and voting closed for [_1] roles)',                          if (defined($close) && $close ne '' && $close < time) {
                                                     &Apache::lonnet::plaintext('st',$crstype));                              if ($canvote eq 'notended') {
                     } else {                                  $discussion .= '&nbsp;'.&mt('(Posting and voting closed for [_1] roles)',
                         $discussion .= '&nbsp;'.&mt('(Closed for [_1] roles)',                                                              &Apache::lonnet::plaintext('st',$crstype));
                                                     &Apache::lonnet::plaintext('st',$crstype));                              } else {
                                   $discussion .= '&nbsp;'.&mt('(Closed for [_1] roles)',
                                                               &Apache::lonnet::plaintext('st',$crstype));
                               }
                           }
                     }                      }
           } else {
                       $discussion.= '<span class="LC_feedback_link">'.&mt('This discussion is closed.').'</span>';
                 }                  }
             }              }
  } else {              unless ($nofdbklink) {
             $discussion.= '<span class="LC_feedback_link">'.&mt('This discussion is closed.').'</span>';          $discussion.= &send_message_link($ressymb);
               }
               $discussion.='</div>';
         }          }
  $discussion.= &send_message_link($ressymb).'</div>';  
     }      }
     return $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 {  sub can_see_hidden {
     my ($mode,$ressymb,$feedurl,$group,$cdom,$cnum,$crs) = @_;      my ($mode,$ressymb,$feedurl,$group,$cdom,$cnum,$crs) = @_;
     my $seehidden;      my $seehidden;
Line 4540  ENDREDIR Line 4583  ENDREDIR
   ($env{'request.course.id'} && ($feedurl!~m:^/adm:))    ($env{'request.course.id'} && ($feedurl!~m:^/adm:))
   ||    ||
   ($env{'request.course.id'} && ($symb=~/^bulletin\_\_\_/))    ($env{'request.course.id'} && ($symb=~/^bulletin\_\_\_/))
             ||
             (($env{'request.course.id'}) && ($feedurl =~ /ext\.tool$/))
   ) {    ) {
   &Apache::loncommon::content_type($r,'text/html');    &Apache::loncommon::content_type($r,'text/html');
   $r->send_http_header;    $r->send_http_header;

Removed from v.1.370.2.5  
changed lines
  Added in v.1.370.2.5.2.1


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>