version 1.242, 2007/02/23 00:39:31
|
version 1.246, 2007/03/20 00:08:09
|
Line 1012 sub build_posting_display {
|
Line 1012 sub build_posting_display {
|
$sender.=' <font color="red"><b>['.$$anonhash{$key}.']</b></font> '. |
$sender.=' <font color="red"><b>['.$$anonhash{$key}.']</b></font> '. |
$screenname; |
$screenname; |
} |
} |
|
$sender.=&Apache::loncommon::student_image_tag($contrib{$idx.':senderdomain'},$contrib{$idx.':sendername'}); |
# Set up for sorting by domain, then username |
# Set up for sorting by domain, then username |
unless (defined($$usernamesort{$contrib{$idx.':senderdomain'}})) { |
unless (defined($$usernamesort{$contrib{$idx.':senderdomain'}})) { |
%{$$usernamesort{$contrib{$idx.':senderdomain'}}} = (); |
%{$$usernamesort{$contrib{$idx.':senderdomain'}}} = (); |
Line 2559 sub screen_header {
|
Line 2559 sub screen_header {
|
'<p><label><input type="radio" name="discuss" value="author" /> '. |
'<p><label><input type="radio" name="discuss" value="author" /> '. |
&mt('Feedback to resource author').'</label></p>'; |
&mt('Feedback to resource author').'</label></p>'; |
} |
} |
|
my %optionhash=(); |
|
foreach my $type ('question','comment','policy') { |
|
$optionhash{$type}=$env{'course.'.$env{'request.course.id'}.'.'.$type.'.email.text'}; |
|
} |
if (&feedback_available(1)) { |
if (&feedback_available(1)) { |
$msgoptions.= |
$msgoptions.= |
'<p><label><input type="radio" name="discuss" value="question" /> '. |
'<p><label><input type="radio" name="discuss" value="question" /> '. |
&mt('Question about resource content').'</label></p>'; |
($optionhash{'question'}?$optionhash{'question'}:&mt('Question about resource content')).'</label></p>'; |
} |
} |
if (&feedback_available(0,1)) { |
if (&feedback_available(0,1)) { |
$msgoptions.= |
$msgoptions.= |
'<p><label><input type="radio" name="discuss" value="course" /> '. |
'<p><label><input type="radio" name="discuss" value="course" /> '. |
&mt('Question/Comment/Feedback about course content'). |
($optionhash{'comment'}?$optionhash{'comment'}:&mt('Question/Comment/Feedback about course content')). |
'</label></p>'; |
'</label></p>'; |
} |
} |
if (&feedback_available(0,0,1)) { |
if (&feedback_available(0,0,1)) { |
$msgoptions.= |
$msgoptions.= |
'<p><label><input type="radio" name="discuss" value="policy" /> '. |
'<p><label><input type="radio" name="discuss" value="policy" /> '. |
&mt('Question/Comment/Feedback about course policy'). |
($optionhash{'policy'}?$optionhash{'policy'}:&mt('Question/Comment/Feedback about course policy')). |
'</label></p>'; |
'</label></p>'; |
} |
} |
} |
} |
Line 2671 sub feedback_available {
|
Line 2675 sub feedback_available {
|
} |
} |
|
|
sub send_msg { |
sub send_msg { |
my ($title,$feedurl,$email,$citations,$attachmenturl,$symb,%to)=@_; |
my ($title,$feedurl,$email,$citations,$attachmenturl,$symb,%to)=@_; |
my $status=''; |
my $status=''; |
my $sendsomething=0; |
my $sendsomething=0; |
my $restitle = &get_resource_title($symb,$feedurl); |
my $restitle = &get_resource_title($symb,$feedurl); |
if ($title=~/^Error/) { $title=&mt('Feedback').': '.$title; } |
if ($title=~/^Error/) { $title=&mt('Feedback').': '.$title; } |
unless ($title=~/\w/) { $title=&mt('Feedback'); } |
unless ($title=~/\w/) { $title=&mt('Feedback'); } |
foreach my $key (keys(%to)) { |
foreach my $key (keys(%to)) { |
if ($key) { |
if ($key) { |
unless (&Apache::lonmsg::user_normal_msg(split(/\:/,$key), |
my ($user,$domain) = split(/\:/,$key,2); |
$title.' ['.$restitle.']',$email,$citations,$feedurl, |
if (!defined($user)) { |
$attachmenturl,undef,undef,$symb,$restitle)=~/ok/) { |
$status.='<br />'.&mt('Error sending message to [_1], no user specified.',$key); |
$status.='<br />'.&mt('Error sending message to').' '.$key.'<br />'; |
} elsif (!defined($domain)) { |
} else { |
$status.='<br />'.&mt('Error sending message to [_1], no domain specified.',$key); |
$sendsomething++; |
} else { |
} |
unless (&Apache::lonmsg::user_normal_msg($user,$domain, |
|
$title.' ['.$restitle.']',$email,$citations,$feedurl, |
|
$attachmenturl,undef,undef,$symb,$restitle)=~/ok/) { |
|
$status.='<br />'.&mt('Error sending message to').' '.$key.'<br />'; |
|
} else { |
|
$sendsomething++; |
|
} |
|
} |
|
} |
} |
} |
} |
|
|
|
my %record=&Apache::lonnet::restore('_feedback'); |
my %record=&Apache::lonnet::restore('_feedback'); |
my ($temp)=keys(%record); |
my ($temp)=keys(%record); |
unless ($temp=~/^error\:/) { |
unless ($temp=~/^error\:/) { |
my %newrecord=(); |
my %newrecord=(); |
$newrecord{'resource'}=$feedurl; |
$newrecord{'resource'}=$feedurl; |
$newrecord{'subnumber'}=$record{'subnumber'}+1; |
$newrecord{'subnumber'}=$record{'subnumber'}+1; |
unless (&Apache::lonnet::cstore(\%newrecord,'_feedback') eq 'ok') { |
unless (&Apache::lonnet::cstore(\%newrecord,'_feedback') eq 'ok') { |
$status.='<br />'.&mt('Not registered').'<br />'; |
$status.='<br />'.&mt('Not registered').'<br />'; |
} |
} |
} |
} |
|
|
return ($status,$sendsomething); |
return ($status,$sendsomething); |
} |
} |
|
|
sub adddiscuss { |
sub adddiscuss { |