--- loncom/interface/lonfeedback.pm 2006/05/09 15:09:27 1.197 +++ loncom/interface/lonfeedback.pm 2006/05/10 22:47:22 1.203 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.197 2006/05/09 15:09:27 albertel Exp $ +# $Id: lonfeedback.pm,v 1.203 2006/05/10 22:47:22 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -726,7 +726,7 @@ ENDDISCUSS if ($outputtarget ne 'tex') { $discussion.=&generate_attachments_button('',$attachnum,$ressymb,$now,\@currnewattach,\@currdelold,'',$mode); if (@currnewattach > 0) { - $newattachmsg .= 'New attachments'; + $newattachmsg .= 'New attachments'; if (@currnewattach > 1) { $newattachmsg .= '
'. + ' '. &mt('Feedback to resource author').''; } if (&feedback_available(1)) { $msgoptions.= - ' '. + ' '. &mt('Question about resource content').''; } if (&feedback_available(0,1)) { $msgoptions.= - ' '. + ' '. &mt('Question/Comment/Feedback about course content'). ''; } if (&feedback_available(0,0,1)) { $msgoptions.= - ' '. + ' '. &mt('Question/Comment/Feedback about course policy'). ''; } @@ -2292,10 +2287,9 @@ sub screen_header { &Apache::lonnet::allowed('pch', $env{'request.course.id'}. ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { - $discussoptions=' '. + $discussoptions=' '. &mt('Contribution to course discussion of resource'); - $discussoptions.=' '. + $discussoptions.=' '. &mt('Anonymous contribution to course discussion of resource'). ' ('.&mt('name only visible to course faculty').') '. ''.&mt('Change Screenname').''; @@ -2419,13 +2413,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 +2427,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 +2436,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'}) ) { @@ -2694,6 +2688,7 @@ END &Apache::loncommon::end_page(); $r->print(< @@ -2733,7 +2728,6 @@ END - END @@ -2799,7 +2793,6 @@ this.form.submit();" /> - ENDATTACH @@ -3111,7 +3104,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], @@ -3250,7 +3248,7 @@ ENDREDIR # -------------------------------------------------------- Work on attachments &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; - &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','addnewattach','delnewattach','timestamp','numoldver','idx','anondiscuss','discuss','blog']); + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','addnewattach','delnewattach','timestamp','numoldver','idx','discuss','blog']); my (@currnewattach,@currdelold,@keepold); &process_attachments(\@currnewattach,\@currdelold,\@keepold); if (exists($env{'form.addnewattach.filename'})) { @@ -3417,9 +3415,10 @@ ENDREDIR # Discussion? Store that. my $numpost=0; - if ($env{'form.discuss'} || $env{'form.anondiscuss'}) { + if ($env{'form.discuss'} =~/^(?:non|)anon$/ + || $env{'form.anondiscuss'}) { my $subject = &clear_out_html($env{'form.subject'},undef,1); - my $anonmode=(defined($env{'form.anondiscuss'})); + my $anonmode=($env{'form.discuss'} eq 'anon' || $env{'form.anondiscuss'} ); $typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl, $subject); $numpost++;
'. &mt('Feedback to resource author').'
'. + ' '. &mt('Question about resource content').''; } if (&feedback_available(0,1)) { $msgoptions.= - ' '. + ' '. &mt('Question/Comment/Feedback about course content'). ''; } if (&feedback_available(0,0,1)) { $msgoptions.= - ' '. + ' '. &mt('Question/Comment/Feedback about course policy'). ''; } @@ -2292,10 +2287,9 @@ sub screen_header { &Apache::lonnet::allowed('pch', $env{'request.course.id'}. ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { - $discussoptions=' '. + $discussoptions=' '. &mt('Contribution to course discussion of resource'); - $discussoptions.=' '. + $discussoptions.=' '. &mt('Anonymous contribution to course discussion of resource'). ' ('.&mt('name only visible to course faculty').') '. ''.&mt('Change Screenname').''; @@ -2419,13 +2413,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 +2427,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 +2436,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'}) ) { @@ -2694,6 +2688,7 @@ END &Apache::loncommon::end_page(); $r->print(< @@ -2733,7 +2728,6 @@ END - END @@ -2799,7 +2793,6 @@ this.form.submit();" /> - ENDATTACH @@ -3111,7 +3104,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], @@ -3250,7 +3248,7 @@ ENDREDIR # -------------------------------------------------------- Work on attachments &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; - &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','addnewattach','delnewattach','timestamp','numoldver','idx','anondiscuss','discuss','blog']); + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','addnewattach','delnewattach','timestamp','numoldver','idx','discuss','blog']); my (@currnewattach,@currdelold,@keepold); &process_attachments(\@currnewattach,\@currdelold,\@keepold); if (exists($env{'form.addnewattach.filename'})) { @@ -3417,9 +3415,10 @@ ENDREDIR # Discussion? Store that. my $numpost=0; - if ($env{'form.discuss'} || $env{'form.anondiscuss'}) { + if ($env{'form.discuss'} =~/^(?:non|)anon$/ + || $env{'form.anondiscuss'}) { my $subject = &clear_out_html($env{'form.subject'},undef,1); - my $anonmode=(defined($env{'form.anondiscuss'})); + my $anonmode=($env{'form.discuss'} eq 'anon' || $env{'form.anondiscuss'} ); $typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl, $subject); $numpost++;
'. &mt('Question about resource content').'
'. + ' '. &mt('Question/Comment/Feedback about course content'). ''; } if (&feedback_available(0,0,1)) { $msgoptions.= - ' '. + ' '. &mt('Question/Comment/Feedback about course policy'). ''; } @@ -2292,10 +2287,9 @@ sub screen_header { &Apache::lonnet::allowed('pch', $env{'request.course.id'}. ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { - $discussoptions=' '. + $discussoptions=' '. &mt('Contribution to course discussion of resource'); - $discussoptions.=' '. + $discussoptions.=' '. &mt('Anonymous contribution to course discussion of resource'). ' ('.&mt('name only visible to course faculty').') '. ''.&mt('Change Screenname').''; @@ -2419,13 +2413,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 +2427,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 +2436,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'}) ) { @@ -2694,6 +2688,7 @@ END &Apache::loncommon::end_page(); $r->print(< @@ -2733,7 +2728,6 @@ END - END @@ -2799,7 +2793,6 @@ this.form.submit();" /> - ENDATTACH @@ -3111,7 +3104,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], @@ -3250,7 +3248,7 @@ ENDREDIR # -------------------------------------------------------- Work on attachments &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; - &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','addnewattach','delnewattach','timestamp','numoldver','idx','anondiscuss','discuss','blog']); + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','addnewattach','delnewattach','timestamp','numoldver','idx','discuss','blog']); my (@currnewattach,@currdelold,@keepold); &process_attachments(\@currnewattach,\@currdelold,\@keepold); if (exists($env{'form.addnewattach.filename'})) { @@ -3417,9 +3415,10 @@ ENDREDIR # Discussion? Store that. my $numpost=0; - if ($env{'form.discuss'} || $env{'form.anondiscuss'}) { + if ($env{'form.discuss'} =~/^(?:non|)anon$/ + || $env{'form.anondiscuss'}) { my $subject = &clear_out_html($env{'form.subject'},undef,1); - my $anonmode=(defined($env{'form.anondiscuss'})); + my $anonmode=($env{'form.discuss'} eq 'anon' || $env{'form.anondiscuss'} ); $typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl, $subject); $numpost++;
'. &mt('Question/Comment/Feedback about course content'). '
'. + ' '. &mt('Question/Comment/Feedback about course policy'). ''; } @@ -2292,10 +2287,9 @@ sub screen_header { &Apache::lonnet::allowed('pch', $env{'request.course.id'}. ($env{'request.course.sec'}?'/'.$env{'request.course.sec'}:''))) { - $discussoptions=' '. + $discussoptions=' '. &mt('Contribution to course discussion of resource'); - $discussoptions.=' '. + $discussoptions.=' '. &mt('Anonymous contribution to course discussion of resource'). ' ('.&mt('name only visible to course faculty').') '. ''.&mt('Change Screenname').''; @@ -2419,13 +2413,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 +2427,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 +2436,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'}) ) { @@ -2694,6 +2688,7 @@ END &Apache::loncommon::end_page(); $r->print(< @@ -2733,7 +2728,6 @@ END - END @@ -2799,7 +2793,6 @@ this.form.submit();" /> - ENDATTACH @@ -3111,7 +3104,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], @@ -3250,7 +3248,7 @@ ENDREDIR # -------------------------------------------------------- Work on attachments &Apache::loncommon::content_type($r,'text/html'); $r->send_http_header; - &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','addnewattach','delnewattach','timestamp','numoldver','idx','anondiscuss','discuss','blog']); + &Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'},['subject','comment','addnewattach','delnewattach','timestamp','numoldver','idx','discuss','blog']); my (@currnewattach,@currdelold,@keepold); &process_attachments(\@currnewattach,\@currdelold,\@keepold); if (exists($env{'form.addnewattach.filename'})) { @@ -3417,9 +3415,10 @@ ENDREDIR # Discussion? Store that. my $numpost=0; - if ($env{'form.discuss'} || $env{'form.anondiscuss'}) { + if ($env{'form.discuss'} =~/^(?:non|)anon$/ + || $env{'form.anondiscuss'}) { my $subject = &clear_out_html($env{'form.subject'},undef,1); - my $anonmode=(defined($env{'form.anondiscuss'})); + my $anonmode=($env{'form.discuss'} eq 'anon' || $env{'form.anondiscuss'} ); $typestyle.=&adddiscuss($symb,$message,$anonmode,$attachmenturl, $subject); $numpost++;
'. &mt('Question/Comment/Feedback about course policy'). '