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

version 1.219, 2006/11/28 22:27:56 version 1.220, 2006/11/29 03:23:02
Line 291  sub list_discussion { Line 291  sub list_discussion {
         'disp' => 'Display',          'disp' => 'Display',
         'nolo' => 'Not new',          'nolo' => 'Not new',
         'togg' => 'Toggle read/unread',          'togg' => 'Toggle read/unread',
           'aner' => 'An error occurred opening the manifest file.',
           'difo' => 'Discussion for',
           'aerr' => 'An error occurred opening the export file for posting',
           'aysu' => 'Are you sure you want to delete this post?',
           'dpwn' => 'Deleted posts will no longer be visible to you and other students',
           'bwco' => 'but will continue to be visible to your instructor',
           'depo' => 'Deleted posts will no longer be visible to you or anyone else.',
     );      );
   
     my $currdisp = $lt{'allposts'};      my $currdisp = $lt{'allposts'};
Line 385  identifier="MANIFEST-$ressymb" xsi:schem Line 392  identifier="MANIFEST-$ressymb" xsi:schem
 imscp_v1p1.xsd http://www.imsglobal.org/xsd/imsmd_v1p2 imsmd_v1p2p2.xsd">  imscp_v1p1.xsd http://www.imsglobal.org/xsd/imsmd_v1p2 imsmd_v1p2p2.xsd">
   <organizations default="$ressymb">    <organizations default="$ressymb">
     <organization identifier="$ressymb">      <organization identifier="$ressymb">
       <title>Discussion for $ressymb</title>\n|;        <title>$lt{'difo'} $ressymb</title>\n|;
             } else {              } else {
                 $discussion .= 'An error occurred opening the manifest file.<br />';                  $discussion .= $lt{'aner'}.'<br />';
             }              }
  } else {   } else {
             my $colspan=$maxdepth+1;              my $colspan=$maxdepth+1;
Line 400  imscp_v1p1.xsd http://www.imsglobal.org/ Line 407  imscp_v1p1.xsd http://www.imsglobal.org/
            prevparm = "&previous="+previous             prevparm = "&previous="+previous
        }         }
        if (caller == 'studentdelete') {         if (caller == 'studentdelete') {
            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 (confirm("$lt{'aysu'}\\n$lt{'dpwn'},\\n$lt{'bwco'}")) {
                document.location.href = "/adm/feedback?hide="+symbparm+prevparm+groupparm                 document.location.href = "/adm/feedback?hide="+symbparm+prevparm+groupparm
            }             }
        } else {         } else {
            if (caller == 'seeiddelete') {             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")) {                 if (confirm("$lt{'aysu'}\\n$lt{'depo'}")) {
                    document.location.href = "/adm/feedback?deldisc="+symbparm+prevparm+groupparm                     document.location.href = "/adm/feedback?deldisc="+symbparm+prevparm+groupparm
                }                 }
            }             }
Line 463  imscp_v1p1.xsd http://www.imsglobal.org/ Line 470  imscp_v1p1.xsd http://www.imsglobal.org/
     }      }
     $discussion .= '</tr></table></td></tr>';      $discussion .= '</tr></table></td></tr>';
   
             my $numhidden = keys %notshown;              my $numhidden = keys(%notshown);
             if ($numhidden > 0) {              if ($numhidden > 0) {
                 my $colspan = $maxdepth+1;                  my $colspan = $maxdepth+1;
                 $discussion.="\n".'<tr><td bgcolor="#CCCCCC" colspan="'.$colspan.'">'.                  $discussion.="\n".'<tr><td bgcolor="#CCCCCC" colspan="'.$colspan.'">'.
Line 567  imscp_v1p1.xsd http://www.imsglobal.org/ Line 574  imscp_v1p1.xsd http://www.imsglobal.org/
                                            $imsitems{$alldiscussion{$_}}{'attach'}.'</body></html>'."\n";                                              $imsitems{$alldiscussion{$_}}{'attach'}.'</body></html>'."\n"; 
                         close($postingfile);                          close($postingfile);
                     } else {                      } else {
                         $discussion .= 'An error occurred opening the export file for posting '.$alldiscussion{$_}.'<br />';                          $discussion .= $lt{'aerr'}.' '.$alldiscussion{$_}.'<br />';
                     }                      }
                     $copyresult.=&replicate_attachments($imsitems{$alldiscussion{$_}}{'allattachments'},$tempexport);                      $copyresult.=&replicate_attachments($imsitems{$alldiscussion{$_}}{'allattachments'},$tempexport);
                 } else {                  } else {
Line 627  END Line 634  END
                     $discussion .= &mt('Posts by').':';                      $discussion .= &mt('Posts by').':';
                     if ($totposters > 0) {                      if ($totposters > 0) {
                         foreach my $poster (@posters) {                          foreach my $poster (@posters) {
                             $poster =~ s/:/\@/;  
                             $discussion .= ' '.$poster.',';                              $discussion .= ' '.$poster.',';
                         }                          }
                         $discussion =~ s/,$//;                          $discussion =~ s/,$//;
Line 708  END Line 714  END
                     open(OUTPUT, "zip -r $imszip *  2> /dev/null |");                      open(OUTPUT, "zip -r $imszip *  2> /dev/null |");
                     close(OUTPUT);                      close(OUTPUT);
                     chdir $cwd;                      chdir $cwd;
                     $discussion .= 'Download the zip file from <a href="'.$imszipfile.'">Discussion Posting Archive</a><br />';                      $discussion .= &mt('Download the zip file from [_1]Discussion Posting Archive','<a href="'.$imszipfile.'">').'</a><br />';
                     if ($copyresult) {                      if ($copyresult) {
                         $discussion .= 'The following errors occurred during export - <br />'.$copyresult;                          $discussion .= &mt('The following errors occurred during export').' - <br />'.$copyresult;
                     }                      }
                 }                  }
             } else {              } else {
                 $discussion .= '<br />Unfortunately you will not be able to retrieve an archive of the discussion posts at this time, because there was a problem creating a manifest file.<br />';                  $discussion .= '<br />'.&mt('Unfortunately you will not be able to retrieve an archive of the discussion posts at this time, because there was a problem creating a manifest file.').'<br />';
             }              }
             return $discussion;              return $discussion;
         }          }
Line 777  sub postingform_display { Line 783  sub postingform_display {
     my ($mode,$ressymb,$now,$subject,$comment,$outputtarget,$attachnum,      my ($mode,$ressymb,$now,$subject,$comment,$outputtarget,$attachnum,
         $currnewattach,$currdelold,$group) = @_;          $currnewattach,$currdelold,$group) = @_;
     my $newattachmsg;      my $newattachmsg;
       my %lt = &Apache::lonlocal::texthash(
                 'note' => 'Note: in anonymous discussion, your name is visible only to course faculty',
                'title' => 'Title',
                'podi' => 'Post Discussion',
                'poan' => 'Post Anonymous Discussion',
                'newa' => 'New attachments',
       );
     my $postingform = (<<ENDDISCUSS);      my $postingform = (<<ENDDISCUSS);
 <form action="/adm/feedback" method="post" name="mailform" enctype="multipart/form-data"> <input type="submit" name="discuss" value="Post Discussion" />  <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="Post Anonymous Discussion" /> <input type="hidden" name="symb" value="$ressymb" />  <input type="submit" name="anondiscuss" value="$lt{'poan'}" /> <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" />
 <br /><a name="newpost"></a>  <br /><a name="newpost"></a>
 <font size="1">Note: in anonymous discussion, your name is visible only  <font size="1">$lt{'note'}</font><br />
 to course faculty</font><br />  <b>$lt{'title'}:</b>&nbsp;<input type="text" name="subject" value="$subject" size="30" /><br /><br />
 <b>Title:</b>&nbsp;<input type="text" name="subject" value="$subject" size="30" /><br /><br />  
 <textarea name="comment" cols="80" rows="14" wrap="hard">$comment</textarea>  <textarea name="comment" cols="80" rows="14" wrap="hard">$comment</textarea>
 ENDDISCUSS  ENDDISCUSS
     if ($env{'form.origpage'}) {      if ($env{'form.origpage'}) {
Line 809  ENDDISCUSS Line 821  ENDDISCUSS
                                                      $now,$currnewattach,                                                       $now,$currnewattach,
                                                      $currdelold,'',$mode);                                                       $currdelold,'',$mode);
         if ((ref($currnewattach) eq 'ARRAY') && (@{$currnewattach} > 0)) {          if ((ref($currnewattach) eq 'ARRAY') && (@{$currnewattach} > 0)) {
             $newattachmsg = '<br /><b>New attachments</b><br />';              $newattachmsg = '<br /><b>'.$lt{'newa'}.'</b><br />';
             if (@{$currnewattach} > 1) {              if (@{$currnewattach} > 1) {
                 $newattachmsg .= '<ol>';                  $newattachmsg .= '<ol>';
                 foreach my $item (@{$currnewattach}) {                  foreach my $item (@{$currnewattach}) {
Line 1335  sub get_post_contents { Line 1347  sub get_post_contents {
         if ($type eq 'export') {          if ($type eq 'export') {
             $$imsfiles{$idx}{$i} = '';              $$imsfiles{$idx}{$i} = '';
             if ($attachmsg) {              if ($attachmsg) {
                 $$attachtxt{$i} = '<br />Attachments:<br />';                  $$attachtxt{$i} = '<br />'.&mt('Attachments').':<br />';
                 foreach (sort keys %currattach) {                  foreach (sort keys %currattach) {
                     if ($$allattachments{$_}{'filename'} =~ m-^/uploaded/([^/]+/[^/]+)(/feedback)?(/?\d*)/([^/]+)$-) {                      if ($$allattachments{$_}{'filename'} =~ m-^/uploaded/([^/]+/[^/]+)(/feedback)?(/?\d*)/([^/]+)$-) {
                         my $fname = $1.$3.'/'.$4;                          my $fname = $1.$3.'/'.$4;
Line 1346  sub get_post_contents { Line 1358  sub get_post_contents {
             }              }
         } else {          } else {
             if ($attachmsg) {              if ($attachmsg) {
                 $$attachtxt{$i} = '<br />Attachments:'.$attachmsg.'<br />';                  $$attachtxt{$i} = '<br />'.&mt('Attachments').':'.$attachmsg.'<br />';
             } else {              } else {
                 $$attachtxt{$i} = '';                  $$attachtxt{$i} = '';
             }              }
Line 1393  sub replicate_attachments { Line 1405  sub replicate_attachments {
                         print $attachcopy $content;                          print $attachcopy $content;
                         close($attachcopy);                          close($attachcopy);
                     } else {                      } else {
                         $response .= 'Error copying file attachment - '.$5.' to IMS package: '.$!.'<br />'."\n";                          $response .= &mt('Error copying file attachment - [_1] to IMS package',$5).': '.$!.'<br />'."\n";
                     }                      }
                 } else {                  } else {
                     &Apache::lonnet::logthis("Replication of attachment failed when building IMS export of discussion posts - domain: $1, course: $2, file: $$attachrefs{$id}{'filename'} -error: $rtncode");                      &Apache::lonnet::logthis("Replication of attachment failed when building IMS export of discussion posts - domain: $1, course: $2, file: $$attachrefs{$id}{'filename'} -error: $rtncode");
                     $response .= 'Error copying file attachment - '.$5.' to IMS package: '.$rtncode.'<br />'."\n";                      $response .= &mt('Error copying file attachment - [_1] to IMS package: ',$5).$rtncode.'<br />'."\n";
                 }                  }
             }              }
         }          }
Line 1411  sub mail_screen { Line 1423  sub mail_screen {
       &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','currnewattach','addnewattach','deloldattach','delnewattach','timestamp','idx','anondiscuss','discuss','blog','group','ref']);        &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','currnewattach','addnewattach','deloldattach','delnewattach','timestamp','idx','anondiscuss','discuss','blog','group','ref']);
   }    }
   
     my %lt = &Apache::lonlocal::texthash(
               'plch' => 'Please check at least one of the following feedback types:',
               'myqu' => 'My question/comment/feedback:',
               'title' => 'Title',
               'reta' => 'Retained attachments',
               'atta' => 'Attachment (128 KB max size)',
              ); 
   my $title=&Apache::lonnet::gettitle($feedurl);    my $title=&Apache::lonnet::gettitle($feedurl);
   if (!$title) { $title = $feedurl; }    if (!$title) { $title = $feedurl; }
   my $quote='';    my $quote='';
Line 1501  END Line 1520  END
               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);
                   $subject = 'Re: '.$subversions{$numoldver};                    $subject = &mt('Re: ')..$subversions{$numoldver};
               }                }
               $subject = &HTML::Entities::encode($subject,'<>&"');                $subject = &HTML::Entities::encode($subject,'<>&"');
           } else {            } else {
Line 1548  END Line 1567  END
   }    }
   my $latexHelp=&Apache::loncommon::helpLatexCheatsheet();    my $latexHelp=&Apache::loncommon::helpLatexCheatsheet();
   my $send=&mt('Send');    my $send=&mt('Send');
     my $alert = &mt('Please select a feedback type.');
   my $js= <<END;    my $js= <<END;
 <script type="text/javascript">  <script type="text/javascript">
 //<!--  //<!--
Line 1578  END Line 1598  END
     }      }
     document.mailform.submit();      document.mailform.submit();
         } else {          } else {
             alert('Please select a feedback type.');              alert('$alert');
  }   }
     }      }
     $anonchk      $anonchk
Line 1616  END Line 1636  END
 END  END
   }    }
   $r->print(<<END);    $r->print(<<END);
 Please check at least one of the following feedback types:  $lt{'plch'}
 $options<hr />  $options<hr />
 $quote  $quote
 <p>My question/comment/feedback:</p>  <p>$lt{'myqu'}</p>
 <p>  <p>
 $latexHelp  $latexHelp
 Title: <input type="text" name="subject" size="30" value="$subject" /></p>  $lt{'title'}: <input type="text" name="subject" size="30" value="$subject" /></p>
 <p>  <p>
 <textarea name="comment" id="comment" cols="60" rows="10" wrap="hard">$comment  <textarea name="comment" id="comment" cols="60" rows="10" wrap="hard">$comment
 </textarea></p>  </textarea></p>
Line 1648  END Line 1668  END
         }          }
     } else {      } else {
         $r->print(<<END);          $r->print(<<END);
 Attachment (128 KB max size): <input type="file" name="attachment" />  $lt{'atta'}: <input type="file" name="attachment" />
 </p>  </p>
 END  END
     }      }
Line 1678  END Line 1698  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 .= '<br /><b>New attachments</b><br />';                  $newattachmsg .= '<br /><b>'.&mt('New attachments').'</b><br />';
                 if (@currnewattach > 1) {                  if (@currnewattach > 1) {
                     $newattachmsg .= '<ol>';                      $newattachmsg .= '<ol>';
                     foreach my $item (@currnewattach) {                      foreach my $item (@currnewattach) {
Line 1692  END Line 1712  END
                 }                  }
             }              }
             if ($attachmsg) {              if ($attachmsg) {
                 $r->print("<br /><b>Retained attachments</b>:$attachmsg<br />\n");                  $r->print("<br /><b>$lt{'reta'}</b>:$attachmsg<br />\n");
             }              }
             if ($newattachmsg) {              if ($newattachmsg) {
                 $r->print("$newattachmsg<br />");                  $r->print("$newattachmsg<br />");
Line 1983  sub print_sortfilter_options { Line 2003  sub print_sortfilter_options {
         'spse' => 'Specific sections',          'spse' => 'Specific sections',
         'spgr' => 'Specific groups',          'spgr' => 'Specific groups',
         'psub' => 'Pick specific users (by name)',          'psub' => 'Pick specific users (by name)',
         'shal' => 'Show a list of current posters'          'shal' => 'Show a list of current posters',
           'stor' => 'Store changes',
     );      );
   
     my %sort_types = ();      my %sort_types = ();
Line 2105  $start_page Line 2126  $start_page
 <br />  <br />
 <input type="hidden" name="previous" value="$previous" />  <input type="hidden" name="previous" value="$previous" />
 <input type="hidden" name="applysort" value="$symb" />  <input type="hidden" name="applysort" value="$symb" />
 <input type="button" name="sub" value="Store Changes" onClick="verifyFilter()" />  <input type="button" name="sub" value="$lt{'stor'}" onClick="verifyFilter()" />
 END  END
     if (exists($env{'form.group'})) {      if (exists($env{'form.group'})) {
         $r->print('<input type="hidden" name="group" value="'.$env{'form.group'}.'" />');          $r->print('<input type="hidden" name="group" value="'.$env{'form.group'}.'" />');
Line 2154  sub print_showposters { Line 2175  sub print_showposters {
     my %lt = &Apache::lonlocal::texthash(      my %lt = &Apache::lonlocal::texthash(
                                           sele => 'Select',                                            sele => 'Select',
                                           full => 'Fullname',                                            full => 'Fullname',
                                           usdo => 'Username/domain',                                            usdo => 'Username:domain',
                                           post => 'Posts',                                            post => 'Posts',
                                         );                                          );
     if ($contrib{'version'}) {      if ($contrib{'version'}) {
Line 2215  END Line 2236  END
                     $r->print(&Apache::loncommon::start_data_table_row().                      $r->print(&Apache::loncommon::start_data_table_row().
       '<td align="right">'.$count.'</td>        '<td align="right">'.$count.'</td>
                                <td align="center"><label><input name="stuinfo" type="checkbox" value="'.$_.'" /></td>                                 <td align="center"><label><input name="stuinfo" type="checkbox" value="'.$_.'" /></td>
                                <td>'.$last.', '.$first.' ('.$uname.','.$udom.')</label></td>                                 <td>'.$last.', '.$first.' ('.$uname.':'.$udom.')</label></td>
                                <td>'.$postcounts{$_}.'</td>'.                                 <td>'.$postcounts{$_}.'</td>'.
       &Apache::loncommon::end_data_table_row());        &Apache::loncommon::end_data_table_row());
                 }                  }
Line 2299  sub get_post_attachments { Line 2320  sub get_post_attachments {
 sub fail_redirect {  sub fail_redirect {
   my ($r,$feedurl) = @_;    my ($r,$feedurl) = @_;
   if ($feedurl=~/^\/adm\//) { $feedurl.='?register=1' };    if ($feedurl=~/^\/adm\//) { $feedurl.='?register=1' };
     my %lt = &Apache::lonlocal::texthash(
                    'sorr' => 'Sorry, no recipients  ...',
     );
   my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');    my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif');
   $r->print(&Apache::loncommon::start_page('Feedback not sent',undef,    $r->print(&Apache::loncommon::start_page('Feedback not sent',undef,
    {'redirect'  => [2,$feedurl],     {'redirect'  => [2,$feedurl],
     'only_body' => 1,}));      'only_body' => 1,}));
   $r->print(<<ENDFAILREDIR);    $r->print(<<ENDFAILREDIR);
 <img align="right" src="$logo" />  <img align="right" src="$logo" />
 <b>Sorry, no recipients  ...</b>  <b>$lt{'sorr'}</b>
 ENDFAILREDIR  ENDFAILREDIR
   $r->print(&Apache::loncommon::end_page());    $r->print(&Apache::loncommon::end_page());
 }  }
Line 2564  sub clear_out_html { Line 2588  sub clear_out_html {
   
 sub assemble_email {  sub assemble_email {
   my ($feedurl,$message,$prevattempts,$usersaw,$useranswer)=@_;    my ($feedurl,$message,$prevattempts,$usersaw,$useranswer)=@_;
     my %lt = &Apache::lonlocal::texthash(
                'prev' => 'Previous attempts of student (if applicable)',
                'orig' => 'Original screen output (if applicable)',
                'corr' => 'Correct Answer(s) (if applicable)',
     );
   my $email=<<"ENDEMAIL";    my $email=<<"ENDEMAIL";
 $message  $message
 ENDEMAIL  ENDEMAIL
     my $citations=<<"ENDCITE";      my $citations=<<"ENDCITE";
 <h2>Previous attempts of student (if applicable)</h2>  <h2>$lt{'prev'}</h2>
 $prevattempts  $prevattempts
 <br /><hr />  <br /><hr />
 <h2>Original screen output (if applicable)</h2>  <h2>$lt{'orig'}</h2>
 $usersaw  $usersaw
 <h2>Correct Answer(s) (if applicable)</h2>  <h2>$lt{'corr'}</h2>
 $useranswer  $useranswer
 ENDCITE  ENDCITE
   return ($email,$citations);    return ($email,$citations);
Line 2837  sub show_preview { Line 2866  sub show_preview {
     my $end_page = &Apache::loncommon::end_page();      my $end_page = &Apache::loncommon::end_page();
   
     $r->print($start_page.'<table border="2"><tr><td>'.      $r->print($start_page.'<table border="2"><tr><td>'.
       '<b>Subject:</b> '.$subject.'<br /><br />'.        '<b>'.&mt('Subject').':</b> '.$subject.'<br /><br />'.
       $message.'</td></tr></table>'.$end_page);        $message.'</td></tr></table>'.$end_page);
 }  }
   
Line 2882  ENDPREVIEW Line 2911  ENDPREVIEW
 sub modify_attachments {  sub modify_attachments {
     my ($r,$currnewattach,$currdelold,$symb,$idx,$attachmenturls)=@_;      my ($r,$currnewattach,$currdelold,$symb,$idx,$attachmenturls)=@_;
   
       my %lt = &Apache::lonlocal::texthash(
                  'subj' => 'Subject',
                  'thfo' => 'The following attachments were part of the most recent saved version of this posting.',
                  'chth' => 'Check the checkboxes for any you wish to remove.',
                  'thef' => 'The following attachments have been uploaded for inclusion with this posting.',
                  'adda' => 'Add a new attachment to this post.',
                  'stch' => 'Store Changes',
                );
     my $js = <<END;      my $js = <<END;
 <script type="text/javascript">  <script type="text/javascript">
  function setAction () {   function setAction () {
Line 2924  END Line 2961  END
         if ($attachmenturls) {          if ($attachmenturls) {
             my @currold = keys %currattach;              my @currold = keys %currattach;
             if (@currold > 0) {              if (@currold > 0) {
                 $r->print("The following attachments were part of the most recent saved version of this posting.<br />Check the checkboxes for any you wish to remove<br />\n");                    $r->print($lt{'thfo'}.'<br />'.$lt{'chth'}.'<br />'."\n");  
                 foreach my $id (@currold) {                  foreach my $id (@currold) {
                     my $attachurl = &HTML::Entities::decode($attachments{$id}{'filename'});                       my $attachurl = &HTML::Entities::decode($attachments{$id}{'filename'}); 
                     $attachurl =~ m#/([^/]+)$#;                      $attachurl =~ m#/([^/]+)$#;
Line 2935  END Line 2972  END
         }          }
     }      }
     if ((ref($currnewattach) eq 'ARRAY') && (@{$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($lt{'thef'}.'<br />'.$lt{'chth'}.'<br />'."\n");
         foreach (@{$currnewattach}) {          foreach (@{$currnewattach}) {
             $_ =~ m#/([^/]+)$#;              $_ =~ m#/([^/]+)$#;
             $r->print('<label><input type="checkbox" name="delnewattach" value="'.$_.'" />&nbsp;'.$1.'</label><br />'."\n");              $r->print('<label><input type="checkbox" name="delnewattach" value="'.$_.'" />&nbsp;'.$1.'</label><br />'."\n");
Line 2943  END Line 2980  END
         $r->print("<br />");           $r->print("<br />"); 
     }      }
     $r->print(<<END);      $r->print(<<END);
    Add a new attachment to this post.&nbsp;<input type="file" name="addnewattach" /><input type="button" name="upload" value="Upload" onClick="this.form.submit()" />         $lt{'adda'}&nbsp;<input type="file" name="addnewattach" /><input type="button" name="upload" value="Upload" onClick="this.form.submit()" />    
    </td>     </td>
   </tr>    </tr>
  </table>   </table>
Line 2956  END Line 2993  END
 <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
     foreach (@{$currnewattach}) {      foreach my $item (@{$currnewattach}) {
         $r->print('<input type="hidden" name="currnewattach" value="'.$_.'" />'."\n");          $r->print('<input type="hidden" name="currnewattach" value="'.$item.'" />'."\n");
     }      }
     foreach (@{$currdelold}) {      foreach my $item (@{$currdelold}) {
         $r->print('<input type="hidden" name="deloldattach" value="'.$_.'" />'."\n");          $r->print('<input type="hidden" name="deloldattach" value="'.$item.'" />'."\n");
     }      }
     $r->print(<<END);      $r->print(<<END);
  <input type="button" name="rtntoedit" value="Store Changes" onClick="setAction()"/>   <input type="button" name="rtntoedit" value="$lt{'stch'}" onClick="setAction()"/>
 </form>  </form>
 $end_page  $end_page
 END  END
Line 3002  sub generate_attachments_button { Line 3039  sub generate_attachments_button {
     my ($idx,$attachnum,$ressymb,$now,$currnewattach,$deloldattach,$numoldver,$mode) = @_;      my ($idx,$attachnum,$ressymb,$now,$currnewattach,$deloldattach,$numoldver,$mode) = @_;
     my $origpage = $ENV{'REQUEST_URI'};      my $origpage = $ENV{'REQUEST_URI'};
     my $att=$attachnum.' '.&mt("attachments");      my $att=$attachnum.' '.&mt("attachments");
       my %lt = &Apache::lonlocal::texthash(
                   'clic' => 'Click to add/remove attachments',
       ); 
     my $response = (<<END);      my $response = (<<END);
 <br />  <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"  $lt{'clic'}:&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);
 END  END
     unless ($mode eq 'board') {      unless ($mode eq 'board') {

Removed from v.1.219  
changed lines
  Added in v.1.220


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