version 1.133, 2004/11/15 21:35:37
|
version 1.141, 2004/11/19 19:11:33
|
Line 74 sub list_discussion {
|
Line 74 sub list_discussion {
|
if($ENV{'form.export'}) { |
if($ENV{'form.export'}) { |
$outputtarget = 'export'; |
$outputtarget = 'export'; |
} |
} |
} |
} |
if (not &discussion_visible($status)) { return ''; } |
if (not &discussion_visible($status)) { return ''; } |
my @bgcols = ("#cccccc","#eeeeee"); |
my @bgcols = ("#cccccc","#eeeeee"); |
my $discussiononly=0; |
my $discussiononly=0; |
Line 106 sub list_discussion {
|
Line 106 sub list_discussion {
|
my $userpickkey = $ressymb.'_userpick'; |
my $userpickkey = $ressymb.'_userpick'; |
my $toggkey = $ressymb.'_readtoggle'; |
my $toggkey = $ressymb.'_readtoggle'; |
my $readkey = $ressymb.'_read'; |
my $readkey = $ressymb.'_read'; |
|
$ressymb=$encsymb; |
my %dischash = &Apache::lonnet::get('nohist_'.$ENV{'request.course.id'}.'_discuss',[$lastkey,$showkey,$markkey,$visitkey,$ondispkey,$userpickkey,$toggkey,$readkey],$ENV{'user.domain'},$ENV{'user.name'}); |
my %dischash = &Apache::lonnet::get('nohist_'.$ENV{'request.course.id'}.'_discuss',[$lastkey,$showkey,$markkey,$visitkey,$ondispkey,$userpickkey,$toggkey,$readkey],$ENV{'user.domain'},$ENV{'user.name'}); |
my %discinfo = (); |
my %discinfo = (); |
my $showonlyunread = 0; |
my $showonlyunread = 0; |
Line 132 sub list_discussion {
|
Line 132 sub list_discussion {
|
$prevread = $dischash{$lastkey}; |
$prevread = $dischash{$lastkey}; |
} |
} |
} |
} |
&Apache::lonnet::logthis("\n last read r symb ".$lastkey); |
|
|
|
# Get information about students and non-students in course for filtering display of posts |
# Get information about students and non-students in course for filtering display of posts |
my %roleshash = (); |
my %roleshash = (); |
Line 355 imscp_v1p1.xsd http://www.imsglobal.org/
|
Line 354 imscp_v1p1.xsd http://www.imsglobal.org/
|
} |
} |
</script> |
</script> |
|; |
|; |
#FIXME need a <form back here for indiviaual red toggling |
$discussion.='<form name="readchoices" method="post" action="/adm/feedback?chgreads='.$ressymb.'" ><table bgcolor="#AAAAAA" cellpadding="2" cellspacing="2" border="0">'; |
$discussion.='<form><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>'; |
if ($visible>2) { |
if ($visible>2) { |
$discussion.='<td align="left">'. |
$discussion.='<td align="left">'. |
'<a href="/adm/feedback?threadedon='.$ressymb; |
'<a href="/adm/feedback?cmd=threadedon&symb='.$ressymb; |
if ($newpostsflag) { |
if ($newpostsflag) { |
$discussion .= '&previous='.$prevread; |
$discussion .= '&previous='.$prevread; |
} |
} |
$discussion .='">'.&mt('Threaded View').'</a> '. |
$discussion .='">'.&mt('Threaded View').'</a> '. |
'<a href="/adm/feedback?threadedoff='.$ressymb; |
'<a href="/adm/feedback?cmd=threadedoff&symb='.$ressymb; |
if ($newpostsflag) { |
if ($newpostsflag) { |
$discussion .= '&previous='.$prevread; |
$discussion .= '&previous='.$prevread; |
} |
} |
$discussion .='">'.&mt('Chronological View').'</a> |
$discussion .='">'.&mt('Chronological View').'</a> |
<a href= "/adm/feedback?sortfilter='.$ressymb; |
<a href= "/adm/feedback?cmd=sortfilter&symb='.$ressymb; |
if ($newpostsflag) { |
if ($newpostsflag) { |
$discussion .= '&previous='.$prevread; |
$discussion .= '&previous='.$prevread; |
} |
} |
Line 386 imscp_v1p1.xsd http://www.imsglobal.org/
|
Line 384 imscp_v1p1.xsd http://www.imsglobal.org/
|
$discussion .= '">'.&mt('Export').'?</a> </td>'; |
$discussion .= '">'.&mt('Export').'?</a> </td>'; |
if ($newpostsflag) { |
if ($newpostsflag) { |
if (!$markondisp) { |
if (!$markondisp) { |
$discussion .='<td align="right"><a href="/adm/feedback?markread='.$ressymb.'">'.&mt('Mark NEW posts no longer new').'</a> '; |
$discussion .='<td align="right"><a href="/adm/feedback?markread=1&symb='.$ressymb.'">'.&mt('Mark NEW posts no longer new').'</a> '; |
} else { |
} else { |
$discussion .= '<td> </td>'; |
$discussion .= '<td> </td>'; |
} |
} |
Line 562 END
|
Line 560 END
|
</td> |
</td> |
</tr> |
</tr> |
</table> |
</table> |
<br /><br /> |
<br /><br /></form> |
</form> |
|
END |
END |
} |
} |
if ($outputtarget eq 'export') { |
if ($outputtarget eq 'export') { |
Line 641 to course faculty</font><br />
|
Line 638 to course faculty</font><br />
|
<b>Title:</b> <input type="text" name="subject" value="$subject" size="30" /><br /><br /> |
<b>Title:</b> <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'}) { |
$discussion.='<input type="hidden" name="origpage" value="'.$ENV{'form.origpage'}.'" />'."\n"; |
$discussion.='<input type="hidden" name="origpage" value="'.$ENV{'form.origpage'}.'" />'."\n"; |
foreach (@currnewattach) { |
foreach (@currnewattach) { |
$discussion.='<input type="hidden" name="currnewattach" value="'.$_.'" />'."\n"; |
$discussion.='<input type="hidden" name="currnewattach" value="'.$_.'" />'."\n"; |
} |
} |
} |
} |
$discussion.="</form>\n"; |
$discussion.="</form>\n"; |
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 .= '<b>New attachments</b><br />'; |
if (@currnewattach > 1) { |
if (@currnewattach > 1) { |
$newattachmsg .= '<ol>'; |
$newattachmsg .= '<ol>'; |
foreach my $item (@currnewattach) { |
foreach my $item (@currnewattach) { |
$item =~ m#.*/([^/]+)$#; |
$item =~ m#.*/([^/]+)$#; |
$newattachmsg .= '<li><a href="'.$item.'">'.$1.'</a></li>'."\n"; |
$newattachmsg .= '<li><a href="'.$item.'">'.$1.'</a></li>'."\n"; |
|
} |
|
$newattachmsg .= '</ol>'."\n"; |
|
} else { |
|
$currnewattach[0] =~ m#.*/([^/]+)$#; |
|
$newattachmsg .= '<a href="'.$currnewattach[0].'">'.$1.'</a><br />'."\n"; |
} |
} |
$newattachmsg .= '</ol>'."\n"; |
|
} else { |
|
$currnewattach[0] =~ m#.*/([^/]+)$#; |
|
$newattachmsg .= '<a href="'.$currnewattach[0].'">'.$1.'</a><br />'."\n"; |
|
} |
} |
} |
$discussion.=$newattachmsg; |
$discussion.=$newattachmsg; |
$discussion.=&generate_preview_button(); |
$discussion.=&generate_preview_button(); |
} |
} |
|
} |
} |
} else { |
} else { |
if (&discussion_open($status) && |
if (&discussion_open($status) && |
&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'}:''))) { |
if ($outputtarget ne 'tex') { |
if ($outputtarget ne 'tex') { |
$discussion.='<table bgcolor="#BBBBBB"><tr><td><a href="/adm/feedback?replydisc='. |
$discussion.='<table bgcolor="#BBBBBB"><tr><td><a href="/adm/feedback?replydisc='. |
$ressymb.':::" '.$target.'>'. |
$ressymb.':::" '.$target.'>'. |
Line 968 sub build_posting_display {
|
Line 965 sub build_posting_display {
|
} else { |
} else { |
$rolematch .= ':'.$sectionpick; |
$rolematch .= ':'.$sectionpick; |
$skiptest = 0; |
$skiptest = 0; |
} |
|
} |
} |
if ($statusfilter) { |
if ($statusfilter) { |
if ($statusfilter eq 'all') { |
if ($statusfilter eq 'all') { |
Line 982 sub build_posting_display {
|
Line 978 sub build_posting_display {
|
$$shown{$idx} = 1; |
$$shown{$idx} = 1; |
} else { |
} else { |
foreach my $role (@{$$roleinfo{$poster}}) { |
foreach my $role (@{$$roleinfo{$poster}}) { |
&Apache::lonnet::logthis("\n rolematch $rolematch\nrole $role"); |
|
if ($role =~ m/^$rolematch$/) { |
if ($role =~ m/^$rolematch$/) { |
$$shown{$idx} = 1; |
$$shown{$idx} = 1; |
last; |
last; |
Line 1477 END
|
Line 1472 END
|
|
|
sub print_display_options { |
sub print_display_options { |
my ($r,$symb,$previous,$dispchgA,$dispchgB,$markchg,$toggchg,$feedurl) = @_; |
my ($r,$symb,$previous,$dispchgA,$dispchgB,$markchg,$toggchg,$feedurl) = @_; |
&dewrapper(\$feedurl); |
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->send_http_header; |
|
|
my $function = &Apache::loncommon::get_users_function(); |
my $function = &Apache::loncommon::get_users_function(); |
my $tabcolor = &Apache::loncommon::designparm($function.'.tabbg', |
my $tabcolor = &Apache::loncommon::designparm($function.'.tabbg', |
Line 1658 $lt{'sdpf'}<br/> $lt{'prca'} <ol><li>$l
|
Line 1654 $lt{'sdpf'}<br/> $lt{'prca'} <ol><li>$l
|
</table> |
</table> |
<br /> |
<br /> |
<br /> |
<br /> |
|
<input type="hidden" name="symb" value="$symb" /> |
<input type="hidden" name="previous" value="$previous" /> |
<input type="hidden" name="previous" value="$previous" /> |
<input type="hidden" name="$dispchgA" value=""/> |
<input type="hidden" name="$dispchgA" value=""/> |
<input type="hidden" name="$dispchgB" value=""/> |
<input type="hidden" name="$dispchgB" value=""/> |
Line 1676 END
|
Line 1673 END
|
sub print_sortfilter_options { |
sub print_sortfilter_options { |
my ($r,$symb,$previous,$feedurl) = @_; |
my ($r,$symb,$previous,$feedurl) = @_; |
|
|
&dewrapper(\$feedurl); |
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->send_http_header; |
|
|
|
&Apache::lonenc::check_encrypt(\$symb); |
my @sections = (); |
my @sections = (); |
my $section_sel = ''; |
my $section_sel = ''; |
my $numsections = 0; |
my $numsections = 0; |
Line 1813 END
|
Line 1813 END
|
sub print_showposters { |
sub print_showposters { |
my ($r,$symb,$previous,$feedurl,$sortposts) = @_; |
my ($r,$symb,$previous,$feedurl,$sortposts) = @_; |
|
|
# backward compatibility (bulletin boards used to be 'wrapped') |
&Apache::lonenc::check_encrypt(\$symb); |
my $ressymb=&wrap_symb($symb); |
|
my $crs='/'.$ENV{'request.course.id'}; |
my $crs='/'.$ENV{'request.course.id'}; |
if ($ENV{'request.course.sec'}) { |
if ($ENV{'request.course.sec'}) { |
$crs.='_'.$ENV{'request.course.sec'}; |
$crs.='_'.$ENV{'request.course.sec'}; |
} |
} |
$crs=~s/\_/\//g; |
$crs=~s/\_/\//g; |
my $seeid=&Apache::lonnet::allowed('rin',$crs); |
my $seeid=&Apache::lonnet::allowed('rin',$crs); |
my %contrib=&Apache::lonnet::restore($ressymb,$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'}); |
my %namesort = (); |
my %namesort = (); |
Line 1999 sub redirect_back {
|
Line 1998 sub redirect_back {
|
my $qrystr = ''; |
my $qrystr = ''; |
my $prevtag = ''; |
my $prevtag = ''; |
|
|
|
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->send_http_header; |
|
|
&dewrapper(\$feedurl); |
&dewrapper(\$feedurl); |
if ($feedurl=~/^\/adm\//) { $feedurl.='?register=1' }; |
if ($feedurl=~/^\/adm\//) { $feedurl.='?register=1' }; |
if ($previous > 0) { |
if ($previous > 0) { |
Line 2086 ENDNOREDIRTWO
|
Line 2088 ENDNOREDIRTWO
|
} |
} |
|
|
sub screen_header { |
sub screen_header { |
my ($feedurl) = @_; |
my ($feedurl,$symb) = @_; |
my $msgoptions=''; |
my $msgoptions=''; |
my $discussoptions=''; |
my $discussoptions=''; |
unless (($ENV{'form.replydisc'}) || ($ENV{'form.editdisc'})) { |
unless (($ENV{'form.replydisc'}) || ($ENV{'form.editdisc'})) { |
Line 2112 sub screen_header {
|
Line 2114 sub screen_header {
|
} |
} |
} |
} |
if ($ENV{'request.course.id'}) { |
if ($ENV{'request.course.id'}) { |
if (&discussion_open() && |
if (&discussion_open(undef,$symb) && |
&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'}:''))) { |
Line 2122 sub screen_header {
|
Line 2124 sub screen_header {
|
$discussoptions.='<br /><input type="checkbox" name="anondiscuss" onClick="this.form.discuss.checked=false;" /> '. |
$discussoptions.='<br /><input type="checkbox" name="anondiscuss" onClick="this.form.discuss.checked=false;" /> '. |
&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>'; |
' <i>('.&mt('name only visible to course faculty').')</i>'; |
} |
} |
} |
} |
if ($msgoptions) { $msgoptions='<h2><img src="/adm/lonMisc/feedback.gif" />'.&mt('Sending Messages').'</h2>'.$msgoptions; } |
if ($msgoptions) { $msgoptions='<h2><img src="/adm/lonMisc/feedback.gif" />'.&mt('Sending Messages').'</h2>'.$msgoptions; } |
if ($discussoptions) { |
if ($discussoptions) { |
Line 2398 sub adddiscuss {
|
Line 2400 sub adddiscuss {
|
|
|
sub show_preview { |
sub show_preview { |
my $r=shift; |
my $r=shift; |
|
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->send_http_header; |
my $message=&clear_out_html($ENV{'form.comment'}); |
my $message=&clear_out_html($ENV{'form.comment'}); |
$message=~s/\n/\<br \/\>/g; |
$message=~s/\n/\<br \/\>/g; |
$message=&Apache::lonspeller::markeduptext($message); |
$message=&Apache::lonspeller::markeduptext($message); |
Line 2438 sub modify_attachments {
|
Line 2442 sub modify_attachments {
|
if ($idx) { |
if ($idx) { |
&extract_attachments($attachmenturls,$idx,$numoldver,\$msg,\%attachments,\%currattach,$currdelold); |
&extract_attachments($attachmenturls,$idx,$numoldver,\$msg,\%attachments,\%currattach,$currdelold); |
} |
} |
|
&Apache::lonenc::check_encrypt(\$symb); |
$r->print(<<END); |
$r->print(<<END); |
<html> |
<html> |
<head> |
<head> |
Line 2731 sub handler {
|
Line 2736 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','editdisc','threadedon','threadedoff','onlyunread','allposts','onlyunmark','previous','markread','markonread','markondisp','toggoff','toggon','modifydisp','changes','navtime','navmaps','navurl','sortfilter','sortposts','applysort','rolefilter','statusfilter','sectionpick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold','allversions','export']); |
['hide','unhide','deldisc','postdata','preview','replydisc','editdisc','cmd','symb','onlyunread','allposts','onlyunmark','previous','markread','markonread','markondisp','toggoff','toggon','modifydisp','changes','navtime','navmaps','navurl','sortposts','applysort','rolefilter','statusfilter','sectionpick','posterlist','userpick','attach','origpage','currnewattach','deloldattach','keepold','allversions','export']); |
if ($ENV{'form.discsymb'}) { |
if ($ENV{'form.discsymb'}) { |
my ($symb,$feedurl) = &get_feedurl_and_clean_symb($ENV{'form.discsymb'}); |
my ($symb,$feedurl) = &get_feedurl_and_clean_symb($ENV{'form.discsymb'}); |
my $readkey = $symb.'_read'; |
my $readkey = $symb.'_read'; |
Line 2754 sub handler {
|
Line 2759 sub handler {
|
&Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss', |
&Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss', |
\%readinghash,$ENV{'user.domain'},$ENV{'user.name'}); |
\%readinghash,$ENV{'user.domain'},$ENV{'user.name'}); |
} |
} |
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->send_http_header; |
|
&redirect_back($r,$feedurl,&mt('Marked postings read/unread').'<br />', |
&redirect_back($r,$feedurl,&mt('Marked postings read/unread').'<br />', |
'0','0','',$ENV{'form.previous'},'','','',); |
'0','0','',$ENV{'form.previous'},'','','',); |
return OK; |
return OK; |
Line 2795 END
|
Line 2798 END
|
return OK; |
return OK; |
} |
} |
if ($ENV{'form.posterlist'}) { |
if ($ENV{'form.posterlist'}) { |
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->send_http_header; |
|
my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.applysort'}); |
my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.applysort'}); |
&print_showposters($r,$symb,$ENV{'form.previous'},$feedurl, |
&print_showposters($r,$symb,$ENV{'form.previous'},$feedurl, |
$ENV{'form.sortposts'}); |
$ENV{'form.sortposts'}); |
return OK; |
return OK; |
} |
} |
if ($ENV{'form.userpick'}) { |
if ($ENV{'form.userpick'}) { |
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->send_http_header; |
|
my @posters = &Apache::loncommon::get_env_multiple('form.stuinfo'); |
my @posters = &Apache::loncommon::get_env_multiple('form.stuinfo'); |
my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.userpick'}); |
my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.userpick'}); |
my $numpicks = @posters; |
my $numpicks = @posters; |
Line 2818 END
|
Line 2817 END
|
return OK; |
return OK; |
} |
} |
if ($ENV{'form.applysort'}) { |
if ($ENV{'form.applysort'}) { |
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->send_http_header; |
|
my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.applysort'}); |
my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.applysort'}); |
&redirect_back($r,$feedurl,&mt('Changed sort/filter').'<br />','0','0', |
&redirect_back($r,$feedurl,&mt('Changed sort/filter').'<br />','0','0', |
'',$ENV{'form.previous'},$ENV{'form.sortposts'}, |
'',$ENV{'form.previous'},$ENV{'form.sortposts'}, |
$ENV{'form.rolefilter'},$ENV{'form.statusfilter'}, |
$ENV{'form.rolefilter'},$ENV{'form.statusfilter'}, |
$ENV{'form.secpick'}); |
$ENV{'form.secpick'}); |
return OK; |
return OK; |
} elsif ($ENV{'form.sortfilter'}) { |
} elsif ($ENV{'form.cmd'} eq 'sortfilter') { |
&Apache::loncommon::content_type($r,'text/html'); |
my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.symb'}); |
$r->send_http_header; |
|
my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.sortfilter'}); |
|
&print_sortfilter_options($r,$symb,$ENV{'form.previous'},$feedurl); |
&print_sortfilter_options($r,$symb,$ENV{'form.previous'},$feedurl); |
return OK; |
return OK; |
} elsif ($ENV{'form.navtime'}) { |
} elsif ($ENV{'form.navtime'}) { |
Line 2891 $textline
|
Line 2886 $textline
|
ENDREDIR |
ENDREDIR |
return OK; |
return OK; |
} elsif ($ENV{'form.modifydisp'}) { |
} elsif ($ENV{'form.modifydisp'}) { |
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->send_http_header; |
|
my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.modifydisp'}); |
my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.modifydisp'}); |
my ($dispchgA,$dispchgB,$markchg,$toggchg) = |
my ($dispchgA,$dispchgB,$markchg,$toggchg) = |
split(/_/,$ENV{'form.changes'}); |
split(/_/,$ENV{'form.changes'}); |
Line 2902 ENDREDIR
|
Line 2895 ENDREDIR
|
} elsif ($ENV{'form.markondisp'} || $ENV{'form.markonread'} || |
} elsif ($ENV{'form.markondisp'} || $ENV{'form.markonread'} || |
$ENV{'form.allposts'} || $ENV{'form.onlyunread'} || |
$ENV{'form.allposts'} || $ENV{'form.onlyunread'} || |
$ENV{'form.onlyunmark'} || $ENV{'form.toggoff'} || |
$ENV{'form.onlyunmark'} || $ENV{'form.toggoff'} || |
$ENV{'form.toggon'} ) { |
$ENV{'form.toggon'} || $ENV{'form.markread'}) { |
&Apache::loncommon::content_type($r,'text/html'); |
my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.symb'}); |
$r->send_http_header; |
my %discinfo; |
my $feedurl; |
|
if ( ($ENV{'form.toggoff'}) || ($ENV{'form.toggon'}) ) { |
|
# ------------------------ Modify setting for read/unread toggle for each post |
# ------------------------ Modify setting for read/unread toggle for each post |
my $symb=$ENV{'form.toggoff'}?$ENV{'form.toggoff'}:$ENV{'form.toggon'}; |
if ($ENV{'form.toggoff'}) { $discinfo{$symb.'_readtoggle'}=0; } |
($symb,$feedurl)=&get_feedurl_and_clean_symb($symb); |
if ($ENV{'form.toggon'}) { $discinfo{$symb.'_readtoggle'}=1; } |
my %discinfo; |
|
$discinfo{$symb.'_readtoggle'}=1; |
|
if ($ENV{'form.toggoff'}) { $discinfo{$symb.'_readtoggle'}=0; } |
|
&Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss', |
|
\%discinfo,$ENV{'user.domain'},$ENV{'user.name'}); |
|
} |
|
if (($ENV{'form.markondisp'}) || ($ENV{'form.markonread'})) { |
|
# --------- Modify setting for identification of 'NEW' posts in this discussion |
# --------- Modify setting for identification of 'NEW' posts in this discussion |
my $symb=$ENV{'form.markondisp'}?$ENV{'form.markondisp'}:$ENV{'form.markonread'}; |
if ($ENV{'form.markondisp'}) { |
($symb,$feedurl)=&get_feedurl_and_clean_symb($symb); |
$discinfo{$symb.'_lastread'} = time; |
my %discinfo; |
$discinfo{$symb.'_markondisp'} = 1; |
my $lastkey = $symb.'_lastread'; |
} |
my $ondispkey = $symb.'_markondisp'; |
if ($ENV{'form.markonread'}) { |
if ($ENV{'form.markondisp'}) { |
if ( $ENV{'form.previous'} > 0 ) { |
$discinfo{$lastkey} = time; |
$discinfo{$symb.'_lastread'} = $ENV{'form.previous'}; |
$discinfo{$ondispkey} = 1; |
} |
} elsif ($ENV{'form.markonread'}) { |
$discinfo{$symb.'_markondisp'} = 0; |
if ( $ENV{'form.previous'} > 0 ) { |
|
$discinfo{$lastkey} = $ENV{'form.previous'}; |
|
} |
|
$discinfo{$ondispkey} = 0; |
|
} |
|
&Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss', |
|
\%discinfo,$ENV{'user.domain'},$ENV{'user.name'}); |
|
} |
} |
if ($ENV{'form.allposts'} || $ENV{'form.onlyunread'} || |
|
$ENV{'form.onlyunmark'}) { |
|
# --------------------------------- Modify display setting for this discussion |
# --------------------------------- Modify display setting for this discussion |
my $symb; |
if ($ENV{'form.allposts'}) { |
if ($ENV{'form.allposts'}) { |
$discinfo{$symb.'_showonlyunread'} = 0; |
$symb = $ENV{'form.allposts'}; |
$discinfo{$symb.'_showonlyunmark'} = 0; |
} elsif ($ENV{'form.onlyunread'}) { |
|
$symb = $ENV{'form.onlyunread'}; |
|
} else { |
|
$symb = $ENV{'form.onlyunmark'}; |
|
} |
|
($symb,$feedurl)=&get_feedurl_and_clean_symb($symb); |
|
my %discinfo; |
|
if ($ENV{'form.allposts'}) { |
|
$discinfo{$symb.'_showonlyunread'} = 0; |
|
$discinfo{$symb.'_showonlyunmark'} = 0; |
|
} elsif ($ENV{'form.onlyunread'}) { |
|
$discinfo{$symb.'_showonlyunread'} = 1; |
|
} else { |
|
$discinfo{$symb.'_showonlyunmark'} = 1; |
|
} |
|
&Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss', |
|
\%discinfo,$ENV{'user.domain'},$ENV{'user.name'}); |
|
} |
} |
|
if ($ENV{'form.onlyunread'}) { $discinfo{$symb.'_showonlyunread'} = 1; } |
|
if ($ENV{'form.onlyunmark'}) { $discinfo{$symb.'_showonlyunmark'} = 1; } |
|
# ----------------------------------------------------- Mark new posts not NEW |
|
if ($ENV{'form.markread'}) { $discinfo{$symb.'_lastread'} = time; } |
|
&Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss', |
|
\%discinfo,$ENV{'user.domain'},$ENV{'user.name'}); |
my $previous=$ENV{'form.previous'}; |
my $previous=$ENV{'form.previous'}; |
if ($ENV{'form.markondisp'}) { $previous=undef; } |
if ($ENV{'form.markondisp'}) { $previous=undef; } |
&redirect_back($r,$feedurl,&mt('Changed display status').'<br />', |
&redirect_back($r,$feedurl,&mt('Changed display status').'<br />', |
'0','0','',$previous); |
'0','0','',$previous); |
return OK; |
return OK; |
} elsif ($ENV{'form.markread'}) { |
|
# ----------------------------------------------------- Mark new posts not NEW |
|
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->send_http_header; |
|
my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.markread'}); |
|
&Apache::lonnet::logthis("\n last read w symb ".$symb); |
|
my %discinfo; |
|
$discinfo{$symb.'_lastread'} = time; |
|
&Apache::lonnet::put('nohist_'.$ENV{'request.course.id'}.'_discuss', |
|
\%discinfo,$ENV{'user.domain'},$ENV{'user.name'}); |
|
&redirect_back($r,$feedurl,&mt('Changed reading status').'<br />', |
|
'0','0'); |
|
return OK; |
|
} elsif (($ENV{'form.hide'}) || ($ENV{'form.unhide'})) { |
} elsif (($ENV{'form.hide'}) || ($ENV{'form.unhide'})) { |
# ----------------------------------------------------------------- Hide/unhide |
# ----------------------------------------------------------------- Hide/unhide |
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->send_http_header; |
|
|
|
my $entry=$ENV{'form.hide'}?$ENV{'form.hide'}:$ENV{'form.unhide'}; |
my $entry=$ENV{'form.hide'}?$ENV{'form.hide'}:$ENV{'form.unhide'}; |
my ($symb,$idx)=split(/\:\:\:/,$entry); |
my ($symb,$idx)=split(/\:\:\:/,$entry); |
($symb,my $feedurl)=&get_feedurl_and_clean_symb($symb); |
($symb,my $feedurl)=&get_feedurl_and_clean_symb($symb); |
Line 3019 ENDREDIR
|
Line 2967 ENDREDIR
|
|
|
&redirect_back($r,$feedurl,&mt('Changed discussion status').'<br />', |
&redirect_back($r,$feedurl,&mt('Changed discussion status').'<br />', |
'0','0','',$ENV{'form.previous'}); |
'0','0','',$ENV{'form.previous'}); |
} elsif (($ENV{'form.threadedon'}) || ($ENV{'form.threadedoff'})) { |
return OK; |
&Apache::loncommon::content_type($r,'text/html'); |
} elsif ($ENV{'form.cmd'}=~/^(threadedoff|threadedon)$/) { |
$r->send_http_header; |
my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.symb'}); |
my $symb; |
if ($ENV{'form.cmd'} eq 'threadedon') { |
if ($ENV{'form.threadedon'}) { |
|
$symb=$ENV{'form.threadedon'}; |
|
&Apache::lonnet::put('environment',{'threadeddiscussion' => 'on'}); |
&Apache::lonnet::put('environment',{'threadeddiscussion' => 'on'}); |
&Apache::lonnet::appenv('environment.threadeddiscussion' => 'on'); |
&Apache::lonnet::appenv('environment.threadeddiscussion' => 'on'); |
} else { |
} else { |
$symb=$ENV{'form.threadedoff'}; |
|
&Apache::lonnet::del('environment',['threadeddiscussion']); |
&Apache::lonnet::del('environment',['threadeddiscussion']); |
&Apache::lonnet::delenv('environment\.threadeddiscussion'); |
&Apache::lonnet::delenv('environment\.threadeddiscussion'); |
} |
} |
my ($symb,$feedurl)=&get_feedurl_and_clean_symb($symb); |
|
&redirect_back($r,$feedurl,&mt('Changed discussion view mode').'<br />', |
&redirect_back($r,$feedurl,&mt('Changed discussion view mode').'<br />', |
'0','0','',$ENV{'form.previous'}); |
'0','0','',$ENV{'form.previous'}); |
|
return OK; |
} elsif ($ENV{'form.deldisc'}) { |
} elsif ($ENV{'form.deldisc'}) { |
# --------------------------------------------------------------- Hide for good |
# --------------------------------------------------------------- Hide for good |
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->send_http_header; |
|
|
|
my ($symb,$idx)=split(/\:\:\:/,$ENV{'form.deldisc'}); |
my ($symb,$idx)=split(/\:\:\:/,$ENV{'form.deldisc'}); |
($symb,my $feedurl)=&get_feedurl_and_clean_symb($symb); |
($symb,my $feedurl)=&get_feedurl_and_clean_symb($symb); |
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'}); |
my %newhash=('deleted' => $contrib{'deleted'}.".$idx."); |
my %newhash=('deleted' => $contrib{'deleted'}.".$idx."); |
&Apache::lonnet::store(\%newhash,$symb,$ENV{'request.course.id'}, |
&Apache::lonnet::store(\%newhash,$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'}); |
&redirect_back($r,$feedurl,&mt('Changed discussion status').'<br />', |
&redirect_back($r,$feedurl,&mt('Changed discussion status').'<br />', |
'0','0','',$ENV{'form.previous'}); |
'0','0','',$ENV{'form.previous'}); |
|
return OK; |
} elsif ($ENV{'form.preview'}) { |
} elsif ($ENV{'form.preview'}) { |
# -------------------------------------------------------- User wants a preview |
# -------------------------------------------------------- User wants a preview |
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->send_http_header; |
|
&show_preview($r); |
&show_preview($r); |
|
return OK; |
} elsif ($ENV{'form.attach'}) { |
} elsif ($ENV{'form.attach'}) { |
# -------------------------------------------------------- Work on attachments |
# -------------------------------------------------------- Work on attachments |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
Line 3067 ENDREDIR
|
Line 3009 ENDREDIR
|
unless (length($ENV{'form.addnewattach'})>131072) { |
unless (length($ENV{'form.addnewattach'})>131072) { |
my $subdir = 'feedback/'.$ENV{'form.timestamp'}; |
my $subdir = 'feedback/'.$ENV{'form.timestamp'}; |
my $newattachment=&Apache::lonnet::userfileupload('addnewattach',undef,$subdir); |
my $newattachment=&Apache::lonnet::userfileupload('addnewattach',undef,$subdir); |
push @currnewattach, $newattachment; |
push @currnewattach, $newattachment; |
} |
} |
} |
} |
my $attachmenturls; |
my $attachmenturls; |
Line 3081 ENDREDIR
|
Line 3023 ENDREDIR
|
} |
} |
&modify_attachments($r,\@currnewattach,\@currdelold,$symb,$idx, |
&modify_attachments($r,\@currnewattach,\@currdelold,$symb,$idx, |
$attachmenturls); |
$attachmenturls); |
|
return OK; |
} elsif ($ENV{'form.export'}) { |
} elsif ($ENV{'form.export'}) { |
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
Line 3096 ENDREDIR
|
Line 3039 ENDREDIR
|
my $bodytag=&Apache::loncommon::bodytag('Resource Feedback and Discussion'); |
my $bodytag=&Apache::loncommon::bodytag('Resource Feedback and Discussion'); |
$r->print($bodytag.$discussion); |
$r->print($bodytag.$discussion); |
return OK; |
return OK; |
#FIXME deleted CHGREADS needs to be readded |
|
} else { |
} else { |
# ------------------------------------------------------------- Normal feedback |
# ------------------------------------------------------------- Normal feedback |
my $feedurl=$ENV{'form.postdata'}; |
my $feedurl=$ENV{'form.postdata'}; |
Line 3141 ENDREDIR
|
Line 3083 ENDREDIR
|
return OK; |
return OK; |
} |
} |
# Go ahead with feedback, no ambiguous reference |
# Go ahead with feedback, no ambiguous reference |
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->send_http_header; |
|
|
|
unless ( |
unless ( |
( |
( |
($feedurl=~m:^/res:) && ($feedurl!~m:^/res/adm:) |
($feedurl=~m:^/res:) && ($feedurl!~m:^/res/adm:) |
Line 3153 ENDREDIR
|
Line 3092 ENDREDIR
|
|| |
|| |
($ENV{'request.course.id'} && ($symb=~/^bulletin\_\_\_/)) |
($ENV{'request.course.id'} && ($symb=~/^bulletin\_\_\_/)) |
) { |
) { |
|
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->send_http_header; |
# Unable to give feedback |
# Unable to give feedback |
&no_redirect_back($r,$feedurl); |
&no_redirect_back($r,$feedurl); |
} |
} |
# --------------------------------------------------- Print login screen header |
# --------------------------------------------------- Print login screen header |
unless ($ENV{'form.sendit'}) { |
unless ($ENV{'form.sendit'}) { |
my $options=&screen_header($feedurl); |
&Apache::loncommon::content_type($r,'text/html'); |
|
$r->send_http_header; |
|
my $options=&screen_header($feedurl,$symb); |
if ($options) { |
if ($options) { |
&mail_screen($r,$feedurl,$options); |
&mail_screen($r,$feedurl,$options); |
} else { |
} else { |