Diff for /loncom/interface/lonfeedback.pm between versions 1.196 and 1.206

version 1.196, 2006/05/08 22:12:29 version 1.206, 2006/06/29 22:20:22
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 726  ENDDISCUSS Line 728  ENDDISCUSS
             if ($outputtarget ne 'tex') {              if ($outputtarget ne 'tex') {
                 $discussion.=&generate_attachments_button('',$attachnum,$ressymb,$now,\@currnewattach,\@currdelold,'',$mode);                  $discussion.=&generate_attachments_button('',$attachnum,$ressymb,$now,\@currnewattach,\@currdelold,'',$mode);
                 if (@currnewattach > 0) {                  if (@currnewattach > 0) {
                     $newattachmsg .= '<b>New attachments</b><br />';                      $newattachmsg .= '<br /><b>New attachments</b><br />';
                     if (@currnewattach > 1) {                      if (@currnewattach > 1) {
                         $newattachmsg .= '<ol>';                          $newattachmsg .= '<ol>';
                         foreach my $item (@currnewattach) {                          foreach my $item (@currnewattach) {
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').'</a></td></tr></table>';
     }      }
     return $discussion;      return $discussion;
 }  }
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 1328  sub mail_screen { Line 1330  sub mail_screen {
   my $attachnum = 0;    my $attachnum = 0;
   my $anonchk = (<<END);    my $anonchk = (<<END);
   function anonchk() {    function anonchk() {
      if (document.mailform.anondiscuss.checked == true) {        for (var i=0; i < document.mailform.discuss.length; i++) {
           document.attachment.anondiscuss.value = '1'    if (document.mailform.discuss[i].checked) {
      }        document.attachment.discuss.value = 
      if (document.mailform.discuss.checked == true) {    document.mailform.discuss[i].value;
           document.attachment.discuss.value = '1'    }
      }        }
         if (document.mailform.blog.checked) {
     document.attachment.blog.value = 1;
         }
      return       return
    }     }
 END  END
Line 1341  END Line 1346  END
   if (exists($env{'form.origpage'})) {    if (exists($env{'form.origpage'})) {
       $anonscript = (<<END);        $anonscript = (<<END);
   function setposttype() {    function setposttype() {
       var anondisc = $env{'form.anondiscuss'};        var disc = "$env{'form.discuss'}";
       var disc = $env{'form.discuss'};        for (var i=0; i < document.mailform.discuss.length; i++) {
       if (anondisc == 1) {    if (disc == document.mailform.discuss[i].value) {
           document.mailform.anondiscuss.checked = true        document.mailform.discuss[i].checked = 1;
     }
       }        }
       if (disc == 1) {        var blog = "$env{'form.blog'}";
           document.mailform.discuss.checked = true        if (blog == 1) {
             document.mailform.blog.checked=1;
       }        }
       return        return
   }    }
Line 1414  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.checked = false    if (document.mailform.elements.discuss[i].value == currtype ) {
           document.mailform.elements.anondiscuss.checked = true        document.mailform.elements.discuss[i].checked=1;
       }    } 
       if (currtype == 0) {  
           document.mailform.elements.anondiscuss.checked = false  
           document.mailform.elements.discuss.checked = true  
       }        }
       return        return
   }    }
Line 1441  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 1452  END Line 1456  END
 //<!--  //<!--
     function gosubmit() {      function gosubmit() {
         var rec=0;          var rec=0;
         if (typeof(document.mailform.elements.author)!="undefined") {  
           if (document.mailform.elements.author.checked) {  
              rec=1;  
           }   
         }  
         if (typeof(document.mailform.elements.question)!="undefined") {  
           if (document.mailform.elements.question.checked) {  
              rec=1;  
           }   
         }  
         if (typeof(document.mailform.elements.course)!="undefined") {  
           if (document.mailform.elements.course.checked) {  
              rec=1;  
           }   
         }  
         if (typeof(document.mailform.elements.policy)!="undefined") {  
           if (document.mailform.elements.policy.checked) {  
              rec=1;  
           }   
         }  
         if (typeof(document.mailform.elements.discuss)!="undefined") {          if (typeof(document.mailform.elements.discuss)!="undefined") {
           if (document.mailform.elements.discuss.checked) {      if (typeof(document.mailform.elements.discuss.length) == "undefined") {
              rec=1;   if (document.mailform.elements.discuss.checked ) {
           }       rec=1;
         }   }
         if (typeof(document.mailform.elements.anondiscuss)!="undefined") {      } else {
           if (document.mailform.elements.anondiscuss.checked) {   for (var i=0; i<document.mailform.elements.discuss.length; i++) {
              rec=1;      if (document.mailform.elements.discuss[i].checked ) {
           }    rec=1;
         }      } 
    }
       }
    }
         if (typeof(document.mailform.elements.blog)!="undefined") {          if (typeof(document.mailform.elements.blog)!="undefined") {
           if (document.mailform.elements.blog.checked) {            if (document.mailform.elements.blog.checked) {
              rec=1;               rec=1;
Line 1494  END Line 1481  END
     }      }
     document.mailform.submit();      document.mailform.submit();
         } else {          } else {
             alert('Please check a feedback type.');              alert('Please select a feedback type.');
  }   }
     }      }
     $anonchk      $anonchk
Line 1583  END Line 1570  END
         $r->print(&generate_attachments_button($postidx,$attachnum,$ressymb,$now,\@currnewattach,\@currdelold,$numoldver));          $r->print(&generate_attachments_button($postidx,$attachnum,$ressymb,$now,\@currnewattach,\@currdelold,$numoldver));
         if ($attachnum > 0) {          if ($attachnum > 0) {
             if (@currnewattach > 0) {              if (@currnewattach > 0) {
                 $newattachmsg .= '<b>New attachments</b><br />';                  $newattachmsg .= '<br /><b>New attachments</b><br />';
                 if (@currnewattach > 1) {                  if (@currnewattach > 1) {
                     $newattachmsg .= '<ol>';                      $newattachmsg .= '<ol>';
                     foreach my $item (@currnewattach) {                      foreach my $item (@currnewattach) {
Line 1817  sub print_sortfilter_options { Line 1804  sub print_sortfilter_options {
     $r->send_http_header;      $r->send_http_header;
   
     &Apache::lonenc::check_encrypt(\$symb);      &Apache::lonenc::check_encrypt(\$symb);
     my @sections = ();      my @sections;
     my $section_sel = '';      my $section_sel = '';
     my $numsections = 0;  
     my $numvisible = 5;      my $numvisible = 5;
     my %sectioncount = ();      my %sectioncount = &Apache::loncommon::get_sections();
   
     $numsections = &Apache::loncommon::get_sections($env{'course.'.$env{'request.course.id'}.'.domain'},$env{'course.'.$env{'request.course.id'}.'.num'},\%sectioncount);  
   
     if ($env{'request.course.sec'} !~ /^\s*$/) {  #Restrict section choice to current section       if ($env{'request.course.sec'} !~ /^\s*$/) {  #Restrict section choice to current section 
         @sections = ('all',$env{'request.course.sec'});          @sections = ('all',$env{'request.course.sec'});
         $numvisible = 2;          $numvisible = 2;
     } else {      } else {
         @sections = sort {$a cmp $b} keys(%sectioncount);          @sections = sort {$a cmp $b} keys(%sectioncount);
         unshift(@sections,'all'); # Put 'all' at the front of the list          if (scalar(@sections) < 4) {
         if ($numsections < 4) {              $numvisible = scalar(@sections) + 1;
             $numvisible = $numsections + 1;  
         }          }
           unshift(@sections,'all'); # Put 'all' at the front of the list
   
     }      }
     foreach (@sections) {      foreach (@sections) {
         $section_sel .= "  <option value=\"$_\" />$_\n";          $section_sel .= "  <option value=\"$_\" />$_\n";
Line 2206  sub redirect_back { Line 2191  sub redirect_back {
   }    }
   $feedurl=&Apache::lonenc::check_encrypt($feedurl);    $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 %onload = ('onload' => "if (window.name!='loncapaclient') { this.document.reldt.submit(); self.window.close(); }");    my %onload;
     if ($env{'environment.remote'} ne 'off') {
         $onload{'onload'} =
     "if (window.name!='loncapaclient') { this.document.reldt.submit(); self.window.close(); }";
     }
   my $start_page=    my $start_page=
       &Apache::loncommon::start_page('New posts marked as read',undef,        &Apache::loncommon::start_page('New posts marked as read',undef,
      {'redirect'    => [2,$feedurl],       {'redirect'    => [2,$feedurl],
Line 2237  sub no_redirect_back { Line 2226  sub no_redirect_back {
   my ($r,$feedurl) = @_;    my ($r,$feedurl) = @_;
   my $nofeed=&mt('Sorry, no feedback possible on this resource  ...');    my $nofeed=&mt('Sorry, no feedback possible on this resource  ...');
     
     my %onload;
     if ($env{'environment.remote'} ne 'off') {
         $onload{'onload'} = 
     "if (window.name!='loncapaclient') { self.window.close(); }";
     }
   
   my %body_options = ('only_body'   => 1,    my %body_options = ('only_body'   => 1,
       'bgcolor'     => '#FFFFFF',        'bgcolor'     => '#FFFFFF',
       'add_entries' => {'onload' => "if (window.name!='loncapaclient') { self.window.close(); }"});        'add_entries' => \%onload,);
   
   if ($feedurl !~ m{^/adm/feedback}) {     if ($feedurl !~ m{^/adm/feedback}) { 
       $body_options{'rediect'} = [2,$feedurl];        $body_options{'rediect'} = [2,$feedurl];
Line 2268  sub screen_header { Line 2263  sub screen_header {
     unless (($env{'form.replydisc'}) || ($env{'form.editdisc'})) {      unless (($env{'form.replydisc'}) || ($env{'form.editdisc'})) {
  if (($feedurl=~/^\/res\//) && ($feedurl!~/^\/res\/adm/) && ($env{'user.adv'})) {   if (($feedurl=~/^\/res\//) && ($feedurl!~/^\/res\/adm/) && ($env{'user.adv'})) {
     $msgoptions=       $msgoptions= 
  '<p><label><input type="checkbox" name="author" /> '.   '<p><label><input type="radio" name="discuss" value="author" /> '.
  &mt('Feedback to resource author').'</label></p>';   &mt('Feedback to resource author').'</label></p>';
  }   }
  if (&feedback_available(1)) {   if (&feedback_available(1)) {
     $msgoptions.=      $msgoptions.=
  '<p><label><input type="checkbox" name="question" /> '.   '<p><label><input type="radio" name="discuss" value="question" /> '.
  &mt('Question about resource content').'</label></p>';   &mt('Question about resource content').'</label></p>';
  }   }
  if (&feedback_available(0,1)) {   if (&feedback_available(0,1)) {
     $msgoptions.=      $msgoptions.=
  '<p><label><input type="checkbox" name="course" /> '.   '<p><label><input type="radio" name="discuss" value="course" /> '.
  &mt('Question/Comment/Feedback about course content').   &mt('Question/Comment/Feedback about course content').
  '</label></p>';   '</label></p>';
  }   }
  if (&feedback_available(0,0,1)) {   if (&feedback_available(0,0,1)) {
     $msgoptions.=      $msgoptions.=
  '<p><label><input type="checkbox" name="policy" /> '.   '<p><label><input type="radio" name="discuss" value="policy" /> '.
  &mt('Question/Comment/Feedback about course policy').   &mt('Question/Comment/Feedback about course policy').
  '</label></p>';   '</label></p>';
  }   }
Line 2294  sub screen_header { Line 2289  sub screen_header {
     &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'}:''))) {
     $discussoptions='<label><input type="checkbox" name="discuss" onClick="this.form.anondiscuss.checked=false;" '.      $discussoptions='<label><input type="radio" name="discuss" value="nonanon" checked="checked" /> '.
  ($env{'form.replydisc'}?' checked="1"':'').' /> '.  
  &mt('Contribution to course discussion of resource');   &mt('Contribution to course discussion of resource');
     $discussoptions.='</label><br /><label><input type="checkbox" name="anondiscuss" onClick="this.form.discuss.checked=false;" /> '.      $discussoptions.='</label><br /><label><input type="radio" name="discuss" value="anon" /> '.
  &mt('Anonymous contribution to course discussion of resource').   &mt('Anonymous contribution to course discussion of resource').
  ' <i>('.&mt('name only visible to course faculty').')</i></label> '.   ' <i>('.&mt('name only visible to course faculty').')</i></label> '.
  '<a href="/adm/preferences?action=changescreenname">'.&mt('Change Screenname').'</a>';   '<a href="/adm/preferences?action=changescreenname">'.&mt('Change Screenname').'</a>';
Line 2421  sub decide_receiver { Line 2415  sub decide_receiver {
   my ($feedurl,$author,$question,$course,$policy,$defaultflag) = @_;    my ($feedurl,$author,$question,$course,$policy,$defaultflag) = @_;
   my $typestyle='';    my $typestyle='';
   my %to=();    my %to=();
   if ($env{'form.author'}||$author) {    if ($env{'form.discuss'} eq 'author' ||$author) {
     $typestyle.='Submitting as Author Feedback<br />';      $typestyle.='Submitting as Author Feedback<br />';
     $feedurl=~/^\/res\/(\w+)\/(\w+)\//;      $feedurl=~/^\/res\/(\w+)\/(\w+)\//;
     $to{$2.':'.$1}=1;      $to{$2.':'.$1}=1;
   }    }
   if ($env{'form.question'}||$question) {    if ($env{'form.discuss'} eq 'question' ||$question) {
     $typestyle.='Submitting as Question<br />';      $typestyle.=&mt('Submitting as Question').'<br />';
     foreach (split(/\,/,      foreach (split(/\,/,
    $env{'course.'.$env{'request.course.id'}.'.question.email'})     $env{'course.'.$env{'request.course.id'}.'.question.email'})
      ) {       ) {
Line 2435  sub decide_receiver { Line 2429  sub decide_receiver {
         if ($rec) { $to{$rec}=1; }          if ($rec) { $to{$rec}=1; }
     }       } 
   }    }
   if ($env{'form.course'}||$course) {    if ($env{'form.discuss'} eq 'course' ||$course) {
     $typestyle.='Submitting as Comment<br />';      $typestyle.=&mt('Submitting as Comment').'<br />';
     foreach (split(/\,/,      foreach (split(/\,/,
    $env{'course.'.$env{'request.course.id'}.'.comment.email'})     $env{'course.'.$env{'request.course.id'}.'.comment.email'})
      ) {       ) {
Line 2444  sub decide_receiver { Line 2438  sub decide_receiver {
         if ($rec) { $to{$rec}=1; }          if ($rec) { $to{$rec}=1; }
     }       } 
   }    }
   if ($env{'form.policy'}||$policy) {    if ($env{'form.discuss'} eq 'policy' ||$policy) {
     $typestyle.='Submitting as Policy Feedback<br />';      $typestyle.=&mt('Submitting as Policy Feedback').'<br />';
     foreach (split(/\,/,      foreach (split(/\,/,
    $env{'course.'.$env{'request.course.id'}.'.policy.email'})     $env{'course.'.$env{'request.course.id'}.'.policy.email'})
      ) {       ) {
Line 2656  sub generate_preview_button { Line 2650  sub generate_preview_button {
     unless ($fieldname) { $fieldname='comment'; }      unless ($fieldname) { $fieldname='comment'; }
     my $pre=&mt("Show Preview and Check Spelling");      my $pre=&mt("Show Preview and Check Spelling");
     return(<<ENDPREVIEW);      return(<<ENDPREVIEW);
   <br />
 <form name="preview" action="/adm/feedback?preview=1" method="post" target="preview">  <form name="preview" action="/adm/feedback?preview=1" method="post" target="preview">
 <input type="hidden" name="subject">  <input type="hidden" name="subject">
 <input type="hidden" name="comment" />  <input type="hidden" name="comment" />
Line 2667  ENDPREVIEW Line 2662  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);
Line 2696  END Line 2691  END
  &Apache::loncommon::end_page();   &Apache::loncommon::end_page();
                 
     $r->print(<<END);      $r->print(<<END);
   $start_page
 <form name="modattachments" method="post" enctype="multipart/form-data" action="/adm/feedback?attach=$symb">  <form name="modattachments" method="post" enctype="multipart/form-data" action="/adm/feedback?attach=$symb">
  <table border="2">   <table border="2">
   <tr>    <tr>
Line 2735  END Line 2731  END
 <input type="hidden" name="idx" value="$env{'form.idx'}" />  <input type="hidden" name="idx" value="$env{'form.idx'}" />
 <input type="hidden" name="numoldver" value="$env{'form.numoldver'}" />  <input type="hidden" name="numoldver" value="$env{'form.numoldver'}" />
 <input type="hidden" name="origpage" value="$env{'form.origpage'}" />  <input type="hidden" name="origpage" value="$env{'form.origpage'}" />
 <input type="hidden" name="anondiscuss" value="$env{'form.anondiscuss'}" />  
 <input type="hidden" name="blog" value="$env{'form.blog'}" />  <input type="hidden" name="blog" value="$env{'form.blog'}" />
 <input type="hidden" name="discuss" value="$env{'form.discuss'}" />  <input type="hidden" name="discuss" value="$env{'form.discuss'}" />
 END  END
Line 2786  sub generate_attachments_button { Line 2781  sub generate_attachments_button {
     my $origpage = $ENV{'REQUEST_URI'};      my $origpage = $ENV{'REQUEST_URI'};
     my $att=$attachnum.' '.&mt("attachments");      my $att=$attachnum.' '.&mt("attachments");
     my $response = (<<END);      my $response = (<<END);
   <br />
 <form name="attachment" action="/adm/feedback?attach=$ressymb" method="post">  <form name="attachment" action="/adm/feedback?attach=$ressymb" method="post">
 Click to add/remove attachments:&nbsp;<input type="button" value="$att"  Click to add/remove attachments:&nbsp;<input type="button" value="$att"
 onClick="if (typeof(document.mailform.onsubmit)=='function') {document.mailform.onsubmit();};this.form.comment.value=escape(document.mailform.comment.value);this.form.subject.value=escape(document.mailform.subject.value);  onClick="if (typeof(document.mailform.onsubmit)=='function') {document.mailform.onsubmit();};this.form.comment.value=escape(document.mailform.comment.value);this.form.subject.value=escape(document.mailform.subject.value);
Line 2801  this.form.submit();" /> Line 2797  this.form.submit();" />
 <input type="hidden" name="subject" />  <input type="hidden" name="subject" />
 <input type="hidden" name="comment" />  <input type="hidden" name="comment" />
 <input type="hidden" name="blog" value = "0" />  <input type="hidden" name="blog" value = "0" />
 <input type="hidden" name="anondiscuss" value = "0" />  
 <input type="hidden" name="discuss" value = "0" />  <input type="hidden" name="discuss" value = "0" />
 <input type="hidden" name="numoldver" value="$numoldver" />  <input type="hidden" name="numoldver" value="$numoldver" />
 ENDATTACH  ENDATTACH
Line 3113  sub handler { Line 3108  sub handler {
       &Apache::loncommon::content_type($r,'text/html');        &Apache::loncommon::content_type($r,'text/html');
       $r->send_http_header;        $r->send_http_header;
       my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');        my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');
       my %onload = ('onload' => "if (window.name!='loncapaclient') { this.document.reldt.submit(); self.window.close(); }");        my %onload;
         if ($env{'environment.remote'} ne 'off') {
     $onload{'onload'} =
         "if (window.name!='loncapaclient') { this.document.reldt.submit(); self.window.close(); }";
         }
   
       my $start_page=        my $start_page=
   &Apache::loncommon::start_page('New posts marked as read',undef,    &Apache::loncommon::start_page('New posts marked as read',undef,
  {'redirect'    => [2,$feedurl],   {'redirect'    => [2,$feedurl],
Line 3252  ENDREDIR Line 3252  ENDREDIR
 # -------------------------------------------------------- Work on attachments  # -------------------------------------------------------- Work on attachments
       &Apache::loncommon::content_type($r,'text/html');        &Apache::loncommon::content_type($r,'text/html');
       $r->send_http_header;        $r->send_http_header;
       &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','addnewattach','delnewattach','timestamp','numoldver','idx','anondiscuss','discuss','blog']);        &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','addnewattach','delnewattach','timestamp','numoldver','idx','discuss','blog']);
       my (@currnewattach,@currdelold,@keepold);        my (@currnewattach,@currdelold,@keepold);
       &process_attachments(\@currnewattach,\@currdelold,\@keepold);        &process_attachments(\@currnewattach,\@currdelold,\@keepold);
       if (exists($env{'form.addnewattach.filename'})) {        if (exists($env{'form.addnewattach.filename'})) {
Line 3419  ENDREDIR Line 3419  ENDREDIR
 # Discussion? Store that.  # Discussion? Store that.
   
       my $numpost=0;        my $numpost=0;
       if ($env{'form.discuss'} || $env{'form.anondiscuss'}) {        if ($env{'form.discuss'} =~/^(?:non|)anon$/ 
     || $env{'form.anondiscuss'}) {
   my $subject = &clear_out_html($env{'form.subject'},undef,1);    my $subject = &clear_out_html($env{'form.subject'},undef,1);
   my $anonmode=(defined($env{'form.anondiscuss'}));    my $anonmode=($env{'form.discuss'} eq 'anon' || $env{'form.anondiscuss'} );
   $typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl,    $typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl,
   $subject);    $subject);
   $numpost++;    $numpost++;

Removed from v.1.196  
changed lines
  Added in v.1.206


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