--- loncom/interface/lonfeedback.pm 2006/05/09 20:00:44 1.198 +++ loncom/interface/lonfeedback.pm 2006/05/10 22:29:57 1.202 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.198 2006/05/09 20:00:44 albertel Exp $ +# $Id: lonfeedback.pm,v 1.202 2006/05/10 22:29:57 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -1328,11 +1328,11 @@ sub mail_screen { my $attachnum = 0; my $anonchk = (< "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= &Apache::loncommon::start_page('New posts marked as read',undef, {'redirect' => [2,$feedurl], @@ -2236,9 +2225,15 @@ sub no_redirect_back { my ($r,$feedurl) = @_; 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, 'bgcolor' => '#FFFFFF', - 'add_entries' => {'onload' => "if (window.name!='loncapaclient') { self.window.close(); }"}); + 'add_entries' => \%onload,); if ($feedurl !~ m{^/adm/feedback}) { $body_options{'rediect'} = [2,$feedurl]; @@ -2267,23 +2262,23 @@ sub screen_header { unless (($env{'form.replydisc'}) || ($env{'form.editdisc'})) { if (($feedurl=~/^\/res\//) && ($feedurl!~/^\/res\/adm/) && ($env{'user.adv'})) { $msgoptions= - '

'; } if (&feedback_available(1)) { $msgoptions.= - '

'; } if (&feedback_available(0,1)) { $msgoptions.= - '

'; } if (&feedback_available(0,0,1)) { $msgoptions.= - '

'; } @@ -2419,13 +2414,13 @@ sub decide_receiver { my ($feedurl,$author,$question,$course,$policy,$defaultflag) = @_; my $typestyle=''; my %to=(); - if ($env{'form.author'}||$author) { + if ($env{'form.discuss'} eq 'author' ||$author) { $typestyle.='Submitting as Author Feedback
'; $feedurl=~/^\/res\/(\w+)\/(\w+)\//; $to{$2.':'.$1}=1; } - if ($env{'form.question'}||$question) { - $typestyle.='Submitting as Question
'; + if ($env{'form.discuss'} eq 'question' ||$question) { + $typestyle.=&mt('Submitting as Question').'
'; foreach (split(/\,/, $env{'course.'.$env{'request.course.id'}.'.question.email'}) ) { @@ -2433,8 +2428,8 @@ sub decide_receiver { if ($rec) { $to{$rec}=1; } } } - if ($env{'form.course'}||$course) { - $typestyle.='Submitting as Comment
'; + if ($env{'form.discuss'} eq 'course' ||$course) { + $typestyle.=&mt('Submitting as Comment').'
'; foreach (split(/\,/, $env{'course.'.$env{'request.course.id'}.'.comment.email'}) ) { @@ -2442,8 +2437,8 @@ sub decide_receiver { if ($rec) { $to{$rec}=1; } } } - if ($env{'form.policy'}||$policy) { - $typestyle.='Submitting as Policy Feedback
'; + if ($env{'form.discuss'} eq 'policy' ||$policy) { + $typestyle.=&mt('Submitting as Policy Feedback').'
'; foreach (split(/\,/, $env{'course.'.$env{'request.course.id'}.'.policy.email'}) ) { @@ -3110,7 +3105,12 @@ sub handler { &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; 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= &Apache::loncommon::start_page('New posts marked as read',undef, {'redirect' => [2,$feedurl], @@ -3416,9 +3416,10 @@ ENDREDIR # Discussion? Store that. 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 $anonmode=($env{'form.discuss'} eq 'anon'); + my $anonmode=($env{'form.discuss'} eq 'anon' || $env{'form.anondiscuss'} ); $typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl, $subject); $numpost++;