Diff for /loncom/interface/lonfeedback.pm between versions 1.213 and 1.219

version 1.213, 2006/07/27 15:48:56 version 1.219, 2006/11/28 22:27:56
Line 92  sub list_discussion { Line 92  sub list_discussion {
             return '';              return '';
         }          }
     }      }
   
     my @bgcols = ("#cccccc","#eeeeee");      my @bgcols = ("#cccccc","#eeeeee");
     my $discussiononly=0;      my $discussiononly=0;
     if ($mode eq 'board') { $discussiononly=1; }      if ($mode eq 'board') { $discussiononly=1; }
Line 186  sub list_discussion { Line 187  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 392  imscp_v1p1.xsd http://www.imsglobal.org/ Line 393  imscp_v1p1.xsd http://www.imsglobal.org/
             my $colspan=$maxdepth+1;              my $colspan=$maxdepth+1;
             $discussion.= qq|              $discussion.= qq|
 <script>  <script>
    function studentdelete (symb,idx,newflag,previous) {     function verifydelete (caller,symb,idx,newflag,previous,groupparm) {
        var symbparm = symb+':::'+idx         var symbparm = symb+':::'+idx
        var prevparm = ""         var prevparm = ""
        if (newflag == 1) {         if (newflag == 1) {
            prevparm = "&previous="+previous             prevparm = "&previous="+previous
        }         }
        if (confirm("Are you sure you want to delete this post?\\nDeleted posts will no longer be visible to you and other students,\\nbut will continue to be visible to your instructor")) {         if (caller == 'studentdelete') {
            document.location.href = "/adm/feedback?hide="+symbparm+prevparm             if (confirm("Are you sure you want to delete this post?\\nDeleted posts will no longer be visible to you and other students,\\nbut will continue to be visible to your instructor")) {
        }                   document.location.href = "/adm/feedback?hide="+symbparm+prevparm+groupparm
              }
          } else {
              if (caller == 'seeiddelete') {
                  if (confirm("Are you sure you want to delete this post?\\nDeleted posts will no longer be visible to you or anyone else")) {
                      document.location.href = "/adm/feedback?deldisc="+symbparm+prevparm+groupparm
                  }
              }
          }
    }     }
 </script>  </script>
             |;              |;
Line 752  END Line 761  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 982  sub build_posting_display { Line 991  sub build_posting_display {
                                     $sender .= '" '.$target.'>'.&mt('Edit').'</a>';                                      $sender .= '" '.$target.'>'.&mt('Edit').'</a>';
                                                                           
                                     unless ($seeid) {                                      unless ($seeid) {
                                         $sender.=" <a href=\"javascript:studentdelete('$escsymb','$idx','$$newpostsflag','$prevread')";                                          my $grpargs = &group_args($group);
                                           $sender.=" <a href=\"javascript:verifydelete('studentdelete','$escsymb','$idx','$$newpostsflag','$prevread','$grpargs')";
                                         $sender .= '">'.&mt('Delete').'</a>';                                          $sender .= '">'.&mt('Delete').'</a>';
                                     }                                      }
                                 }                                  }
Line 1005  sub build_posting_display { Line 1015  sub build_posting_display {
                                     }                                      }
     $sender .= &group_args($group);      $sender .= &group_args($group);
                                     $sender .= '">'.&mt('Hide').'</a>';                                      $sender .= '">'.&mt('Hide').'</a>';
         }                               }
         $sender.=' <a href="/adm/feedback?deldisc='.                                  my $grpargs = &group_args($group);
         $escsymb.':::'.$idx;          $sender.= 
                                 if ($$newpostsflag) {                                      " <a href=\"javascript:verifydelete('seeiddelete','$escsymb','$idx','$$newpostsflag','$prevread','$grpargs')\">";
                                     $sender .= '&previous='.$prevread;                                  $sender .= &mt('Delete').'</a>';
                                 }  
  $sender .= &group_args($group);  
                                 $sender .= '">'.&mt('Delete').'</a>';  
                             }                              }
         } else {          } else {
     if ($screenname) {      if ($screenname) {
Line 1486  END Line 1493  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 1592  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 2058  $start_page Line 2067  $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 2555  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 2822  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 2833  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 2881  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 2908  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 3168  sub sort_filter_names { Line 3182  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.213  
changed lines
  Added in v.1.219


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