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

version 1.209, 2006/07/18 17:20:32 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 271  sub list_discussion { Line 271  sub list_discussion {
     my $imsresources;      my $imsresources;
     my $copyresult;      my $copyresult;
   
     my $grp_arg;  
     if ($group ne '') {  
         $grp_arg = &grp_args($group);  
     }   
   
     my $function = &Apache::loncommon::get_users_function();      my $function = &Apache::loncommon::get_users_function();
     my $color = &Apache::loncommon::designparm($function.'.tabbg',      my $color = &Apache::loncommon::designparm($function.'.tabbg',
                                                     $env{'user.domain'});                                                      $env{'user.domain'});
Line 340  sub list_discussion { Line 335  sub list_discussion {
     if ($newpostsflag) {      if ($newpostsflag) {
         $chglink .= '&previous='.$prevread;          $chglink .= '&previous='.$prevread;
     }      }
     if ($group ne '') {      $chglink.=&group_args($group);
         $chglink.='&'.$grp_arg;  
     }  
   
     if ($visible) {      if ($visible) {
 # Print the discusssion  # Print the discusssion
Line 421  imscp_v1p1.xsd http://www.imsglobal.org/ Line 414  imscp_v1p1.xsd http://www.imsglobal.org/
  if ($newpostsflag) {   if ($newpostsflag) {
     $discussion .= '&previous='.$prevread;      $discussion .= '&previous='.$prevread;
  }   }
                 if ($group ne '') {   $discussion .= &group_args($group);
                     $discussion .= '&'.$grp_arg;  
                 }  
  $discussion .='">'.&mt('Threaded View').'</a>&nbsp;&nbsp;'.   $discussion .='">'.&mt('Threaded View').'</a>&nbsp;&nbsp;'.
     '<a href="/adm/feedback?cmd=threadedoff&amp;symb='.$escsymb;      '<a href="/adm/feedback?cmd=threadedoff&amp;symb='.$escsymb;
  if ($newpostsflag) {   if ($newpostsflag) {
     $discussion .= '&previous='.$prevread;      $discussion .= '&previous='.$prevread;
  }   }
                 if ($group ne '') {   $discussion .= &group_args($group);
                     $discussion .= '&amp;'.$grp_arg;  
                 }  
  $discussion .='">'.&mt('Chronological View').'</a>&nbsp;&nbsp;   $discussion .='">'.&mt('Chronological View').'</a>&nbsp;&nbsp;
                               <a href= "/adm/feedback?cmd=sortfilter&amp;symb='.$escsymb;                                <a href= "/adm/feedback?cmd=sortfilter&amp;symb='.$escsymb;
                 if ($newpostsflag) {                  if ($newpostsflag) {
                     $discussion .= '&previous='.$prevread;                      $discussion .= '&previous='.$prevread;
                 }                  }
                 if ($group ne '') {   $discussion .= &group_args($group);
                     $discussion .= '&amp;'.$grp_arg;  
                 }  
                 $discussion .='">'.&mt('Sorting/Filtering options').'</a>&nbsp;&nbsp';                  $discussion .='">'.&mt('Sorting/Filtering options').'</a>&nbsp;&nbsp';
             } else {              } else {
                 $discussion .= '<td align="left">';                  $discussion .= '<td align="left">';
Line 448  imscp_v1p1.xsd http://www.imsglobal.org/ Line 435  imscp_v1p1.xsd http://www.imsglobal.org/
             if ($newpostsflag) {              if ($newpostsflag) {
                 $discussion .= '&previous='.$prevread;                  $discussion .= '&previous='.$prevread;
             }              }
             if ($group ne '') {      $discussion .= &group_args($group);
                 $discussion .= '&amp;'.$grp_arg;  
             }  
             $discussion .= '">'.&mt('Export').'?</a>&nbsp;&nbsp;</td>';              $discussion .= '">'.&mt('Export').'?</a>&nbsp;&nbsp;</td>';
     if ($newpostsflag) {      if ($newpostsflag) {
  if (!$markondisp) {   if (!$markondisp) {
     $discussion .='<td align="right"><a href="/adm/preferences?action=changediscussions';      $discussion .='<td align="right"><a href="/adm/preferences?action=changediscussions';
                     if ($group ne '') {      $discussion .= &group_args($group);
                         $discussion .= '&amp;'.$grp_arg;  
                     }  
     $discussion .= '">'.      $discussion .= '">'.
                         &mt('Preferences on what is marked as NEW').                          &mt('Preferences on what is marked as NEW').
  '</a><br /><a href="/adm/feedback?markread=1&amp;symb='.$escsymb;   '</a><br /><a href="/adm/feedback?markread=1&amp;symb='.$escsymb;
                     if ($group ne '') {      $discussion .= &group_args($group);
                         $discussion .= '&amp;'.$grp_arg;  
                     }  
                     $discussion .= '">'.&mt('Mark NEW posts no longer new').'</a>';                      $discussion .= '">'.&mt('Mark NEW posts no longer new').'</a>';
  } else {   } else {
     $discussion .= '<td>&nbsp;</td>';      $discussion .= '<td>&nbsp;</td>';
Line 481  imscp_v1p1.xsd http://www.imsglobal.org/ Line 462  imscp_v1p1.xsd http://www.imsglobal.org/
                 if ($newpostsflag) {                  if ($newpostsflag) {
                     $discussion .= '&previous='.$prevread;                      $discussion .= '&previous='.$prevread;
                 }                  }
                 if ($group ne '') {   $discussion .= &group_args($group);
                     $discussion .= '&amp;'.$grp_arg;  
                 }  
                 $discussion .= '">'.&mt('Show all posts').'</a> '.&mt('to display').' '.                  $discussion .= '">'.&mt('Show all posts').'</a> '.&mt('to display').' '.
                          $numhidden.' ';                           $numhidden.' ';
                 if ($showunmark) {                  if ($showunmark) {
Line 734  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 731  END
             if (($group ne '') && ($mode eq 'board')) {                if (($group ne '') && ($mode eq 'board')) {  
                 if (&check_group_priv($group,'pgd') eq 'ok') {                  if (&check_group_priv($group,'pgd') eq 'ok') {
                     $discussion .=                      $discussion .=
          &postingform_display($mode,$ressymb,$now,$subject,$comment,   &postingform_display($mode,$ressymb,$now,$subject,
                               $outputtarget,$attachnum,$currnewattach,       $comment,$outputtarget,$attachnum,
                               $currdelold,$group);       $currnewattach,$currdelold,
        $group);
                 }                  }
             } else {              } else {
         $discussion.=           $discussion.= 
          &postingform_display($mode,$ressymb,$now,$subject,$comment,      &postingform_display($mode,$ressymb,$now,$subject,
                               $outputtarget,$attachnum,$currnewattach,   $comment,$outputtarget,$attachnum,
                               $currdelold);   $currnewattach,$currdelold);
             }              }
  }   }
     } else {      } else {
Line 772  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 843  sub build_posting_display { Line 823  sub build_posting_display {
     my ($usernamesort,$subjectsort,$namesort,$notshown,$newitem,$dischash,$shown,$alldiscussion,$imsitems,$imsfiles,$roleinfo,$discussionitems,$replies,$depth,$posters,$maxdepth,$visible,$newpostsflag,$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$ressymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,$rolefilter,$sectionpick,$grouppick,$classgroups,$statusfilter,$toggkey,$outputtarget,$anonhash,$anoncnt,$group) = @_;      my ($usernamesort,$subjectsort,$namesort,$notshown,$newitem,$dischash,$shown,$alldiscussion,$imsitems,$imsfiles,$roleinfo,$discussionitems,$replies,$depth,$posters,$maxdepth,$visible,$newpostsflag,$current,$status,$viewgrades,$seeid,$prevread,$sortposts,$ressymb,$target,$readkey,$showunmark,$showonlyunread,$totposters,$rolefilter,$sectionpick,$grouppick,$classgroups,$statusfilter,$toggkey,$outputtarget,$anonhash,$anoncnt,$group) = @_;
     my @original=();      my @original=();
     my @index=();      my @index=();
     my $skipgrpcheck = 0;      my $skip_group_check = 0;
     my $symb=&Apache::lonenc::check_decrypt($ressymb);      my $symb=&Apache::lonenc::check_decrypt($ressymb);
     my $escsymb=&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'});
   
     if ((@{$grouppick} == 0) || (grep/^all$/,@{$grouppick})) {      if ((@{$grouppick} == 0) || (grep(/^all$/,@{$grouppick}))) {
         $skipgrpcheck = 1;          $skip_group_check = 1;
     }      }
     if ($contrib{'version'}) {      if ($contrib{'version'}) {
         my $oldest = $contrib{'1:timestamp'};          my $oldest = $contrib{'1:timestamp'};
Line 998  sub build_posting_display { Line 978  sub build_posting_display {
                                     if ($$newpostsflag) {                                      if ($$newpostsflag) {
                                         $sender .= '&previous='.$prevread;                                          $sender .= '&previous='.$prevread;
                                     }                                      }
                                     if ($group ne '') {      $sender .= &group_args($group);
                                         $sender.='&amp;'.&grp_args($group);  
                                     }  
                                     $sender .= '" '.$target.'>'.&mt('Edit').'</a>';                                      $sender .= '" '.$target.'>'.&mt('Edit').'</a>';
                                                                           
                                     unless ($seeid) {                                      unless ($seeid) {
Line 1025  sub build_posting_display { Line 1003  sub build_posting_display {
                                     if ($$newpostsflag) {                                      if ($$newpostsflag) {
                                         $sender .= '&previous='.$prevread;                                          $sender .= '&previous='.$prevread;
                                     }                                      }
                                     if ($group ne '') {      $sender .= &group_args($group);
                                         $sender.='&amp;'.&grp_args($group);  
                                     }  
                                     $sender .= '">'.&mt('Hide').'</a>';                                      $sender .= '">'.&mt('Hide').'</a>';
         }                               }                     
         $sender.=' <a href="/adm/feedback?deldisc='.          $sender.=' <a href="/adm/feedback?deldisc='.
Line 1035  sub build_posting_display { Line 1011  sub build_posting_display {
                                 if ($$newpostsflag) {                                  if ($$newpostsflag) {
                                     $sender .= '&previous='.$prevread;                                      $sender .= '&previous='.$prevread;
                                 }                                  }
                                 if ($group ne '') {   $sender .= &group_args($group);
                                     $sender .= '&amp;'.&grp_args($group);  
                                 }  
                                 $sender .= '">'.&mt('Delete').'</a>';                                  $sender .= '">'.&mt('Delete').'</a>';
                             }                              }
         } else {          } else {
Line 1073  sub build_posting_display { Line 1047  sub build_posting_display {
                                 if ($$newpostsflag) {                                  if ($$newpostsflag) {
                                     $sender .= '&previous='.$prevread;                                      $sender .= '&previous='.$prevread;
                                 }                                  }
                                 $sender .= '&amp;'.&grp_args($group);                                  $sender .= &group_args($group);
                                 $sender .= '" '.$target.'>'.&mt('Reply').'</a>';                                  $sender .= '" '.$target.'>'.&mt('Reply').'</a>';
                             } elsif (&Apache::lonnet::allowed('pch',                               } elsif (&Apache::lonnet::allowed('pch', 
  $env{'request.course.id'}.   $env{'request.course.id'}.
Line 1167  sub build_posting_display { Line 1141  sub build_posting_display {
                                         }                                          }
                                     }                                      }
                                 }                                  }
                                 if ($$shown{$idx} && !$skipgrpcheck) {                                  if ($$shown{$idx} && !$skip_group_check) {
                                     my $showflag = 0;                                      my $showflag = 0;
                                     if (ref($$classgroups{$poster}{active}) eq 'HASH') {                                      if (ref($$classgroups{$poster}{active}) eq 'HASH') {
                                         foreach my $grp (@{$grouppick}) {                                          foreach my $grp (@{$grouppick}) {
Line 1215  sub build_posting_display { Line 1189  sub build_posting_display {
                                 $$discussionitems[$idx] .= &mt('This post has been edited by the author.');                                  $$discussionitems[$idx] .= &mt('This post has been edited by the author.');
                                 if ($seeid) {                                  if ($seeid) {
                                     $$discussionitems[$idx] .= '&nbsp;&nbsp;<a href="/adm/feedback?allversions='.$escsymb.':::'.$idx;                                      $$discussionitems[$idx] .= '&nbsp;&nbsp;<a href="/adm/feedback?allversions='.$escsymb.':::'.$idx;
                                     if ($group ne '') {      $$discussionitems[$idx] .= &group_args($group);
                                         $$discussionitems[$idx] .= '&amp;'.&grp_args($group);  
                                     }  
                                     $$discussionitems[$idx] .= '">'.&mt('Display all versions').'</a>';                                      $$discussionitems[$idx] .= '">'.&mt('Display all versions').'</a>';
                                 }                                  }
                                 $$discussionitems[$idx].='<br/>'.&mt('Earlier version(s) were posted on: ');                                  $$discussionitems[$idx].='<br/>'.&mt('Earlier version(s) were posted on: ');
Line 1514  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 1616  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 1711  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 1958  sub print_sortfilter_options { Line 1932  sub print_sortfilter_options {
         unshift(@sections,'all'); # Put 'all' at the front of the list          unshift(@sections,'all'); # Put 'all' at the front of the list
   
     }      }
     foreach (@sections) {      foreach my $sec (@sections) {
         $section_sel .= "  <option value=\"$_\" />$_\n";          $section_sel .= "  <option value=\"$sec\">$sec</option>\n";
     }      }
   
     if (&check_group_priv() eq 'ok') {      if (&check_group_priv() eq 'ok') {
Line 1984  sub print_sortfilter_options { Line 1958  sub print_sortfilter_options {
             $numgroupvis = 1;              $numgroupvis = 1;
         }          }
     }      }
     foreach (@groups) {      foreach my $group (@groups) {
         $group_sel .= "  <option value=\"$_\" />$_\n";          $group_sel .= "  <option value=\"$group\">$group</option>\n";
     }      }
   
     my $function = &Apache::loncommon::get_users_function();      my $function = &Apache::loncommon::get_users_function();
Line 2075  $start_page Line 2049  $start_page
  <tr>   <tr>
   <td align="center" valign="top">    <td align="center" valign="top">
    <select name="sortposts">     <select name="sortposts">
     <option value="ascdate" selected="selected" />$sort_types{'ascdate'}      <option value="ascdate" selected="selected">$sort_types{'ascdate'}</option>
     <option value="descdate" />$sort_types{'descdate'}      <option value="descdate">$sort_types{'descdate'}</option>
     <option value="thread" />$sort_types{'thread'}      <option value="thread">$sort_types{'thread'}</option>
     <option value="subject" />$sort_types{'subject'}      <option value="subject">$sort_types{'subject'}</option>
     <option value="username" />$sort_types{'username'}      <option value="username">$sort_types{'username'}</option>
     <option value="lastfirst" />$sort_types{'lastfirst'}      <option value="lastfirst">$sort_types{'lastfirst'}</option>
    </select>     </select>
   </td>    </td>
   <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 value="all" selected="selected">$status_types{'all'}</option>
     <option value="Active" />$status_types{'Active'}      <option value="Active">$status_types{'Active'}</option>
     <option value="Expired" />$status_types{'Expired'}      <option value="Expired">$status_types{'Expired'}</option>
       <option value="Future">$status_types{'Future'}</option>
    </select>     </select>
   </td>    </td>
   <td>&nbsp;</td>    <td>&nbsp;</td>
   <td align="center" valign="top">    <td align="center" valign="top">
    <select name="rolefilter" multiple="true" size="5">     <select name="rolefilter" multiple="true" size="5">
     <option value="all" />$role_types{'all'}      <option value="all">$role_types{'all'}</option>
     <option value="st" />$role_types{'st'}      <option value="st">$role_types{'st'}</option>
     <option value="cc" />$role_types{'cc'}      <option value="cc">$role_types{'cc'}</option>
     <option value="in" />$role_types{'in'}      <option value="in">$role_types{'in'}</option>
     <option value="ta" />$role_types{'ta'}      <option value="ta">$role_types{'ta'}</option>
     <option value="ep" />$role_types{'ep'}      <option value="ep">$role_types{'ep'}</option>
     <option value="cr" />$role_types{'cr'}      <option value="cr">$role_types{'cr'}</option>
    </select>     </select>
   </td>    </td>
   <td>&nbsp;</td>    <td>&nbsp;</td>
Line 2573  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 2840  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 2847  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 2898  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 2912  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 2948  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 3196  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',
                    );                     );
 }  }
       
Line 3793  sub check_group_priv { Line 3773  sub check_group_priv {
     return '';      return '';
 }  }
   
 sub grp_args {   sub group_args { 
     my ($group) = @_;      my ($group) = @_;
     my $extra_args = 'group='.$group;      if ($group eq '') { return ''; }
       my $extra_args = '&amp;group='.$group;
     if (exists($env{'form.ref'})) {      if (exists($env{'form.ref'})) {
         $extra_args .= '&ref='.$env{'form.ref'};          $extra_args .= '&amp;ref='.$env{'form.ref'};
     }      }
     return $extra_args;      return $extra_args;
 }  }

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


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