version 1.42, 2003/03/29 22:50:22
|
version 1.44, 2003/06/04 22:05:22
|
Line 54 use Apache::lontexconvert();
|
Line 54 use Apache::lontexconvert();
|
|
|
sub mail_screen { |
sub mail_screen { |
my ($r,$feedurl,$options) = @_; |
my ($r,$feedurl,$options) = @_; |
my $bodytag=&Apache::loncommon::bodytag('Resource Feedback and Discussion', |
my $bodytag=&Apache::loncommon::bodytag('Resource Feedback and Discussion'); |
'','onLoad="window.focus();"'); |
|
$r->print(<<ENDDOCUMENT); |
$r->print(<<ENDDOCUMENT); |
<html> |
<html> |
<head> |
<head> |
Line 105 sub mail_screen {
|
Line 104 sub mail_screen {
|
</head> |
</head> |
$bodytag |
$bodytag |
<h2><tt>$feedurl</tt></h2> |
<h2><tt>$feedurl</tt></h2> |
<form action="/adm/feedback" method=post name=mailform> |
<form action="/adm/feedback" method="post" name="mailform" |
|
enctype="multipart/form-data"> |
<input type=hidden name=postdata value="$feedurl"> |
<input type=hidden name=postdata value="$feedurl"> |
Please check at least one of the following feedback types: |
Please check at least one of the following feedback types: |
$options<hr> |
$options<hr> |
Line 339 sub feedback_available {
|
Line 339 sub feedback_available {
|
} |
} |
|
|
sub send_msg { |
sub send_msg { |
my ($feedurl,$email,$citations,%to)=@_; |
my ($feedurl,$email,$citations,$attachmenturl,%to)=@_; |
my $status=''; |
my $status=''; |
my $sendsomething=0; |
my $sendsomething=0; |
foreach (keys %to) { |
foreach (keys %to) { |
if ($_) { |
if ($_) { |
my $declutter=&Apache::lonnet::declutter($feedurl); |
my $declutter=&Apache::lonnet::declutter($feedurl); |
unless (&Apache::lonmsg::user_normal_msg(split(/\:/,$_), |
unless (&Apache::lonmsg::user_normal_msg(split(/\:/,$_), |
'Feedback ['.$declutter.']',$email,$citations,$feedurl)=~/ok/) { |
'Feedback ['.$declutter.']',$email,$citations,$feedurl, |
|
$attachmenturl)=~/ok/) { |
$status.='<br>Error sending message to '.$_.'<br>'; |
$status.='<br>Error sending message to '.$_.'<br>'; |
} else { |
} else { |
$sendsomething++; |
$sendsomething++; |
Line 382 sub adddiscuss {
|
Line 383 sub adddiscuss {
|
$ENV{'environment.middlename'}.' '. |
$ENV{'environment.middlename'}.' '. |
$ENV{'environment.lastname'}.' '. |
$ENV{'environment.lastname'}.' '. |
$ENV{'enrironment.generation'}, |
$ENV{'enrironment.generation'}, |
'attachment' => $attachmenturl); |
'attachmenturl'=> $attachmenturl); |
if ($anon) { |
if ($anon) { |
$contrib{'anonymous'}='true'; |
$contrib{'anonymous'}='true'; |
} |
} |
Line 565 sub handler {
|
Line 566 sub handler {
|
my $attachmenturl=''; |
my $attachmenturl=''; |
if ($ENV{'form.attachment.filename'}) { |
if ($ENV{'form.attachment.filename'}) { |
unless (length($ENV{'form.attachment'})>131072) { |
unless (length($ENV{'form.attachment'})>131072) { |
$attachmenturl=&Apache::lonnet::userfileupload('attachment',1); |
$attachmenturl=&Apache::lonnet::userfileupload('attachment'); |
} |
} |
} |
} |
# Filter HTML out of message (could be nasty) |
# Filter HTML out of message (could be nasty) |
Line 579 sub handler {
|
Line 580 sub handler {
|
my ($typestyle,%to) = &decide_receiver($feedurl); |
my ($typestyle,%to) = &decide_receiver($feedurl); |
|
|
# Actually send mail |
# Actually send mail |
my ($status,$numsent)=&send_msg($feedurl,$email,$citations,%to); |
my ($status,$numsent)=&send_msg($feedurl,$email,$citations, |
|
$attachmenturl,%to); |
|
|
# Discussion? Store that. |
# Discussion? Store that. |
|
|