Diff for /loncom/interface/lonfeedback.pm between versions 1.370.2.7 and 1.388

version 1.370.2.7, 2023/09/15 23:02:08 version 1.388, 2022/01/18 16:55:30
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 960  sub postingform_display { Line 1003  sub postingform_display {
             }              }
         }          }
     }      }
       my $postanon;
       if (&Apache::lonnet::allowed('pac',$env{'request.course.id'}.
          ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
           $postanon = '<input type="submit" name="anondiscuss" value="'.$lt{'poan'}.'" />';
       }
     $postingform .= (<<ENDDISCUSS);      $postingform .= (<<ENDDISCUSS);
 <form action="/adm/feedback" method="post" name="mailform" enctype="multipart/form-data"> <input type="submit" name="discuss" value="$lt{'podi'}" />  <form action="/adm/feedback" method="post" name="mailform" enctype="multipart/form-data"> <input type="submit" name="discuss" value="$lt{'podi'}" />
 <input type="submit" name="anondiscuss" value="$lt{'poan'}" /> <input type="hidden" name="symb" value="$ressymb" />  $postanon<input type="hidden" name="symb" value="$ressymb" />
 <input type="hidden" name="sendit" value="true" />  <input type="hidden" name="sendit" value="true" />
 <input type="hidden" name="timestamp" value="$now" />  <input type="hidden" name="timestamp" value="$now" />
 <a name="newpost"></a>  <a name="newpost"></a>
Line 2067  END Line 2115  END
         $r->print('<input type="hidden" name="ref" value="'.$env{'form.ref'}.'" />');          $r->print('<input type="hidden" name="ref" value="'.$env{'form.ref'}.'" />');
     }      }
     $r->print(<<END);      $r->print(<<END);
 <input type="hidden" name="sendit" value="1" />  <input type="hidden" name="sendit" value="1" /><br /><br />
 <input type="button" value="$send" onclick='gosubmit();' />  <input type="button" value="$send" onclick='gosubmit();' />
 </form>  </form>
 END  END
Line 2715  sub fail_redirect { Line 2763  sub fail_redirect {
   my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');    my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');
   my %parms=('only_body'   => 1);    my %parms=('only_body'   => 1);
   if ($delay !~ /^\d+(|\.\d+)$/) {    if ($delay !~ /^\d+(|\.\d+)$/) {
       $delay = 2;        $delay = 0;
   }    }
   if ($env{'form.modal'}) {    if ($env{'form.modal'}) {
       my $onload = 'document.forms.reldt.submit()';        my $onload = 'document.forms.reldt.submit()';
Line 2731  sub fail_redirect { Line 2779  sub fail_redirect {
   }    }
   $r->print(&Apache::loncommon::start_page('Feedback not sent',undef,\%parms));    $r->print(&Apache::loncommon::start_page('Feedback not sent',undef,\%parms));
   my $windowname = 'loncapaclient';    my $windowname = 'loncapaclient';
     if ($env{'request.lti.login'}) {
        $windowname .= 'lti';
     }
   $r->print(<<ENDFAILREDIR);    $r->print(<<ENDFAILREDIR);
 <img align="right" src="$logo" />  <img align="right" src="$logo" />
 <p class="LC_warning">$lt{'sorr'}</p>  <p class="LC_warning">$lt{'sorr'}</p>
Line 2742  ENDFAILREDIR Line 2793  ENDFAILREDIR
   
 sub redirect_back {  sub redirect_back {
   my ($r,$feedurl,$typestyle,$sendsomething,$sendposts,$blog,$status,$previous,$sort,    my ($r,$feedurl,$typestyle,$sendsomething,$sendposts,$blog,$status,$previous,$sort,
       $rolefilter,$statusfilter,$sectionpick,$grouppick,$numpicks,$group,$toolarge,$delay) = @_;        $rolefilter,$statusfilter,$sectionpick,$grouppick,$numpicks,$group,$toolarge) = @_;
   my $sorttag = '';    my $sorttag = '';
   my $roletag = '';    my $roletag = '';
   my $statustag = '';    my $statustag = '';
Line 2841  sub redirect_back { Line 2892  sub redirect_back {
   &Apache::lonenc::check_encrypt(\$feedurl);    &Apache::lonenc::check_encrypt(\$feedurl);
   my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');    my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');
   my %parms=('only_body'   => 1);    my %parms=('only_body'   => 1);
   if ($delay !~ /^\d+(|\.\d+)$/) {  
       $delay = 0;  
   }  
   if ($env{'form.modal'}) {    if ($env{'form.modal'}) {
       my $onload = 'document.forms.reldt.submit()';        my $onload = 'document.forms.reldt.submit()';
       if ($delay) {  
           my $js_delay = int(1000 * $delay);  
           $onload = "setTimeout(function(){  
                         document.forms.reldt.submit();  
                      },$js_delay);";  
       }  
       $parms{'add_entries'}={'onload' => $onload};        $parms{'add_entries'}={'onload' => $onload};
   } else {    } else {
       $parms{'redirect'}=[$delay,$feedurl];        $parms{'redirect'}=[0,$feedurl];
   }    }
   my $start_page=    my $start_page=
       &Apache::loncommon::start_page('Feedback sent',undef,\%parms);        &Apache::loncommon::start_page('Feedback sent',undef,\%parms);
   my $end_page = &Apache::loncommon::end_page();    my $end_page = &Apache::loncommon::end_page();
     my $windowname = 'loncapaclient';
     if ($env{'request.lti.login'}) {
        $windowname .= 'lti';
     }
   $r->print(<<ENDREDIR);    $r->print(<<ENDREDIR);
 $start_page  $start_page
 <img align="right" src="$logo" />  <img align="right" src="$logo" />
Line 2867  $typestyle Line 2913  $typestyle
 $blog  $blog
 $toolarge  $toolarge
 <font color="red">$status</font>  <font color="red">$status</font>
 <form name="reldt" action="$feedurl" target="loncapaclient">  <form name="reldt" action="$feedurl" target="$windowname">
 $prevtag  $prevtag
 $sorttag  $sorttag
 $statustag  $statustag
Line 2901  sub no_redirect_back { Line 2947  sub no_redirect_back {
           }            }
           $parms{'add_entries'}={'onload' => $onload};            $parms{'add_entries'}={'onload' => $onload};
           my $windowname = 'loncapaclient';            my $windowname = 'loncapaclient';
             if ($env{'request.lti.login'}) {
                 $windowname .= 'lti';
             }
           $form_for_modal = <<ENDFORM;            $form_for_modal = <<ENDFORM;
 <form name="reldt" action="$feedurl" target="$windowname">  <form name="reldt" action="$feedurl" target="$windowname">
 </form>  </form>
Line 2911  ENDFORM Line 2960  ENDFORM
           $parms{'redirect'}=[$delay,$feedurl];            $parms{'redirect'}=[$delay,$feedurl];
       }        }
   }    }
    
   my $start_page=    my $start_page=
       &Apache::loncommon::start_page('Feedback not sent',undef,        &Apache::loncommon::start_page('Feedback not sent',undef,
      \%parms);       \%parms);
Line 2934  sub screen_header { Line 2984  sub screen_header {
                     question => 'Question about resource content',                      question => 'Question about resource content',
                     comment => 'Question/Comment/Feedback about course content',                      comment => 'Question/Comment/Feedback about course content',
                     policy => 'Question/Comment/Feedback about course policy',                      policy => 'Question/Comment/Feedback about course policy',
                   );                    );  
     my $contribdisc = &mt('Contribution to course discussion of resource');      my $contribdisc = &mt('Contribution to course discussion of resource');
     my $anoncontrib = &mt('Anonymous 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 $namevis = &mt('name only visible to course faculty');
Line 2943  sub screen_header { Line 2993  sub screen_header {
         $crstype = &Apache::loncommon::course_type();          $crstype = &Apache::loncommon::course_type();
         if ($crstype eq 'Community') {          if ($crstype eq 'Community') {
             $default{'comment'} = &mt('Question/Comment/Feedback about community content');              $default{'comment'} = &mt('Question/Comment/Feedback about community content');
             $default{'policy'} = &mt('Question/Comment/Feedback about community policy');              $default{'policy'} = &mt('Question/Comment/Feedback about community policy'); 
             $contribdisc = &mt('Contribution to community discussion of resource');              $contribdisc = &mt('Contribution to community discussion of resource');
             $anoncontrib = &mt('Anonymous contribution to community discussion of resource');              $anoncontrib = &mt('Anonymous contribution to community discussion of resource');
             $namevis = &mt('name only visible to community facilitators');              $namevis = &mt('name only visible to community facilitators');
Line 2976  sub screen_header { Line 3026  sub screen_header {
         if (!$blocked && &discussion_open(undef,$realsymb) &&          if (!$blocked && &discussion_open(undef,$realsymb) &&
             (&Apache::lonnet::allowed('pch',              (&Apache::lonnet::allowed('pch',
                                       $env{'request.course.id'}.                                        $env{'request.course.id'}.
                                       ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:'')) ||                                         ($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')))) {              (($group ne '') && ($symb =~ m{^bulletin___\d+___adm/wrapper/adm/\Q$cdom\E/\Q$cnum\E/\d+/bulletinboard$}) && (&check_group_priv($group,'pgd') eq 'ok')))) {
             $discoptions{'nonanon'} = 1;              $discoptions{'nonanon'} = 1;
             $discoptions{'anon'} = 1;              if (&Apache::lonnet::allowed('pac',$env{'request.course.id'}.
                  ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
                   $discoptions{'anon'} = 1;
               }
             $blockblog = &Apache::loncommon::blocking_status('blogs');              $blockblog = &Apache::loncommon::blocking_status('blogs');
         }          }
     }      }
Line 2990  sub screen_header { Line 3043  sub screen_header {
     }      }
     if (keys(%fdbkoptions)) {      if (keys(%fdbkoptions)) {
         if ($fdbkoptions{'author'}) {          if ($fdbkoptions{'author'}) {
             $msgoptions =      $msgoptions =
                 '<label><input type="radio" name="discuss" value="author"'.$checkradio.' /> '.   '<label><input type="radio" name="discuss" value="author"'.$checkradio.' /> '.
                 &mt('Feedback to resource author').'</label><br />';   &mt('Feedback to resource author').'</label><br />';
         }   }
         foreach my $item ('question','comment','policy') {          foreach my $item ('question','comment','policy') {
             my $type = $item;              my $type = $item;
             if ($item eq 'comment') {              if ($item eq 'comment') {
Line 3003  sub screen_header { Line 3056  sub screen_header {
             if ($fdbkoptions{$type}) {              if ($fdbkoptions{$type}) {
                 $msgoptions .=                  $msgoptions .=
                     '<label><input type="radio" name="discuss" value="'.$type.'"'.$checkradio.' />'.                      '<label><input type="radio" name="discuss" value="'.$type.'"'.$checkradio.' />'.
                     ($optionhash?$optionhash:$default{$item}).'</label><br />';                      ($optionhash?$optionhash:$default{$item}).'</label><br />'; 
             }      }
         }          }
     }      }
     if (keys(%discoptions)) {      if (keys(%discoptions)) {
Line 3108  sub feedback_available { Line 3161  sub feedback_available {
 }  }
   
 sub send_msg {  sub send_msg {
     my ($title,$feedurl,$email,$citations,$attachmenturl,$symb,$clientip,%to)=@_;      my ($title,$feedurl,$email,$citations,$attachmenturl,$symb,%to)=@_;
     my $status='';      my $status='';
     my $sendsomething=0;      my $sendsomething=0;
     my $delay;  
     my $senthide;  
     my %setters;  
     my ($startblock,$endblock,$triggerblock,$by_ip,$blockdom) =  
         &Apache::loncommon::blockcheck(\%setters,'com',$clientip);  
     if ($by_ip) {  
         $senthide = 1;  
     }  
     my $restitle = &get_resource_title($symb,$feedurl);      my $restitle = &get_resource_title($symb,$feedurl);
     if ($title=~/^Error/) { $title=&mt('Feedback').': '.$title; }      if ($title=~/^Error/) { $title=&mt('Feedback').': '.$title; }
     unless ($title=~/\w/) { $title=&mt('Feedback'); }      unless ($title=~/\w/) { $title=&mt('Feedback'); }
Line 3132  sub send_msg { Line 3177  sub send_msg {
     } else {      } else {
  unless (&Apache::lonmsg::user_normal_msg($user,$domain,   unless (&Apache::lonmsg::user_normal_msg($user,$domain,
  $title.' ['.$restitle.']',$email,$citations,$feedurl,   $title.' ['.$restitle.']',$email,$citations,$feedurl,
  $attachmenturl,undef,undef,$symb,$restitle,undef,   $attachmenturl,undef,undef,$symb,$restitle)=~/ok/) {
                                                          undef,undef,undef,$senthide)=~/ok/) {  
     $status.='<br />'.&mt('Error sending message to').' '.$key.'<br />';      $status.='<br />'.&mt('Error sending message to').' '.$key.'<br />';
  } else {   } else {
     $sendsomething++;      $sendsomething++;
Line 3141  sub send_msg { Line 3185  sub send_msg {
     }      }
  }   }
     }      }
     if ($sendsomething && $senthide) {  
         if ($by_ip) {  
             my $showdom = &Apache::lonnet::domain($blockdom);  
             if ($showdom eq '') {  
                 $showdom = $blockdom;  
             }  
             $delay = 4;  
             $status.='<br />'.&mt("Message content of feedback you send to instructor(s) from your current IP address: [_1] will be unavailable in your 'Sent' folder.",$clientip).  
                      '<ul><li>'.  
                      &mt('This does not affect delivery of feedback to your instructor(s).').  
                      '</li><li>'.  
                      &mt('Note: some types of communication functionality are blocked for certain IP address(es).').  
                      '</li><li>'.  
                      &mt('This restriction was set by an administrator in the [_1] LON-CAPA domain.',  
                          $showdom).  
                      '</li></ul><br />';  
         }  
     }  
   
 # Records of number of feedback messages are kept under the "symb" called "_feedback"  # Records of number of feedback messages are kept under the "symb" called "_feedback"
 # There are two entries within the framework of a course:  # There are two entries within the framework of a course:
Line 3176  sub send_msg { Line 3202  sub send_msg {
     }      }
         }          }
     }      }
     return ($status,$sendsomething,$delay);      return ($status,$sendsomething);
 }  }
   
 # Routine to get the complete feedback records  # Routine to get the complete feedback records
Line 3600  sub modify_attachments { Line 3626  sub modify_attachments {
    document.modattachments.action = document.modattachments.origpage.value;     document.modattachments.action = document.modattachments.origpage.value;
    document.modattachments.submit();     document.modattachments.submit();
  }   }
 </script>  </script> 
 <script type="text/javascript" src="/res/adm/includes/file_upload.js"></script>  <script type="text/javascript" src="/res/adm/includes/file_upload.js"></script>
 END  END
   
Line 4132  sub handler { Line 4158  sub handler {
   'only_body'   => 1,    'only_body'   => 1,
   'add_entries' => \%onload});    'add_entries' => \%onload});
       my $end_page = &Apache::loncommon::end_page();        my $end_page = &Apache::loncommon::end_page();
         my $windowname = 'loncapaclient';
         if ($env{'request.lti.login'}) {
             $windowname .= 'lti';
         }
       $r->print (<<ENDREDIR);        $r->print (<<ENDREDIR);
 $start_page  $start_page
 <img align="right" src="$logo" />  <img align="right" src="$logo" />
 $textline  $textline
 <form name="reldt" action="$feedurl" target="loncapaclient">  <form name="reldt" action="$feedurl" target="$windowname">
 </form>  </form>
 <br />  <br />
 $end_page  $end_page
Line 4643  ENDREDIR Line 4673  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;
Line 4668  ENDREDIR Line 4700  ENDREDIR
   if ($options) {    if ($options) {
       &mail_screen($r,$feedurl,$options,$symb,$attachmax{'text'});        &mail_screen($r,$feedurl,$options,$symb,$attachmax{'text'});
   } else {    } else {
       &fail_redirect($r,$feedurl,2);        &fail_redirect($r,$feedurl,1);
   }    }
   return OK;    return OK;
       }        }
Line 4687  ENDREDIR Line 4719  ENDREDIR
       my $usersymb = &Apache::lonenc::check_encrypt($symb);        my $usersymb = &Apache::lonenc::check_encrypt($symb);
       my $useranswer=        my $useranswer=
           &Apache::loncommon::get_student_answers(            &Apache::loncommon::get_student_answers(
               $symb,$env{'user.name'},$env{'user.domain'},                $usersymb,$env{'user.name'},$env{'user.domain'},
               $env{'request.course.id'});                $env{'request.course.id'});
       &Apache::lonnet::delenv('allowed.vgr');        &Apache::lonnet::delenv('allowed.vgr');
 # Get attachments, if any, and not too large  # Get attachments, if any, and not too large
Line 4734  ENDREDIR Line 4766  ENDREDIR
       my ($typestyle,%to) = &Apache::lonmsg::decide_receiver($feedurl);        my ($typestyle,%to) = &Apache::lonmsg::decide_receiver($feedurl);
   
 # Actually send mail  # Actually send mail
       my $clientip = &Apache::lonnet::get_requestor_ip($r);        my ($status,$numsent)=&send_msg(&clear_out_html($env{'form.subject'}),
       my ($status,$numsent,$delay)=&send_msg(&clear_out_html($env{'form.subject'}),        $feedurl,$email,$citations,
              $feedurl,$email,$citations,        $attachmenturl,$usersymb,%to);
              $attachmenturl,$usersymb,$clientip,%to);  
   
 # Discussion? Store that.  # Discussion? Store that.
       my $numpost=0;        my $numpost=0;
Line 4745  ENDREDIR Line 4776  ENDREDIR
      && $env{'form.discuss'} !~ /^(?:author|question|course|policy)/)       && $env{'form.discuss'} !~ /^(?:author|question|course|policy)/)
    || $env{'form.anondiscuss'} ne '') {     || $env{'form.anondiscuss'} ne '') {
   my $subject = &clear_out_html($env{'form.subject'});    my $subject = &clear_out_html($env{'form.subject'});
   my $anonmode=($env{'form.discuss'} eq 'anon' || $env{'form.anondiscuss'} );            my $anonmode;
             if (&Apache::lonnet::allowed('pac',$env{'request.course.id'}.
                ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
         $anonmode=($env{'form.discuss'} eq 'anon' || $env{'form.anondiscuss'} );
             }
   $typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl,    $typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl,
   $subject,$group);    $subject,$group);
   $numpost++;    $numpost++;
Line 4769  ENDREDIR Line 4804  ENDREDIR
       
 # Receipt screen and redirect back to where came from  # Receipt screen and redirect back to where came from
       &redirect_back($r,$feedurl,$typestyle,$numsent,$numpost,$blog,$status,$env{'form.previous'},        &redirect_back($r,$feedurl,$typestyle,$numsent,$numpost,$blog,$status,$env{'form.previous'},
                      undef,undef,undef,undef,undef,undef,$group,$toolarge,$delay);                       undef,undef,undef,undef,undef,undef,$group,$toolarge);
   }    }
   return OK;    return OK;
 }  }

Removed from v.1.370.2.7  
changed lines
  Added in v.1.388


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