version 1.199, 2006/05/09 20:38:45
|
version 1.205, 2006/06/29 21:22:09
|
Line 43 use Apache::lonrss();
|
Line 43 use Apache::lonrss();
|
use HTML::LCParser(); |
use HTML::LCParser(); |
use Apache::lonspeller(); |
use Apache::lonspeller(); |
use Cwd; |
use Cwd; |
|
use lib '/home/httpd/lib/perl/'; |
|
use LONCAPA; |
|
|
sub discussion_open { |
sub discussion_open { |
my ($status,$symb)=@_; |
my ($status,$symb)=@_; |
Line 394 imscp_v1p1.xsd http://www.imsglobal.org/
|
Line 396 imscp_v1p1.xsd http://www.imsglobal.org/
|
$discussion.='<form name="readchoices" method="post" action="/adm/feedback?chgreads='.$ressymb.'" ><table bgcolor="#AAAAAA" cellpadding="2" cellspacing="2" border="0">'; |
$discussion.='<form name="readchoices" method="post" action="/adm/feedback?chgreads='.$ressymb.'" ><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>'; |
my $escsymb=&Apache::lonnet::escape($ressymb); |
my $escsymb=&escape($ressymb); |
if ($visible>2) { |
if ($visible>2) { |
$discussion.='<td align="left">'. |
$discussion.='<td align="left">'. |
'<a href="/adm/feedback?cmd=threadedon&symb='.$escsymb; |
'<a href="/adm/feedback?cmd=threadedon&symb='.$escsymb; |
Line 694 END
|
Line 696 END
|
my $subject = ''; |
my $subject = ''; |
if ($env{'form.origpage'}) { |
if ($env{'form.origpage'}) { |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['addnewattach','deloldattach','delnewattach','timestamp','idx','subject','comment']); |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['addnewattach','deloldattach','delnewattach','timestamp','idx','subject','comment']); |
$subject = &Apache::lonnet::unescape($env{'form.subject'}); |
$subject = &unescape($env{'form.subject'}); |
$comment = &Apache::lonnet::unescape($env{'form.comment'}); |
$comment = &unescape($env{'form.comment'}); |
my @keepold = (); |
my @keepold = (); |
&process_attachments(\@currnewattach,\@currdelold,\@keepold); |
&process_attachments(\@currnewattach,\@currdelold,\@keepold); |
if (@currnewattach > 0) { |
if (@currnewattach > 0) { |
Line 751 ENDDISCUSS
|
Line 753 ENDDISCUSS
|
($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.='<a href="/adm/feedback?replydisc='. |
$discussion.='<a href="/adm/feedback?replydisc='. |
&Apache::lonnet::escape($ressymb).':::" '.$target.'>'. |
&escape($ressymb).':::" '.$target.'>'. |
'<img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/chat.gif').'" border="0" />'. |
'<img 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&symb='. |
&Apache::lonnet::escape($ressymb). |
&escape($ressymb). |
'"><img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/feedback.gif').'" border="0" />'. |
'"><img src="'.&Apache::loncommon::lonhttpdurl('/adm/lonMisc/feedback.gif').'" border="0" />'. |
&mt('Send Message').'</td></tr></table>'; |
&mt('Send Message').'</td></tr></table>'; |
} |
} |
Line 769 sub build_posting_display {
|
Line 771 sub build_posting_display {
|
my @original=(); |
my @original=(); |
my @index=(); |
my @index=(); |
my $symb=&Apache::lonenc::check_decrypt($ressymb); |
my $symb=&Apache::lonenc::check_decrypt($ressymb); |
my $escsymb=&Apache::lonnet::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'}); |
Line 1419 END
|
Line 1421 END
|
$parentmsg = $contrib{$idx.':replyto'}; |
$parentmsg = $contrib{$idx.':replyto'}; |
} |
} |
unless (exists($env{'form.origpage'})) { |
unless (exists($env{'form.origpage'})) { |
my $anonflag = 0; |
my $anonflag = 'nonanon'; |
if ($contrib{$idx.':anonymous'}) { |
if ($contrib{$idx.':anonymous'}) { |
$anonflag = 1; |
$anonflag = 'anon'; |
} |
} |
$anonscript = (<<END); |
$anonscript = (<<END); |
function setposttype () { |
function setposttype () { |
var currtype = $anonflag |
var currtype = "$anonflag"; |
if (currtype == 1) { |
for (var i=0; i<document.mailform.discuss.length; i++) { |
document.mailform.elements.discuss.value = 'anon' |
if (document.mailform.elements.discuss[i].value == currtype ) { |
} |
document.mailform.elements.discuss[i].checked=1; |
if (currtype == 0) { |
} |
document.mailform.elements.discuss.value = 'nonanon' |
|
} |
} |
return |
return |
} |
} |
Line 1444 END
|
Line 1445 END
|
} |
} |
|
|
if ($env{'form.origpage'}) { |
if ($env{'form.origpage'}) { |
$subject = &Apache::lonnet::unescape($env{'form.subject'}); |
$subject = &unescape($env{'form.subject'}); |
$comment = &Apache::lonnet::unescape($env{'form.comment'}); |
$comment = &unescape($env{'form.comment'}); |
&process_attachments(\@currnewattach,\@currdelold,\@keepold); |
&process_attachments(\@currnewattach,\@currdelold,\@keepold); |
} |
} |
my $latexHelp=&Apache::loncommon::helpLatexCheatsheet(); |
my $latexHelp=&Apache::loncommon::helpLatexCheatsheet(); |
Line 1455 END
|
Line 1456 END
|
//<!-- |
//<!-- |
function gosubmit() { |
function gosubmit() { |
var rec=0; |
var rec=0; |
if (typeof(document.mailform.elements.author)!="undefined") { |
|
if (document.mailform.elements.author.checked) { |
|
rec=1; |
|
} |
|
} |
|
if (typeof(document.mailform.elements.question)!="undefined") { |
|
if (document.mailform.elements.question.checked) { |
|
rec=1; |
|
} |
|
} |
|
if (typeof(document.mailform.elements.course)!="undefined") { |
|
if (document.mailform.elements.course.checked) { |
|
rec=1; |
|
} |
|
} |
|
if (typeof(document.mailform.elements.policy)!="undefined") { |
|
if (document.mailform.elements.policy.checked) { |
|
rec=1; |
|
} |
|
} |
|
if (typeof(document.mailform.elements.discuss)!="undefined") { |
if (typeof(document.mailform.elements.discuss)!="undefined") { |
// anon versus nonanon discussion |
if (typeof(document.mailform.elements.discuss.length) == "undefined") { |
if (document.mailform.elements.discuss[0].checked |
if (document.mailform.elements.discuss.checked ) { |
|| document.mailform.elements.discuss[1].checked) { |
rec=1; |
rec=1; |
} |
} |
} else { |
} |
for (var i=0; i<document.mailform.elements.discuss.length; i++) { |
|
if (document.mailform.elements.discuss[i].checked ) { |
|
rec=1; |
|
} |
|
} |
|
} |
|
} |
if (typeof(document.mailform.elements.blog)!="undefined") { |
if (typeof(document.mailform.elements.blog)!="undefined") { |
if (document.mailform.elements.blog.checked) { |
if (document.mailform.elements.blog.checked) { |
rec=1; |
rec=1; |
Line 2204 sub redirect_back {
|
Line 2191 sub redirect_back {
|
} |
} |
$feedurl=&Apache::lonenc::check_encrypt($feedurl); |
$feedurl=&Apache::lonenc::check_encrypt($feedurl); |
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif'); |
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif'); |
my %onload = ('onload' => "if (window.name!='loncapaclient') { this.document.reldt.submit(); self.window.close(); }"); |
my %onload; |
|
if ($env{'environment.remote'} ne 'off') { |
|
$onload{'onload'} = |
|
"if (window.name!='loncapaclient') { this.document.reldt.submit(); self.window.close(); }"; |
|
} |
my $start_page= |
my $start_page= |
&Apache::loncommon::start_page('New posts marked as read',undef, |
&Apache::loncommon::start_page('New posts marked as read',undef, |
{'redirect' => [2,$feedurl], |
{'redirect' => [2,$feedurl], |
Line 2235 sub no_redirect_back {
|
Line 2226 sub no_redirect_back {
|
my ($r,$feedurl) = @_; |
my ($r,$feedurl) = @_; |
my $nofeed=&mt('Sorry, no feedback possible on this resource ...'); |
my $nofeed=&mt('Sorry, no feedback possible on this resource ...'); |
|
|
|
my %onload; |
|
if ($env{'environment.remote'} ne 'off') { |
|
$onload{'onload'} = |
|
"if (window.name!='loncapaclient') { self.window.close(); }"; |
|
} |
|
|
my %body_options = ('only_body' => 1, |
my %body_options = ('only_body' => 1, |
'bgcolor' => '#FFFFFF', |
'bgcolor' => '#FFFFFF', |
'add_entries' => {'onload' => "if (window.name!='loncapaclient') { self.window.close(); }"}); |
'add_entries' => \%onload,); |
|
|
if ($feedurl !~ m{^/adm/feedback}) { |
if ($feedurl !~ m{^/adm/feedback}) { |
$body_options{'rediect'} = [2,$feedurl]; |
$body_options{'rediect'} = [2,$feedurl]; |
Line 2266 sub screen_header {
|
Line 2263 sub screen_header {
|
unless (($env{'form.replydisc'}) || ($env{'form.editdisc'})) { |
unless (($env{'form.replydisc'}) || ($env{'form.editdisc'})) { |
if (($feedurl=~/^\/res\//) && ($feedurl!~/^\/res\/adm/) && ($env{'user.adv'})) { |
if (($feedurl=~/^\/res\//) && ($feedurl!~/^\/res\/adm/) && ($env{'user.adv'})) { |
$msgoptions= |
$msgoptions= |
'<p><label><input type="checkbox" name="author" /> '. |
'<p><label><input type="radio" name="discuss" value="author" /> '. |
&mt('Feedback to resource author').'</label></p>'; |
&mt('Feedback to resource author').'</label></p>'; |
} |
} |
if (&feedback_available(1)) { |
if (&feedback_available(1)) { |
$msgoptions.= |
$msgoptions.= |
'<p><label><input type="checkbox" name="question" /> '. |
'<p><label><input type="radio" name="discuss" value="question" /> '. |
&mt('Question about resource content').'</label></p>'; |
&mt('Question about resource content').'</label></p>'; |
} |
} |
if (&feedback_available(0,1)) { |
if (&feedback_available(0,1)) { |
$msgoptions.= |
$msgoptions.= |
'<p><label><input type="checkbox" name="course" /> '. |
'<p><label><input type="radio" name="discuss" value="course" /> '. |
&mt('Question/Comment/Feedback about course content'). |
&mt('Question/Comment/Feedback about course content'). |
'</label></p>'; |
'</label></p>'; |
} |
} |
if (&feedback_available(0,0,1)) { |
if (&feedback_available(0,0,1)) { |
$msgoptions.= |
$msgoptions.= |
'<p><label><input type="checkbox" name="policy" /> '. |
'<p><label><input type="radio" name="discuss" value="policy" /> '. |
&mt('Question/Comment/Feedback about course policy'). |
&mt('Question/Comment/Feedback about course policy'). |
'</label></p>'; |
'</label></p>'; |
} |
} |
Line 2418 sub decide_receiver {
|
Line 2415 sub decide_receiver {
|
my ($feedurl,$author,$question,$course,$policy,$defaultflag) = @_; |
my ($feedurl,$author,$question,$course,$policy,$defaultflag) = @_; |
my $typestyle=''; |
my $typestyle=''; |
my %to=(); |
my %to=(); |
if ($env{'form.author'}||$author) { |
if ($env{'form.discuss'} eq 'author' ||$author) { |
$typestyle.='Submitting as Author Feedback<br />'; |
$typestyle.='Submitting as Author Feedback<br />'; |
$feedurl=~/^\/res\/(\w+)\/(\w+)\//; |
$feedurl=~/^\/res\/(\w+)\/(\w+)\//; |
$to{$2.':'.$1}=1; |
$to{$2.':'.$1}=1; |
} |
} |
if ($env{'form.question'}||$question) { |
if ($env{'form.discuss'} eq 'question' ||$question) { |
$typestyle.='Submitting as Question<br />'; |
$typestyle.=&mt('Submitting as Question').'<br />'; |
foreach (split(/\,/, |
foreach (split(/\,/, |
$env{'course.'.$env{'request.course.id'}.'.question.email'}) |
$env{'course.'.$env{'request.course.id'}.'.question.email'}) |
) { |
) { |
Line 2432 sub decide_receiver {
|
Line 2429 sub decide_receiver {
|
if ($rec) { $to{$rec}=1; } |
if ($rec) { $to{$rec}=1; } |
} |
} |
} |
} |
if ($env{'form.course'}||$course) { |
if ($env{'form.discuss'} eq 'course' ||$course) { |
$typestyle.='Submitting as Comment<br />'; |
$typestyle.=&mt('Submitting as Comment').'<br />'; |
foreach (split(/\,/, |
foreach (split(/\,/, |
$env{'course.'.$env{'request.course.id'}.'.comment.email'}) |
$env{'course.'.$env{'request.course.id'}.'.comment.email'}) |
) { |
) { |
Line 2441 sub decide_receiver {
|
Line 2438 sub decide_receiver {
|
if ($rec) { $to{$rec}=1; } |
if ($rec) { $to{$rec}=1; } |
} |
} |
} |
} |
if ($env{'form.policy'}||$policy) { |
if ($env{'form.discuss'} eq 'policy' ||$policy) { |
$typestyle.='Submitting as Policy Feedback<br />'; |
$typestyle.=&mt('Submitting as Policy Feedback').'<br />'; |
foreach (split(/\,/, |
foreach (split(/\,/, |
$env{'course.'.$env{'request.course.id'}.'.policy.email'}) |
$env{'course.'.$env{'request.course.id'}.'.policy.email'}) |
) { |
) { |
Line 2653 sub generate_preview_button {
|
Line 2650 sub generate_preview_button {
|
unless ($fieldname) { $fieldname='comment'; } |
unless ($fieldname) { $fieldname='comment'; } |
my $pre=&mt("Show Preview and Check Spelling"); |
my $pre=&mt("Show Preview and Check Spelling"); |
return(<<ENDPREVIEW); |
return(<<ENDPREVIEW); |
|
<br /> |
<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="subject"> |
<input type="hidden" name="subject"> |
<input type="hidden" name="comment" /> |
<input type="hidden" name="comment" /> |
Line 2664 ENDPREVIEW
|
Line 2662 ENDPREVIEW
|
|
|
sub modify_attachments { |
sub modify_attachments { |
my ($r,$currnewattach,$currdelold,$symb,$idx,$attachmenturls)=@_; |
my ($r,$currnewattach,$currdelold,$symb,$idx,$attachmenturls)=@_; |
my $orig_subject = &Apache::lonnet::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; |
$subject=&Apache::lontexconvert::msgtexconverted($subject); |
$subject=&Apache::lontexconvert::msgtexconverted($subject); |
Line 2783 sub generate_attachments_button {
|
Line 2781 sub generate_attachments_button {
|
my $origpage = $ENV{'REQUEST_URI'}; |
my $origpage = $ENV{'REQUEST_URI'}; |
my $att=$attachnum.' '.&mt("attachments"); |
my $att=$attachnum.' '.&mt("attachments"); |
my $response = (<<END); |
my $response = (<<END); |
|
<br /> |
<form name="attachment" action="/adm/feedback?attach=$ressymb" method="post"> |
<form name="attachment" action="/adm/feedback?attach=$ressymb" method="post"> |
Click to add/remove attachments: <input type="button" value="$att" |
Click to add/remove attachments: <input type="button" value="$att" |
onClick="if (typeof(document.mailform.onsubmit)=='function') {document.mailform.onsubmit();};this.form.comment.value=escape(document.mailform.comment.value);this.form.subject.value=escape(document.mailform.subject.value); |
onClick="if (typeof(document.mailform.onsubmit)=='function') {document.mailform.onsubmit();};this.form.comment.value=escape(document.mailform.comment.value);this.form.subject.value=escape(document.mailform.subject.value); |
Line 3109 sub handler {
|
Line 3108 sub handler {
|
&Apache::loncommon::content_type($r,'text/html'); |
&Apache::loncommon::content_type($r,'text/html'); |
$r->send_http_header; |
$r->send_http_header; |
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif'); |
my $logo=&Apache::loncommon::lonhttpdurl('/adm/lonIcons/lonlogos.gif'); |
my %onload = ('onload' => "if (window.name!='loncapaclient') { this.document.reldt.submit(); self.window.close(); }"); |
my %onload; |
|
if ($env{'environment.remote'} ne 'off') { |
|
$onload{'onload'} = |
|
"if (window.name!='loncapaclient') { this.document.reldt.submit(); self.window.close(); }"; |
|
} |
|
|
my $start_page= |
my $start_page= |
&Apache::loncommon::start_page('New posts marked as read',undef, |
&Apache::loncommon::start_page('New posts marked as read',undef, |
{'redirect' => [2,$feedurl], |
{'redirect' => [2,$feedurl], |
Line 3415 ENDREDIR
|
Line 3419 ENDREDIR
|
# Discussion? Store that. |
# Discussion? Store that. |
|
|
my $numpost=0; |
my $numpost=0; |
if ($env{'form.discuss'}) { |
if ($env{'form.discuss'} =~/^(?:non|)anon$/ |
|
|| $env{'form.anondiscuss'}) { |
my $subject = &clear_out_html($env{'form.subject'},undef,1); |
my $subject = &clear_out_html($env{'form.subject'},undef,1); |
my $anonmode=($env{'form.discuss'} eq 'anon'); |
my $anonmode=($env{'form.discuss'} eq 'anon' || $env{'form.anondiscuss'} ); |
$typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl, |
$typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl, |
$subject); |
$subject); |
$numpost++; |
$numpost++; |