version 1.198, 2006/05/09 20:00:44
|
version 1.202, 2006/05/10 22:29:57
|
Line 1328 sub mail_screen {
|
Line 1328 sub mail_screen {
|
my $attachnum = 0; |
my $attachnum = 0; |
my $anonchk = (<<END); |
my $anonchk = (<<END); |
function anonchk() { |
function anonchk() { |
if (document.mailform.discuss[0].checked) { |
for (var i=0; i < document.mailform.discuss.length; i++) { |
document.attachment.discuss.value = 'nonanon'; |
if (document.mailform.discuss[i].checked) { |
} |
document.attachment.discuss.value = |
if (document.mailform.discuss[1].checked) { |
document.mailform.discuss[i].value; |
document.attachment.discuss.value = 'anon'; |
} |
} |
} |
if (document.mailform.blog.checked) { |
if (document.mailform.blog.checked) { |
document.attachment.blog.value = 1; |
document.attachment.blog.value = 1; |
Line 1345 END
|
Line 1345 END
|
$anonscript = (<<END); |
$anonscript = (<<END); |
function setposttype() { |
function setposttype() { |
var disc = "$env{'form.discuss'}"; |
var disc = "$env{'form.discuss'}"; |
if (disc == 'nonanon') { |
for (var i=0; i < document.mailform.discuss.length; i++) { |
document.mailform.discuss[0].checked=1; |
if (disc == document.mailform.discuss[i].value) { |
} |
document.mailform.discuss[i].checked = 1; |
if (disc == 'anon') { |
} |
document.mailform.discuss[1].checked=1; |
|
} |
} |
var blog = "$env{'form.blog'}"; |
var blog = "$env{'form.blog'}"; |
if (blog == 1) { |
if (blog == 1) { |
Line 1456 END
|
Line 1455 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.discuss.length) == "undefined") { |
if (document.mailform.elements.discuss[0].checked |
if (document.mailform.discuss.checked ) { |
|| document.mailform.elements.discuss[1].checked) { |
rec=1; |
rec=1; |
} |
} |
} else { |
} |
for (var i=0; i<document.mailform.discuss.length; i++) { |
|
if (document.mailform.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.blog.checked) { |
rec=1; |
rec=1; |
} |
} |
} |
} |
Line 2205 sub redirect_back {
|
Line 2190 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 2236 sub no_redirect_back {
|
Line 2225 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 2267 sub screen_header {
|
Line 2262 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 2419 sub decide_receiver {
|
Line 2414 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 2433 sub decide_receiver {
|
Line 2428 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 2442 sub decide_receiver {
|
Line 2437 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 3110 sub handler {
|
Line 3105 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 3416 ENDREDIR
|
Line 3416 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++; |