Diff for /loncom/interface/lonfeedback.pm between versions 1.202 and 1.204

version 1.202, 2006/05/10 22:29:57 version 1.204, 2006/05/30 12:46:09
Line 43  use Apache::lonrss(); Line 43  use Apache::lonrss();
 use HTML::LCParser();  use HTML::LCParser();
 use Apache::lonspeller();  use Apache::lonspeller();
 use Cwd;  use Cwd;
   use lib '/home/httpd/lib/perl/';
   use LONCAPA;
   
 sub discussion_open {  sub discussion_open {
     my ($status,$symb)=@_;      my ($status,$symb)=@_;
Line 394  imscp_v1p1.xsd http://www.imsglobal.org/ Line 396  imscp_v1p1.xsd http://www.imsglobal.org/
     $discussion.='<form name="readchoices" method="post" action="/adm/feedback?chgreads='.$ressymb.'" ><table bgcolor="#AAAAAA" cellpadding="2" cellspacing="2" border="0">';      $discussion.='<form name="readchoices" method="post" action="/adm/feedback?chgreads='.$ressymb.'" ><table bgcolor="#AAAAAA" cellpadding="2" cellspacing="2" border="0">';
     $discussion .='<tr><td bgcolor="#DDDDBB" colspan="'.$colspan.'">'.      $discussion .='<tr><td bgcolor="#DDDDBB" colspan="'.$colspan.'">'.
  '<table border="0" width="100%" bgcolor="#DDDDBB"><tr>';   '<table border="0" width="100%" bgcolor="#DDDDBB"><tr>';
     my $escsymb=&Apache::lonnet::escape($ressymb);      my $escsymb=&escape($ressymb);
     if ($visible>2) {      if ($visible>2) {
  $discussion.='<td align="left">'.   $discussion.='<td align="left">'.
     '<a href="/adm/feedback?cmd=threadedon&amp;symb='.$escsymb;      '<a href="/adm/feedback?cmd=threadedon&amp;symb='.$escsymb;
Line 694  END Line 696  END
         my $subject = '';          my $subject = '';
         if ($env{'form.origpage'}) {          if ($env{'form.origpage'}) {
             &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['addnewattach','deloldattach','delnewattach','timestamp','idx','subject','comment']);              &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['addnewattach','deloldattach','delnewattach','timestamp','idx','subject','comment']);
             $subject = &Apache::lonnet::unescape($env{'form.subject'});              $subject = &unescape($env{'form.subject'});
             $comment = &Apache::lonnet::unescape($env{'form.comment'});              $comment = &unescape($env{'form.comment'});
             my @keepold = ();              my @keepold = ();
             &process_attachments(\@currnewattach,\@currdelold,\@keepold);              &process_attachments(\@currnewattach,\@currdelold,\@keepold);
             if (@currnewattach > 0) {              if (@currnewattach > 0) {
Line 751  ENDDISCUSS Line 753  ENDDISCUSS
         ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {          ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) {
     if ($outputtarget ne 'tex') {      if ($outputtarget ne 'tex') {
  $discussion.='<a href="/adm/feedback?replydisc='.   $discussion.='<a href="/adm/feedback?replydisc='.
     &Apache::lonnet::escape($ressymb).':::" '.$target.'>'.      &escape($ressymb).':::" '.$target.'>'.
     '<img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif').'" border="0" />'.      '<img 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&symb='.
     &Apache::lonnet::escape($ressymb).      &escape($ressymb).
     '"><img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/feedback.gif').'" border="0" />'.      '"><img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/feedback.gif').'" border="0" />'.
     &mt('Send Message').'</td></tr></table>';      &mt('Send Message').'</td></tr></table>';
     }      }
Line 769  sub build_posting_display { Line 771  sub build_posting_display {
     my @original=();      my @original=();
     my @index=();      my @index=();
     my $symb=&Apache::lonenc::check_decrypt($ressymb);      my $symb=&Apache::lonenc::check_decrypt($ressymb);
     my $escsymb=&Apache::lonnet::escape($ressymb);      my $escsymb=&escape($ressymb);
     my %contrib=&Apache::lonnet::restore($symb,$env{'request.course.id'},      my %contrib=&Apache::lonnet::restore($symb,$env{'request.course.id'},
   $env{'course.'.$env{'request.course.id'}.'.domain'},    $env{'course.'.$env{'request.course.id'}.'.domain'},
   $env{'course.'.$env{'request.course.id'}.'.num'});    $env{'course.'.$env{'request.course.id'}.'.num'});
Line 1419  END Line 1421  END
                   $parentmsg = $contrib{$idx.':replyto'};                    $parentmsg = $contrib{$idx.':replyto'};
               }                }
               unless (exists($env{'form.origpage'})) {                unless (exists($env{'form.origpage'})) {
                   my $anonflag = 0;                    my $anonflag = 'nonanon';
                   if ($contrib{$idx.':anonymous'}) {                    if ($contrib{$idx.':anonymous'}) {
                       $anonflag = 1;                        $anonflag = 'anon';
                   }                    }
                   $anonscript = (<<END);                    $anonscript = (<<END);
   function setposttype () {    function setposttype () {
       var currtype = $anonflag        var currtype = "$anonflag";
       if (currtype == 1) {        for (var i=0; i<document.mailform.discuss.length; i++) {
           document.mailform.elements.discuss.value = 'anon'    if (document.mailform.elements.discuss[i].value == currtype ) {
       }        document.mailform.elements.discuss[i].checked=1;
       if (currtype == 0) {    } 
           document.mailform.elements.discuss.value = 'nonanon'  
       }        }
       return        return
   }    }
Line 1444  END Line 1445  END
   }    }
   
   if ($env{'form.origpage'}) {    if ($env{'form.origpage'}) {
       $subject = &Apache::lonnet::unescape($env{'form.subject'});        $subject = &unescape($env{'form.subject'});
       $comment = &Apache::lonnet::unescape($env{'form.comment'});        $comment = &unescape($env{'form.comment'});
       &process_attachments(\@currnewattach,\@currdelold,\@keepold);        &process_attachments(\@currnewattach,\@currdelold,\@keepold);
   }    }
   my $latexHelp=&Apache::loncommon::helpLatexCheatsheet();    my $latexHelp=&Apache::loncommon::helpLatexCheatsheet();
Line 1456  END Line 1457  END
     function gosubmit() {      function gosubmit() {
         var rec=0;          var rec=0;
         if (typeof(document.mailform.elements.discuss)!="undefined") {          if (typeof(document.mailform.elements.discuss)!="undefined") {
     if (typeof(document.mailform.discuss.length) == "undefined") {      if (typeof(document.mailform.elements.discuss.length) == "undefined") {
  if (document.mailform.discuss.checked ) {   if (document.mailform.elements.discuss.checked ) {
     rec=1;      rec=1;
  }   }
     } else {      } else {
  for (var i=0; i<document.mailform.discuss.length; i++) {   for (var i=0; i<document.mailform.elements.discuss.length; i++) {
     if (document.mailform.discuss[i].checked ) {      if (document.mailform.elements.discuss[i].checked ) {
  rec=1;   rec=1;
     }       } 
  }   }
     }      }
  }   }
         if (typeof(document.mailform.elements.blog)!="undefined") {          if (typeof(document.mailform.elements.blog)!="undefined") {
           if (document.mailform.blog.checked) {            if (document.mailform.elements.blog.checked) {
              rec=1;               rec=1;
           }             } 
         }          }
Line 2660  ENDPREVIEW Line 2661  ENDPREVIEW
   
 sub modify_attachments {  sub modify_attachments {
     my ($r,$currnewattach,$currdelold,$symb,$idx,$attachmenturls)=@_;      my ($r,$currnewattach,$currdelold,$symb,$idx,$attachmenturls)=@_;
     my $orig_subject = &Apache::lonnet::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;
     $subject=&Apache::lontexconvert::msgtexconverted($subject);      $subject=&Apache::lontexconvert::msgtexconverted($subject);

Removed from v.1.202  
changed lines
  Added in v.1.204


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