version 1.64, 2003/10/21 00:22:23
|
version 1.68, 2003/11/07 16:37:23
|
Line 69 sub list_discussion {
|
Line 69 sub list_discussion {
|
unless ($symb) { return ''; } |
unless ($symb) { return ''; } |
my $seeid=&Apache::lonnet::allowed('rin',$crs); |
my $seeid=&Apache::lonnet::allowed('rin',$crs); |
my $viewgrades=&Apache::lonnet::allowed('vgr',$crs); |
my $viewgrades=&Apache::lonnet::allowed('vgr',$crs); |
my %discussionitems=(); |
my @discussionitems=(); |
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 $visible=0; |
|
my @depth=(); |
|
my @original=(); |
|
my @index=(); |
|
my @replies=(); |
|
my %alldiscussion=(); |
|
my $maxdepth=0; |
|
|
if ($contrib{'version'}) { |
if ($contrib{'version'}) { |
for (my $id=1;$id<=$contrib{'version'};$id++) { |
for (my $id=1;$id<=$contrib{'version'};$id++) { |
my $idx=$id; |
my $idx=$id; |
my $hidden=($contrib{'hidden'}=~/\.$idx\./); |
my $hidden=($contrib{'hidden'}=~/\.$idx\./); |
my $deleted=($contrib{'deleted'}=~/\.$idx\./); |
my $deleted=($contrib{'deleted'}=~/\.$idx\./); |
|
my $origindex='0.'; |
|
if ($contrib{$idx.':replyto'}) { |
|
# this is a follow-up message |
|
$original[$idx]=$original[$contrib{$idx.':replyto'}]; |
|
$depth[$idx]=$depth[$contrib{$idx.':replyto'}]+1; |
|
$origindex=$index[$contrib{$idx.':replyto'}]; |
|
if ($depth[$idx]>$maxdepth) { $maxdepth=$depth[$idx]; } |
|
} else { |
|
# this is an original message |
|
$original[$idx]=0; |
|
$depth[$idx]=0; |
|
} |
|
if ($replies[$depth[$idx]]) { |
|
$replies[$depth[$idx]]++; |
|
} else { |
|
$replies[$depth[$idx]]=1; |
|
} |
unless ((($hidden) && (!$seeid)) || ($deleted)) { |
unless ((($hidden) && (!$seeid)) || ($deleted)) { |
|
$visible++; |
my $message=$contrib{$idx.':message'}; |
my $message=$contrib{$idx.':message'}; |
$message=~s/\n/\<br \/\>/g; |
$message=~s/\n/\<br \/\>/g; |
$message=&Apache::lontexconvert::msgtexconverted($message); |
$message=&Apache::lontexconvert::msgtexconverted($message); |
Line 140 sub list_discussion {
|
Line 166 sub list_discussion {
|
$vgrlink=&Apache::loncommon::submlink('Submissions', |
$vgrlink=&Apache::loncommon::submlink('Submissions', |
$contrib{$idx.':sendername'},$contrib{$idx.':senderdomain'},$symb); |
$contrib{$idx.':sendername'},$contrib{$idx.':senderdomain'},$symb); |
} |
} |
$discussionitems{$idx}='<p><b>'.$sender.'</b> '.$vgrlink.' ('. |
#figure out at what position this needs to print |
|
my $thisindex=$idx; |
|
# if ($ENV{'request.discussions.threaded'}) { |
|
if (1) { |
|
$thisindex=$origindex.substr('00'.$replies[$depth[$idx]],-2,2); |
|
} |
|
$alldiscussion{$thisindex}=$idx; |
|
$index[$idx]=$thisindex; |
|
$discussionitems[$idx]='<p><b>'.$sender.'</b> '.$vgrlink.' ('. |
localtime($contrib{$idx.':timestamp'}). |
localtime($contrib{$idx.':timestamp'}). |
'):<blockquote>'.$message. |
'):<blockquote>'.$message. |
'</blockquote></p>'; |
'</blockquote></p>'; |
Line 148 sub list_discussion {
|
Line 182 sub list_discussion {
|
} |
} |
} |
} |
} |
} |
my $discussion='<hr />'; |
my $discussion=''; |
foreach (sort { $a <=> $b } keys %discussionitems) { |
if ($visible) { |
$discussion.=$discussionitems{$_}; |
$discussion.='<table bgcolor="#AAAAAA" cellpadding="2" cellspacing="2" border="0">'; |
|
foreach (sort { $a <=> $b } keys %alldiscussion) { |
|
$discussion.="\n<tr bgcolor='#CCCCCC'><td>".$discussionitems[$alldiscussion{$_}]. |
|
"</td></tr>"; |
|
} |
|
$discussion.='</table>'; |
} |
} |
if ($discussiononly) { |
if ($discussiononly) { |
$discussion.=(<<ENDDISCUSS); |
$discussion.=(<<ENDDISCUSS); |
Line 234 $bodytag
|
Line 273 $bodytag
|
<form action="/adm/feedback" method="post" name="mailform" |
<form action="/adm/feedback" method="post" name="mailform" |
enctype="multipart/form-data"> |
enctype="multipart/form-data"> |
<input type="hidden" name="postdata" value="$feedurl" /> |
<input type="hidden" name="postdata" value="$feedurl" /> |
|
<input type="hidden" name="replydisc" value="$ENV{'form.replydisc'}" /> |
Please check at least one of the following feedback types: |
Please check at least one of the following feedback types: |
$options<hr /> |
$options<hr /> |
<p>My question/comment/feedback:</p> |
<p>My question/comment/feedback:</p> |
Line 313 ENDNOREDIRTWO
|
Line 353 ENDNOREDIRTWO
|
} |
} |
|
|
sub screen_header { |
sub screen_header { |
my ($feedurl) = @_; |
my ($feedurl) = @_; |
my $msgoptions=''; |
my $msgoptions=''; |
my $discussoptions=''; |
my $discussoptions=''; |
if (($feedurl=~/^\/res\//) && ($feedurl!~/^\/res\/adm/)) { |
unless ($ENV{'form.replydisc'}) { |
$msgoptions= |
if (($feedurl=~/^\/res\//) && ($feedurl!~/^\/res\/adm/)) { |
'<p><input type="checkbox" name="author" /> '. |
$msgoptions= |
&mt('Feedback to resource author').'</p>'; |
'<p><input type="checkbox" name="author" /> '. |
} |
&mt('Feedback to resource author').'</p>'; |
if (&feedback_available(1)) { |
} |
$msgoptions.= |
if (&feedback_available(1)) { |
'<br /><input type="checkbox" name="question" /> '. |
$msgoptions.= |
&mt('Question about resource content'); |
'<br /><input type="checkbox" name="question" /> '. |
} |
&mt('Question about resource content'); |
if (&feedback_available(0,1)) { |
} |
$msgoptions.= |
if (&feedback_available(0,1)) { |
'<br /><input type="checkbox" name="course" /> '. |
$msgoptions.= |
&mt('Question/Comment/Feedback about course content'); |
'<br /><input type="checkbox" name="course" /> '. |
} |
&mt('Question/Comment/Feedback about course content'); |
if (&feedback_available(0,0,1)) { |
} |
$msgoptions.= |
if (&feedback_available(0,0,1)) { |
'<br /><input type="checkbox" name="policy" /> '. |
$msgoptions.= |
&mt('Question/Comment/Feedback about course policy'); |
'<br /><input type="checkbox" name="policy" /> '. |
} |
&mt('Question/Comment/Feedback about course policy'); |
|
} |
if ($ENV{'request.course.id'}) { |
} |
if (&Apache::lonnet::allowed('pch', |
if ($ENV{'request.course.id'}) { |
$ENV{'request.course.id'}. |
if (&Apache::lonnet::allowed('pch', |
($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) { |
$ENV{'request.course.id'}. |
$discussoptions='<input type="checkbox" name="discuss" onClick="this.form.anondiscuss.checked=false;" /> '. |
($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) { |
&mt('Contribution to course discussion of resource'); |
$discussoptions='<input type="checkbox" name="discuss" onClick="this.form.anondiscuss.checked=false;" /> '. |
$discussoptions.='<br /><input type="checkbox" name="anondiscuss" onClick="this.form.discuss.checked=false;" /> '. |
&mt('Contribution to course discussion of resource'); |
&mt('Anonymous contribution to course discussion of resource'). |
$discussoptions.='<br /><input type="checkbox" name="anondiscuss" onClick="this.form.discuss.checked=false;" /> '. |
' <i>('.&mt('name only visible to course faculty').')</i>'; |
&mt('Anonymous contribution to course discussion of resource'). |
|
' <i>('.&mt('name only visible to course faculty').')</i>'; |
} |
} |
} |
} |
if ($msgoptions) { $msgoptions='<h2>'.&mt('Sending Messages').'</h2>'.$msgoptions; } |
if ($msgoptions) { $msgoptions='<h2>'.&mt('Sending Messages').'</h2>'.$msgoptions; } |
if ($discussoptions) { |
if ($discussoptions) { |
$discussoptions='<h2>'.&mt('Discussion Contributions').'</h2>'.$discussoptions; } |
$discussoptions='<h2>'.&mt('Discussion Contributions').'</h2>'.$discussoptions; } |
return $msgoptions.$discussoptions; |
return $msgoptions.$discussoptions; |
} |
} |
|
|
sub resource_output { |
sub resource_output { |
Line 522 sub adddiscuss {
|
Line 563 sub adddiscuss {
|
$ENV{'environment.lastname'}.' '. |
$ENV{'environment.lastname'}.' '. |
$ENV{'enrironment.generation'}, |
$ENV{'enrironment.generation'}, |
'attachmenturl'=> $attachmenturl); |
'attachmenturl'=> $attachmenturl); |
|
if ($ENV{'form.replydisc'}) { |
|
$contrib{'replyto'}=(split(/\:\:\:/,$ENV{'form.replydisc'}))[1]; |
|
} |
if ($anon) { |
if ($anon) { |
$contrib{'anonymous'}='true'; |
$contrib{'anonymous'}='true'; |
} |
} |
Line 563 sub show_preview {
|
Line 607 sub show_preview {
|
} |
} |
|
|
sub generate_preview_button { |
sub generate_preview_button { |
|
my $pre=&mt("Show Preview"); |
return(<<ENDPREVIEW); |
return(<<ENDPREVIEW); |
<form name="preview" action="/adm/feedback?preview=1" method="post" target="preview"> |
<form name="preview" action="/adm/feedback?preview=1" method="post" target="preview"> |
<input type="hidden" name="comment" /> |
<input type="hidden" name="comment" /> |
<input type="button" value="Show Preview" |
<input type="button" value="$pre" |
onClick="this.form.comment.value=document.mailform.comment.value;this.form.submit();" /> |
onClick="this.form.comment.value=document.mailform.comment.value;this.form.submit();" /> |
</form> |
</form> |
ENDPREVIEW |
ENDPREVIEW |
Line 582 sub handler {
|
Line 627 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']); |
['hide','unhide','deldisc','postdata','preview','replydisc']); |
|
|
if (($ENV{'form.hide'}) || ($ENV{'form.unhide'})) { |
if (($ENV{'form.hide'}) || ($ENV{'form.unhide'})) { |
# ----------------------------------------------------------------- Hide/unhide |
# ----------------------------------------------------------------- Hide/unhide |
Line 652 sub handler {
|
Line 697 sub handler {
|
$feedurl=~s/^$ENV{'HTTP_HOST'}//; |
$feedurl=~s/^$ENV{'HTTP_HOST'}//; |
$feedurl=~s/\?.+$//; |
$feedurl=~s/\?.+$//; |
|
|
my $symb=&Apache::lonnet::symbread($feedurl); |
my $symb; |
|
if ($ENV{'form.replydisc'}) { |
|
$symb=(split(/\:\:\:/,$ENV{'form.replydisc'}))[0]; |
|
my ($map,$id,$url)=&Apache::lonnet::decode_symb($symb); |
|
$feedurl=&Apache::lonnet::clutter($url); |
|
} else { |
|
$symb=&Apache::lonnet::symbread($feedurl); |
|
} |
unless ($symb) { |
unless ($symb) { |
$symb=$ENV{'form.symb'}; |
$symb=$ENV{'form.symb'}; |
if ($symb) { |
if ($symb) { |