Diff for /loncom/interface/lonfeedback.pm between versions 1.212 and 1.218

version 1.212, 2006/07/18 17:44:43 version 1.218, 2006/11/28 21:44:37
Line 186  sub list_discussion { Line 186  sub list_discussion {
             push @{$roleinfo{$student}}, 'st:'.$section.':'.$status;              push @{$roleinfo{$student}}, 'st:'.$section.':'.$status;
         }          }
  ($classgroups,$studentgroups) =    ($classgroups,$studentgroups) = 
          &Apache::loncoursedata::get_group_memberships($classlist,$keylist,      &Apache::loncoursedata::get_group_memberships($classlist,$keylist,
                                                        $cdom,$cnum);    $cdom,$cnum);
     }      }
   
 # Get discussion display default settings for user  # Get discussion display default settings for user
Line 713  END Line 713  END
     if ($discussiononly) {      if ($discussiononly) {
         my $now = time;          my $now = time;
         my $attachnum = 0;          my $attachnum = 0;
         my $currnewattach;          my $currnewattach = [];
         my $currdelold;          my $currdelold = [];
         my $comment = '';          my $comment = '';
         my $subject = '';          my $subject = '';
         if ($env{'form.origpage'}) {          if ($env{'form.origpage'}) {
Line 752  END Line 752  END
     if ($outputtarget ne 'tex') {      if ($outputtarget ne 'tex') {
  $discussion.='<a href="/adm/feedback?replydisc='.   $discussion.='<a href="/adm/feedback?replydisc='.
     &escape($ressymb).':::" '.$target.'>'.      &escape($ressymb).':::" '.$target.'>'.
     '<img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif').'" border="0" />'.      '<img alt="" src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif').'" border="0" />'.
     &mt('Post Discussion').'</a><br />';      &mt('Post Discussion').'</a><br />';
             }              }
  }   }
  $discussion.='<a href="/adm/feedback?sendmessageonly=1&symb='.   $discussion.='<a href="/adm/feedback?sendmessageonly=1&amp;symb='.
     &escape($ressymb).      &escape($ressymb).
     '"><img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/feedback.gif').'" border="0" />'.      '"><img alt="" src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/feedback.gif').'" border="0" />'.
     &mt('Send Message').'</a></td></tr></table>';      &mt('Send Message').'</a></td></tr></table>';
     }      }
     return $discussion;      return $discussion;
Line 1486  END Line 1486  END
                       $numoldver = 1;                        $numoldver = 1;
                   }                    }
               }                }
               my $message;  
               if ($idx > 0) {                if ($idx > 0) {
                   my %msgversions = ();                    my %msgversions = ();
                   &get_post_versions(\%msgversions,$contrib{$idx.':message'},0,$numoldver);                    &get_post_versions(\%msgversions,$contrib{$idx.':message'},0,$numoldver);
                   $message = $msgversions{$numoldver};                    $quote = $msgversions{$numoldver};
               }                }
       &newline_to_br(\$message);  
       $quote='<blockquote>'.&Apache::lontexconvert::msgtexconverted($message).'</blockquote>';  
               if ($idx > 0) {                if ($idx > 0) {
                   my %subversions = ();                    my %subversions = ();
                   &get_post_versions(\%subversions,$contrib{$idx.':subject'},1,$numoldver);                    &get_post_versions(\%subversions,$contrib{$idx.':subject'},1,$numoldver);
Line 1588  END Line 1585  END
       &Apache::loncommon::start_page('Resource Feedback and Discussion',$js,        &Apache::loncommon::start_page('Resource Feedback and Discussion',$js,
      {'add_entries' => \%onload});       {'add_entries' => \%onload});
   
     if ($quote ne '') {
         &newline_to_br(\$quote);
         $quote='<blockquote>'.&Apache::lontexconvert::msgtexconverted($quote).'</blockquote>';
     }
   
   $r->print(<<END);    $r->print(<<END);
 $start_page  $start_page
 <h2><tt>$title</tt></h2>  <h2><tt>$title</tt></h2>
Line 1683  END Line 1685  END
                 }                  }
             }              }
             if ($attachmsg) {              if ($attachmsg) {
                 $r->print("<b>Retained attachments</b>:$attachmsg<br />\n");                  $r->print("<br /><b>Retained attachments</b>:$attachmsg<br />\n");
             }              }
             if ($newattachmsg) {              if ($newattachmsg) {
                 $r->print("$newattachmsg<br />");                  $r->print("$newattachmsg<br />");
Line 2058  $start_page Line 2060  $start_page
   <td>&nbsp;</td>    <td>&nbsp;</td>
   <td align="center" valign="top">    <td align="center" valign="top">
    <select name="statusfilter">     <select name="statusfilter">
     <option value="all" selected="selected" />$status_types{'all'}</option>      <option value="all" selected="selected">$status_types{'all'}</option>
     <option value="Active" />$status_types{'Active'}</option>      <option value="Active">$status_types{'Active'}</option>
     <option value="Expired" />$status_types{'Expired'}</option>      <option value="Expired">$status_types{'Expired'}</option>
       <option value="Future">$status_types{'Future'}</option>
    </select>     </select>
   </td>    </td>
   <td>&nbsp;</td>    <td>&nbsp;</td>
Line 2545  sub clear_out_html { Line 2548  sub clear_out_html {
      H1=>1, H2=>1, H3=>1, H4=>1, H5=>1);       H1=>1, H2=>1, H3=>1, H4=>1, H5=>1);
   }    }
 # Do the substitution of everything that is not explicitly allowed  # Do the substitution of everything that is not explicitly allowed
   $message =~ s/\<(\/?\s*(\w*)[^\>\<]*)/    $message =~ s/\<(\/?\s*(\w+)[^\>\<]*)/
   {($html{uc($2)}&&(length($1)<1000))?"\<$1":"\&lt;$1"}/ge;    {($html{uc($2)}&&(length($1)<1000))?"\<$1":"\&lt;$1"}/ge;
   $message =~ s/(\<?\s*(\w*)[^\<\>]*)\>/    $message =~ s/(\<?\s*(\w+)[^\<\>]*)\>/
   {($html{uc($2)}&&(length($1)<1000))?"$1\>":"$1\&gt;"}/ge;    {($html{uc($2)}&&(length($1)<1000))?"$1\>":"$1\&gt;"}/ge;
   return $message;    return $message;
 }  }
Line 2812  sub show_preview { Line 2815  sub show_preview {
     my ($r) = @_;      my ($r) = @_;
     &Apache::loncommon::content_type($r,'text/html');      &Apache::loncommon::content_type($r,'text/html');
     $r->send_http_header;      $r->send_http_header;
       my $start_page=
    &Apache::loncommon::start_page('Preview',undef,
          {'only_body'   => 1,});
   
     my $message=&clear_out_html($env{'form.comment'});      my $message=&clear_out_html($env{'form.comment'});
     &newline_to_br(\$message);      &newline_to_br(\$message);
     $message=&Apache::lonspeller::markeduptext($message);      $message=&Apache::lonspeller::markeduptext($message);
Line 2819  sub show_preview { Line 2826  sub show_preview {
     my $subject=&clear_out_html($env{'form.subject'},undef,1);      my $subject=&clear_out_html($env{'form.subject'},undef,1);
     $subject=~s/\n/\<br \/\>/g;      $subject=~s/\n/\<br \/\>/g;
     $subject=&Apache::lontexconvert::msgtexconverted($subject);      $subject=&Apache::lontexconvert::msgtexconverted($subject);
     my $start_page=  
  &Apache::loncommon::start_page('Preview',undef,  
        {'only_body'   => 1,});  
   
     my $end_page = &Apache::loncommon::end_page();      my $end_page = &Apache::loncommon::end_page();
   
Line 2870  ENDPREVIEW Line 2874  ENDPREVIEW
   
 sub modify_attachments {  sub modify_attachments {
     my ($r,$currnewattach,$currdelold,$symb,$idx,$attachmenturls)=@_;      my ($r,$currnewattach,$currdelold,$symb,$idx,$attachmenturls)=@_;
   
       my $js = <<END;
   <script type="text/javascript">
    function setAction () {
      document.modattachments.action = document.modattachments.origpage.value;
      document.modattachments.submit();
    }
   </script> 
   END
   
       my $start_page = 
    &Apache::loncommon::start_page('Discussion Post Attachments',$js);
   
     my $orig_subject = &unescape($env{'form.subject'});      my $orig_subject = &unescape($env{'form.subject'});
     my $subject=&clear_out_html($orig_subject,undef,1);      my $subject=&clear_out_html($orig_subject,undef,1);
     $subject=~s/\n/\<br \/\>/g;      $subject=~s/\n/\<br \/\>/g;
Line 2884  sub modify_attachments { Line 2901  sub modify_attachments {
         &extract_attachments($attachmenturls,$idx,$numoldver,\$msg,\%attachments,\%currattach,$currdelold);          &extract_attachments($attachmenturls,$idx,$numoldver,\$msg,\%attachments,\%currattach,$currdelold);
     }      }
     &Apache::lonenc::check_encrypt(\$symb);      &Apache::lonenc::check_encrypt(\$symb);
     my $js = <<END;  
 <script type="text/javascript">  
  function setAction () {  
    document.modattachments.action = document.modattachments.origpage.value;  
    document.modattachments.submit();  
  }  
 </script>   
 END  
   
     my $start_page =   
  &Apache::loncommon::start_page('Discussion Post Attachments',$js);  
     my $end_page =       my $end_page = 
  &Apache::loncommon::end_page();   &Apache::loncommon::end_page();
                 
Line 2920  END Line 2927  END
             }              }
         }          }
     }      }
     if (@{$currnewattach} > 0) {      if ((ref($currnewattach) eq 'ARRAY') && (@{$currnewattach} > 0)) {
         $r->print("The following attachments have been uploaded for inclusion with this posting.<br />Check the checkboxes for any you wish to remove<br />\n");          $r->print("The following attachments have been uploaded for inclusion with this posting.<br />Check the checkboxes for any you wish to remove<br />\n");
         foreach (@{$currnewattach}) {          foreach (@{$currnewattach}) {
             $_ =~ m#/([^/]+)$#;              $_ =~ m#/([^/]+)$#;
Line 3168  sub sort_filter_names { Line 3175  sub sort_filter_names {
                    );                     );
     %{$status_types} = (      %{$status_types} = (
                      all     => 'Roles of any status',                       all     => 'Roles of any status',
                      Active => 'Only active roles',                       Active  => 'Only active roles',
                      Expired => 'Only inactive roles'                       Expired => 'Only past roles',
                        Future  => 'Only future roles',
                    );                     );
 }  }
       

Removed from v.1.212  
changed lines
  Added in v.1.218


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