Diff for /loncom/interface/lonfeedback.pm between versions 1.370.2.5.2.4 and 1.390

version 1.370.2.5.2.4, 2022/11/16 14:46:16 version 1.390, 2022/01/19 00:44:31
Line 1003  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 1307  sub build_posting_display { Line 1312  sub build_posting_display {
                                 @{$$usernamesort{$contrib{$idx.':senderdomain'}}{$contrib{$idx.':sendername'}}} = ("$idx");                                  @{$$usernamesort{$contrib{$idx.':senderdomain'}}{$contrib{$idx.':sendername'}}} = ("$idx");
                             }                              }
 # Set up for sorting by last name, then first name  # Set up for sorting by last name, then first name
                             my %names = &Apache::loncommon::getnames($contrib{$idx.':sendername'},                              my %names = &Apache::lonnet::get('environment',
                                                                      $contrib{$idx.':senderdomain'});                                   ['firstname','lastname'],$contrib{$idx.':senderdomain'},
                                     ,$contrib{$idx.':sendername'});
                             my $lastname = $names{'lastname'};                              my $lastname = $names{'lastname'};
                             my $firstname = $names{'firstname'};                              my $firstname = $names{'firstname'};
                             if ($lastname eq '') {                              if ($lastname eq '') {
Line 1688  sub get_post_contents { Line 1694  sub get_post_contents {
                                         $$contrib{$idx.':sendername'},                                          $$contrib{$idx.':sendername'},
                                         $$contrib{$idx.':senderdomain'});                                          $$contrib{$idx.':senderdomain'});
     $$screenname=$$contrib{$idx.':screenname'};      $$screenname=$$contrib{$idx.':screenname'};
     $$showaboutme = &Apache::loncommon::aboutme_on($$contrib{$idx.':sendername'},      $$showaboutme = &Apache::lonnet::usertools_access($$contrib{$idx.':sendername'},
                                                    $$contrib{$idx.':senderdomain'});                                                        $$contrib{$idx.':senderdomain'},
                                                         'aboutme');
     my $sender = $$plainname;      my $sender = $$plainname;
     if ($$showaboutme) {      if ($$showaboutme) {
         $sender = &Apache::loncommon::aboutmewrapper(          $sender = &Apache::loncommon::aboutmewrapper(
Line 2108  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 2772  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 2900  sub redirect_back { Line 2910  sub redirect_back {
   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 2908  $typestyle Line 2922  $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 2941  sub no_redirect_back { Line 2955  sub no_redirect_back {
                          },$js_delay);";                           },$js_delay);";
           }            }
           $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 2952  ENDFORM Line 2969  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 2975  sub screen_header { Line 2993  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 2984  sub screen_header { Line 3002  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 3017  sub screen_header { Line 3035  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 3031  sub screen_header { Line 3052  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 3044  sub screen_header { Line 3065  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 3152  sub send_msg { Line 3173  sub send_msg {
     my ($title,$feedurl,$email,$citations,$attachmenturl,$symb,$clientip,%to)=@_;      my ($title,$feedurl,$email,$citations,$attachmenturl,$symb,$clientip,%to)=@_;
     my $status='';      my $status='';
     my $sendsomething=0;      my $sendsomething=0;
     my $delay;      my $delay; 
     my $senthide;      my $senthide;
     my %setters;      my %setters;
     my ($startblock,$endblock,$triggerblock,$by_ip,$blockdom) =      my ($startblock,$endblock,$triggerblock,$by_ip,$blockdom) =
Line 3641  sub modify_attachments { Line 3662  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 4173  sub handler { Line 4194  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 4788  ENDREDIR Line 4813  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++;

Removed from v.1.370.2.5.2.4  
changed lines
  Added in v.1.390


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