--- loncom/interface/lonfeedback.pm 2006/05/09 20:44:15 1.200 +++ loncom/interface/lonfeedback.pm 2006/06/30 04:49:03 1.207 @@ -1,7 +1,7 @@ # The LearningOnline Network # Feedback # -# $Id: lonfeedback.pm,v 1.200 2006/05/09 20:44:15 albertel Exp $ +# $Id: lonfeedback.pm,v 1.207 2006/06/30 04:49:03 albertel Exp $ # # Copyright Michigan State University Board of Trustees # @@ -43,6 +43,8 @@ use Apache::lonrss(); use HTML::LCParser(); use Apache::lonspeller(); use Cwd; +use lib '/home/httpd/lib/perl/'; +use LONCAPA; sub discussion_open { my ($status,$symb)=@_; @@ -394,7 +396,7 @@ imscp_v1p1.xsd http://www.imsglobal.org/ $discussion.='
'. + ' '. &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'). ''; } @@ -2428,13 +2415,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'}) ) { @@ -2442,8 +2429,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'}) ) { @@ -2451,8 +2438,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'}) ) { @@ -2663,6 +2650,7 @@ sub generate_preview_button { unless ($fieldname) { $fieldname='comment'; } my $pre=&mt("Show Preview and Check Spelling"); return(< @@ -2674,7 +2662,7 @@ ENDPREVIEW sub modify_attachments { 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); $subject=~s/\n/\/g; $subject=&Apache::lontexconvert::msgtexconverted($subject); @@ -2793,6 +2781,7 @@ sub generate_attachments_button { my $origpage = $ENV{'REQUEST_URI'}; my $att=$attachnum.' '.&mt("attachments"); my $response = (< Click to add/remove attachments:
'. &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'). ''; } @@ -2428,13 +2415,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'}) ) { @@ -2442,8 +2429,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'}) ) { @@ -2451,8 +2438,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'}) ) { @@ -2663,6 +2650,7 @@ sub generate_preview_button { unless ($fieldname) { $fieldname='comment'; } my $pre=&mt("Show Preview and Check Spelling"); return(< @@ -2674,7 +2662,7 @@ ENDPREVIEW sub modify_attachments { 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); $subject=~s/\n/\/g; $subject=&Apache::lontexconvert::msgtexconverted($subject); @@ -2793,6 +2781,7 @@ sub generate_attachments_button { my $origpage = $ENV{'REQUEST_URI'}; my $att=$attachnum.' '.&mt("attachments"); my $response = (< Click to add/remove attachments:
'. &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'). ''; } @@ -2428,13 +2415,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'}) ) { @@ -2442,8 +2429,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'}) ) { @@ -2451,8 +2438,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'}) ) { @@ -2663,6 +2650,7 @@ sub generate_preview_button { unless ($fieldname) { $fieldname='comment'; } my $pre=&mt("Show Preview and Check Spelling"); return(< @@ -2674,7 +2662,7 @@ ENDPREVIEW sub modify_attachments { 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); $subject=~s/\n/\/g; $subject=&Apache::lontexconvert::msgtexconverted($subject); @@ -2793,6 +2781,7 @@ sub generate_attachments_button { my $origpage = $ENV{'REQUEST_URI'}; my $att=$attachnum.' '.&mt("attachments"); my $response = (< Click to add/remove attachments:
'. &mt('Question/Comment/Feedback about course content'). '
'. + ' '. &mt('Question/Comment/Feedback about course policy'). ''; } @@ -2428,13 +2415,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'}) ) { @@ -2442,8 +2429,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'}) ) { @@ -2451,8 +2438,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'}) ) { @@ -2663,6 +2650,7 @@ sub generate_preview_button { unless ($fieldname) { $fieldname='comment'; } my $pre=&mt("Show Preview and Check Spelling"); return(< @@ -2674,7 +2662,7 @@ ENDPREVIEW sub modify_attachments { 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); $subject=~s/\n/\/g; $subject=&Apache::lontexconvert::msgtexconverted($subject); @@ -2793,6 +2781,7 @@ sub generate_attachments_button { my $origpage = $ENV{'REQUEST_URI'}; my $att=$attachnum.' '.&mt("attachments"); my $response = (< Click to add/remove attachments:
'. &mt('Question/Comment/Feedback about course policy'). '