version 1.137, 2004/11/15 22:48:51
|
version 1.140, 2004/11/19 18:58:49
|
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 639 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 966 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 980 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 1679 sub print_sortfilter_options {
|
Line 1676 sub print_sortfilter_options {
|
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$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 1815 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 2445 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 2901 ENDREDIR
|
Line 2899 ENDREDIR
|
my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.symb'}); |
my ($symb,$feedurl)=&get_feedurl_and_clean_symb($ENV{'form.symb'}); |
my %discinfo; |
my %discinfo; |
# ------------------------ Modify setting for read/unread toggle for each post |
# ------------------------ Modify setting for read/unread toggle for each post |
if ($ENV{'form.toggoff'}) { $discinfo{$symb.'_readtoggle'}=1; } |
if ($ENV{'form.toggoff'}) { $discinfo{$symb.'_readtoggle'}=0; } |
if ($ENV{'form.toggon'}) { $discinfo{$symb.'_readtoggle'}=0; } |
if ($ENV{'form.toggon'}) { $discinfo{$symb.'_readtoggle'}=1; } |
# --------- Modify setting for identification of 'NEW' posts in this discussion |
# --------- Modify setting for identification of 'NEW' posts in this discussion |
if ($ENV{'form.markondisp'}) { |
if ($ENV{'form.markondisp'}) { |
$discinfo{$symb.'_lastread'} = time; |
$discinfo{$symb.'_lastread'} = time; |
Line 3011 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; |