version 1.22, 2002/01/01 16:39:32
|
version 1.28, 2002/07/24 19:57:38
|
Line 41
|
Line 41
|
# 7/26 Guy Albertelli |
# 7/26 Guy Albertelli |
# 7/26,8/10,10/1,11/5,11/6,12/27,12/29 Gerd Kortemeyer |
# 7/26,8/10,10/1,11/5,11/6,12/27,12/29 Gerd Kortemeyer |
# YEAR=2002 |
# YEAR=2002 |
# 1/1 Gerd Kortemeyer |
# 1/1,1/16 Gerd Kortemeyer |
# |
# |
|
|
package Apache::lonfeedback; |
package Apache::lonfeedback; |
Line 102 sub mail_screen {
|
Line 102 sub mail_screen {
|
</head> |
</head> |
<body bgcolor="#FFFFFF" onLoad="window.focus();"> |
<body bgcolor="#FFFFFF" onLoad="window.focus();"> |
<img align=right src=/adm/lonIcons/lonlogos.gif> |
<img align=right src=/adm/lonIcons/lonlogos.gif> |
<h1>Feedback</h1> |
<h1>Resource Feedback and Discussion</h1> |
<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> |
<input type=hidden name=postdata value="$feedurl"> |
<input type=hidden name=postdata value="$feedurl"> |
Line 199 sub screen_header {
|
Line 199 sub screen_header {
|
} |
} |
|
|
if ($ENV{'request.course.id'}) { |
if ($ENV{'request.course.id'}) { |
if (&Apache::lonnet::allowed('pch',$ENV{'request.course.id'})) { |
if (&Apache::lonnet::allowed('pch', |
|
$ENV{'request.course.id'}. |
|
($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) { |
$options.='<br><input type=checkbox name=discuss> '. |
$options.='<br><input type=checkbox name=discuss> '. |
'<b>Contribution to course discussion of resource</b>'; |
'<b>Contribution to course discussion of resource</b>'; |
$options.='<br><input type=checkbox name=anondiscuss> '. |
$options.='<br><input type=checkbox name=anondiscuss> '. |
Line 258 sub decide_receiver {
|
Line 260 sub decide_receiver {
|
} |
} |
if ($ENV{'form.question'}) { |
if ($ENV{'form.question'}) { |
$typestyle.='Submitting as Question<br>'; |
$typestyle.='Submitting as Question<br>'; |
map { |
foreach (split(/\,/, |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.question.email'}) |
|
) { |
$to{$_}=1; |
$to{$_}=1; |
} split(/\,/, |
} |
$ENV{'course.'.$ENV{'request.course.id'}.'.question.email'}); |
|
} |
} |
if ($ENV{'form.course'}) { |
if ($ENV{'form.course'}) { |
$typestyle.='Submitting as Comment<br>'; |
$typestyle.='Submitting as Comment<br>'; |
map { |
foreach (split(/\,/, |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.comment.email'}) |
|
) { |
$to{$_}=1; |
$to{$_}=1; |
} split(/\,/, |
} |
$ENV{'course.'.$ENV{'request.course.id'}.'.comment.email'}); |
|
} |
} |
if ($ENV{'form.policy'}) { |
if ($ENV{'form.policy'}) { |
$typestyle.='Submitting as Policy Feedback<br>'; |
$typestyle.='Submitting as Policy Feedback<br>'; |
map { |
foreach (split(/\,/, |
|
$ENV{'course.'.$ENV{'request.course.id'}.'.policy.email'}) |
|
) { |
$to{$_}=1; |
$to{$_}=1; |
} split(/\,/, |
} |
$ENV{'course.'.$ENV{'request.course.id'}.'.policy.email'}); |
|
} |
} |
return ($typestyle,%to); |
return ($typestyle,%to); |
} |
} |
Line 284 sub send_msg {
|
Line 289 sub send_msg {
|
my ($feedurl,$email,$citations,%to)=@_; |
my ($feedurl,$email,$citations,%to)=@_; |
my $status=''; |
my $status=''; |
my $sendsomething=0; |
my $sendsomething=0; |
map { |
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(/\:/,$_), |
Line 294 sub send_msg {
|
Line 299 sub send_msg {
|
$sendsomething++; |
$sendsomething++; |
} |
} |
} |
} |
} keys %to; |
} |
|
|
my %record=&Apache::lonnet::restore('_feedback'); |
my %record=&Apache::lonnet::restore('_feedback'); |
my ($temp)=keys %record; |
my ($temp)=keys %record; |
Line 313 sub send_msg {
|
Line 318 sub send_msg {
|
sub adddiscuss { |
sub adddiscuss { |
my ($symb,$email,$anon)=@_; |
my ($symb,$email,$anon)=@_; |
my $status=''; |
my $status=''; |
if (&Apache::lonnet::allowed('pch',$ENV{'request.course.id'})) { |
if (&Apache::lonnet::allowed('pch',$ENV{'request.course.id'}. |
|
($ENV{'request.course.sec'}?'/'.$ENV{'request.course.sec'}:''))) { |
|
|
my %contrib=('message' => $email, |
my %contrib=('message' => $email, |
'sendername' => $ENV{'user.name'}, |
'sendername' => $ENV{'user.name'}, |
'senderdomain' => $ENV{'user.domain'}); |
'senderdomain' => $ENV{'user.domain'}, |
|
'screenname' => $ENV{'environment.screenname'}, |
|
'plainname' => $ENV{'environment.firstname'}.' '. |
|
$ENV{'environment.middlename'}.' '. |
|
$ENV{'environment.lastname'}.' '. |
|
$ENV{'enrironment.generation'}); |
if ($anon) { |
if ($anon) { |
$contrib{'anonymous'}='true'; |
$contrib{'anonymous'}='true'; |
} |
} |
Line 357 sub handler {
|
Line 368 sub handler {
|
|
|
# --------------------------- Get query string for limited number of parameters |
# --------------------------- Get query string for limited number of parameters |
|
|
map { |
&Apache::loncommon::get_unprocessed_cgi($ENV{'QUERY_STRING'}, |
my ($name, $value) = split(/=/,$_); |
['hide','unhide','postdata']); |
$value =~ tr/+/ /; |
|
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C",hex($1))/eg; |
|
if (($name eq 'hide') || ($name eq 'unhide')) { |
|
unless ($ENV{'form.'.$name}) { |
|
$ENV{'form.'.$name}=$value; |
|
} |
|
} |
|
} (split(/&/,$ENV{'QUERY_STRING'})); |
|
|
|
if (($ENV{'form.hide'}) || ($ENV{'form.unhide'})) { |
if (($ENV{'form.hide'}) || ($ENV{'form.unhide'})) { |
# ----------------------------------------------------------------- Hide/unhide |
# ----------------------------------------------------------------- Hide/unhide |