Diff for /loncom/interface/lonfeedback.pm between versions 1.81 and 1.89

version 1.81, 2004/05/05 23:04:57 version 1.89, 2004/06/03 20:06:15
Line 34  use Apache::Constants qw(:common); Line 34  use Apache::Constants qw(:common);
 use Apache::lonmsg();  use Apache::lonmsg();
 use Apache::loncommon();  use Apache::loncommon();
 use Apache::lontexconvert();  use Apache::lontexconvert();
 use Apache::lonlocal;  use Apache::lonlocal; # must not have ()
   use Apache::lonhtmlcommon();
   
 sub list_discussion {  sub list_discussion {
     my ($mode,$status,$symb)=@_;      my ($mode,$status,$symb)=@_;
 #    &Apache::lonnet::logthis("status is $status");  
     if (!($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER'      if (!($status eq 'CAN_ANSWER' || $status eq 'CANNOT_ANSWER'
   || $status eq 'OPEN')) {    || $status eq 'OPEN')) {
  return '';   return '';
     }      }
       my $close=&Apache::lonnet::EXT('resource.0.discussend');
       if (defined($close) && $close ne '' && $close < time) {
    return ''
       }
   
       my @bgcols = ("#cccccc","#eeeeee");
     my $discussiononly=0;      my $discussiononly=0;
     if ($mode eq 'board') { $discussiononly=1; }      if ($mode eq 'board') { $discussiononly=1; }
     unless ($ENV{'request.course.id'}) { return ''; }      unless ($ENV{'request.course.id'}) { return ''; }
Line 68  sub list_discussion { Line 75  sub list_discussion {
     my $lastkey = $ressymb.'_lastread';      my $lastkey = $ressymb.'_lastread';
     my $showkey = $ressymb.'_showonlyunread';      my $showkey = $ressymb.'_showonlyunread';
     my $visitkey = $ressymb.'_visit';      my $visitkey = $ressymb.'_visit';
     my %dischash = &Apache::lonnet::get('nohist_'.$ENV{'request.course.id'}.'_discuss',[$lastkey,$showkey,$visitkey],$ENV{'user.domain'},$ENV{'user.name'});      my $ondispkey = $ressymb.'_markondisp';
       my %dischash = &Apache::lonnet::get('nohist_'.$ENV{'request.course.id'}.'_discuss',[$lastkey,$showkey,$visitkey,$ondispkey],$ENV{'user.domain'},$ENV{'user.name'});
       my %discinfo = ();
     my $showonlyunread = 0;      my $showonlyunread = 0;
       my $markondisp = 0;
     my $prevread = 0;      my $prevread = 0;
     my $previous = 0;      my $previous = 0;
     my $visit = 0;      my $visit = 0;
Line 81  sub list_discussion { Line 91  sub list_discussion {
     if ($previous > 0) {      if ($previous > 0) {
         $prevread = $previous;          $prevread = $previous;
     } elsif (defined($dischash{$lastkey})) {      } elsif (defined($dischash{$lastkey})) {
         $prevread = $dischash{$lastkey};          unless ($dischash{$lastkey} eq '') {
               $prevread = $dischash{$lastkey};
           }
       }
   
   # Get discussion display default settings for user
       my %userenv = &Apache::lonnet::get('environment',['discdisplay','discmarkread'],$ENV{'user.domain'},$ENV{'user.name'});
       my $discdisplay=$userenv{'discdisplay'};
       if ($discdisplay eq 'unread') {
           $showonlyunread = 1;
       }
       my $discmarkread=$userenv{'discmarkread'};
       if ($discmarkread eq 'ondisp') {
           $markondisp = 1;
       }
   
   # Override user's default if user specified display setting for this discussion
       if (defined($dischash{$ondispkey})) {
           $markondisp = $dischash{$ondispkey};
       }
       if ($markondisp) {
           $discinfo{$lastkey} = time;
     }      }
   
     if (defined($dischash{$showkey})) {      if (defined($dischash{$showkey})) {
Line 107  sub list_discussion { Line 138  sub list_discussion {
     my @replies=();      my @replies=();
     my %alldiscussion=();      my %alldiscussion=();
     my %notshown = ();      my %notshown = ();
       my %newitem = ();
     my $maxdepth=0;      my $maxdepth=0;
   
     my $target='';      my $target='';
Line 116  sub list_discussion { Line 148  sub list_discussion {
     }      }
           
     my $now = time;      my $now = time;
     my %discinfo = ();  
     $discinfo{$visitkey} = $visit;      $discinfo{$visitkey} = $visit;
     $discinfo{$lastkey} = $now;  
   
     &Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss',\%discinfo,$ENV{'user.domain'},$ENV{'user.name'});      &Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss',\%discinfo,$ENV{'user.domain'},$ENV{'user.name'});
   
     if ($contrib{'version'}) {      if ($contrib{'version'}) {
           my $oldest = $contrib{'1:timestamp'};
           if ($prevread eq '0') {
               $prevread = $oldest-1;
           }
  for (my $id=1;$id<=$contrib{'version'};$id++) {   for (my $id=1;$id<=$contrib{'version'};$id++) {
     my $idx=$id;      my $idx=$id;
             my $posttime = $contrib{$idx.':timestamp'};              my $posttime = $contrib{$idx.':timestamp'};
             if ($prevread > 0 && $prevread <= $posttime) {              if ($prevread <= $posttime) {
                 $newpostsflag = 1;                  $newpostsflag = 1;
             }              }
     my $hidden=($contrib{'hidden'}=~/\.$idx\./);      my $hidden=($contrib{'hidden'}=~/\.$idx\./);
Line 159  sub list_discussion { Line 193  sub list_discussion {
                     $subject=&Apache::lontexconvert::msgtexconverted($subject);                      $subject=&Apache::lontexconvert::msgtexconverted($subject);
                 }                  }
  if ($contrib{$idx.':attachmenturl'}) {   if ($contrib{$idx.':attachmenturl'}) {
     my ($fname,$ft)      my ($fname)
                         =($contrib{$idx.':attachmenturl'}=~/\/(\w+)\.(\w+)$/);                          =($contrib{$idx.':attachmenturl'}=~m|/([^/]+)$|);
     $message.='<p>'.&mt('Attachment').': <a href="'.      &Apache::lonnet::allowuploaded('/adm/feedback',
  &Apache::lonnet::tokenwrapper(     $contrib{$idx.':attachmenturl'});
                                              $contrib{$idx.':attachmenturl'}).      $message.='<p>'.&mt('Attachment').
  '"><tt>'.$fname.'.'.$ft.'</tt></a></p>';   ': <a href="'.$contrib{$idx.':attachmenturl'}.'"><tt>'.
    $fname.'</tt></a></p>';
  }   }
  if ($message) {   if ($message) {
     if ($hidden) {      if ($hidden) {
Line 243  sub list_discussion { Line 278  sub list_discussion {
                     if ($showonlyunread && $prevread > $posttime) {                      if ($showonlyunread && $prevread > $posttime) {
                         $notshown{$idx} = 1;                          $notshown{$idx} = 1;
                     } else {                      } else {
                         $discussionitems[$idx]='<p><table border="0" width="100%"><tr>';  
                         if ($prevread > 0 && $prevread <= $posttime) {                          if ($prevread > 0 && $prevread <= $posttime) {
                             $discussionitems[$idx] .= '<td align="left" bgcolor="#FFFFFF"><font color="#FF0000">NEW</font></td>';                              $newitem{$idx} = 1;
                               $discussionitems[$idx] .= '
                                <p><table border="0" width="100%">
                                 <tr><td align="left"><font color="#FF0000"><b>NEW</b></font></td>';
                           } else {
                               $newitem{$idx} = 0;
                               $discussionitems[$idx] .= '
                                <p><table border="0" width="100%">
                                 <tr><td align="left">&nbsp;</td>';
                         }                          }
                         $discussionitems[$idx] .= '<td align ="left">&nbsp;&nbsp;'.                          $discussionitems[$idx] .= '<td align ="left">&nbsp;&nbsp;'.
                             '<b>'.$subject.'</b>&nbsp;&nbsp;'.                              '<b>'.$subject.'</b>&nbsp;&nbsp;'.
Line 259  sub list_discussion { Line 301  sub list_discussion {
     }      }
   
     my $discussion='';      my $discussion='';
   
       my $function = &Apache::loncommon::get_users_function();
       my $color = &Apache::loncommon::designparm($function.'.tabbg',
                                                       $ENV{'user.domain'});
       my %lt = &Apache::lonlocal::texthash(
           'cuse' => 'Current settings for this discussion',
           'allposts' => 'All posts',
           'unread' => 'New posts only',
           'ondisp' => 'Once displayed',
           'onmark' => 'Once marked read',
           'disa' => 'Posts to be displayed',
           'npce' => 'Posts cease to be marked "NEW"',
           'chgt' => 'Change to ',
       );
   
       my $currdisp = $lt{'allposts'};
       my $currmark = $lt{'onmark'};
       my $dispchange = $lt{'unread'};
       my $markchange = $lt{'ondisp'};
       my $displink = '/adm/feedback?onlyunread='.$ressymb;
       my $marklink = '/adm/feedback?markondisp='.$ressymb;
   
       if ($markondisp) {
           $currmark = $lt{'ondisp'};
           $markchange = $lt{'onmark'};
           $marklink = '/adm/feedback?markonread='.$ressymb;
           if ($newpostsflag) {
               $marklink .= '&previous='.$prevread;
           }
       }
   
       if ($showonlyunread) {
           $currdisp = $lt{'unread'};
           $dispchange = $lt{'allposts'};
           $displink = '/adm/feedback?allposts='.$ressymb;
       }
   
       if ($newpostsflag) {
           $displink .= '&previous='.$prevread;
       }
   
     if ($visible) {      if ($visible) {
 # Print the discusssion  # Print the discusssion
  $discussion.='<table bgcolor="#AAAAAA" cellpadding="2" cellspacing="2" border="0">';   $discussion.='<table bgcolor="#AAAAAA" cellpadding="2" cellspacing="2" border="0">';
  if ($visible>2) {   my $colspan=$maxdepth+1;
     my $colspan=$maxdepth+1;          $discussion .= '<tr bgcolor="#FFFFFF"><td colspan="'.$colspan.'" valign="top">'.
     $discussion.='<tr><td bgcolor="DDDDBB" colspan="'.$colspan.'">'.          '<table border="0" bgcolor="#FFFFFF" width="100%" cellspacing="2" cellpadding="2">'.
             '<table border="0" width="100%" bgcolor="#DDDDBB"><tr><td align="left">'.          '<tr><td align="left"><b>'.$lt{'cuse'}.'</b></td><td>&nbsp;&nbsp;&nbsp;&nbsp;</td><td align="right"><b>'.$lt{'chgt'}.'</b></td></tr>'.
             '<a href="/adm/feedback?threadedon='.$ressymb.'">'.&mt('Threaded View').'</a>&nbsp;&nbsp;'.          '<tr><td>'.$lt{'disa'}.':&nbsp;<i>'.$currdisp.'</i></td><td>&nbsp;&nbsp;&nbsp;&nbsp;</td><td align="right"><a href="'.$displink.'">'.$dispchange.'</a></td></tr>'.
             '<a href="/adm/feedback?threadedoff='.$ressymb.'">'.&mt('Chronological View').'</a>&nbsp;&nbsp;</td>'.          '<tr><td>'.$lt{'npce'}.':&nbsp;<i>'.$currmark.'</i></td><td>&nbsp;&nbsp;&nbsp;&nbsp;</td><td align="right"><a href="'.$marklink.'">'.$markchange.'</a></td></tr>'.
             '<td align="right"><a href="/adm/feedback?';          '</table></td></tr>'.
             if ($showonlyunread) {          '<tr><td bgcolor="#DDDDBB" colspan="'.$colspan.'">'.
                 $discussion .= 'allposts='.$ressymb;          '<table border="0" width="100%" bgcolor="#DDDDBB"><tr>';
                 if ($newpostsflag) {          if ($visible>2) {
                     $discussion .= '&previous='.$prevread;      $discussion.='<td align="left">'.
                 }              '<a href="/adm/feedback?threadedon='.$ressymb;
                 $discussion .='">'.&mt('Show all posts').'?';              if ($newpostsflag) {
                   $discussion .= '&previous='.$prevread;
               }
               $discussion .='">'.&mt('Threaded View').'</a>&nbsp;&nbsp;'.
               '<a href="/adm/feedback?threadedoff='.$ressymb;
               if ($newpostsflag) {
                   $discussion .= '&previous='.$prevread;
               }
               $discussion .='">'.&mt('Chronological View').'</a>&nbsp;&nbsp;</td>';
    } 
           if ($newpostsflag) {
               if (!$markondisp) {
                   $discussion .='<td align="right"><a href="/adm/feedback?markread='.$ressymb.'">'.&mt('Mark new posts as read').'</a>&nbsp;&nbsp;';
             } else {              } else {
                 $discussion .= 'onlyunread='.$ressymb;                  $discussion .= '<td>&nbsp;</td>';
                 if ($newpostsflag) {  
                     $discussion .= '&previous='.$prevread;  
                 }  
                 $discussion .= '">'.&mt('Show only unread posts').'?';  
             }              }
             $discussion .= '</a>&nbsp;&nbsp;</td></tr></table></td></tr>';          } else {
  }              $discussion .= '<td>&nbsp;</td>';
           }
           $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;
Line 304  sub list_discussion { Line 398  sub list_discussion {
     $discussion.='<td>&nbsp;&nbsp;&nbsp;</td>';      $discussion.='<td>&nbsp;&nbsp;&nbsp;</td>';
         }          }
         my $colspan=$maxdepth-$thisdepth+1;          my $colspan=$maxdepth-$thisdepth+1;
                 $discussion.='<td  bgcolor="#CCCCCC" colspan="'.$colspan.'">'.                  $discussion.='<td  bgcolor="'.$bgcols[$newitem{$alldiscussion{$_}}].'" colspan="'.$colspan.'">'.
                              $discussionitems[$alldiscussion{$_}].                               $discussionitems[$alldiscussion{$_}].
                      '</td></tr>';                       '</td></tr>';
     }      }
Line 322  sub list_discussion { Line 416  sub list_discussion {
 <font size="1">Note: in anonymous discussion, your name is visible only to  <font size="1">Note: in anonymous discussion, your name is visible only to
 course faculty</font><br />  course faculty</font><br />
 <b>Title:</b>&nbsp;<input type="text" name="subject" value="" size="30" /><br /><br />  <b>Title:</b>&nbsp;<input type="text" name="subject" value="" size="30" /><br /><br />
 <textarea name="comment" cols="60" rows="10" wrap="hard"></textarea>  <textarea name="comment" cols="60" rows="12" wrap="hard"></textarea>
 <p>  <p>
 Attachment (128 KB max size): <input type="file" name="attachment" />  Attachment (128 KB max size): <input type="file" name="attachment" />
 </p>  </p>
Line 368  sub mail_screen { Line 462  sub mail_screen {
           $prevtag = '<input type="hidden" name="previous" value="'.$ENV{'form.previous'}.'" />';            $prevtag = '<input type="hidden" name="previous" value="'.$ENV{'form.previous'}.'" />';
       }        }
   }    }
   my $latexHelp = Apache::loncommon::helpLatexCheatsheet();    my $latexHelp=&Apache::loncommon::helpLatexCheatsheet();
     my $htmlheader=&Apache::lonhtmlcommon::htmlareaheaders();
   my $send=&mt('Send');    my $send=&mt('Send');
   $r->print(<<ENDDOCUMENT);    $r->print(<<ENDDOCUMENT);
 <html>  <html>
 <head>  <head>
 <title>The LearningOnline Network with CAPA</title>  <title>The LearningOnline Network with CAPA</title>
 <meta http-equiv="pragma" content="no-cache"></meta>  <meta http-equiv="pragma" content="no-cache"></meta>
   $htmlheader
 <script type="text/javascript">  <script type="text/javascript">
 //<!--  //<!--
     function gosubmit() {      function gosubmit() {
Line 411  sub mail_screen { Line 507  sub mail_screen {
         }          }
   
         if (rec) {          if (rec) {
       document.mailform.onsubmit();
     document.mailform.submit();      document.mailform.submit();
         } else {          } else {
             alert('Please check a feedback type.');              alert('Please check a feedback type.');
Line 445  Attachment (128 KB max size): <input typ Line 542  Attachment (128 KB max size): <input typ
 </p>  </p>
 </form>  </form>
 ENDDOCUMENT  ENDDOCUMENT
 $r->print(&generate_preview_button().'</body></html>');  $r->print(&generate_preview_button().
   &Apache::lonhtmlcommon::htmlareaactive().
   '</body></html>');
 }  }
   
 sub fail_redirect {  sub fail_redirect {
Line 580  sub resource_output { Line 679  sub resource_output {
   
 sub clear_out_html {  sub clear_out_html {
   my ($message,$override)=@_;    my ($message,$override)=@_;
     unless (&Apache::lonhtmlcommon::htmlareablocked()) { return $message; }
   my $cid=$ENV{'request.course.id'};    my $cid=$ENV{'request.course.id'};
   if (($ENV{"course.$cid.allow_limited_html_in_feedback"} =~ m/yes/i) ||    if (($ENV{"course.$cid.allow_limited_html_in_feedback"} =~ m/yes/i) ||
       ($override)) {        ($override)) {
       # allows <B> <I> <P> <A> <LI> <OL> <UL> <EM> <BR> <TT> <STRONG>         # allows <B> <I> <P> <A> <LI> <OL> <UL> <EM> <BR> <TT> <STRONG> 
       # <BLOCKQUOTE> <DIV .*> <DIV> <IMG>        # <BLOCKQUOTE> <DIV .*> <DIV> <IMG> <M> <SPAN> <H1> <H2> <H3> <H4> <SUB>
         # <SUP>
       my %html=(B=>1, I=>1, P=>1, A=>1, LI=>1, OL=>1, UL=>1, EM=>1,        my %html=(B=>1, I=>1, P=>1, A=>1, LI=>1, OL=>1, UL=>1, EM=>1,
  BR=>1, TT=>1, STRONG=>1, BLOCKQUOTE=>1, DIV=>1, IMG=>1,   BR=>1, TT=>1, STRONG=>1, BLOCKQUOTE=>1, DIV=>1, IMG=>1,
                 M=>1);                  M=>1, SUB=>1, SUP=>1, SPAN=>1, 
    H1=>1, H2=>1, H3=>1, H4=>1, H5=>1);
   
       $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;
Line 788  sub generate_preview_button { Line 890  sub generate_preview_button {
 <input type="hidden" name="subject">  <input type="hidden" name="subject">
 <input type="hidden" name="comment" />  <input type="hidden" name="comment" />
 <input type="button" value="$pre"  <input type="button" value="$pre"
 onClick="this.form.comment.value=document.mailform.comment.value;this.form.subject.value=document.mailform.subject.value;this.form.submit();" />  onClick="document.mailform.onsubmit();this.form.comment.value=document.mailform.comment.value;this.form.subject.value=document.mailform.subject.value;this.form.submit();" />
 </form>  </form>
 ENDPREVIEW  ENDPREVIEW
 }  }
Line 804  sub handler { Line 906  sub handler {
 # --------------------------- Get query string for limited number of parameters  # --------------------------- Get query string for limited number of parameters
   
    &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},     &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},
          ['hide','unhide','deldisc','postdata','preview','replydisc','threadedon','threadedoff','onlyunread','allposts','previous']);           ['hide','unhide','deldisc','postdata','preview','replydisc','threadedon','threadedoff','onlyunread','allposts','previous','markread','markonread','markondisp']);
   
   if (($ENV{'form.allposts'}) || ($ENV{'form.onlyunread'})) {    if (($ENV{'form.markondisp'}) || ($ENV{'form.markonread'})) {
   # ---------------------- Modify setting for identification of 'NEW' posts in this discussion
   
         &Apache::loncommon::content_type($r,'text/html');
         $r->send_http_header;
         my $symb=$ENV{'form.markondisp'}?$ENV{'form.markondisp'}:$ENV{'form.markonread'};
         my $ressymb = $symb;
         my ($map,$ind,$url)=&Apache::lonnet::decode_symb($symb);
         unless ($ressymb =~ m|bulletin___\d+___adm/wrapper|) {
             $ressymb=~s|(bulletin___\d+___)|$1adm/wrapper|;
         }
                                                                                             
         my %discinfo = ();
         my $lastkey = $ressymb.'_lastread';
         my $ondispkey = $ressymb.'_markondisp';
         if ($ENV{'form.markondisp'}) {
             $discinfo{$lastkey} = time;
             $discinfo{$ondispkey} = 1;
         } elsif ($ENV{'form.markonread'}) {
             if ( defined($ENV{'previous'}) ) {
                 $discinfo{$lastkey} = $ENV{'previous'};
             }
             $discinfo{$ondispkey} = 0;
         }
         &Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss',\%discinfo,$ENV{'user.domain'},$ENV{'user.name'});
         if ($ENV{'form.markondisp'}) {
             &redirect_back($r,&Apache::lonnet::clutter($url),&mt('Changed display status').'<br />','0','0');
         } else {
             &redirect_back($r,&Apache::lonnet::clutter($url),&mt('Changed display status').'<br />','0','0','',$ENV{'form.previous'});
         }
         return OK;
     } elsif (($ENV{'form.allposts'}) || ($ENV{'form.onlyunread'})) {
 # ----------------------------------------------------------------- Modify display setting for this discussion   # ----------------------------------------------------------------- Modify display setting for this discussion 
       &Apache::loncommon::content_type($r,'text/html');        &Apache::loncommon::content_type($r,'text/html');
       $r->send_http_header;        $r->send_http_header;
       my $symb=$ENV{'form.allposts'}?$ENV{'form.allposts'}:$ENV{'form.onlyunread'};        my $symb=$ENV{'form.allposts'}?$ENV{'form.allposts'}:$ENV{'form.onlyunread'};
         my $ressymb = $symb;
       my ($map,$ind,$url)=&Apache::lonnet::decode_symb($symb);        my ($map,$ind,$url)=&Apache::lonnet::decode_symb($symb);
       my %contrib=&Apache::lonnet::restore($symb,$ENV{'request.course.id'},        unless ($ressymb =~ m|bulletin___\d+___adm/wrapper|) {
                           $ENV{'course.'.$ENV{'request.course.id'}.'.domain'},            $ressymb=~s|(bulletin___\d+___)|$1adm/wrapper|;
                           $ENV{'course.'.$ENV{'request.course.id'}.'.num'});        }
       my %readinghash = ();        my %discinfo = ();
                                                                                          if ($ENV{'form.allposts'}) {
       if ($contrib{'version'}) {            $discinfo{$ressymb.'_showonlyunread'} = 0;
           if ($ENV{'form.allposts'}) {        } elsif ($ENV{'form.onlyunread'}) {
               $readinghash{$symb.'_showonlyunread'} = 0;            $discinfo{$ressymb.'_showonlyunread'} = 1;
           } elsif ($ENV{'form.onlyunread'}) {        }
               $readinghash{$symb.'_showonlyunread'} = 1;        &Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss',\%discinfo,$ENV{'user.domain'},$ENV{'user.name'});
           }        &redirect_back($r,&Apache::lonnet::clutter($url),&mt('Changed display status').'<br />','0','0','',$ENV{'form.previous'});
           &Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss',\%readinghash,$ENV{'user.domain'},$ENV{'user.name'});        return OK;
     } elsif ($ENV{'form.markread'}) {
   # ----------------------------------------------------------------- Mark new posts as read
         &Apache::loncommon::content_type($r,'text/html');
         $r->send_http_header;
         my $symb=$ENV{'form.markread'};
         my $ressymb = $symb;
         my ($map,$ind,$url)=&Apache::lonnet::decode_symb($symb);
         unless ($ressymb =~ m|bulletin___\d+___adm/wrapper|) {
             $ressymb=~s|(bulletin___\d+___)|$1adm/wrapper|;
       }        }
       &redirect_back($r,&Apache::lonnet::clutter($url),&mt('Changed reading status').'<br />','0','0','',$ENV{'form.previous'});        my %discinfo = ();
         my $lastkey = $ressymb.'_lastread';
         $discinfo{$lastkey} = time;
         &Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss',\%discinfo,$ENV{'user.domain'},$ENV{'user.name'});
         &redirect_back($r,&Apache::lonnet::clutter($url),&mt('Changed reading status').'<br />','0','0');
       return OK;        return OK;
   } elsif (($ENV{'form.hide'}) || ($ENV{'form.unhide'})) {    } elsif (($ENV{'form.hide'}) || ($ENV{'form.unhide'})) {
 # ----------------------------------------------------------------- Hide/unhide  # ----------------------------------------------------------------- Hide/unhide
Line 976  sub handler { Line 1123  sub handler {
       my $attachmenturl='';        my $attachmenturl='';
       if ($ENV{'form.attachment.filename'}) {        if ($ENV{'form.attachment.filename'}) {
   unless (length($ENV{'form.attachment'})>131072) {    unless (length($ENV{'form.attachment'})>131072) {
       $attachmenturl=&Apache::lonnet::userfileupload('attachment');        $attachmenturl=&Apache::lonnet::userfileupload('attachment',undef,'feedback');
   }    }
       }        }
 # Filter HTML out of message (could be nasty)  # Filter HTML out of message (could be nasty)

Removed from v.1.81  
changed lines
  Added in v.1.89


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